2003-12-24 23:32:59 +03:00
|
|
|
#include <stdio.h>
|
2004-01-04 21:53:02 +03:00
|
|
|
#include "disasm.h"
|
2004-10-18 02:05:17 +04:00
|
|
|
|
|
|
|
#if BX_DEBUGGER
|
2004-01-04 21:53:02 +03:00
|
|
|
#include "../bx_debug/debug.h"
|
2004-10-18 02:05:17 +04:00
|
|
|
#endif
|
2002-08-12 18:39:40 +04:00
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// 32-bit general purpose register
|
|
|
|
void disassembler::REG32 (unsigned attr)
|
2002-08-12 18:39:40 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (i32bit_opsize)
|
|
|
|
dis_sprintf("%s", general_32bit_reg_name[attr]);
|
|
|
|
else
|
|
|
|
dis_sprintf("%s", general_16bit_reg_name[attr]);
|
2002-08-12 18:39:40 +04:00
|
|
|
}
|
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// 8-bit general purpose register
|
|
|
|
void disassembler::REG8 (unsigned attr)
|
2002-08-12 18:39:40 +04:00
|
|
|
{
|
2004-12-10 02:19:48 +03:00
|
|
|
dis_sprintf("%s", general_8bit_reg_name[attr]);
|
2002-08-12 18:39:40 +04:00
|
|
|
}
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// 16-bit general purpose register
|
|
|
|
void disassembler::REG16 (unsigned attr)
|
2002-08-12 18:39:40 +04:00
|
|
|
{
|
2004-12-10 02:19:48 +03:00
|
|
|
dis_sprintf("%s", general_16bit_reg_name[attr]);
|
2002-08-12 18:39:40 +04:00
|
|
|
}
|
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// segment register
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::OP_SEG (unsigned attr)
|
2002-09-20 19:34:55 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
dis_sprintf("%s", segment_name[attr]);
|
2002-09-20 19:34:55 +04:00
|
|
|
}
|
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// memory operand
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::OP_MEM (unsigned attr)
|
2003-08-04 20:03:09 +04:00
|
|
|
{
|
2004-12-08 21:54:15 +03:00
|
|
|
if(mod == 3)
|
2003-12-24 23:32:59 +03:00
|
|
|
dis_sprintf("(bad)");
|
2004-12-08 21:54:15 +03:00
|
|
|
else
|
2003-12-24 23:32:59 +03:00
|
|
|
(this->*resolve_modrm)(attr);
|
2003-08-04 20:03:09 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::OP_Q (unsigned attr)
|
2003-08-04 20:03:09 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (mod == 3)
|
2004-12-08 21:54:15 +03:00
|
|
|
{
|
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("mm%d", rm);
|
|
|
|
else
|
|
|
|
dis_sprintf("%%mm%d", rm);
|
|
|
|
}
|
2003-12-24 23:32:59 +03:00
|
|
|
else
|
|
|
|
(this->*resolve_modrm)(attr);
|
2003-08-04 20:03:09 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::OP_W (unsigned attr)
|
2002-09-20 19:34:55 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (mod == 3)
|
2004-12-08 21:54:15 +03:00
|
|
|
{
|
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("xmm%d", rm);
|
|
|
|
else
|
|
|
|
dis_sprintf("%%xmm%d", rm);
|
|
|
|
}
|
2003-12-24 23:32:59 +03:00
|
|
|
else
|
|
|
|
(this->*resolve_modrm)(attr);
|
2002-09-20 19:34:55 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::OP_V (unsigned attr)
|
2002-09-20 19:34:55 +04:00
|
|
|
{
|
2004-12-08 21:54:15 +03:00
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("xmm%d", nnn);
|
|
|
|
else
|
|
|
|
dis_sprintf("%%xmm%d", nnn);
|
2002-09-20 19:34:55 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::OP_P (unsigned attr)
|
|
|
|
{
|
2004-12-08 21:54:15 +03:00
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("mm%d", nnn);
|
|
|
|
else
|
|
|
|
dis_sprintf("%%mm%d", nnn);
|
2002-09-28 10:29:55 +04:00
|
|
|
}
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::OP_X (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2004-11-21 02:26:32 +03:00
|
|
|
const char *esi, *seg;
|
2002-09-28 10:29:55 +04:00
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
if (i32bit_addrsize)
|
2004-12-08 21:54:15 +03:00
|
|
|
esi = general_32bit_reg_name[eSI_REG];
|
2002-09-28 10:29:55 +04:00
|
|
|
else
|
2004-12-08 21:54:15 +03:00
|
|
|
esi = general_16bit_reg_name[eSI_REG];
|
2003-12-24 23:32:59 +03:00
|
|
|
|
2004-12-08 21:54:15 +03:00
|
|
|
if (seg_override)
|
|
|
|
seg = seg_override;
|
2004-11-21 02:26:32 +03:00
|
|
|
else
|
2004-12-08 21:54:15 +03:00
|
|
|
seg = segment_name[DS_REG];
|
2002-09-28 10:29:55 +04:00
|
|
|
|
2004-12-08 21:54:15 +03:00
|
|
|
print_datasize(attr);
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2004-12-08 21:54:15 +03:00
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf("%s:[%s]", seg, esi);
|
|
|
|
else
|
|
|
|
dis_sprintf("%s:(%s)", seg, esi);
|
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::OP_Y (unsigned attr)
|
2004-12-08 21:54:15 +03:00
|
|
|
{
|
|
|
|
const char *edi;
|
|
|
|
|
|
|
|
if (i32bit_addrsize)
|
|
|
|
edi = general_32bit_reg_name[eDI_REG];
|
|
|
|
else
|
|
|
|
edi = general_16bit_reg_name[eDI_REG];
|
|
|
|
|
|
|
|
print_datasize(attr);
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2004-12-08 21:54:15 +03:00
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf("%s:[%s]", segment_name[ES_REG], edi);
|
|
|
|
else
|
|
|
|
dis_sprintf("%s:(%s)", segment_name[ES_REG], edi);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
void disassembler::OP_O (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
const char *seg;
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
if (seg_override)
|
|
|
|
seg = seg_override;
|
|
|
|
else
|
2004-12-08 21:54:15 +03:00
|
|
|
seg = segment_name[DS_REG];
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
print_datasize(attr);
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
if (i32bit_addrsize) {
|
|
|
|
Bit32u imm32 = fetch_dword();
|
2004-12-10 02:19:48 +03:00
|
|
|
dis_sprintf("%s:0x%x", seg, (unsigned) imm32);
|
2004-11-21 02:26:32 +03:00
|
|
|
}
|
2003-01-21 16:23:47 +03:00
|
|
|
else {
|
2003-12-24 23:32:59 +03:00
|
|
|
Bit16u imm16 = fetch_word();
|
2004-12-10 02:19:48 +03:00
|
|
|
dis_sprintf("%s:0x%x", seg, (unsigned) imm16);
|
2004-11-21 02:26:32 +03:00
|
|
|
}
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Jb (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
Bit8s imm8; /* JMP rel8 is signed */
|
|
|
|
imm8 = (Bit8s) fetch_byte();
|
|
|
|
if (i32bit_opsize) {
|
2003-08-04 20:03:09 +04:00
|
|
|
#if BX_DEBUGGER
|
2003-12-24 23:32:59 +03:00
|
|
|
char *Sym=bx_dbg_disasm_symbolic_address((Bit32u)(imm8+db_eip), db_base);
|
2003-08-04 20:03:09 +04:00
|
|
|
if(Sym) {
|
|
|
|
dis_sprintf("%s", Sym);
|
|
|
|
}
|
|
|
|
else // Symbol not found
|
|
|
|
#endif
|
2004-12-08 21:54:15 +03:00
|
|
|
dis_sprintf(".+0x%x", (unsigned) (imm8+db_eip));
|
2004-11-21 02:26:32 +03:00
|
|
|
}
|
2001-04-10 05:04:59 +04:00
|
|
|
else
|
2003-12-24 23:32:59 +03:00
|
|
|
{
|
2003-08-04 20:03:09 +04:00
|
|
|
#if BX_DEBUGGER
|
2003-12-24 23:32:59 +03:00
|
|
|
char *Sym=bx_dbg_disasm_symbolic_address((Bit32u)((imm8+db_eip) & 0xFFFF), db_base);
|
2003-08-04 20:03:09 +04:00
|
|
|
if(Sym) {
|
|
|
|
dis_sprintf("%s", Sym);
|
|
|
|
}
|
|
|
|
else // Symbol not found
|
2003-12-24 23:32:59 +03:00
|
|
|
#endif
|
2004-12-08 21:54:15 +03:00
|
|
|
dis_sprintf(".+0x%x", (unsigned) ((imm8+db_eip) & 0xFFFF));
|
2003-12-24 23:32:59 +03:00
|
|
|
}
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Jv (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (i32bit_opsize) {
|
|
|
|
Bit32s imm32; /* JMP rel32 is signed */
|
|
|
|
imm32 = (Bit32s) fetch_dword();
|
2003-08-04 20:03:09 +04:00
|
|
|
#if BX_DEBUGGER
|
2003-12-24 23:32:59 +03:00
|
|
|
char *Sym=bx_dbg_disasm_symbolic_address((Bit32u)(imm32+db_eip), db_base);
|
2003-08-04 20:03:09 +04:00
|
|
|
if(Sym) {
|
|
|
|
dis_sprintf("%s", Sym);
|
|
|
|
}
|
|
|
|
else // Symbol not found
|
|
|
|
#endif
|
2004-12-08 21:54:15 +03:00
|
|
|
dis_sprintf(".+0x%x", (unsigned) (imm32+db_eip));
|
2004-11-21 02:26:32 +03:00
|
|
|
}
|
2002-09-28 10:29:55 +04:00
|
|
|
else
|
2004-11-21 02:26:32 +03:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
Bit16s imm16; /* JMP rel16 is signed */
|
|
|
|
imm16 = (Bit16s) fetch_word();
|
2003-08-04 20:03:09 +04:00
|
|
|
#if BX_DEBUGGER
|
2003-12-24 23:32:59 +03:00
|
|
|
char *Sym=bx_dbg_disasm_symbolic_address((Bit32u)((imm16+db_eip) & 0xFFFF), db_base);
|
2003-08-04 20:03:09 +04:00
|
|
|
if(Sym) {
|
|
|
|
dis_sprintf("%s", Sym);
|
|
|
|
}
|
|
|
|
else // Symbol not found
|
2003-12-24 23:32:59 +03:00
|
|
|
#endif
|
2004-12-08 21:54:15 +03:00
|
|
|
dis_sprintf(".+0x%x", (unsigned) ((imm16+db_eip) & 0xFFFF));
|
2004-11-21 02:26:32 +03:00
|
|
|
}
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Ap (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (i32bit_opsize)
|
|
|
|
{
|
|
|
|
Bit32u imm32 = fetch_dword();
|
|
|
|
Bit16u cs_selector = fetch_word();
|
|
|
|
dis_sprintf("%04x:%08x", (unsigned) cs_selector, (unsigned) imm32);
|
|
|
|
}
|
2001-04-10 05:04:59 +04:00
|
|
|
else
|
2003-12-24 23:32:59 +03:00
|
|
|
{
|
|
|
|
Bit16u imm16 = fetch_word();
|
|
|
|
Bit16u cs_selector = fetch_word();
|
|
|
|
dis_sprintf("%04x:%04x", (unsigned) cs_selector, (unsigned) imm16);
|
|
|
|
}
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// general purpose register or memory operand
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Eb (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (mod == 3)
|
|
|
|
dis_sprintf("%s", general_8bit_reg_name[rm]);
|
|
|
|
else
|
2004-12-10 02:19:48 +03:00
|
|
|
(this->*resolve_modrm)(B_SIZE);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Ew (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (mod == 3)
|
|
|
|
dis_sprintf("%s", general_16bit_reg_name[rm]);
|
2001-04-10 05:04:59 +04:00
|
|
|
else
|
2004-12-10 02:19:48 +03:00
|
|
|
(this->*resolve_modrm)(W_SIZE);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Ev (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (mod == 3)
|
|
|
|
{
|
|
|
|
if (i32bit_opsize)
|
|
|
|
dis_sprintf("%s", general_32bit_reg_name[rm]);
|
|
|
|
else
|
|
|
|
dis_sprintf("%s", general_16bit_reg_name[rm]);
|
|
|
|
}
|
2001-04-10 05:04:59 +04:00
|
|
|
else
|
2004-12-10 02:19:48 +03:00
|
|
|
(this->*resolve_modrm)(V_SIZE);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Ed (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (mod == 3)
|
|
|
|
dis_sprintf("%s", general_32bit_reg_name[rm]);
|
2001-04-10 05:04:59 +04:00
|
|
|
else
|
2004-12-10 02:19:48 +03:00
|
|
|
(this->*resolve_modrm)(D_SIZE);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// general purpose register
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Gb (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
dis_sprintf("%s", general_8bit_reg_name[nnn]);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Gv (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (i32bit_opsize)
|
|
|
|
dis_sprintf("%s", general_32bit_reg_name[nnn]);
|
|
|
|
else
|
|
|
|
dis_sprintf("%s", general_16bit_reg_name[nnn]);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Gd (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
dis_sprintf("%s", general_32bit_reg_name[nnn]);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// 32-bit general purpose register
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Rd (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2004-12-08 21:54:15 +03:00
|
|
|
dis_sprintf("%s", general_32bit_reg_name[rm]);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// 16-bit general purpose register
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Rw (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2004-12-08 21:54:15 +03:00
|
|
|
dis_sprintf("%s", general_16bit_reg_name[rm]);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// segment register
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Sw (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
dis_sprintf("%s", segment_name[nnn]);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// immediate
|
2004-12-08 21:54:15 +03:00
|
|
|
void disassembler::I1 (unsigned)
|
|
|
|
{
|
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("1");
|
|
|
|
else
|
|
|
|
dis_sprintf("$1");
|
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Ib (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2004-12-08 21:54:15 +03:00
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("0x%x", (unsigned) fetch_byte());
|
|
|
|
else
|
|
|
|
dis_sprintf("$0x%x", (unsigned) fetch_byte());
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Iw (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2004-12-08 21:54:15 +03:00
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("0x%x", (unsigned) fetch_word());
|
|
|
|
else
|
|
|
|
dis_sprintf("$0x%x", (unsigned) fetch_word());
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Id (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2004-12-08 21:54:15 +03:00
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("0x%x", (unsigned) fetch_dword());
|
|
|
|
else
|
|
|
|
dis_sprintf("$0x%x", (unsigned) fetch_dword());
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::Iv (unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (i32bit_opsize)
|
|
|
|
Id(attr);
|
|
|
|
else
|
|
|
|
Iw(attr);
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
|
|
|
|
2004-12-10 02:19:48 +03:00
|
|
|
// sign extended immediate
|
2003-12-24 23:32:59 +03:00
|
|
|
void disassembler::sIb(unsigned attr)
|
2001-04-10 05:04:59 +04:00
|
|
|
{
|
2003-12-24 23:32:59 +03:00
|
|
|
if (i32bit_opsize)
|
|
|
|
{
|
2004-10-17 01:17:44 +04:00
|
|
|
Bit32u imm32 = (Bit8s) fetch_byte();
|
2004-12-08 21:54:15 +03:00
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("0x%x", (unsigned) imm32);
|
|
|
|
else
|
|
|
|
dis_sprintf("$0x%x", (unsigned) imm32);
|
2003-12-24 23:32:59 +03:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-11-21 02:26:32 +03:00
|
|
|
Bit16u imm16 = (Bit8s) fetch_byte();
|
2004-12-08 21:54:15 +03:00
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("0x%x", (unsigned) imm16);
|
|
|
|
else
|
|
|
|
dis_sprintf("$0x%x", (unsigned) imm16);
|
2003-12-24 23:32:59 +03:00
|
|
|
}
|
2001-04-10 05:04:59 +04:00
|
|
|
}
|
2002-11-19 08:47:45 +03:00
|
|
|
|
2003-12-24 23:32:59 +03:00
|
|
|
// floating point
|
2004-12-08 21:54:15 +03:00
|
|
|
void disassembler::ST0 (unsigned attr)
|
|
|
|
{
|
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("st(0)");
|
|
|
|
else
|
|
|
|
dis_sprintf("%%st(0)");
|
|
|
|
}
|
|
|
|
|
|
|
|
void disassembler::STj (unsigned attr)
|
|
|
|
{
|
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("st(%d)", rm);
|
|
|
|
else
|
|
|
|
dis_sprintf("%%st(%d)", rm);
|
|
|
|
}
|
|
|
|
|
|
|
|
// control register
|
|
|
|
void disassembler::Cd (unsigned attr)
|
|
|
|
{
|
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("cr%d", nnn);
|
|
|
|
else
|
|
|
|
dis_sprintf("%%cr%d", nnn);
|
|
|
|
}
|
|
|
|
|
|
|
|
// debug register
|
|
|
|
void disassembler::Dd (unsigned attr)
|
|
|
|
{
|
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("db%d", nnn);
|
|
|
|
else
|
|
|
|
dis_sprintf("%%db%d", nnn);
|
|
|
|
}
|
|
|
|
|
|
|
|
// test registers
|
|
|
|
void disassembler::Td (unsigned attr)
|
|
|
|
{
|
|
|
|
if (intel_mode)
|
|
|
|
dis_sprintf ("tr%d", nnn);
|
|
|
|
else
|
|
|
|
dis_sprintf("%%tr%d", nnn);
|
|
|
|
}
|