Fixed disasm of 'enter' instruction in AT&T mode

This commit is contained in:
Stanislav Shwartsman 2006-03-23 17:43:39 +00:00
parent f347ab97bf
commit bc4ca51055
4 changed files with 19 additions and 1 deletions

View File

@ -197,6 +197,19 @@ void disassembler::Iw(const x86_insn *insn)
dis_sprintf("0x%04x", (unsigned) fetch_word());
}
void disassembler::IwIb(const x86_insn *insn)
{
Bit16u iw = fetch_word();
Bit8u ib = fetch_byte();
if (intel_mode) {
dis_sprintf("0x%04x, 0x%02x", iw, ib);
}
else {
dis_sprintf("$0x%02x, $0x%04x", ib, iw);
}
}
void disassembler::Id(const x86_insn *insn)
{
if (! intel_mode) dis_putc('$');

View File

@ -67,6 +67,8 @@
#define Id &disassembler::Id
#define Iq &disassembler::Iq
#define IwIb &disassembler::IwIb
#define sIbw &disassembler::sIbw
#define sIbd &disassembler::sIbd
#define sIbq &disassembler::sIbq

View File

@ -428,6 +428,9 @@ public:
void Id(const x86_insn *insn);
void Iq(const x86_insn *insn);
// two immediates Iw/Ib
void IwIb(const x86_insn *insn);
// sign extended immediate
void sIbw(const x86_insn *insn);
void sIbd(const x86_insn *insn);

View File

@ -251,7 +251,7 @@ Ia_divsd_Vsd_Wsd = { "divsd", "divsd", Vsd, Wsd, XX },
Ia_divss_Vss_Wss = { "divss", "divss", Vss, Wss, XX },
Ia_divw_AX_Ew = { "div", "divw", AX, Ew, XX },
Ia_emms = { "emms", "emms", XX, XX, XX },
Ia_enter = { "enter", "enter", Iw, Ib, XX },
Ia_enter = { "enter", "enter", IwIb, XX, XX },
Ia_error = { "(error)", "(error)", XX, XX, XX },
Ia_f2xm1 = { "f2xm1", "f2xm1", XX, XX, XX },
Ia_fabs = { "fabs", "fabs", XX, XX, XX },