mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-02 06:10:13 +00:00
35 lines
1.2 KiB
C#
35 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Indy.IL2CPU.Assembler.X86 {
|
|
[OpCode("out")]
|
|
public class Out: InstructionWithDestinationAndSize {
|
|
public static void InitializeEncodingData(Instruction.InstructionData aData) {
|
|
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
|
|
OpCode = new byte[] { 0xE6 },
|
|
OperandSizeByte=0,
|
|
DestinationImmediate=true,
|
|
DestinationImmediateSize=InstructionSize.Byte
|
|
|
|
}); // fixed port (immediate)
|
|
aData.EncodingOptions.Add(new InstructionData.InstructionEncodingOption {
|
|
OpCode = new byte[] { 0xEE },
|
|
OperandSizeByte = 0,
|
|
DestinationReg=Registers.DX
|
|
}); // fixed port (register)
|
|
}
|
|
|
|
public override string ToString() {
|
|
string xReg = "";
|
|
switch(Size) {
|
|
case 8: xReg = "al";break;
|
|
case 16: xReg = "ax"; break;
|
|
case 32: xReg = "eax"; break;
|
|
|
|
}
|
|
return Mnemonic + " " + this.GetDestinationAsString() + ", " + xReg;
|
|
}
|
|
}
|
|
}
|