Cosmos/source/Indy.IL2CPU/Assembler/x86/JumpAlways.cs
mterwoord_cp 7860d3f0e0
2008-12-21 11:25:55 +00:00

36 lines
No EOL
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Indy.IL2CPU.Assembler.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 },
DestinationReg = Guid.Empty,
AllowedSizes = InstructionSizes.DWord,
ReverseRegisters=true,
NeedsModRMByte = true,
InitialModRMByteValue = 0xE0
}); // indirect at register
}
}
}