public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { int code = memory[offset]; if ((code & 0xF8) == 0x58) { // 01011rrr cmd.Attributes = new string[] { RAsm.Reg32Name(code & 0x03) }; return(true); } else if (code == 0x9C) { // 10001111oo000mmm return(true); } else if ((code & 0xC7) == 0x07) { // 00sss111 cmd.Attributes = new string[] { RAsm.RegSssName((code & 0x38) >> 3) }; return(true); } else if (code == 0x0F) { int code2 = memory[offset + 1]; if ((code2 & 0xC7) == 0x81) { // 0000 1111 10ss s001 cmd.Size = 2; cmd.Attributes = new string[] { RAsm.RegSssName((code2 & 0x38) >> 3) }; return(true); } } return(false); }
public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { byte code = memory[offset]; if ((code & 0xF8) == 0x40) { // 01000rrr cmd.Attributes = new string[] { RAsm.Reg32Name(code & 0x03) }; return(true); } else if ((code & 0xFE) == 0xFE) { // 1111111woo000mmm cmd.Size = 2; int code2 = memory[offset + 1]; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; int rrr = (code2 & 0x38) >> 3; int mmm = (code2 & 0x07); string p1 = RAsm.RegName(w, rrr); string p2 = RAsm.FuncName(w, oo, mmm); cmd.Attributes = new string[] { p1, p2 }; return(true); } return(false); }
public override bool Parse(FAsmCommand command, FBytes memory, int offset) { int code = memory[offset++]; if (code == 0xFF) { int code2 = memory[offset++]; if ((code2 & 0x38) == 0x28) { // 1111 1111 oo10 1mmm - MemFar command.Size = 2; } else if ((code2 & 0x38) == 0x20) { // 1111 1111 oo10 0mmm - RegWord / MemNear } return(true); } else if (code == 0xEB) { // 1110 1011 - Short return(true); } else if (code == 0xE9) { // 1110 1001 - Near return(true); } else if (code == 0xEA) { // 1110 1010 - Far return(true); } return(false); }
public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { int code = memory[offset++]; if(code == 0xE3) { // 11100011 - Short return true; } return false; }
public override bool Parse(FAsmCommand command, FBytes memory, int offset) { int code = memory[offset]; if ((code & 0xF8) == 0x50) { // 0101 0rrr - RegWord command.Attributes = new string[] { RAsm.Reg32Name(code & 0x07) }; return(true); } else if (code == 0xFF) { int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x30) { // 1111 1111 oo11 0mmm - MemWord command.Size = 2; int oo = (code2 & 0xC0) >> 6; command.Attributes = new string[] { RAsm.FuncName(1, oo, code2 & 0x07) }; return(true); } } else if ((code & 0xC7) == 0x06) { // 00ss s110 - SegOld int sss = (code & 0x38) >> 3; command.Attributes = new string[] { RAsm.RegSssName(sss) }; return(true); } else if (code == 0x0F) { int code2 = memory[offset + 1]; if ((code2 & 0xC7) == 0x80) { // 0000 1111 10ss s000 - Seg command.Size = 2; int sss = (code & 0x38) >> 3; command.Attributes = new string[] { RAsm.RegSssName(sss) }; return(true); } } else if ((code & 0x6A) == 0x6A) { // 01101010 - Imm8 command.Size = 1 + RAsm.W0_BYTES; command.Attributes = new string[] { memory[offset + 1].ToString("X2") }; return(true); } else if ((code & 0x68) == 0x68) { // 01101000 - Imm command.Size = 1 + RAsm.W1_BYTES; command.Attributes = new string[] { memory.GetUint32(offset + 1).ToString("X8") }; return(true); } return(false); }
public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { byte code = memory[offset++]; if ((code & 0xFE) == 0x02) { // 0000 001w oorrrmmm cmd.Size = 2; cmd.Attributes = RAsm.OoRrrMmmName(code & 0x01, memory[offset + 1]); return(true); } else if ((code & 0xFE) == 0x00) { // 0000 000w oorrrmmm cmd.Size = 2; cmd.Attributes = RAsm.OoRrrMmmName(code & 0x01, memory[offset + 1]); return(true); } else if ((code & 0xFE) == 0x04) { // 0000010w if ((code & 0x01) == 0x00) { cmd.Size = 1 + RAsm.W0_BYTES; cmd.Attributes = new string[] { memory[offset + 1].ToString("X2") }; } else { cmd.Size = 1 + RAsm.W1_BYTES; cmd.Attributes = new string[] { memory.GetUint32(offset + 1).ToString("X8") }; } return(true); } else if ((code & 0xFE) == 0x82) { int code2 = memory[offset++]; if ((code2 & 0x38) == 0x00) { // 1000 001w oo00 0mmm cmd.Size = 2; RAsm.ParseOoMmm(cmd, code & 0x01, (code2 & 0xC0) >> 6, code2 & 0x07, memory, offset); return(true); } } else if ((code & 0xFE) == 0x80) { int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x00) { // 1000 000w oo000mmm cmd.Size = 2; return(true); } } return(false); }
// <OpCode name="Rep" flag="11110011" regs="" mode="8086" text="Repeat Following String Operation" /> public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { int code = memory[offset]; if (code == 0xF3) { int code2 = memory[offset + 1]; cmd.Size = 2; } return(true); }
public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { byte code = memory[offset]; if (code == 0x8D) { // 1000 1101 oorr rmmm cmd.Size = 2; return(RAsm.ParseOoRrrMmm(cmd, 1, memory[offset + 1], memory, offset + 2)); } return(false); }
public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { byte code = memory[offset]; if (code == 0x63) { // 0110 0011 oorrrmmm cmd.Size = 2; cmd.Attributes = RAsm.OoRrrMmmName(1, memory[offset + 1]); return(true); } return(false); }
public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { int code = memory[offset]; if (code == 0x68) { // 0110 1000 - Imm32 cmd.Size = 1 + RAsm.W1_BYTES; cmd.Attributes = new string[] { memory.GetUint32(offset + 1).ToString("X8") }; return(true); } return(false); }
public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { byte code = memory[offset]; if ((code & 0xFE) == 0x2A) { // 0010 101w oorr rmmm - Reg,Reg cmd.Size = 2; cmd.Attributes = RAsm.OoRrrMmmName(code & 0x01, memory[offset + 1]); return(true); } else if ((code & 0xFE) == 0x28) { // 0010 100w oorr rmmm - Mem,Reg cmd.Size = 2; cmd.Attributes = RAsm.OoRrrMmmName(code & 0x01, memory[offset + 1]); return(true); } else if ((code & 0xFE) == 0x2C) { // 0010 110w - Acc,Imm cmd.Size = 1; return(true); } else if ((code & 0xFE) == 0x82) { int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x28) { // 1000 001w oo10 1mmm - Reg,Imm8 cmd.Size = 2; return(true); } } else if ((code & 0xFE) == 0x80) { int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x28) { // 1000 000w oo10 1mmm - Reg,Imm cmd.Size = 2 + RAsm.GetWordBytes(code & 0x01); int oo = (code2 & 0xC0) >> 6; string des = RAsm.FuncName(code & 0x01, oo, code2 & 0x07); cmd.Attributes = new object[] { des, memory.GetUint32(offset + 2) }; return(true); } } return(false); }
public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { byte code = memory[offset]; if ((code & 0xFE) == 0x12) { // 0001 001w oorr rmmm cmd.Size = 2; cmd.Attributes = RAsm.OoRrrMmmName(code & 0x01, memory[offset + 1]); return(true); } else if ((code & 0xFE) == 0x10) { // 0001 000w oorr rmmm cmd.Size = 2; cmd.Attributes = RAsm.OoRrrMmmName(code & 0x01, memory[offset + 1]); return(true); } else if ((code & 0xFE) == 0x14) { // 0001 010w cmd.Size = 1; return(true); } else if ((code & 0xFE) == 0x82) { int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x10) { // 1000 001w oo01 0mmm cmd.Size = 2; return(true); } } else if ((code & 0xFE) == 0x80) { int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x10) { // 1000 000w oo01 0mmm cmd.Size = 2; return(true); } } return(false); }
public override bool Parse(FAsmCommand command, FBytes memory, int offset) { int code = memory[offset]; if (code == 0xC3) { // 11000011 command.Size = 3; command.Attributes = new object[] { memory.GetUint16(offset + 1) }; } else if (code == 0xC2) { // 11000010 command.Size = 3; command.Attributes = new object[] { memory.GetUint16(offset + 1) }; } return(true); }
public override bool Parse(FAsmCommand command, FBytes memory, int offset) { int code = memory[offset]; if (code == 0xCC) { // 1100 1100 return(true); } else if (code == 0xCD) { // 1100 1101 command.Size = 2; command.Attributes = new string[] { memory[offset + 1].ToString("X2") }; return(true); } return(false); }
public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { int code = memory[offset++]; if (code == 0xFF) { int code2 = memory[offset + 1]; if ((code2 & 0x18) == 0x18) { // 1111 1111 oo01 1mmm - MemFar return(true); } } else if (code == 0xE8) { // 1110 1000 - Near cmd.Size = 1 + RInt.BYTE_SIZE; cmd.Attributes = new object[] { memory.GetUint32(offset) }; return(true); } else if (code == 0x9A) { // 1001 1010 - Far cmd.Size = 1 + RAsm.W1_BYTES; cmd.Attributes = new object[] { memory.GetUint32(offset + 1) }; return(true); } else if (code == 0xFF) { // 1111 1111 oo01 0mmm - RegWord return(true); } else if (code == 0xFF) { int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x10) { // 11111111oo010mmm - MemNear } return(true); } return(false); }
public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { int code = memory[offset++]; if ((code & 0xF0) == 0x70) { // 0111 cccc - Short return(true); } else if (code == 0x0F) { int code2 = memory[offset++]; if ((code2 & 0xF0) == 0x80) { // 0000 1111 1000 cccc - Near cmd.Size = 2; } } return(false); }
public override bool Parse(FAsmCommand command, FBytes memory, int offset) { int code = memory[offset]; if ((code & 0xFE) == 0xA2) { // 1010 001w - MemOfs,Acc return(true); } else if ((code & 0xFE) == 0xA0) { // 1010 000w - Acc,MemOfs command.Size = 1 + RInt.BYTE_SIZE; command.Attributes = new object[] { "EAX", "dword ptr [" + memory.GetUint32(offset + 1).ToString("X8") + "]" }; return(true); } else if ((code & 0xF0) == 0xB0) { // 1011 wrrr - Reg,Imm offset++; int w = (code & 0x08) >> 3; if (w == 0x01) { command.Size = 1 + RInt.BYTE_SIZE; command.Attributes = new object[] { RAsm.RegName(w, code & 0x07), memory.GetUint32(offset) }; } else { command.Size = 1 + RByte.BYTE_SIZE; command.Attributes = new object[] { RAsm.RegName(w, code & 0x07), memory[offset] }; } return(true); } else if ((code & 0xFE) == 0xC6) { int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x00) { // 1100 011w oo00 0mmm - Reg,Reg command.Size = 2; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; command.Attributes = new string[] { RAsm.FuncName(w, oo, code2 & 0x07) }; return(true); } } else if ((code & 0xFE) == 0x8A) { // 1000 101w oorr rmmm int code2 = memory[offset + 1]; command.Size = 2; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; string des = RAsm.RegName(w, (code2 & 0x38) >> 3); string src = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } else if ((code & 0xFE) == 0x8A) { // 1000 101w oorr rmmm - Reg,Mem int code2 = memory[offset + 1]; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; if (oo == 0x01) { command.Size = 3; } else { command.Size = 2; } string src = RAsm.RegName(w, (code2 & 0x38) >> 3); string des = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } else if ((code & 0xFE) == 0x88) { // 1000 100w oorr rmmm - Mem,Reg int code2 = memory[offset + 1]; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; if (oo == 0x01) { command.Size = 3; } else { command.Size = 2; } string src = RAsm.RegName(w, (code2 & 0x38) >> 3); string des = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } else if (code == 0x8C) { // 1000 1100 oosssmmm - Reg16,Seg int code2 = memory[offset + 1]; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; if (oo == 0x01) { command.Size = 3; } else { command.Size = 2; } string src = RAsm.RegName(w, (code2 & 0x38) >> 3); string des = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } else if (code == 0x8E) { // 1000 1110 ooss smmm - Seg,Reg16 int code2 = memory[offset + 1]; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; if (oo == 0x01) { command.Size = 3; } else { command.Size = 2; } string src = RAsm.RegName(w, (code2 & 0x38) >> 3); string des = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } else if (code == 0x8C) { // 1000 1100 ooss smmm - Mem16,Seg int code2 = memory[offset + 1]; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; if (oo == 0x01) { command.Size = 3; } else { command.Size = 2; } string src = RAsm.RegName(w, (code2 & 0x38) >> 3); string des = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } else if (code == 0x8E) { // 1000 1110 ooss smmm - Seg,Mem16 int code2 = memory[offset + 1]; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; if (oo == 0x01) { command.Size = 3; } else { command.Size = 2; } string src = RAsm.RegName(w, (code2 & 0x38) >> 3); string des = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } else if (code == 0x0F) { int code2 = memory[offset + 1]; if (code2 == 0x20) { int code3 = memory[offset + 2]; if ((code3 & 0xC0) == 0xC0) { // 0000 1111 0010 0000 11ss srrr - CRn,Reg32 command.Size = 3; string des = RAsm.RegSssName((code3 & 0x38) >> 3); string src = RAsm.Reg32Name(code3 & 0x07); command.Attributes = new string[] { des, src }; return(true); } } else if (code2 == 0x22) { int code3 = memory[offset + 2]; if ((code3 & 0xC0) == 0xC0) { // 0000 1111 0010 0010 11ss srrr command.Size = 3; string des = RAsm.RegSssName((code3 & 0x38) >> 3); string src = RAsm.Reg32Name(code3 & 0x07); command.Attributes = new string[] { des, src }; return(true); } } else if (code2 == 0x21) { int code3 = memory[offset + 2]; if ((code3 & 0xC0) == 0xC0) { // 0000 1111 0010 0001 11ss srrr - Reg32,DRn command.Size = 3; string des = RAsm.Reg32Name(code3 & 0x07); string src = RAsm.RegSssName((code3 & 0x38) >> 3); command.Attributes = new string[] { des, src }; return(true); } } else if (code2 == 0x23) { int code3 = memory[offset + 2]; if ((code3 & 0xC0) == 0xC0) { // 0000 1111 0010 0011 11ss srrr - DRn,Reg32 command.Size = 3; string src = RAsm.Reg32Name(code3 & 0x07); string des = RAsm.RegSssName((code3 & 0x38) >> 3); command.Attributes = new string[] { des, src }; return(true); } } else if (code2 == 0x24) { int code3 = memory[offset + 2]; if ((code3 & 0xC0) == 0xC0) { // 0000 1111 0010 0100 11ss srrr - Reg32,TRn command.Size = 3; string src = RAsm.Reg32Name(code3 & 0x07); string des = RAsm.RegSssName((code3 & 0x38) >> 3); command.Attributes = new string[] { des, src }; return(true); } } else if (code2 == 0x26) { int code3 = memory[offset + 2]; if ((code3 & 0xC0) == 0xC0) { // 0000 1111 0010 0110 11ss srrr - TRn,Reg32 command.Size = 3; string src = RAsm.Reg32Name(code3 & 0x07); string des = RAsm.RegSssName((code3 & 0x38) >> 3); command.Attributes = new string[] { des, src }; return(true); } } } return(false); }
// <OpCode flag="11010100" name="Aam" regs="Imm8" mode="Pentium" text="ASCII Adjust AX Register After Multiplication" /> // <OpCode flag="1101010000001010" name="Aam" regs="" mode="8086" text="ASCII Adjust AX Register After Multiplication" /> public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) { return(true); }
public override bool Parse(FAsmCommand command, FBytes memory, int offset) { int code = memory[offset]; if ((code & 0xFE) == 0x34) { // 0011 010w - Acc,Imm return(true); } else if ((code & 0xFE) == 0x32) { // 0011 001w oorr rmmm - Reg,Reg //33 C5 xor eax,ebp command.Size = 2; int code2 = memory[offset + 1]; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; string des = RAsm.RegName(w, (code2 & 0x38) >> 3); string src = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } else if ((code & 0xFE) == 0x30) { // 0011 000w oorr rmmm - Mem,Reg command.Size = 2; int code2 = memory[offset + 1]; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; string des = RAsm.RegName(w, (code2 & 0x38) >> 3); string src = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } else if ((code & 0xFE) == 0x32) { // 0011 001w oor rrmmm - Reg,Mem int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x30) { command.Size = 2; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; string des = RAsm.Reg32Name((code2 & 0x38) >> 3); string src = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } } else if ((code & 0xFE) == 0x82) { // 1000 001w oo11 0mmm - Reg,Imm8 int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x30) { command.Size = 2; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; string des = RAsm.Reg32Name((code2 & 0x38) >> 3); string src = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } } else if ((code & 0xFE) == 0x82) { int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x30) { // 1000 001w oo11 0mmm - Mem,Imm8 command.Size = 2; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; string des = RAsm.Reg32Name((code2 & 0x38) >> 3); string src = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } } else if ((code & 0xFE) == 0x80) { int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x30) { // 1000 000w oo11 0mmm - Reg,Imm command.Size = 2; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; string des = RAsm.Reg32Name((code2 & 0x38) >> 3); string src = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } } else if ((code & 0xFE) == 0x80) { int code2 = memory[offset + 1]; if ((code2 & 0x38) == 0x30) { // 1000 000w oo11 0mmm - Mem,Imm command.Size = 2; int w = code & 0x01; int oo = (code2 & 0xC0) >> 6; string des = RAsm.Reg32Name((code2 & 0x38) >> 3); string src = RAsm.FuncName(w, oo, code2 & 0x07); command.Attributes = new string[] { des, src }; return(true); } } return(false); }