mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 14:02:19 +00:00
61 lines
2.5 KiB
C#
61 lines
2.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Cosmos.IL2CPU.X86 {
|
|
[OpCode("and")]
|
|
public class And: InstructionWithDestinationAndSourceAndSize {
|
|
public static void InitializeEncodingData(Instruction.InstructionData aData) {
|
|
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
|
|
OpCode = new byte[] { 0x22 },
|
|
NeedsModRMByte = true,
|
|
OperandSizeByte = 0,
|
|
SourceMemory=true,
|
|
DestinationRegAny=true
|
|
}); // memory to register
|
|
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
|
|
OpCode=new byte[]{0x20},
|
|
NeedsModRMByte=true,
|
|
InitialModRMByteValue=0xC0,
|
|
DestinationRegAny=true,
|
|
SourceRegAny = true,
|
|
ReverseRegisters=true,
|
|
OperandSizeByte = 0
|
|
}); // reg to reg
|
|
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
|
|
OpCode=new byte[]{0x80},
|
|
OperandSizeByte=0,
|
|
NeedsModRMByte=true,
|
|
InitialModRMByteValue=0x20,
|
|
SourceImmediate=true,
|
|
DestinationMemory=true,
|
|
ReverseRegisters=true
|
|
}); // immediate to memory
|
|
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
|
|
OpCode = new byte[] { 0x20 },
|
|
OperandSizeByte = 0,
|
|
NeedsModRMByte = true,
|
|
SourceRegAny = true,
|
|
DestinationMemory = true,
|
|
ReverseRegisters = true
|
|
}); // reg to memory
|
|
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
|
|
OpCode = new byte[] { 0x24 },
|
|
OperandSizeByte = 0,
|
|
SourceImmediate = true,
|
|
DestinationReg = Registers.EAX,
|
|
ReverseRegisters = true
|
|
}); // immediate to reg
|
|
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
|
|
OpCode = new byte[] { 0x80 },
|
|
OperandSizeByte = 0,
|
|
NeedsModRMByte = true,
|
|
InitialModRMByteValue = 0xE0,
|
|
SourceImmediate = true,
|
|
DestinationRegAny = true,
|
|
ReverseRegisters = true
|
|
}); // immediate to reg
|
|
}
|
|
}
|
|
}
|