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

40 lines
1.5 KiB
C#

using System;
using System.Linq;
namespace Cosmos.IL2CPU.X86
{
/// <summary>
/// Subtracts the source operand from the destination operand and
/// replaces the destination operand with the result.
/// </summary>
[OpCode("sbb")]
public class SubWithCarry : InstructionWithDestinationAndSourceAndSize
{
public static void InitializeEncodingData(Instruction.InstructionData aData) {
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
OpCode = new byte[] { 0x18 },
NeedsModRMByte = true,
InitialModRMByteValue = 0xC0,
DestinationRegAny = true,
SourceRegAny = true,
OperandSizeByte = 0,
ReverseRegisters = true
}); // reg to reg
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
OpCode = new byte[] { 0x1A },
NeedsModRMByte = true,
SourceMemory = true,
DestinationRegAny = true,
OperandSizeByte = 0
}); // mem to reg
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
OpCode = new byte[] { 0x18 },
NeedsModRMByte = true,
DestinationMemory = true,
SourceRegAny = true,
OperandSizeByte = 0,
ReverseRegisters = true
}); // reg to mem
}
}
}