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

36 lines
No EOL
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.IL2CPU.X86 {
/// <summary>
/// Represents the JMP opcode
/// </summary>
[OpCode("jmp")]
public class Jump: JumpBase {
public static void InitializeEncodingData(Instruction.InstructionData aData) {
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
OpCode = new byte[] { 0xE9 },
DestinationImmediate = true,
AllowedSizes=InstructionSizes.DWord
}); // direct to immediate
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
OpCode = new byte[] { 0xFF },
DestinationMemory = true,
AllowedSizes = InstructionSizes.DWord,
ReverseRegisters = true,
NeedsModRMByte=true,
InitialModRMByteValue = 0x20
}); // indirect at memory
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
OpCode = new byte[] { 0xFF },
DestinationRegAny = true,
AllowedSizes = InstructionSizes.DWord,
ReverseRegisters=true,
NeedsModRMByte = true,
InitialModRMByteValue = 0xE0
}); // indirect at register
}
}
}