ReactOS 0.4.15-dev-8227-g32d615f
i386-dis.c File Reference
#include <ntoskrnl.h>
#include "../kdb.h"
#include "dis-asm.h"
#include <setjmp.h>
Include dependency graph for i386-dis.c:

Go to the source code of this file.

Classes

struct  dis_private
 
struct  dis386
 

Macros

#define PARAMS(X)   X
 
#define PTR   void*
 
#define bfd_mach_x86_64_intel_syntax   0
 
#define bfd_mach_x86_64   1
 
#define bfd_mach_i386_i386_intel_syntax   2
 
#define bfd_mach_i386_i386   3
 
#define bfd_mach_i386_i8086   4
 
#define abort()   DbgBreakPoint();
 
#define _(X)   X
 
#define ATTRIBUTE_UNUSED
 
#define sprintf_vma(BUF, VMA)   sprintf(BUF, "0x%IX", VMA)
 
#define MAXLEN   20
 
#define UNIXWARE_COMPAT   1
 
#define FWAIT_OPCODE   (0x9b)
 
#define REX_MODE64   8
 
#define REX_EXTX   4
 
#define REX_EXTY   2
 
#define REX_EXTZ   1
 
#define USED_REX(value)
 
#define PREFIX_REPZ   1
 
#define PREFIX_REPNZ   2
 
#define PREFIX_LOCK   4
 
#define PREFIX_CS   8
 
#define PREFIX_SS   0x10
 
#define PREFIX_DS   0x20
 
#define PREFIX_ES   0x40
 
#define PREFIX_FS   0x80
 
#define PREFIX_GS   0x100
 
#define PREFIX_DATA   0x200
 
#define PREFIX_ADDR   0x400
 
#define PREFIX_FWAIT   0x800
 
#define FETCH_DATA(info, addr)
 
#define XX   NULL, 0
 
#define Eb   OP_E, b_mode
 
#define Ev   OP_E, v_mode
 
#define Ed   OP_E, d_mode
 
#define Edq   OP_E, dq_mode
 
#define indirEb   OP_indirE, b_mode
 
#define indirEv   OP_indirE, v_mode
 
#define Ew   OP_E, w_mode
 
#define Ma   OP_E, v_mode
 
#define M   OP_M, 0 /* lea, lgdt, etc. */
 
#define Mp   OP_M, 0 /* 32 or 48 bit memory operand for LDS, LES etc */
 
#define Gb   OP_G, b_mode
 
#define Gv   OP_G, v_mode
 
#define Gd   OP_G, d_mode
 
#define Gw   OP_G, w_mode
 
#define Rd   OP_Rd, d_mode
 
#define Rm   OP_Rd, m_mode
 
#define Ib   OP_I, b_mode
 
#define sIb   OP_sI, b_mode /* sign extened byte */
 
#define Iv   OP_I, v_mode
 
#define Iq   OP_I, q_mode
 
#define Iv64   OP_I64, v_mode
 
#define Iw   OP_I, w_mode
 
#define Jb   OP_J, b_mode
 
#define Jv   OP_J, v_mode
 
#define Cm   OP_C, m_mode
 
#define Dm   OP_D, m_mode
 
#define Td   OP_T, d_mode
 
#define RMeAX   OP_REG, eAX_reg
 
#define RMeBX   OP_REG, eBX_reg
 
#define RMeCX   OP_REG, eCX_reg
 
#define RMeDX   OP_REG, eDX_reg
 
#define RMeSP   OP_REG, eSP_reg
 
#define RMeBP   OP_REG, eBP_reg
 
#define RMeSI   OP_REG, eSI_reg
 
#define RMeDI   OP_REG, eDI_reg
 
#define RMrAX   OP_REG, rAX_reg
 
#define RMrBX   OP_REG, rBX_reg
 
#define RMrCX   OP_REG, rCX_reg
 
#define RMrDX   OP_REG, rDX_reg
 
#define RMrSP   OP_REG, rSP_reg
 
#define RMrBP   OP_REG, rBP_reg
 
#define RMrSI   OP_REG, rSI_reg
 
#define RMrDI   OP_REG, rDI_reg
 
#define RMAL   OP_REG, al_reg
 
#define RMAL   OP_REG, al_reg
 
#define RMCL   OP_REG, cl_reg
 
#define RMDL   OP_REG, dl_reg
 
#define RMBL   OP_REG, bl_reg
 
#define RMAH   OP_REG, ah_reg
 
#define RMCH   OP_REG, ch_reg
 
#define RMDH   OP_REG, dh_reg
 
#define RMBH   OP_REG, bh_reg
 
#define RMAX   OP_REG, ax_reg
 
#define RMDX   OP_REG, dx_reg
 
#define eAX   OP_IMREG, eAX_reg
 
#define eBX   OP_IMREG, eBX_reg
 
#define eCX   OP_IMREG, eCX_reg
 
#define eDX   OP_IMREG, eDX_reg
 
#define eSP   OP_IMREG, eSP_reg
 
#define eBP   OP_IMREG, eBP_reg
 
#define eSI   OP_IMREG, eSI_reg
 
#define eDI   OP_IMREG, eDI_reg
 
#define AL   OP_IMREG, al_reg
 
#define AL   OP_IMREG, al_reg
 
#define CL   OP_IMREG, cl_reg
 
#define DL   OP_IMREG, dl_reg
 
#define BL   OP_IMREG, bl_reg
 
#define AH   OP_IMREG, ah_reg
 
#define CH   OP_IMREG, ch_reg
 
#define DH   OP_IMREG, dh_reg
 
#define BH   OP_IMREG, bh_reg
 
#define AX   OP_IMREG, ax_reg
 
#define DX   OP_IMREG, dx_reg
 
#define indirDX   OP_IMREG, indir_dx_reg
 
#define Sw   OP_SEG, w_mode
 
#define Ap   OP_DIR, 0
 
#define Ob   OP_OFF, b_mode
 
#define Ob64   OP_OFF64, b_mode
 
#define Ov   OP_OFF, v_mode
 
#define Ov64   OP_OFF64, v_mode
 
#define Xb   OP_DSreg, eSI_reg
 
#define Xv   OP_DSreg, eSI_reg
 
#define Yb   OP_ESreg, eDI_reg
 
#define Yv   OP_ESreg, eDI_reg
 
#define DSBX   OP_DSreg, eBX_reg
 
#define es   OP_REG, es_reg
 
#define ss   OP_REG, ss_reg
 
#define cs   OP_REG, cs_reg
 
#define ds   OP_REG, ds_reg
 
#define fs   OP_REG, fs_reg
 
#define gs   OP_REG, gs_reg
 
#define MX   OP_MMX, 0
 
#define XM   OP_XMM, 0
 
#define EM   OP_EM, v_mode
 
#define EX   OP_EX, v_mode
 
#define MS   OP_MS, v_mode
 
#define XS   OP_XS, v_mode
 
#define OPSUF   OP_3DNowSuffix, 0
 
#define OPSIMD   OP_SIMD_Suffix, 0
 
#define cond_jump_flag   NULL, cond_jump_mode
 
#define loop_jcxz_flag   NULL, loop_jcxz_mode
 
#define SUFFIX_ALWAYS   4
 
#define AFLAG   2
 
#define DFLAG   1
 
#define b_mode   1 /* byte operand */
 
#define v_mode   2 /* operand size depends on prefixes */
 
#define w_mode   3 /* word operand */
 
#define d_mode   4 /* double word operand */
 
#define q_mode   5 /* quad word operand */
 
#define x_mode   6 /* 80 bit float operand */
 
#define m_mode   7 /* d_mode in 32bit, q_mode in 64bit mode. */
 
#define cond_jump_mode   8
 
#define loop_jcxz_mode   9
 
#define dq_mode   10 /* operand size depends on REX prefixes. */
 
#define es_reg   100
 
#define cs_reg   101
 
#define ss_reg   102
 
#define ds_reg   103
 
#define fs_reg   104
 
#define gs_reg   105
 
#define eAX_reg   108
 
#define eCX_reg   109
 
#define eDX_reg   110
 
#define eBX_reg   111
 
#define eSP_reg   112
 
#define eBP_reg   113
 
#define eSI_reg   114
 
#define eDI_reg   115
 
#define al_reg   116
 
#define cl_reg   117
 
#define dl_reg   118
 
#define bl_reg   119
 
#define ah_reg   120
 
#define ch_reg   121
 
#define dh_reg   122
 
#define bh_reg   123
 
#define ax_reg   124
 
#define cx_reg   125
 
#define dx_reg   126
 
#define bx_reg   127
 
#define sp_reg   128
 
#define bp_reg   129
 
#define si_reg   130
 
#define di_reg   131
 
#define rAX_reg   132
 
#define rCX_reg   133
 
#define rDX_reg   134
 
#define rBX_reg   135
 
#define rSP_reg   136
 
#define rBP_reg   137
 
#define rSI_reg   138
 
#define rDI_reg   139
 
#define indir_dx_reg   150
 
#define FLOATCODE   1
 
#define USE_GROUPS   2
 
#define USE_PREFIX_USER_TABLE   3
 
#define X86_64_SPECIAL   4
 
#define FLOAT   NULL, NULL, FLOATCODE, NULL, 0, NULL, 0
 
#define GRP1b   NULL, NULL, USE_GROUPS, NULL, 0, NULL, 0
 
#define GRP1S   NULL, NULL, USE_GROUPS, NULL, 1, NULL, 0
 
#define GRP1Ss   NULL, NULL, USE_GROUPS, NULL, 2, NULL, 0
 
#define GRP2b   NULL, NULL, USE_GROUPS, NULL, 3, NULL, 0
 
#define GRP2S   NULL, NULL, USE_GROUPS, NULL, 4, NULL, 0
 
#define GRP2b_one   NULL, NULL, USE_GROUPS, NULL, 5, NULL, 0
 
#define GRP2S_one   NULL, NULL, USE_GROUPS, NULL, 6, NULL, 0
 
#define GRP2b_cl   NULL, NULL, USE_GROUPS, NULL, 7, NULL, 0
 
#define GRP2S_cl   NULL, NULL, USE_GROUPS, NULL, 8, NULL, 0
 
#define GRP3b   NULL, NULL, USE_GROUPS, NULL, 9, NULL, 0
 
#define GRP3S   NULL, NULL, USE_GROUPS, NULL, 10, NULL, 0
 
#define GRP4   NULL, NULL, USE_GROUPS, NULL, 11, NULL, 0
 
#define GRP5   NULL, NULL, USE_GROUPS, NULL, 12, NULL, 0
 
#define GRP6   NULL, NULL, USE_GROUPS, NULL, 13, NULL, 0
 
#define GRP7   NULL, NULL, USE_GROUPS, NULL, 14, NULL, 0
 
#define GRP8   NULL, NULL, USE_GROUPS, NULL, 15, NULL, 0
 
#define GRP9   NULL, NULL, USE_GROUPS, NULL, 16, NULL, 0
 
#define GRP10   NULL, NULL, USE_GROUPS, NULL, 17, NULL, 0
 
#define GRP11   NULL, NULL, USE_GROUPS, NULL, 18, NULL, 0
 
#define GRP12   NULL, NULL, USE_GROUPS, NULL, 19, NULL, 0
 
#define GRP13   NULL, NULL, USE_GROUPS, NULL, 20, NULL, 0
 
#define GRP14   NULL, NULL, USE_GROUPS, NULL, 21, NULL, 0
 
#define GRPAMD   NULL, NULL, USE_GROUPS, NULL, 22, NULL, 0
 
#define GRPPADLCK   NULL, NULL, USE_GROUPS, NULL, 23, NULL, 0
 
#define PREGRP0   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 0, NULL, 0
 
#define PREGRP1   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 1, NULL, 0
 
#define PREGRP2   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 2, NULL, 0
 
#define PREGRP3   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 3, NULL, 0
 
#define PREGRP4   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 4, NULL, 0
 
#define PREGRP5   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 5, NULL, 0
 
#define PREGRP6   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 6, NULL, 0
 
#define PREGRP7   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 7, NULL, 0
 
#define PREGRP8   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 8, NULL, 0
 
#define PREGRP9   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 9, NULL, 0
 
#define PREGRP10   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 10, NULL, 0
 
#define PREGRP11   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 11, NULL, 0
 
#define PREGRP12   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 12, NULL, 0
 
#define PREGRP13   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 13, NULL, 0
 
#define PREGRP14   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 14, NULL, 0
 
#define PREGRP15   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 15, NULL, 0
 
#define PREGRP16   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 16, NULL, 0
 
#define PREGRP17   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 17, NULL, 0
 
#define PREGRP18   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 18, NULL, 0
 
#define PREGRP19   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 19, NULL, 0
 
#define PREGRP20   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 20, NULL, 0
 
#define PREGRP21   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 21, NULL, 0
 
#define PREGRP22   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 22, NULL, 0
 
#define PREGRP23   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 23, NULL, 0
 
#define PREGRP24   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 24, NULL, 0
 
#define PREGRP25   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 25, NULL, 0
 
#define PREGRP26   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 26, NULL, 0
 
#define PREGRP27   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 27, NULL, 0
 
#define PREGRP28   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 28, NULL, 0
 
#define PREGRP29   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 29, NULL, 0
 
#define PREGRP30   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 30, NULL, 0
 
#define PREGRP31   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 31, NULL, 0
 
#define PREGRP32   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 32, NULL, 0
 
#define X86_64_0   NULL, NULL, X86_64_SPECIAL, NULL, 0, NULL, 0
 
#define MODRM_CHECK   if (!need_modrm) abort ()
 
#define INTERNAL_DISASSEMBLER_ERROR   _("<internal disassembler error>")
 
#define ST   OP_ST, 0
 
#define STi   OP_STi, 0
 
#define FGRPd9_2   NULL, NULL, 0, NULL, 0, NULL, 0
 
#define FGRPd9_4   NULL, NULL, 1, NULL, 0, NULL, 0
 
#define FGRPd9_5   NULL, NULL, 2, NULL, 0, NULL, 0
 
#define FGRPd9_6   NULL, NULL, 3, NULL, 0, NULL, 0
 
#define FGRPd9_7   NULL, NULL, 4, NULL, 0, NULL, 0
 
#define FGRPda_5   NULL, NULL, 5, NULL, 0, NULL, 0
 
#define FGRPdb_4   NULL, NULL, 6, NULL, 0, NULL, 0
 
#define FGRPde_3   NULL, NULL, 7, NULL, 0, NULL, 0
 
#define FGRPdf_4   NULL, NULL, 8, NULL, 0, NULL, 0
 

Typedefs

typedef enum bfd_flavour bfd_flavour
 
typedef enum bfd_architecture bfd_arch
 
typedef uintptr_t bfd_vma
 
typedef unsigned char bfd_byte
 
typedef voidbfd
 
typedef intptr_t bfd_signed_vma
 
typedef void(* op_rtn) (int bytemode, int sizeflag)
 

Enumerations

enum  bfd_flavour { bfd_target_unknown_flavour }
 
enum  bfd_architecture { bfd_arch_i386 }
 
enum  bfd_endian { BFD_ENDIAN_BIG , BIG_ENDIAN_LITTLE , BFD_ENDIAN_UNKNOWN }
 

Functions

int sprintf (char *str, const char *format,...)
 
int print_insn_i386 (bfd_vma pc, struct disassemble_info *info)
 
int KdbpPrintDisasm (void *Ignored, const char *fmt,...)
 
int KdbpNopPrintDisasm (void *Ignored, const char *fmt,...)
 
static int KdbpReadMemory (uintptr_t Addr, unsigned char *Data, unsigned int Length, struct disassemble_info *Ignored)
 
static void KdbpMemoryError (int Status, uintptr_t Addr, struct disassemble_info *Ignored)
 
static void KdbpPrintAddressInCode (uintptr_t Addr, struct disassemble_info *Ignored)
 
static void KdbpNopPrintAddress (uintptr_t Addr, struct disassemble_info *Ignored)
 
LONG KdbpGetInstLength (IN ULONG_PTR Address)
 
LONG KdbpDisassemble (IN ULONG_PTR Address, IN ULONG IntelSyntax)
 
static int fetch_data (struct disassemble_info *, bfd_byte *)
 
static void ckprefix (void)
 
static const charprefix_name (int, int)
 
static int print_insn (bfd_vma, disassemble_info *)
 
static void dofloat (int)
 
static void OP_ST (int, int)
 
static void OP_STi (int, int)
 
static int putop (const char *, int)
 
static void oappend (const char *)
 
static void append_seg (void)
 
static void OP_indirE (int, int)
 
static void print_operand_value (char *, int, bfd_vma)
 
static void OP_E (int, int)
 
static void OP_G (int, int)
 
static bfd_vma get64 (void)
 
static bfd_signed_vma get32 (void)
 
static bfd_signed_vma get32s (void)
 
static int get16 (void)
 
static void set_op (bfd_vma, int)
 
static void OP_REG (int, int)
 
static void OP_IMREG (int, int)
 
static void OP_I (int, int)
 
static void OP_I64 (int, int)
 
static void OP_sI (int, int)
 
static void OP_J (int, int)
 
static void OP_SEG (int, int)
 
static void OP_DIR (int, int)
 
static void OP_OFF (int, int)
 
static void OP_OFF64 (int, int)
 
static void ptr_reg (int, int)
 
static void OP_ESreg (int, int)
 
static void OP_DSreg (int, int)
 
static void OP_C (int, int)
 
static void OP_D (int, int)
 
static void OP_T (int, int)
 
static void OP_Rd (int, int)
 
static void OP_MMX (int, int)
 
static void OP_XMM (int, int)
 
static void OP_EM (int, int)
 
static void OP_EX (int, int)
 
static void OP_MS (int, int)
 
static void OP_XS (int, int)
 
static void OP_M (int, int)
 
static void OP_0fae (int, int)
 
static void OP_0f07 (int, int)
 
static void NOP_Fixup (int, int)
 
static void OP_3DNowSuffix (int, int)
 
static void OP_SIMD_Suffix (int, int)
 
static void SIMD_Fixup (int, int)
 
static void PNI_Fixup (int, int)
 
static void INVLPG_Fixup (int, int)
 
static void BadOp (void)
 
int print_insn_i386_att (bfd_vma pc, disassemble_info *info)
 
int print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
 
static void OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void OP_SEG (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)
 
static void OP_OFF (int bytemode ATTRIBUTE_UNUSED, int sizeflag)
 
static void OP_OFF64 (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void OP_XMM (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void NOP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void OP_SIMD_Suffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 
static void SIMD_Fixup (int extrachar, int sizeflag ATTRIBUTE_UNUSED)
 
static void PNI_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag)
 

Variables

static int mode_64bit
 
static int prefixes
 
static int rex
 
static int rex_used
 
static int used_prefixes
 
static const struct dis386 dis386 []
 
static const struct dis386 dis386_twobyte []
 
static const unsigned char onebyte_has_modrm [256]
 
static const unsigned char twobyte_has_modrm [256]
 
static const unsigned char twobyte_uses_SSE_prefix [256]
 
static char obuf [100]
 
static charobufp
 
static char scratchbuf [100]
 
static unsigned charstart_codep
 
static unsigned charinsn_codep
 
static unsigned charcodep
 
static disassemble_infothe_info
 
static int mod
 
static int rm
 
static int reg
 
static unsigned char need_modrm
 
static const char ** names64
 
static const char ** names32
 
static const char ** names16
 
static const char ** names8
 
static const char ** names8rex
 
static const char ** names_seg
 
static const char ** index16
 
static const charintel_names64 []
 
static const charintel_names32 []
 
static const charintel_names16 []
 
static const charintel_names8 []
 
static const charintel_names8rex []
 
static const charintel_names_seg []
 
static const charintel_index16 []
 
static const charatt_names64 []
 
static const charatt_names32 []
 
static const charatt_names16 []
 
static const charatt_names8 []
 
static const charatt_names8rex []
 
static const charatt_names_seg []
 
static const charatt_index16 []
 
static const struct dis386 grps [][8]
 
static const struct dis386 prefix_user_table [][4]
 
static const struct dis386 x86_64_table [][2]
 
static char op1out [100]
 
static char op2out [100]
 
static char op3out [100]
 
static int op_ad
 
static int op_index [3]
 
static int two_source_ops
 
static bfd_vma op_address [3]
 
static bfd_vma op_riprel [3]
 
static bfd_vma start_pc
 
static char intel_syntax
 
static char open_char
 
static char close_char
 
static char separator_char
 
static char scale_char
 
static const charfloat_mem []
 
static const unsigned char float_mem_mode []
 
static const struct dis386 float_reg [][8]
 
static charfgrps [][8]
 
static const char *const Suffix3DNow []
 
static const charsimd_cmp_op []
 

Macro Definition Documentation

◆ _

#define _ (   X)    X

Definition at line 35 of file i386-dis.c.

◆ abort

#define abort (   void)    DbgBreakPoint();

Definition at line 34 of file i386-dis.c.

◆ AFLAG

#define AFLAG   2

Definition at line 461 of file i386-dis.c.

◆ AH

#define AH   OP_IMREG, ah_reg

Definition at line 420 of file i386-dis.c.

◆ ah_reg

#define ah_reg   120

Definition at line 495 of file i386-dis.c.

◆ AL [1/2]

#define AL   OP_IMREG, al_reg

Definition at line 416 of file i386-dis.c.

◆ AL [2/2]

#define AL   OP_IMREG, al_reg

Definition at line 416 of file i386-dis.c.

◆ al_reg

#define al_reg   116

Definition at line 491 of file i386-dis.c.

◆ Ap

#define Ap   OP_DIR, 0

Definition at line 429 of file i386-dis.c.

◆ ATTRIBUTE_UNUSED

#define ATTRIBUTE_UNUSED

Definition at line 36 of file i386-dis.c.

◆ AX

#define AX   OP_IMREG, ax_reg

Definition at line 424 of file i386-dis.c.

◆ ax_reg

#define ax_reg   124

Definition at line 500 of file i386-dis.c.

◆ b_mode

#define b_mode   1 /* byte operand */

Definition at line 464 of file i386-dis.c.

◆ bfd_mach_i386_i386

#define bfd_mach_i386_i386   3

Definition at line 32 of file i386-dis.c.

◆ bfd_mach_i386_i386_intel_syntax

#define bfd_mach_i386_i386_intel_syntax   2

Definition at line 31 of file i386-dis.c.

◆ bfd_mach_i386_i8086

#define bfd_mach_i386_i8086   4

Definition at line 33 of file i386-dis.c.

◆ bfd_mach_x86_64

#define bfd_mach_x86_64   1

Definition at line 30 of file i386-dis.c.

◆ bfd_mach_x86_64_intel_syntax

#define bfd_mach_x86_64_intel_syntax   0

Definition at line 29 of file i386-dis.c.

◆ BH

#define BH   OP_IMREG, bh_reg

Definition at line 423 of file i386-dis.c.

◆ bh_reg

#define bh_reg   123

Definition at line 498 of file i386-dis.c.

◆ BL

#define BL   OP_IMREG, bl_reg

Definition at line 419 of file i386-dis.c.

◆ bl_reg

#define bl_reg   119

Definition at line 494 of file i386-dis.c.

◆ bp_reg

#define bp_reg   129

Definition at line 505 of file i386-dis.c.

◆ bx_reg

#define bx_reg   127

Definition at line 503 of file i386-dis.c.

◆ CH

Definition at line 421 of file i386-dis.c.

◆ ch_reg

#define ch_reg   121

Definition at line 496 of file i386-dis.c.

◆ CL

#define CL   OP_IMREG, cl_reg

Definition at line 417 of file i386-dis.c.

◆ cl_reg

#define cl_reg   117

Definition at line 492 of file i386-dis.c.

◆ Cm

#define Cm   OP_C, m_mode

Definition at line 375 of file i386-dis.c.

◆ cond_jump_flag

#define cond_jump_flag   NULL, cond_jump_mode

Definition at line 456 of file i386-dis.c.

◆ cond_jump_mode

#define cond_jump_mode   8

Definition at line 471 of file i386-dis.c.

◆ cs

static CRITICAL_SECTION cs   OP_REG, cs_reg

Definition at line 442 of file i386-dis.c.

Referenced by __xmlGlobalInitMutexLock(), _wcsicmp(), _wcsnicmp(), CardCount::Add(), AddCharacterRangeToCharSet(), AddCharacterToCharSet(), array_tests(), balance_data_chunk(), BlpArchInitialize(), CardCount::CardCount(), CFn_FitCharSet(), check_load_safety(), check_script_safety(), client_security_QueryInterface(), co_UserLoadKbdLayout(), Collection_addCert(), Collection_addCRL(), Collection_addCTL(), Collection_enumCert(), Collection_enumCRL(), Collection_enumCTL(), Collection_release(), COMBOEX_Create(), confirm_safety(), confirm_safety_load(), Control_WndProc_Create(), create_activex_object(), create_chain(), create_object(), create_test_wndproc(), CreateOffloadInfo5Internal(), fnIMLangFontLink2_CodePagesToCodePage(), fnIMLangFontLink2_CodePageToCodePages(), full_title(), fullscreen_wnd_proc(), get_glyph_indices(), HEXEDIT_WM_NCCREATE(), III_antialias(), CardCount::Init(), InternetHostSecurityManager_QueryCustomPolicy(), IntGetNewWindowMode(), IntSetNewWindowMode(), iso2022jp_mbtowc(), iso2022jp_wctomb(), main_window_procA(), MCIWND_Create(), mdi_child_wnd_proc_1(), mdi_child_wnd_proc_2(), MDIClientWndProc_common(), ME_CreateTextHost(), MIDIMAP_LoadSettings(), CardRegion::MoveCard(), MsgiAnsiToUnicodeCleanup(), MsgiAnsiToUnicodeMessage(), MsgiUnicodeToAnsiCleanup(), MsgiUnicodeToAnsiMessage(), msi_dialog_oncreate(), OleDocumentView_UIActivate(), open_fileref(), CardStack::operator+(), CardStack::operator+=(), poll_queries(), CardStack::Pop(), PopupMenuWndProc(), CardRegion::Push(), ReadCabinetState(), RealDefWindowProcA(), RealDefWindowProcW(), REBAR_Create(), REBAR_NCCreate(), StringTest::replace(), s_sum_cs(), scroll_init_proc(), scrub_chunk(), CardRegion::SetCardStack(), shader_glsl_destroy(), SPY_DumpStructure(), STATIC_WindowProc(), StaticWndProc_common(), CardCount::Sub(), SysLinkWindowProc(), test_activex(), test_control_procA(), test_flash_ax(), test_GetCharABCWidths(), test_GetGlyphOutline(), test_MDI_child_stack(), test_nonexistent_font(), test_realization(), test_RtlInitializeCriticalSectionEx(), test_RtlLeaveCriticalSection(), test_security(), test_security_reg(), test_set_getsockopt(), tool_window_procA(), toolbar_subclass_proc(), TypeCmd(), wined3d_cs_create(), wined3d_cs_destroy(), wined3d_cs_destroy_object(), wined3d_cs_emit_add_dirty_texture_region(), wined3d_cs_emit_blt_sub_resource(), wined3d_cs_emit_callback(), wined3d_cs_emit_clear(), wined3d_cs_emit_clear_rendertarget_view(), wined3d_cs_emit_clear_unordered_access_view_uint(), wined3d_cs_emit_copy_uav_counter(), wined3d_cs_emit_dispatch(), wined3d_cs_emit_dispatch_indirect(), wined3d_cs_emit_draw(), wined3d_cs_emit_draw_indirect(), wined3d_cs_emit_flush(), wined3d_cs_emit_generate_mipmaps(), wined3d_cs_emit_preload_resource(), wined3d_cs_emit_present(), wined3d_cs_emit_query_issue(), wined3d_cs_emit_reset_state(), wined3d_cs_emit_set_blend_state(), wined3d_cs_emit_set_clip_plane(), wined3d_cs_emit_set_color_key(), wined3d_cs_emit_set_constant_buffer(), wined3d_cs_emit_set_depth_stencil_view(), wined3d_cs_emit_set_index_buffer(), wined3d_cs_emit_set_light(), wined3d_cs_emit_set_light_enable(), wined3d_cs_emit_set_material(), wined3d_cs_emit_set_predication(), wined3d_cs_emit_set_rasterizer_state(), wined3d_cs_emit_set_render_state(), wined3d_cs_emit_set_rendertarget_view(), wined3d_cs_emit_set_sampler(), wined3d_cs_emit_set_sampler_state(), wined3d_cs_emit_set_scissor_rect(), wined3d_cs_emit_set_shader(), wined3d_cs_emit_set_shader_resource_view(), wined3d_cs_emit_set_stream_output(), wined3d_cs_emit_set_stream_source(), wined3d_cs_emit_set_stream_source_freq(), wined3d_cs_emit_set_texture(), wined3d_cs_emit_set_texture_state(), wined3d_cs_emit_set_transform(), wined3d_cs_emit_set_unordered_access_view(), wined3d_cs_emit_set_vertex_declaration(), wined3d_cs_emit_set_viewport(), wined3d_cs_emit_stop(), wined3d_cs_emit_unload_resource(), wined3d_cs_emit_update_sub_resource(), wined3d_cs_exec_add_dirty_texture_region(), wined3d_cs_exec_blt_sub_resource(), wined3d_cs_exec_clear(), wined3d_cs_exec_clear_unordered_access_view(), wined3d_cs_exec_copy_uav_counter(), wined3d_cs_exec_dispatch(), wined3d_cs_exec_draw(), wined3d_cs_exec_flush(), wined3d_cs_exec_present(), wined3d_cs_exec_push_constants(), wined3d_cs_exec_query_issue(), wined3d_cs_exec_reset_state(), wined3d_cs_exec_set_blend_state(), wined3d_cs_exec_set_clip_plane(), wined3d_cs_exec_set_color_key(), wined3d_cs_exec_set_constant_buffer(), wined3d_cs_exec_set_depth_stencil_view(), wined3d_cs_exec_set_index_buffer(), wined3d_cs_exec_set_light(), wined3d_cs_exec_set_light_enable(), wined3d_cs_exec_set_material(), wined3d_cs_exec_set_predication(), wined3d_cs_exec_set_rasterizer_state(), wined3d_cs_exec_set_render_state(), wined3d_cs_exec_set_rendertarget_view(), wined3d_cs_exec_set_sampler(), wined3d_cs_exec_set_sampler_state(), wined3d_cs_exec_set_scissor_rect(), wined3d_cs_exec_set_shader(), wined3d_cs_exec_set_shader_resource_view(), wined3d_cs_exec_set_stream_output(), wined3d_cs_exec_set_stream_source(), wined3d_cs_exec_set_stream_source_freq(), wined3d_cs_exec_set_texture(), wined3d_cs_exec_set_texture_state(), wined3d_cs_exec_set_transform(), wined3d_cs_exec_set_unordered_access_view(), wined3d_cs_exec_set_vertex_declaration(), wined3d_cs_exec_set_viewport(), wined3d_cs_exec_update_sub_resource(), wined3d_cs_init_object(), wined3d_cs_map(), wined3d_cs_mt_finish(), wined3d_cs_mt_push_constants(), wined3d_cs_mt_require_space(), wined3d_cs_mt_submit(), wined3d_cs_push_constants(), wined3d_cs_queue_is_empty(), wined3d_cs_queue_require_space(), wined3d_cs_queue_submit(), wined3d_cs_run(), wined3d_cs_st_push_constants(), wined3d_cs_st_require_space(), wined3d_cs_st_submit(), wined3d_cs_unmap(), wined3d_cs_wait_event(), wined3d_from_cs(), wined3d_not_from_cs(), wined3d_resource_wait_idle(), winsizes_wnd_proc(), CardWindow::WndProc(), and WriteCabinetState().

◆ cs_reg

#define cs_reg   101

Definition at line 476 of file i386-dis.c.

◆ cx_reg

#define cx_reg   125

Definition at line 501 of file i386-dis.c.

◆ d_mode

#define d_mode   4 /* double word operand */

Definition at line 467 of file i386-dis.c.

◆ DFLAG

#define DFLAG   1

Definition at line 462 of file i386-dis.c.

◆ DH

#define DH   OP_IMREG, dh_reg

Definition at line 422 of file i386-dis.c.

◆ dh_reg

#define dh_reg   122

Definition at line 497 of file i386-dis.c.

◆ di_reg

#define di_reg   131

Definition at line 507 of file i386-dis.c.

◆ DL

#define DL   OP_IMREG, dl_reg

Definition at line 418 of file i386-dis.c.

◆ dl_reg

#define dl_reg   118

Definition at line 493 of file i386-dis.c.

◆ Dm

#define Dm   OP_D, m_mode

Definition at line 376 of file i386-dis.c.

◆ dq_mode

#define dq_mode   10 /* operand size depends on REX prefixes. */

Definition at line 473 of file i386-dis.c.

◆ ds

#define ds   OP_REG, ds_reg

Definition at line 443 of file i386-dis.c.

◆ ds_reg

#define ds_reg   103

Definition at line 478 of file i386-dis.c.

◆ DSBX

#define DSBX   OP_DSreg, eBX_reg

Definition at line 438 of file i386-dis.c.

◆ DX

#define DX   OP_IMREG, dx_reg

Definition at line 425 of file i386-dis.c.

◆ dx_reg

#define dx_reg   126

Definition at line 502 of file i386-dis.c.

◆ eAX

#define eAX   OP_IMREG, eAX_reg

Definition at line 407 of file i386-dis.c.

◆ eAX_reg

#define eAX_reg   108

Definition at line 482 of file i386-dis.c.

◆ Eb

#define Eb   OP_E, b_mode

Definition at line 351 of file i386-dis.c.

◆ eBP

#define eBP   OP_IMREG, eBP_reg

Definition at line 412 of file i386-dis.c.

◆ eBP_reg

#define eBP_reg   113

Definition at line 487 of file i386-dis.c.

◆ eBX

#define eBX   OP_IMREG, eBX_reg

Definition at line 408 of file i386-dis.c.

◆ eBX_reg

#define eBX_reg   111

Definition at line 485 of file i386-dis.c.

◆ eCX

#define eCX   OP_IMREG, eCX_reg

Definition at line 409 of file i386-dis.c.

◆ eCX_reg

#define eCX_reg   109

Definition at line 483 of file i386-dis.c.

◆ Ed

#define Ed   OP_E, d_mode

Definition at line 353 of file i386-dis.c.

◆ eDI

#define eDI   OP_IMREG, eDI_reg

Definition at line 414 of file i386-dis.c.

◆ eDI_reg

#define eDI_reg   115

Definition at line 489 of file i386-dis.c.

◆ Edq

#define Edq   OP_E, dq_mode

Definition at line 354 of file i386-dis.c.

◆ eDX

#define eDX   OP_IMREG, eDX_reg

Definition at line 410 of file i386-dis.c.

◆ eDX_reg

#define eDX_reg   110

Definition at line 484 of file i386-dis.c.

◆ EM

#define EM   OP_EM, v_mode

Definition at line 449 of file i386-dis.c.

◆ es

#define es   OP_REG, es_reg

Definition at line 440 of file i386-dis.c.

◆ es_reg

#define es_reg   100

Definition at line 475 of file i386-dis.c.

◆ eSI

#define eSI   OP_IMREG, eSI_reg

Definition at line 413 of file i386-dis.c.

◆ eSI_reg

#define eSI_reg   114

Definition at line 488 of file i386-dis.c.

◆ eSP

#define eSP   OP_IMREG, eSP_reg

Definition at line 411 of file i386-dis.c.

◆ eSP_reg

#define eSP_reg   112

Definition at line 486 of file i386-dis.c.

◆ Ev

#define Ev   OP_E, v_mode

Definition at line 352 of file i386-dis.c.

◆ Ew

#define Ew   OP_E, w_mode

Definition at line 357 of file i386-dis.c.

◆ EX

#define EX   OP_EX, v_mode

Definition at line 450 of file i386-dis.c.

◆ FETCH_DATA

#define FETCH_DATA (   info,
  addr 
)
Value:
((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \
? 1 : fetch_data ((info), (addr)))
GLenum const GLvoid * addr
Definition: glext.h:9621
static int fetch_data(struct disassemble_info *, bfd_byte *)
Definition: i386-dis.c:324

Definition at line 319 of file i386-dis.c.

◆ FGRPd9_2

#define FGRPd9_2   NULL, NULL, 0, NULL, 0, NULL, 0

Definition at line 2636 of file i386-dis.c.

◆ FGRPd9_4

#define FGRPd9_4   NULL, NULL, 1, NULL, 0, NULL, 0

Definition at line 2637 of file i386-dis.c.

◆ FGRPd9_5

#define FGRPd9_5   NULL, NULL, 2, NULL, 0, NULL, 0

Definition at line 2638 of file i386-dis.c.

◆ FGRPd9_6

#define FGRPd9_6   NULL, NULL, 3, NULL, 0, NULL, 0

Definition at line 2639 of file i386-dis.c.

◆ FGRPd9_7

#define FGRPd9_7   NULL, NULL, 4, NULL, 0, NULL, 0

Definition at line 2640 of file i386-dis.c.

◆ FGRPda_5

#define FGRPda_5   NULL, NULL, 5, NULL, 0, NULL, 0

Definition at line 2641 of file i386-dis.c.

◆ FGRPdb_4

#define FGRPdb_4   NULL, NULL, 6, NULL, 0, NULL, 0

Definition at line 2642 of file i386-dis.c.

◆ FGRPde_3

#define FGRPde_3   NULL, NULL, 7, NULL, 0, NULL, 0

Definition at line 2643 of file i386-dis.c.

◆ FGRPdf_4

#define FGRPdf_4   NULL, NULL, 8, NULL, 0, NULL, 0

Definition at line 2644 of file i386-dis.c.

◆ FLOAT

#define FLOAT   NULL, NULL, FLOATCODE, NULL, 0, NULL, 0

Definition at line 525 of file i386-dis.c.

◆ FLOATCODE

#define FLOATCODE   1

Definition at line 520 of file i386-dis.c.

◆ fs

Definition at line 444 of file i386-dis.c.

◆ fs_reg

#define fs_reg   104

Definition at line 479 of file i386-dis.c.

◆ FWAIT_OPCODE

#define FWAIT_OPCODE   (0x9b)

Definition at line 266 of file i386-dis.c.

◆ Gb

#define Gb   OP_G, b_mode

Definition at line 361 of file i386-dis.c.

◆ Gd

#define Gd   OP_G, d_mode

Definition at line 363 of file i386-dis.c.

◆ GRP10

#define GRP10   NULL, NULL, USE_GROUPS, NULL, 17, NULL, 0

Definition at line 544 of file i386-dis.c.

◆ GRP11

#define GRP11   NULL, NULL, USE_GROUPS, NULL, 18, NULL, 0

Definition at line 545 of file i386-dis.c.

◆ GRP12

#define GRP12   NULL, NULL, USE_GROUPS, NULL, 19, NULL, 0

Definition at line 546 of file i386-dis.c.

◆ GRP13

#define GRP13   NULL, NULL, USE_GROUPS, NULL, 20, NULL, 0

Definition at line 547 of file i386-dis.c.

◆ GRP14

#define GRP14   NULL, NULL, USE_GROUPS, NULL, 21, NULL, 0

Definition at line 548 of file i386-dis.c.

◆ GRP1b

#define GRP1b   NULL, NULL, USE_GROUPS, NULL, 0, NULL, 0

Definition at line 527 of file i386-dis.c.

◆ GRP1S

#define GRP1S   NULL, NULL, USE_GROUPS, NULL, 1, NULL, 0

Definition at line 528 of file i386-dis.c.

◆ GRP1Ss

#define GRP1Ss   NULL, NULL, USE_GROUPS, NULL, 2, NULL, 0

Definition at line 529 of file i386-dis.c.

◆ GRP2b

#define GRP2b   NULL, NULL, USE_GROUPS, NULL, 3, NULL, 0

Definition at line 530 of file i386-dis.c.

◆ GRP2b_cl

#define GRP2b_cl   NULL, NULL, USE_GROUPS, NULL, 7, NULL, 0

Definition at line 534 of file i386-dis.c.

◆ GRP2b_one

#define GRP2b_one   NULL, NULL, USE_GROUPS, NULL, 5, NULL, 0

Definition at line 532 of file i386-dis.c.

◆ GRP2S

#define GRP2S   NULL, NULL, USE_GROUPS, NULL, 4, NULL, 0

Definition at line 531 of file i386-dis.c.

◆ GRP2S_cl

#define GRP2S_cl   NULL, NULL, USE_GROUPS, NULL, 8, NULL, 0

Definition at line 535 of file i386-dis.c.

◆ GRP2S_one

#define GRP2S_one   NULL, NULL, USE_GROUPS, NULL, 6, NULL, 0

Definition at line 533 of file i386-dis.c.

◆ GRP3b

#define GRP3b   NULL, NULL, USE_GROUPS, NULL, 9, NULL, 0

Definition at line 536 of file i386-dis.c.

◆ GRP3S

#define GRP3S   NULL, NULL, USE_GROUPS, NULL, 10, NULL, 0

Definition at line 537 of file i386-dis.c.

◆ GRP4

#define GRP4   NULL, NULL, USE_GROUPS, NULL, 11, NULL, 0

Definition at line 538 of file i386-dis.c.

◆ GRP5

#define GRP5   NULL, NULL, USE_GROUPS, NULL, 12, NULL, 0

Definition at line 539 of file i386-dis.c.

◆ GRP6

#define GRP6   NULL, NULL, USE_GROUPS, NULL, 13, NULL, 0

Definition at line 540 of file i386-dis.c.

◆ GRP7

#define GRP7   NULL, NULL, USE_GROUPS, NULL, 14, NULL, 0

Definition at line 541 of file i386-dis.c.

◆ GRP8

#define GRP8   NULL, NULL, USE_GROUPS, NULL, 15, NULL, 0

Definition at line 542 of file i386-dis.c.

◆ GRP9

#define GRP9   NULL, NULL, USE_GROUPS, NULL, 16, NULL, 0

Definition at line 543 of file i386-dis.c.

◆ GRPAMD

#define GRPAMD   NULL, NULL, USE_GROUPS, NULL, 22, NULL, 0

Definition at line 549 of file i386-dis.c.

◆ GRPPADLCK

#define GRPPADLCK   NULL, NULL, USE_GROUPS, NULL, 23, NULL, 0

Definition at line 550 of file i386-dis.c.

◆ gs

#define gs   OP_REG, gs_reg

Definition at line 445 of file i386-dis.c.

◆ gs_reg

#define gs_reg   105

Definition at line 480 of file i386-dis.c.

◆ Gv

#define Gv   OP_G, v_mode

Definition at line 362 of file i386-dis.c.

◆ Gw

#define Gw   OP_G, w_mode

Definition at line 364 of file i386-dis.c.

◆ Ib

#define Ib   OP_I, b_mode

Definition at line 367 of file i386-dis.c.

◆ indir_dx_reg

#define indir_dx_reg   150

Definition at line 518 of file i386-dis.c.

◆ indirDX

#define indirDX   OP_IMREG, indir_dx_reg

Definition at line 426 of file i386-dis.c.

◆ indirEb

#define indirEb   OP_indirE, b_mode

Definition at line 355 of file i386-dis.c.

◆ indirEv

#define indirEv   OP_indirE, v_mode

Definition at line 356 of file i386-dis.c.

◆ INTERNAL_DISASSEMBLER_ERROR

#define INTERNAL_DISASSEMBLER_ERROR   _("<internal disassembler error>")

Definition at line 1866 of file i386-dis.c.

◆ Iq

#define Iq   OP_I, q_mode

Definition at line 370 of file i386-dis.c.

◆ Iv

#define Iv   OP_I, v_mode

Definition at line 369 of file i386-dis.c.

◆ Iv64

#define Iv64   OP_I64, v_mode

Definition at line 371 of file i386-dis.c.

◆ Iw

#define Iw   OP_I, w_mode

Definition at line 372 of file i386-dis.c.

◆ Jb

#define Jb   OP_J, b_mode

Definition at line 373 of file i386-dis.c.

◆ Jv

#define Jv   OP_J, v_mode

Definition at line 374 of file i386-dis.c.

◆ loop_jcxz_flag

#define loop_jcxz_flag   NULL, loop_jcxz_mode

Definition at line 457 of file i386-dis.c.

◆ loop_jcxz_mode

#define loop_jcxz_mode   9

Definition at line 472 of file i386-dis.c.

◆ M

#define M   OP_M, 0 /* lea, lgdt, etc. */

Definition at line 359 of file i386-dis.c.

◆ m_mode

#define m_mode   7 /* d_mode in 32bit, q_mode in 64bit mode. */

Definition at line 470 of file i386-dis.c.

◆ Ma

#define Ma   OP_E, v_mode

Definition at line 358 of file i386-dis.c.

◆ MAXLEN

#define MAXLEN   20

Definition at line 192 of file i386-dis.c.

◆ MODRM_CHECK

#define MODRM_CHECK   if (!need_modrm) abort ()

Definition at line 1296 of file i386-dis.c.

◆ Mp

#define Mp   OP_M, 0 /* 32 or 48 bit memory operand for LDS, LES etc */

Definition at line 360 of file i386-dis.c.

◆ MS

#define MS   OP_MS, v_mode

Definition at line 451 of file i386-dis.c.

◆ MX

#define MX   OP_MMX, 0

Definition at line 447 of file i386-dis.c.

◆ Ob

#define Ob   OP_OFF, b_mode

Definition at line 430 of file i386-dis.c.

◆ Ob64

#define Ob64   OP_OFF64, b_mode

Definition at line 431 of file i386-dis.c.

◆ OPSIMD

#define OPSIMD   OP_SIMD_Suffix, 0

Definition at line 454 of file i386-dis.c.

◆ OPSUF

#define OPSUF   OP_3DNowSuffix, 0

Definition at line 453 of file i386-dis.c.

◆ Ov

#define Ov   OP_OFF, v_mode

Definition at line 432 of file i386-dis.c.

◆ Ov64

#define Ov64   OP_OFF64, v_mode

Definition at line 433 of file i386-dis.c.

◆ PARAMS

#define PARAMS (   X)    X

Definition at line 14 of file i386-dis.c.

◆ PREFIX_ADDR

#define PREFIX_ADDR   0x400

Definition at line 313 of file i386-dis.c.

◆ PREFIX_CS

#define PREFIX_CS   8

Definition at line 306 of file i386-dis.c.

◆ PREFIX_DATA

#define PREFIX_DATA   0x200

Definition at line 312 of file i386-dis.c.

◆ PREFIX_DS

#define PREFIX_DS   0x20

Definition at line 308 of file i386-dis.c.

◆ PREFIX_ES

#define PREFIX_ES   0x40

Definition at line 309 of file i386-dis.c.

◆ PREFIX_FS

#define PREFIX_FS   0x80

Definition at line 310 of file i386-dis.c.

◆ PREFIX_FWAIT

#define PREFIX_FWAIT   0x800

Definition at line 314 of file i386-dis.c.

◆ PREFIX_GS

#define PREFIX_GS   0x100

Definition at line 311 of file i386-dis.c.

◆ PREFIX_LOCK

#define PREFIX_LOCK   4

Definition at line 305 of file i386-dis.c.

◆ PREFIX_REPNZ

#define PREFIX_REPNZ   2

Definition at line 304 of file i386-dis.c.

◆ PREFIX_REPZ

#define PREFIX_REPZ   1

Definition at line 303 of file i386-dis.c.

◆ PREFIX_SS

#define PREFIX_SS   0x10

Definition at line 307 of file i386-dis.c.

◆ PREGRP0

#define PREGRP0   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 0, NULL, 0

Definition at line 552 of file i386-dis.c.

◆ PREGRP1

#define PREGRP1   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 1, NULL, 0

Definition at line 553 of file i386-dis.c.

◆ PREGRP10

#define PREGRP10   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 10, NULL, 0

Definition at line 562 of file i386-dis.c.

◆ PREGRP11

#define PREGRP11   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 11, NULL, 0

Definition at line 563 of file i386-dis.c.

◆ PREGRP12

#define PREGRP12   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 12, NULL, 0

Definition at line 564 of file i386-dis.c.

◆ PREGRP13

#define PREGRP13   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 13, NULL, 0

Definition at line 565 of file i386-dis.c.

◆ PREGRP14

#define PREGRP14   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 14, NULL, 0

Definition at line 566 of file i386-dis.c.

◆ PREGRP15

#define PREGRP15   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 15, NULL, 0

Definition at line 567 of file i386-dis.c.

◆ PREGRP16

#define PREGRP16   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 16, NULL, 0

Definition at line 568 of file i386-dis.c.

◆ PREGRP17

#define PREGRP17   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 17, NULL, 0

Definition at line 569 of file i386-dis.c.

◆ PREGRP18

#define PREGRP18   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 18, NULL, 0

Definition at line 570 of file i386-dis.c.

◆ PREGRP19

#define PREGRP19   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 19, NULL, 0

Definition at line 571 of file i386-dis.c.

◆ PREGRP2

#define PREGRP2   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 2, NULL, 0

Definition at line 554 of file i386-dis.c.

◆ PREGRP20

#define PREGRP20   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 20, NULL, 0

Definition at line 572 of file i386-dis.c.

◆ PREGRP21

#define PREGRP21   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 21, NULL, 0

Definition at line 573 of file i386-dis.c.

◆ PREGRP22

#define PREGRP22   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 22, NULL, 0

Definition at line 574 of file i386-dis.c.

◆ PREGRP23

#define PREGRP23   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 23, NULL, 0

Definition at line 575 of file i386-dis.c.

◆ PREGRP24

#define PREGRP24   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 24, NULL, 0

Definition at line 576 of file i386-dis.c.

◆ PREGRP25

#define PREGRP25   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 25, NULL, 0

Definition at line 577 of file i386-dis.c.

◆ PREGRP26

#define PREGRP26   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 26, NULL, 0

Definition at line 578 of file i386-dis.c.

◆ PREGRP27

#define PREGRP27   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 27, NULL, 0

Definition at line 579 of file i386-dis.c.

◆ PREGRP28

#define PREGRP28   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 28, NULL, 0

Definition at line 580 of file i386-dis.c.

◆ PREGRP29

#define PREGRP29   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 29, NULL, 0

Definition at line 581 of file i386-dis.c.

◆ PREGRP3

#define PREGRP3   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 3, NULL, 0

Definition at line 555 of file i386-dis.c.

◆ PREGRP30

#define PREGRP30   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 30, NULL, 0

Definition at line 582 of file i386-dis.c.

◆ PREGRP31

#define PREGRP31   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 31, NULL, 0

Definition at line 583 of file i386-dis.c.

◆ PREGRP32

#define PREGRP32   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 32, NULL, 0

Definition at line 584 of file i386-dis.c.

◆ PREGRP4

#define PREGRP4   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 4, NULL, 0

Definition at line 556 of file i386-dis.c.

◆ PREGRP5

#define PREGRP5   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 5, NULL, 0

Definition at line 557 of file i386-dis.c.

◆ PREGRP6

#define PREGRP6   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 6, NULL, 0

Definition at line 558 of file i386-dis.c.

◆ PREGRP7

#define PREGRP7   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 7, NULL, 0

Definition at line 559 of file i386-dis.c.

◆ PREGRP8

#define PREGRP8   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 8, NULL, 0

Definition at line 560 of file i386-dis.c.

◆ PREGRP9

#define PREGRP9   NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 9, NULL, 0

Definition at line 561 of file i386-dis.c.

◆ PTR

#define PTR   void*

Definition at line 15 of file i386-dis.c.

◆ q_mode

#define q_mode   5 /* quad word operand */

Definition at line 468 of file i386-dis.c.

◆ rAX_reg

#define rAX_reg   132

Definition at line 509 of file i386-dis.c.

◆ rBP_reg

#define rBP_reg   137

Definition at line 514 of file i386-dis.c.

◆ rBX_reg

#define rBX_reg   135

Definition at line 512 of file i386-dis.c.

◆ rCX_reg

#define rCX_reg   133

Definition at line 510 of file i386-dis.c.

◆ Rd

#define Rd   OP_Rd, d_mode

Definition at line 365 of file i386-dis.c.

◆ rDI_reg

#define rDI_reg   139

Definition at line 516 of file i386-dis.c.

◆ rDX_reg

#define rDX_reg   134

Definition at line 511 of file i386-dis.c.

◆ REX_EXTX

#define REX_EXTX   4

Definition at line 283 of file i386-dis.c.

◆ REX_EXTY

#define REX_EXTY   2

Definition at line 284 of file i386-dis.c.

◆ REX_EXTZ

#define REX_EXTZ   1

Definition at line 285 of file i386-dis.c.

◆ REX_MODE64

#define REX_MODE64   8

Definition at line 282 of file i386-dis.c.

◆ Rm

#define Rm   OP_Rd, m_mode

Definition at line 366 of file i386-dis.c.

◆ RMAH

#define RMAH   OP_REG, ah_reg

Definition at line 400 of file i386-dis.c.

◆ RMAL [1/2]

#define RMAL   OP_REG, al_reg

Definition at line 396 of file i386-dis.c.

◆ RMAL [2/2]

#define RMAL   OP_REG, al_reg

Definition at line 396 of file i386-dis.c.

◆ RMAX

#define RMAX   OP_REG, ax_reg

Definition at line 404 of file i386-dis.c.

◆ RMBH

#define RMBH   OP_REG, bh_reg

Definition at line 403 of file i386-dis.c.

◆ RMBL

#define RMBL   OP_REG, bl_reg

Definition at line 399 of file i386-dis.c.

◆ RMCH

#define RMCH   OP_REG, ch_reg

Definition at line 401 of file i386-dis.c.

◆ RMCL

#define RMCL   OP_REG, cl_reg

Definition at line 397 of file i386-dis.c.

◆ RMDH

#define RMDH   OP_REG, dh_reg

Definition at line 402 of file i386-dis.c.

◆ RMDL

#define RMDL   OP_REG, dl_reg

Definition at line 398 of file i386-dis.c.

◆ RMDX

#define RMDX   OP_REG, dx_reg

Definition at line 405 of file i386-dis.c.

◆ RMeAX

#define RMeAX   OP_REG, eAX_reg

Definition at line 379 of file i386-dis.c.

◆ RMeBP

#define RMeBP   OP_REG, eBP_reg

Definition at line 384 of file i386-dis.c.

◆ RMeBX

#define RMeBX   OP_REG, eBX_reg

Definition at line 380 of file i386-dis.c.

◆ RMeCX

#define RMeCX   OP_REG, eCX_reg

Definition at line 381 of file i386-dis.c.

◆ RMeDI

#define RMeDI   OP_REG, eDI_reg

Definition at line 386 of file i386-dis.c.

◆ RMeDX

#define RMeDX   OP_REG, eDX_reg

Definition at line 382 of file i386-dis.c.

◆ RMeSI

#define RMeSI   OP_REG, eSI_reg

Definition at line 385 of file i386-dis.c.

◆ RMeSP

#define RMeSP   OP_REG, eSP_reg

Definition at line 383 of file i386-dis.c.

◆ RMrAX

#define RMrAX   OP_REG, rAX_reg

Definition at line 387 of file i386-dis.c.

◆ RMrBP

#define RMrBP   OP_REG, rBP_reg

Definition at line 392 of file i386-dis.c.

◆ RMrBX

#define RMrBX   OP_REG, rBX_reg

Definition at line 388 of file i386-dis.c.

◆ RMrCX

#define RMrCX   OP_REG, rCX_reg

Definition at line 389 of file i386-dis.c.

◆ RMrDI

#define RMrDI   OP_REG, rDI_reg

Definition at line 394 of file i386-dis.c.

◆ RMrDX

#define RMrDX   OP_REG, rDX_reg

Definition at line 390 of file i386-dis.c.

◆ RMrSI

#define RMrSI   OP_REG, rSI_reg

Definition at line 393 of file i386-dis.c.

◆ RMrSP

#define RMrSP   OP_REG, rSP_reg

Definition at line 391 of file i386-dis.c.

◆ rSI_reg

#define rSI_reg   138

Definition at line 515 of file i386-dis.c.

◆ rSP_reg

#define rSP_reg   136

Definition at line 513 of file i386-dis.c.

◆ si_reg

#define si_reg   130

Definition at line 506 of file i386-dis.c.

◆ sIb

#define sIb   OP_sI, b_mode /* sign extened byte */

Definition at line 368 of file i386-dis.c.

◆ sp_reg

#define sp_reg   128

Definition at line 504 of file i386-dis.c.

◆ sprintf_vma

#define sprintf_vma (   BUF,
  VMA 
)    sprintf(BUF, "0x%IX", VMA)

Definition at line 38 of file i386-dis.c.

◆ ss

#define ss   OP_REG, ss_reg

Definition at line 441 of file i386-dis.c.

◆ ss_reg

#define ss_reg   102

Definition at line 477 of file i386-dis.c.

◆ ST

#define ST   OP_ST, 0

Definition at line 2633 of file i386-dis.c.

◆ STi

#define STi   OP_STi, 0

Definition at line 2634 of file i386-dis.c.

◆ SUFFIX_ALWAYS

#define SUFFIX_ALWAYS   4

Definition at line 460 of file i386-dis.c.

◆ Sw

#define Sw   OP_SEG, w_mode

Definition at line 428 of file i386-dis.c.

◆ Td

#define Td   OP_T, d_mode

Definition at line 377 of file i386-dis.c.

◆ UNIXWARE_COMPAT

#define UNIXWARE_COMPAT   1

Definition at line 199 of file i386-dis.c.

◆ USE_GROUPS

#define USE_GROUPS   2

Definition at line 521 of file i386-dis.c.

◆ USE_PREFIX_USER_TABLE

#define USE_PREFIX_USER_TABLE   3

Definition at line 522 of file i386-dis.c.

◆ USED_REX

#define USED_REX (   value)
Value:
{ \
if (value) \
rex_used |= (rex & value) ? (value) | 0x40 : 0; \
else \
rex_used |= 0x40; \
}
static int rex
Definition: i386-dis.c:279
static int rex_used
Definition: i386-dis.c:281
Definition: pdh_main.c:94

Definition at line 290 of file i386-dis.c.

◆ v_mode

#define v_mode   2 /* operand size depends on prefixes */

Definition at line 465 of file i386-dis.c.

◆ w_mode

#define w_mode   3 /* word operand */

Definition at line 466 of file i386-dis.c.

◆ X86_64_0

#define X86_64_0   NULL, NULL, X86_64_SPECIAL, NULL, 0, NULL, 0

Definition at line 586 of file i386-dis.c.

◆ X86_64_SPECIAL

#define X86_64_SPECIAL   4

Definition at line 523 of file i386-dis.c.

◆ x_mode

#define x_mode   6 /* 80 bit float operand */

Definition at line 469 of file i386-dis.c.

◆ Xb

#define Xb   OP_DSreg, eSI_reg

Definition at line 434 of file i386-dis.c.

◆ XM

#define XM   OP_XMM, 0

Definition at line 448 of file i386-dis.c.

◆ XS

#define XS   OP_XS, v_mode

Definition at line 452 of file i386-dis.c.

◆ Xv

#define Xv   OP_DSreg, eSI_reg

Definition at line 435 of file i386-dis.c.

◆ XX

#define XX   NULL, 0

Definition at line 349 of file i386-dis.c.

◆ Yb

#define Yb   OP_ESreg, eDI_reg

Definition at line 436 of file i386-dis.c.

◆ Yv

#define Yv   OP_ESreg, eDI_reg

Definition at line 437 of file i386-dis.c.

Typedef Documentation

◆ bfd

typedef void* bfd

Definition at line 27 of file i386-dis.c.

◆ bfd_arch

◆ bfd_byte

Definition at line 25 of file i386-dis.c.

◆ bfd_flavour

◆ bfd_signed_vma

Definition at line 28 of file i386-dis.c.

◆ bfd_vma

typedef uintptr_t bfd_vma

Definition at line 24 of file i386-dis.c.

◆ op_rtn

typedef void(* op_rtn) (int bytemode, int sizeflag)

Definition at line 588 of file i386-dis.c.

Enumeration Type Documentation

◆ bfd_architecture

Enumerator
bfd_arch_i386 

Definition at line 20 of file i386-dis.c.

21{
23} bfd_arch;
@ bfd_arch_i386
Definition: i386-dis.c:22
enum bfd_architecture bfd_arch

◆ bfd_endian

Enumerator
BFD_ENDIAN_BIG 
BIG_ENDIAN_LITTLE 
BFD_ENDIAN_UNKNOWN 

Definition at line 26 of file i386-dis.c.

@ BFD_ENDIAN_BIG
Definition: i386-dis.c:26
@ BIG_ENDIAN_LITTLE
Definition: i386-dis.c:26
@ BFD_ENDIAN_UNKNOWN
Definition: i386-dis.c:26

◆ bfd_flavour

Enumerator
bfd_target_unknown_flavour 

Definition at line 16 of file i386-dis.c.

17{
bfd_flavour
Definition: i386-dis.c:17
@ bfd_target_unknown_flavour
Definition: i386-dis.c:18

Function Documentation

◆ append_seg()

static void append_seg ( void  )
static

Definition at line 3137 of file i386-dis.c.

3138{
3139 if (prefixes & PREFIX_CS)
3140 {
3142 oappend (&"%cs:"[intel_syntax]);
3143 }
3144 if (prefixes & PREFIX_DS)
3145 {
3147 oappend (&"%ds:"[intel_syntax]);
3148 }
3149 if (prefixes & PREFIX_SS)
3150 {
3152 oappend (&"%ss:"[intel_syntax]);
3153 }
3154 if (prefixes & PREFIX_ES)
3155 {
3157 oappend (&"%es:"[intel_syntax]);
3158 }
3159 if (prefixes & PREFIX_FS)
3160 {
3162 oappend (&"%fs:"[intel_syntax]);
3163 }
3164 if (prefixes & PREFIX_GS)
3165 {
3167 oappend (&"%gs:"[intel_syntax]);
3168 }
3169}
#define PREFIX_GS
Definition: i386-dis.c:311
#define PREFIX_DS
Definition: i386-dis.c:308
static int used_prefixes
Definition: i386-dis.c:300
static void oappend(const char *)
Definition: i386-dis.c:3130
#define PREFIX_ES
Definition: i386-dis.c:309
#define PREFIX_CS
Definition: i386-dis.c:306
#define PREFIX_FS
Definition: i386-dis.c:310
#define PREFIX_SS
Definition: i386-dis.c:307
static int prefixes
Definition: i386-dis.c:276
static char intel_syntax
Definition: i386-dis.c:2052

Referenced by OP_DSreg(), OP_E(), OP_OFF(), and OP_OFF64().

◆ BadOp()

static void BadOp ( void  )
static

Definition at line 4448 of file i386-dis.c.

4449{
4450 /* Throw away prefixes and 1st. opcode byte. */
4451 codep = insn_codep + 1;
4452 oappend ("(bad)");
4453}
static unsigned char * codep
Definition: i386-dis.c:1286
static unsigned char * insn_codep
Definition: i386-dis.c:1285

Referenced by OP_0f07(), OP_0fae(), OP_3DNowSuffix(), OP_M(), OP_MS(), OP_Rd(), OP_SIMD_Suffix(), and OP_XS().

◆ ckprefix()

static void ckprefix ( void  )
static

Definition at line 1869 of file i386-dis.c.

1870{
1871 int newrex;
1872 rex = 0;
1873 prefixes = 0;
1874 used_prefixes = 0;
1875 rex_used = 0;
1876 while (1)
1877 {
1878 FETCH_DATA (the_info, codep + 1);
1879 newrex = 0;
1880 switch (*codep)
1881 {
1882 /* REX prefixes family. */
1883 case 0x40:
1884 case 0x41:
1885 case 0x42:
1886 case 0x43:
1887 case 0x44:
1888 case 0x45:
1889 case 0x46:
1890 case 0x47:
1891 case 0x48:
1892 case 0x49:
1893 case 0x4a:
1894 case 0x4b:
1895 case 0x4c:
1896 case 0x4d:
1897 case 0x4e:
1898 case 0x4f:
1899 if (mode_64bit)
1900 newrex = *codep;
1901 else
1902 return;
1903 break;
1904 case 0xf3:
1906 break;
1907 case 0xf2:
1909 break;
1910 case 0xf0:
1912 break;
1913 case 0x2e:
1915 break;
1916 case 0x36:
1918 break;
1919 case 0x3e:
1921 break;
1922 case 0x26:
1924 break;
1925 case 0x64:
1927 break;
1928 case 0x65:
1930 break;
1931 case 0x66:
1933 break;
1934 case 0x67:
1936 break;
1937 case FWAIT_OPCODE:
1938 /* fwait is really an instruction. If there are prefixes
1939 before the fwait, they belong to the fwait, *not* to the
1940 following instruction. */
1941 if (prefixes)
1942 {
1944 codep++;
1945 return;
1946 }
1948 break;
1949 default:
1950 return;
1951 }
1952 /* Rex is ignored when followed by another prefix. */
1953 if (rex)
1954 {
1955 oappend (prefix_name (rex, 0));
1956 oappend (" ");
1957 }
1958 rex = newrex;
1959 codep++;
1960 }
1961}
static int mode_64bit
Definition: i386-dis.c:272
#define PREFIX_DATA
Definition: i386-dis.c:312
static disassemble_info * the_info
Definition: i386-dis.c:1287
#define PREFIX_ADDR
Definition: i386-dis.c:313
#define FWAIT_OPCODE
Definition: i386-dis.c:266
#define PREFIX_LOCK
Definition: i386-dis.c:305
#define PREFIX_REPZ
Definition: i386-dis.c:303
#define PREFIX_FWAIT
Definition: i386-dis.c:314
#define PREFIX_REPNZ
Definition: i386-dis.c:304
static const char * prefix_name(int, int)
Definition: i386-dis.c:1967
#define FETCH_DATA(info, addr)
Definition: i386-dis.c:319

Referenced by print_insn().

◆ dofloat()

static void dofloat ( int  sizeflag)
static

Definition at line 2800 of file i386-dis.c.

2801{
2802 const struct dis386 *dp;
2803 unsigned char floatop;
2804
2805 floatop = codep[-1];
2806
2807 if (mod != 3)
2808 {
2809 int fp_indx = (floatop - 0xd8) * 8 + reg;
2810
2811 putop (float_mem[fp_indx], sizeflag);
2812 obufp = op1out;
2813 OP_E (float_mem_mode[fp_indx], sizeflag);
2814 return;
2815 }
2816 /* Skip mod/rm byte. */
2818 codep++;
2819
2820 dp = &float_reg[floatop - 0xd8][reg];
2821 if (dp->name == NULL)
2822 {
2823 putop (fgrps[dp->bytemode1][rm], sizeflag);
2824
2825 /* Instruction fnstsw is only one with strange arg. */
2826 if (floatop == 0xdf && codep[-1] == 0xe0)
2827 strcpy (op1out, names16[0]);
2828 }
2829 else
2830 {
2831 putop (dp->name, sizeflag);
2832
2833 obufp = op1out;
2834 if (dp->op1)
2835 (*dp->op1) (dp->bytemode1, sizeflag);
2836 obufp = op2out;
2837 if (dp->op2)
2838 (*dp->op2) (dp->bytemode2, sizeflag);
2839 }
2840}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define NULL
Definition: types.h:112
static int rm
Definition: i386-dis.c:1289
static int putop(const char *, int)
Definition: i386-dis.c:2857
static const char * float_mem[]
Definition: i386-dis.c:2483
static const char ** names16
Definition: i386-dis.c:1300
static const unsigned char float_mem_mode[]
Definition: i386-dis.c:2558
#define MODRM_CHECK
Definition: i386-dis.c:1296
static char * fgrps[][8]
Definition: i386-dis.c:2751
static const struct dis386 float_reg[][8]
Definition: i386-dis.c:2646
static char op2out[100]
Definition: i386-dis.c:2036
static int mod
Definition: i386-dis.c:1288
static int reg
Definition: i386-dis.c:1290
static void OP_E(int, int)
Definition: i386-dis.c:3237
static char * obufp
Definition: i386-dis.c:1282
static char op1out[100]
Definition: i386-dis.c:2036
op_rtn op1
Definition: i386-dis.c:592
int bytemode2
Definition: i386-dis.c:595
const char * name
Definition: i386-dis.c:591
op_rtn op2
Definition: i386-dis.c:594
int bytemode1
Definition: i386-dis.c:593

Referenced by print_insn().

◆ fetch_data()

static int fetch_data ( struct disassemble_info info,
bfd_byte addr 
)
static

Definition at line 324 of file i386-dis.c.

325{
326 int status;
327 struct dis_private *priv = (struct dis_private *) info->private_data;
328 bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
329
330 status = (*info->read_memory_func) (start,
331 priv->max_fetched,
332 addr - priv->max_fetched,
333 info);
334 if (status != 0)
335 {
336 /* If we did manage to read at least one byte, then
337 print_insn_i386 will do something sensible. Otherwise, print
338 an error. We do that here because this is where we know
339 STATUS. */
340 if (priv->max_fetched == priv->the_buffer)
341 (*info->memory_error_func) (status, start, info);
342 longjmp (priv->bailout, 1);
343 }
344 else
345 priv->max_fetched = addr;
346 return 1;
347}
GLuint start
Definition: gl.h:1545
uintptr_t bfd_vma
Definition: i386-dis.c:24
bfd_byte the_buffer[MAXLEN]
Definition: i386-dis.c:258
jmp_buf bailout
Definition: i386-dis.c:261
bfd_vma insn_start
Definition: i386-dis.c:259
bfd_byte * max_fetched
Definition: i386-dis.c:257
Definition: ps.c:97

◆ get16()

static int get16 ( void  )
static

Definition at line 3613 of file i386-dis.c.

3614{
3615 int x = 0;
3616
3617 FETCH_DATA (the_info, codep + 2);
3618 x = *codep++ & 0xff;
3619 x |= (*codep++ & 0xff) << 8;
3620 return x;
3621}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

Referenced by OP_DIR(), OP_E(), OP_I(), OP_I64(), OP_J(), OP_OFF(), and OP_sI().

◆ get32()

static bfd_signed_vma get32 ( void  )
static

Definition at line 3584 of file i386-dis.c.

3585{
3586 bfd_signed_vma x = 0;
3587
3588 FETCH_DATA (the_info, codep + 4);
3589 x = *codep++ & (bfd_signed_vma) 0xff;
3590 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
3591 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
3592 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
3593 return x;
3594}
intptr_t bfd_signed_vma
Definition: i386-dis.c:28

Referenced by OP_DIR(), OP_I(), OP_I64(), and OP_OFF().

◆ get32s()

static bfd_signed_vma get32s ( void  )
static

Definition at line 3597 of file i386-dis.c.

3598{
3599 bfd_signed_vma x = 0;
3600
3601 FETCH_DATA (the_info, codep + 4);
3602 x = *codep++ & (bfd_signed_vma) 0xff;
3603 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
3604 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
3605 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
3606
3607 x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);
3608
3609 return x;
3610}

Referenced by OP_E(), OP_I(), OP_J(), and OP_sI().

◆ get64()

static bfd_vma get64 ( void  )
static

Definition at line 3559 of file i386-dis.c.

3560{
3561 bfd_vma x;
3562#ifdef BFD64
3563 unsigned int a;
3564 unsigned int b;
3565
3566 FETCH_DATA (the_info, codep + 8);
3567 a = *codep++ & 0xff;
3568 a |= (*codep++ & 0xff) << 8;
3569 a |= (*codep++ & 0xff) << 16;
3570 a |= (*codep++ & 0xff) << 24;
3571 b = *codep++ & 0xff;
3572 b |= (*codep++ & 0xff) << 8;
3573 b |= (*codep++ & 0xff) << 16;
3574 b |= (*codep++ & 0xff) << 24;
3575 x = a + ((bfd_vma) b << 32);
3576#else
3577 abort ();
3578 x = 0;
3579#endif
3580 return x;
3581}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define abort()
Definition: i386-dis.c:34
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79

Referenced by OP_I64(), and OP_OFF64().

◆ INVLPG_Fixup()

static void INVLPG_Fixup ( int  bytemode,
int  sizeflag 
)
static

Definition at line 4433 of file i386-dis.c.

4434{
4435 if (*codep == 0xf8)
4436 {
4437 char *p = obuf + strlen (obuf);
4438
4439 /* Override "invlpg". */
4440 strcpy (p - 6, "swapgs");
4441 codep++;
4442 }
4443 else
4444 OP_E (bytemode, sizeflag);
4445}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLfloat GLfloat p
Definition: glext.h:8902
static char obuf[100]
Definition: i386-dis.c:1281

◆ KdbpDisassemble()

LONG KdbpDisassemble ( IN ULONG_PTR  Address,
IN ULONG  IntelSyntax 
)

Definition at line 124 of file i386-dis.c.

125{
127
128 info.fprintf_func = KdbpPrintDisasm;
129 info.stream = NULL;
130 info.application_data = NULL;
132 info.arch = bfd_arch_i386;
134 info.insn_sets = 0;
135 info.flags = 0;
136 info.read_memory_func = KdbpReadMemory;
137 info.memory_error_func = KdbpMemoryError;
138 info.print_address_func = KdbpPrintAddressInCode;
139 info.symbol_at_address_func = NULL;
140 info.buffer = NULL;
141 info.buffer_vma = info.buffer_length = 0;
142 info.bytes_per_chunk = 0;
143 info.display_endian = BIG_ENDIAN_LITTLE;
144 info.disassembler_options = NULL;
145
146 return(print_insn_i386(Address, &info));
147}
static void KdbpPrintAddressInCode(uintptr_t Addr, struct disassemble_info *Ignored)
Definition: i386-dis.c:78
int print_insn_i386(bfd_vma pc, struct disassemble_info *info)
Definition: i386-dis.c:2078
int KdbpPrintDisasm(void *Ignored, const char *fmt,...)
Definition: i386-dis.c:45
#define bfd_mach_i386_i386
Definition: i386-dis.c:32
static void KdbpMemoryError(int Status, uintptr_t Addr, struct disassemble_info *Ignored)
Definition: i386-dis.c:72
static int KdbpReadMemory(uintptr_t Addr, unsigned char *Data, unsigned int Length, struct disassemble_info *Ignored)
Definition: i386-dis.c:65
#define bfd_mach_i386_i386_intel_syntax
Definition: i386-dis.c:31
static WCHAR Address[46]
Definition: ping.c:68

Referenced by KdbpCliMainLoop(), and KdbpCmdDisassembleX().

◆ KdbpGetInstLength()

LONG KdbpGetInstLength ( IN ULONG_PTR  Address)

Definition at line 94 of file i386-dis.c.

95{
97
98 info.fprintf_func = KdbpNopPrintDisasm;
99 info.stream = NULL;
100 info.application_data = NULL;
102 info.arch = bfd_arch_i386;
103#ifdef _M_AMD64
104 info.mach = bfd_mach_x86_64;
105#else
107#endif
108 info.insn_sets = 0;
109 info.flags = 0;
110 info.read_memory_func = KdbpReadMemory;
111 info.memory_error_func = KdbpMemoryError;
112 info.print_address_func = KdbpNopPrintAddress;
113 info.symbol_at_address_func = NULL;
114 info.buffer = NULL;
115 info.buffer_vma = info.buffer_length = 0;
116 info.bytes_per_chunk = 0;
117 info.display_endian = BIG_ENDIAN_LITTLE;
118 info.disassembler_options = NULL;
119
120 return(print_insn_i386(Address, &info));
121}
#define bfd_mach_x86_64
Definition: i386-dis.c:30
static void KdbpNopPrintAddress(uintptr_t Addr, struct disassemble_info *Ignored)
Definition: i386-dis.c:87
int KdbpNopPrintDisasm(void *Ignored, const char *fmt,...)
Definition: i386-dis.c:59

Referenced by KdbpStepOverInstruction().

◆ KdbpMemoryError()

static void KdbpMemoryError ( int  Status,
uintptr_t  Addr,
struct disassemble_info Ignored 
)
static

Definition at line 72 of file i386-dis.c.

74{
75}

Referenced by KdbpDisassemble(), and KdbpGetInstLength().

◆ KdbpNopPrintAddress()

static void KdbpNopPrintAddress ( uintptr_t  Addr,
struct disassemble_info Ignored 
)
static

Definition at line 87 of file i386-dis.c.

88{
89}

Referenced by KdbpGetInstLength().

◆ KdbpNopPrintDisasm()

int KdbpNopPrintDisasm ( void Ignored,
const char fmt,
  ... 
)

Definition at line 59 of file i386-dis.c.

60{
61 return(0);
62}

Referenced by KdbpGetInstLength().

◆ KdbpPrintAddressInCode()

static void KdbpPrintAddressInCode ( uintptr_t  Addr,
struct disassemble_info Ignored 
)
static

Definition at line 78 of file i386-dis.c.

79{
80 if (!KdbSymPrintAddress((void*)Addr, NULL))
81 {
82 KdbPrintf("<%08x>", Addr);
83 }
84}
BOOLEAN KdbSymPrintAddress(IN PVOID Address, IN PCONTEXT Context)
Print address...
Definition: kdb_symbols.c:149
VOID __cdecl KdbPrintf(_In_ PCSTR Format,...)
Definition: kdb_print.c:160

Referenced by KdbpDisassemble().

◆ KdbpPrintDisasm()

int KdbpPrintDisasm ( void Ignored,
const char fmt,
  ... 
)

Definition at line 45 of file i386-dis.c.

46{
47 va_list ap;
48 static char buffer[256];
49 int ret;
50
51 va_start(ap, fmt);
54 va_end(ap);
55 return(ret);
56}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
GLuint buffer
Definition: glext.h:5915
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
VOID KdbPuts(_In_ PCSTR String)
Definition: kdb_print.c:152
Definition: dsound.c:943
int ret
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36

Referenced by KdbpDisassemble().

◆ KdbpReadMemory()

static int KdbpReadMemory ( uintptr_t  Addr,
unsigned char Data,
unsigned int  Length,
struct disassemble_info Ignored 
)
static

Definition at line 65 of file i386-dis.c.

67{
68 return KdbpSafeReadMemory(Data, (void *)Addr, Length); /* 0 means no error */
69}
NTSTATUS KdbpSafeReadMemory(OUT PVOID Dest, IN PVOID Src, IN ULONG Bytes)
Definition: kdb.c:1643
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102

Referenced by KdbpDisassemble(), and KdbpGetInstLength().

◆ NOP_Fixup() [1/2]

static void NOP_Fixup ( int bytemode  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 4233 of file i386-dis.c.

4234{
4235 /* NOP with REPZ prefix is called PAUSE. */
4236 if (prefixes == PREFIX_REPZ)
4237 strcpy (obuf, "pause");
4238}

◆ NOP_Fixup() [2/2]

static void NOP_Fixup ( int  ,
int   
)
static

◆ oappend()

◆ OP_0f07()

static void OP_0f07 ( int  bytemode,
int  sizeflag 
)
static

Definition at line 4201 of file i386-dis.c.

4202{
4203 if (mod != 3 || rm != 0)
4204 BadOp ();
4205 else
4206 OP_E (bytemode, sizeflag);
4207}
static void BadOp(void)
Definition: i386-dis.c:4448

◆ OP_0fae()

static void OP_0fae ( int  bytemode,
int  sizeflag 
)
static

Definition at line 4210 of file i386-dis.c.

4211{
4212 if (mod == 3)
4213 {
4214 if (reg == 7)
4215 strcpy (obuf + strlen (obuf) - sizeof ("clflush") + 1, "sfence");
4216
4217 if (reg < 5 || rm != 0)
4218 {
4219 BadOp (); /* bad sfence, mfence, or lfence */
4220 return;
4221 }
4222 }
4223 else if (reg != 7)
4224 {
4225 BadOp (); /* bad clflush */
4226 return;
4227 }
4228
4229 OP_E (bytemode, sizeflag);
4230}

◆ OP_3DNowSuffix() [1/2]

static void OP_3DNowSuffix ( int bytemode  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 4308 of file i386-dis.c.

4309{
4310 const char *mnemonic;
4311
4312 FETCH_DATA (the_info, codep + 1);
4313 /* AMD 3DNow! instructions are specified by an opcode suffix in the
4314 place where an 8-bit immediate would normally go. ie. the last
4315 byte of the instruction. */
4316 obufp = obuf + strlen (obuf);
4317 mnemonic = Suffix3DNow[*codep++ & 0xff];
4318 if (mnemonic)
4319 oappend (mnemonic);
4320 else
4321 {
4322 /* Since a variable sized modrm/sib chunk is between the start
4323 of the opcode (0x0f0f) and the opcode suffix, we need to do
4324 all the modrm processing first, and don't know until now that
4325 we have a bad opcode. This necessitates some cleaning up. */
4326 op1out[0] = '\0';
4327 op2out[0] = '\0';
4328 BadOp ();
4329 }
4330}
static const char *const Suffix3DNow[]
Definition: i386-dis.c:4240

◆ OP_3DNowSuffix() [2/2]

static void OP_3DNowSuffix ( int  ,
int   
)
static

◆ OP_C() [1/2]

static void OP_C ( int dummy  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 4063 of file i386-dis.c.

4064{
4065 int add = 0;
4067 if (rex & REX_EXTX)
4068 add = 8;
4069 sprintf (scratchbuf, "%%cr%d", reg + add);
4071}
static char scratchbuf[100]
Definition: i386-dis.c:1283
#define REX_EXTX
Definition: i386-dis.c:283
#define USED_REX(value)
Definition: i386-dis.c:290
#define sprintf(buf, format,...)
Definition: sprintf.c:55

◆ OP_C() [2/2]

static void OP_C ( int  ,
int   
)
static

◆ OP_D() [1/2]

static void OP_D ( int dummy  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 4074 of file i386-dis.c.

4075{
4076 int add = 0;
4078 if (rex & REX_EXTX)
4079 add = 8;
4080 if (intel_syntax)
4081 sprintf (scratchbuf, "db%d", reg + add);
4082 else
4083 sprintf (scratchbuf, "%%db%d", reg + add);
4085}

◆ OP_D() [2/2]

static void OP_D ( int  ,
int   
)
static

◆ OP_DIR() [1/2]

static void OP_DIR ( int dummy  ATTRIBUTE_UNUSED,
int  sizeflag 
)
static

Definition at line 3942 of file i386-dis.c.

3943{
3944 int seg, offset;
3945
3946 if (sizeflag & DFLAG)
3947 {
3948 offset = get32 ();
3949 seg = get16 ();
3950 }
3951 else
3952 {
3953 offset = get16 ();
3954 seg = get16 ();
3955 }
3957 if (intel_syntax)
3958 sprintf (scratchbuf, "0x%x,0x%x", seg, offset);
3959 else
3960 sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
3962}
GLintptr offset
Definition: glext.h:5920
#define DFLAG
Definition: i386-dis.c:462
static bfd_signed_vma get32(void)
Definition: i386-dis.c:3584
static int get16(void)
Definition: i386-dis.c:3613

◆ OP_DIR() [2/2]

static void OP_DIR ( int  ,
int   
)
static

◆ OP_DSreg()

static void OP_DSreg ( int  code,
int  sizeflag 
)
static

Definition at line 4048 of file i386-dis.c.

4049{
4050 if ((prefixes
4051 & (PREFIX_CS
4052 | PREFIX_DS
4053 | PREFIX_SS
4054 | PREFIX_ES
4055 | PREFIX_FS
4056 | PREFIX_GS)) == 0)
4058 append_seg ();
4059 ptr_reg (code, sizeflag);
4060}
static void ptr_reg(int, int)
Definition: i386-dis.c:4018
static void append_seg(void)
Definition: i386-dis.c:3137
Definition: inflate.c:139

◆ OP_E()

static void OP_E ( int  bytemode,
int  sizeflag 
)
static

Definition at line 3237 of file i386-dis.c.

3238{
3239 bfd_vma disp;
3240 int add = 0;
3241 int riprel = 0;
3243 if (rex & REX_EXTZ)
3244 add += 8;
3245
3246 /* Skip mod/rm byte. */
3248 codep++;
3249
3250 if (mod == 3)
3251 {
3252 switch (bytemode)
3253 {
3254 case b_mode:
3255 USED_REX (0);
3256 if (rex)
3257 oappend (names8rex[rm + add]);
3258 else
3259 oappend (names8[rm + add]);
3260 break;
3261 case w_mode:
3262 oappend (names16[rm + add]);
3263 break;
3264 case d_mode:
3265 oappend (names32[rm + add]);
3266 break;
3267 case q_mode:
3268 oappend (names64[rm + add]);
3269 break;
3270 case m_mode:
3271 if (mode_64bit)
3272 oappend (names64[rm + add]);
3273 else
3274 oappend (names32[rm + add]);
3275 break;
3276 case v_mode:
3277 case dq_mode:
3279 if (rex & REX_MODE64)
3280 oappend (names64[rm + add]);
3281 else if ((sizeflag & DFLAG) || bytemode == dq_mode)
3282 oappend (names32[rm + add]);
3283 else
3284 oappend (names16[rm + add]);
3286 break;
3287 case 0:
3288 break;
3289 default:
3291 break;
3292 }
3293 return;
3294 }
3295
3296 disp = 0;
3297 append_seg ();
3298
3299 if ((sizeflag & AFLAG) || mode_64bit) /* 32 bit address mode */
3300 {
3301 int havesib;
3302 int havebase;
3303 int base;
3304 int index = 0;
3305 int scale = 0;
3306
3307 havesib = 0;
3308 havebase = 1;
3309 base = rm;
3310
3311 if (base == 4)
3312 {
3313 havesib = 1;
3314 FETCH_DATA (the_info, codep + 1);
3315 scale = (*codep >> 6) & 3;
3316 index = (*codep >> 3) & 7;
3317 base = *codep & 7;
3320 if (rex & REX_EXTY)
3321 index += 8;
3322 if (rex & REX_EXTZ)
3323 base += 8;
3324 codep++;
3325 }
3326
3327 switch (mod)
3328 {
3329 case 0:
3330 if ((base & 7) == 5)
3331 {
3332 havebase = 0;
3333 if (mode_64bit && !havesib && (sizeflag & AFLAG))
3334 riprel = 1;
3335 disp = get32s ();
3336 }
3337 break;
3338 case 1:
3339 FETCH_DATA (the_info, codep + 1);
3340 disp = *codep++;
3341 if ((disp & 0x80) != 0)
3342 disp -= 0x100;
3343 break;
3344 case 2:
3345 disp = get32s ();
3346 break;
3347 }
3348
3349 if (!intel_syntax)
3350 if (mod != 0 || (base & 7) == 5)
3351 {
3352 print_operand_value (scratchbuf, !riprel, disp);
3354 if (riprel)
3355 {
3356 set_op (disp, 1);
3357 oappend ("(%rip)");
3358 }
3359 }
3360
3361 if (havebase || (havesib && (index != 4 || scale != 0)))
3362 {
3363 if (intel_syntax)
3364 {
3365 switch (bytemode)
3366 {
3367 case b_mode:
3368 oappend ("BYTE PTR ");
3369 break;
3370 case w_mode:
3371 oappend ("WORD PTR ");
3372 break;
3373 case v_mode:
3374 if (sizeflag & DFLAG)
3375 oappend ("DWORD PTR ");
3376 else
3377 oappend ("WORD PTR ");
3378 break;
3379 case d_mode:
3380 oappend ("DWORD PTR ");
3381 break;
3382 case q_mode:
3383 oappend ("QWORD PTR ");
3384 break;
3385 case m_mode:
3386 if (mode_64bit)
3387 oappend ("DWORD PTR ");
3388 else
3389 oappend ("QWORD PTR ");
3390 break;
3391 case x_mode:
3392 oappend ("XWORD PTR ");
3393 break;
3394 default:
3395 break;
3396 }
3397 }
3398 *obufp++ = open_char;
3399 if (intel_syntax && riprel)
3400 oappend ("rip + ");
3401 *obufp = '\0';
3403 if (!havesib && (rex & REX_EXTZ))
3404 base += 8;
3405 if (havebase)
3406 oappend (mode_64bit && (sizeflag & AFLAG)
3407 ? names64[base] : names32[base]);
3408 if (havesib)
3409 {
3410 if (index != 4)
3411 {
3412 if (intel_syntax)
3413 {
3414 if (havebase)
3415 {
3416 *obufp++ = separator_char;
3417 *obufp = '\0';
3418 }
3419 sprintf (scratchbuf, "%s",
3420 mode_64bit && (sizeflag & AFLAG)
3421 ? names64[index] : names32[index]);
3422 }
3423 else
3424 sprintf (scratchbuf, ",%s",
3425 mode_64bit && (sizeflag & AFLAG)
3426 ? names64[index] : names32[index]);
3428 }
3429 if (scale != 0 || (!intel_syntax && index != 4))
3430 {
3431 *obufp++ = scale_char;
3432 *obufp = '\0';
3433 sprintf (scratchbuf, "%d", 1 << scale);
3435 }
3436 }
3437 if (intel_syntax)
3438 if (mod != 0 || (base & 7) == 5)
3439 {
3440 /* Don't print zero displacements. */
3441 if (disp != 0)
3442 {
3443 if ((bfd_signed_vma) disp > 0)
3444 {
3445 *obufp++ = '+';
3446 *obufp = '\0';
3447 }
3448
3451 }
3452 }
3453
3454 *obufp++ = close_char;
3455 *obufp = '\0';
3456 }
3457 else if (intel_syntax)
3458 {
3459 if (mod != 0 || (base & 7) == 5)
3460 {
3463 ;
3464 else
3465 {
3467 oappend (":");
3468 }
3471 }
3472 }
3473 }
3474 else
3475 { /* 16 bit address mode */
3476 switch (mod)
3477 {
3478 case 0:
3479 if ((rm & 7) == 6)
3480 {
3481 disp = get16 ();
3482 if ((disp & 0x8000) != 0)
3483 disp -= 0x10000;
3484 }
3485 break;
3486 case 1:
3487 FETCH_DATA (the_info, codep + 1);
3488 disp = *codep++;
3489 if ((disp & 0x80) != 0)
3490 disp -= 0x100;
3491 break;
3492 case 2:
3493 disp = get16 ();
3494 if ((disp & 0x8000) != 0)
3495 disp -= 0x10000;
3496 break;
3497 }
3498
3499 if (!intel_syntax)
3500 if (mod != 0 || (rm & 7) == 6)
3501 {
3504 }
3505
3506 if (mod != 0 || (rm & 7) != 6)
3507 {
3508 *obufp++ = open_char;
3509 *obufp = '\0';
3510 oappend (index16[rm + add]);
3511 *obufp++ = close_char;
3512 *obufp = '\0';
3513 }
3514 }
3515}
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
GLuint index
Definition: glext.h:6031
#define REX_EXTY
Definition: i386-dis.c:284
static void print_operand_value(char *, int, bfd_vma)
Definition: i386-dis.c:3180
static const char ** names8rex
Definition: i386-dis.c:1302
#define m_mode
Definition: i386-dis.c:470
#define v_mode
Definition: i386-dis.c:465
#define AFLAG
Definition: i386-dis.c:461
static void set_op(bfd_vma, int)
Definition: i386-dis.c:3624
#define w_mode
Definition: i386-dis.c:466
static char separator_char
Definition: i386-dis.c:2055
#define q_mode
Definition: i386-dis.c:468
#define INTERNAL_DISASSEMBLER_ERROR
Definition: i386-dis.c:1866
#define REX_MODE64
Definition: i386-dis.c:282
#define REX_EXTZ
Definition: i386-dis.c:285
static char close_char
Definition: i386-dis.c:2054
#define es_reg
Definition: i386-dis.c:475
static const char ** names64
Definition: i386-dis.c:1298
#define b_mode
Definition: i386-dis.c:464
static bfd_signed_vma get32s(void)
Definition: i386-dis.c:3597
static const char ** names32
Definition: i386-dis.c:1299
static const char ** index16
Definition: i386-dis.c:1304
static const char ** names8
Definition: i386-dis.c:1301
#define ds_reg
Definition: i386-dis.c:478
#define dq_mode
Definition: i386-dis.c:473
static const char ** names_seg
Definition: i386-dis.c:1303
#define x_mode
Definition: i386-dis.c:469
#define d_mode
Definition: i386-dis.c:467
static char open_char
Definition: i386-dis.c:2053
static char scale_char
Definition: i386-dis.c:2056

Referenced by dofloat(), INVLPG_Fixup(), OP_0f07(), OP_0fae(), OP_EM(), OP_EX(), OP_indirE(), OP_M(), OP_Rd(), and PNI_Fixup().

◆ OP_EM()

static void OP_EM ( int  bytemode,
int  sizeflag 
)
static

Definition at line 4130 of file i386-dis.c.

4131{
4132 int add = 0;
4133 if (mod != 3)
4134 {
4135 OP_E (bytemode, sizeflag);
4136 return;
4137 }
4139 if (rex & REX_EXTZ)
4140 add = 8;
4141
4142 /* Skip mod/rm byte. */
4144 codep++;
4146 if (prefixes & PREFIX_DATA)
4147 sprintf (scratchbuf, "%%xmm%d", rm + add);
4148 else
4149 sprintf (scratchbuf, "%%mm%d", rm + add);
4151}

Referenced by OP_MS().

◆ OP_ESreg()

static void OP_ESreg ( int  code,
int  sizeflag 
)
static

Definition at line 4041 of file i386-dis.c.

4042{
4043 oappend (&"%es:"[intel_syntax]);
4044 ptr_reg (code, sizeflag);
4045}

◆ OP_EX()

static void OP_EX ( int  bytemode,
int  sizeflag 
)
static

Definition at line 4154 of file i386-dis.c.

4155{
4156 int add = 0;
4157 if (mod != 3)
4158 {
4159 OP_E (bytemode, sizeflag);
4160 return;
4161 }
4163 if (rex & REX_EXTZ)
4164 add = 8;
4165
4166 /* Skip mod/rm byte. */
4168 codep++;
4169 sprintf (scratchbuf, "%%xmm%d", rm + add);
4171}

Referenced by OP_XS().

◆ OP_G()

static void OP_G ( int  bytemode,
int  sizeflag 
)
static

Definition at line 3518 of file i386-dis.c.

3519{
3520 int add = 0;
3522 if (rex & REX_EXTX)
3523 add += 8;
3524 switch (bytemode)
3525 {
3526 case b_mode:
3527 USED_REX (0);
3528 if (rex)
3529 oappend (names8rex[reg + add]);
3530 else
3531 oappend (names8[reg + add]);
3532 break;
3533 case w_mode:
3534 oappend (names16[reg + add]);
3535 break;
3536 case d_mode:
3537 oappend (names32[reg + add]);
3538 break;
3539 case q_mode:
3540 oappend (names64[reg + add]);
3541 break;
3542 case v_mode:
3544 if (rex & REX_MODE64)
3545 oappend (names64[reg + add]);
3546 else if (sizeflag & DFLAG)
3547 oappend (names32[reg + add]);
3548 else
3549 oappend (names16[reg + add]);
3551 break;
3552 default:
3554 break;
3555 }
3556}

◆ OP_I()

static void OP_I ( int  bytemode,
int  sizeflag 
)
static

Definition at line 3748 of file i386-dis.c.

3749{
3751 bfd_signed_vma mask = -1;
3752
3753 switch (bytemode)
3754 {
3755 case b_mode:
3756 FETCH_DATA (the_info, codep + 1);
3757 op = *codep++;
3758 mask = 0xff;
3759 break;
3760 case q_mode:
3761 if (mode_64bit)
3762 {
3763 op = get32s ();
3764 break;
3765 }
3766 /* Fall through. */
3767 case v_mode:
3769 if (rex & REX_MODE64)
3770 op = get32s ();
3771 else if (sizeflag & DFLAG)
3772 {
3773 op = get32 ();
3774 mask = 0xffffffff;
3775 }
3776 else
3777 {
3778 op = get16 ();
3779 mask = 0xfffff;
3780 }
3782 break;
3783 case w_mode:
3784 mask = 0xfffff;
3785 op = get16 ();
3786 break;
3787 default:
3789 return;
3790 }
3791
3792 op &= mask;
3793 scratchbuf[0] = '$';
3796 scratchbuf[0] = '\0';
3797}
UINT op
Definition: effect.c:236
GLenum GLint GLuint mask
Definition: glext.h:6028

Referenced by OP_I64().

◆ OP_I64()

static void OP_I64 ( int  bytemode,
int  sizeflag 
)
static

Definition at line 3800 of file i386-dis.c.

3801{
3803 bfd_signed_vma mask = -1;
3804
3805 if (!mode_64bit)
3806 {
3807 OP_I (bytemode, sizeflag);
3808 return;
3809 }
3810
3811 switch (bytemode)
3812 {
3813 case b_mode:
3814 FETCH_DATA (the_info, codep + 1);
3815 op = *codep++;
3816 mask = 0xff;
3817 break;
3818 case v_mode:
3820 if (rex & REX_MODE64)
3821 op = get64 ();
3822 else if (sizeflag & DFLAG)
3823 {
3824 op = get32 ();
3825 mask = 0xffffffff;
3826 }
3827 else
3828 {
3829 op = get16 ();
3830 mask = 0xfffff;
3831 }
3833 break;
3834 case w_mode:
3835 mask = 0xfffff;
3836 op = get16 ();
3837 break;
3838 default:
3840 return;
3841 }
3842
3843 op &= mask;
3844 scratchbuf[0] = '$';
3847 scratchbuf[0] = '\0';
3848}
static bfd_vma get64(void)
Definition: i386-dis.c:3559
static void OP_I(int, int)
Definition: i386-dis.c:3748

◆ OP_IMREG()

static void OP_IMREG ( int  code,
int  sizeflag 
)
static

Definition at line 3701 of file i386-dis.c.

3702{
3703 const char *s;
3704
3705 switch (code)
3706 {
3707 case indir_dx_reg:
3708 if (intel_syntax)
3709 s = "[dx]";
3710 else
3711 s = "(%dx)";
3712 break;
3713 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
3714 case sp_reg: case bp_reg: case si_reg: case di_reg:
3715 s = names16[code - ax_reg];
3716 break;
3717 case es_reg: case ss_reg: case cs_reg:
3718 case ds_reg: case fs_reg: case gs_reg:
3719 s = names_seg[code - es_reg];
3720 break;
3721 case al_reg: case ah_reg: case cl_reg: case ch_reg:
3722 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
3723 USED_REX (0);
3724 if (rex)
3725 s = names8rex[code - al_reg];
3726 else
3727 s = names8[code - al_reg];
3728 break;
3729 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
3730 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
3732 if (rex & REX_MODE64)
3733 s = names64[code - eAX_reg];
3734 else if (sizeflag & DFLAG)
3735 s = names32[code - eAX_reg];
3736 else
3737 s = names16[code - eAX_reg];
3739 break;
3740 default:
3742 break;
3743 }
3744 oappend (s);
3745}
#define ax_reg
Definition: i386-dis.c:500
#define eCX_reg
Definition: i386-dis.c:483
#define cx_reg
Definition: i386-dis.c:501
#define bx_reg
Definition: i386-dis.c:503
#define dh_reg
Definition: i386-dis.c:497
#define ss_reg
Definition: i386-dis.c:477
#define bp_reg
Definition: i386-dis.c:505
#define indir_dx_reg
Definition: i386-dis.c:518
#define al_reg
Definition: i386-dis.c:491
#define dx_reg
Definition: i386-dis.c:502
#define eSP_reg
Definition: i386-dis.c:486
#define gs_reg
Definition: i386-dis.c:480
#define cl_reg
Definition: i386-dis.c:492
#define bl_reg
Definition: i386-dis.c:494
#define sp_reg
Definition: i386-dis.c:504
#define ch_reg
Definition: i386-dis.c:496
#define bh_reg
Definition: i386-dis.c:498
#define eBX_reg
Definition: i386-dis.c:485
#define eDI_reg
Definition: i386-dis.c:489
#define dl_reg
Definition: i386-dis.c:493
#define di_reg
Definition: i386-dis.c:507
#define ah_reg
Definition: i386-dis.c:495
#define eDX_reg
Definition: i386-dis.c:484
#define eSI_reg
Definition: i386-dis.c:488
#define cs_reg
Definition: i386-dis.c:476
#define si_reg
Definition: i386-dis.c:506
#define fs_reg
Definition: i386-dis.c:479
#define eAX_reg
Definition: i386-dis.c:482
#define eBP_reg
Definition: i386-dis.c:487

◆ OP_indirE()

static void OP_indirE ( int  bytemode,
int  sizeflag 
)
static

Definition at line 3172 of file i386-dis.c.

3173{
3174 if (!intel_syntax)
3175 oappend ("*");
3176 OP_E (bytemode, sizeflag);
3177}

◆ OP_J()

static void OP_J ( int  bytemode,
int  sizeflag 
)
static

Definition at line 3900 of file i386-dis.c.

3901{
3902 bfd_vma disp;
3903 bfd_vma mask = -1;
3904
3905 switch (bytemode)
3906 {
3907 case b_mode:
3908 FETCH_DATA (the_info, codep + 1);
3909 disp = *codep++;
3910 if ((disp & 0x80) != 0)
3911 disp -= 0x100;
3912 break;
3913 case v_mode:
3914 if (sizeflag & DFLAG)
3915 disp = get32s ();
3916 else
3917 {
3918 disp = get16 ();
3919 /* For some reason, a data16 prefix on a jump instruction
3920 means that the pc is masked to 16 bits after the
3921 displacement is added! */
3922 mask = 0xffff;
3923 }
3924 break;
3925 default:
3927 return;
3928 }
3929 disp = (start_pc + codep - start_codep + disp) & mask;
3930 set_op (disp, 0);
3933}
static bfd_vma start_pc
Definition: i386-dis.c:2041
static unsigned char * start_codep
Definition: i386-dis.c:1284

◆ OP_M()

static void OP_M ( int  bytemode,
int  sizeflag 
)
static

Definition at line 4192 of file i386-dis.c.

4193{
4194 if (mod == 3)
4195 BadOp (); /* bad lea,lds,les,lfs,lgs,lss modrm */
4196 else
4197 OP_E (bytemode, sizeflag);
4198}

◆ OP_MMX() [1/2]

static void OP_MMX ( int bytemode  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 4104 of file i386-dis.c.

4105{
4106 int add = 0;
4108 if (rex & REX_EXTX)
4109 add = 8;
4111 if (prefixes & PREFIX_DATA)
4112 sprintf (scratchbuf, "%%xmm%d", reg + add);
4113 else
4114 sprintf (scratchbuf, "%%mm%d", reg + add);
4116}

◆ OP_MMX() [2/2]

static void OP_MMX ( int  ,
int   
)
static

◆ OP_MS()

static void OP_MS ( int  bytemode,
int  sizeflag 
)
static

Definition at line 4174 of file i386-dis.c.

4175{
4176 if (mod == 3)
4177 OP_EM (bytemode, sizeflag);
4178 else
4179 BadOp ();
4180}
static void OP_EM(int, int)
Definition: i386-dis.c:4130

◆ OP_OFF() [1/2]

static void OP_OFF ( int bytemode  ATTRIBUTE_UNUSED,
int  sizeflag 
)
static

Definition at line 3965 of file i386-dis.c.

3966{
3967 bfd_vma off;
3968
3969 append_seg ();
3970
3971 if ((sizeflag & AFLAG) || mode_64bit)
3972 off = get32 ();
3973 else
3974 off = get16 ();
3975
3976 if (intel_syntax)
3977 {
3980 {
3982 oappend (":");
3983 }
3984 }
3987}

◆ OP_OFF() [2/2]

static void OP_OFF ( int  ,
int   
)
static

Referenced by OP_OFF64().

◆ OP_OFF64() [1/2]

static void OP_OFF64 ( int bytemode  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 3990 of file i386-dis.c.

3991{
3992 bfd_vma off;
3993
3994 if (!mode_64bit)
3995 {
3996 OP_OFF (bytemode, sizeflag);
3997 return;
3998 }
3999
4000 append_seg ();
4001
4002 off = get64 ();
4003
4004 if (intel_syntax)
4005 {
4008 {
4010 oappend (":");
4011 }
4012 }
4015}
static void OP_OFF(int, int)

◆ OP_OFF64() [2/2]

static void OP_OFF64 ( int  ,
int   
)
static

◆ OP_Rd()

static void OP_Rd ( int  bytemode,
int  sizeflag 
)
static

Definition at line 4095 of file i386-dis.c.

4096{
4097 if (mod == 3)
4098 OP_E (bytemode, sizeflag);
4099 else
4100 BadOp ();
4101}

◆ OP_REG()

static void OP_REG ( int  code,
int  sizeflag 
)
static

Definition at line 3641 of file i386-dis.c.

3642{
3643 const char *s;
3644 int add = 0;
3646 if (rex & REX_EXTZ)
3647 add = 8;
3648
3649 switch (code)
3650 {
3651 case indir_dx_reg:
3652 if (intel_syntax)
3653 s = "[dx]";
3654 else
3655 s = "(%dx)";
3656 break;
3657 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
3658 case sp_reg: case bp_reg: case si_reg: case di_reg:
3659 s = names16[code - ax_reg + add];
3660 break;
3661 case es_reg: case ss_reg: case cs_reg:
3662 case ds_reg: case fs_reg: case gs_reg:
3663 s = names_seg[code - es_reg + add];
3664 break;
3665 case al_reg: case ah_reg: case cl_reg: case ch_reg:
3666 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
3667 USED_REX (0);
3668 if (rex)
3669 s = names8rex[code - al_reg + add];
3670 else
3671 s = names8[code - al_reg];
3672 break;
3673 case rAX_reg: case rCX_reg: case rDX_reg: case rBX_reg:
3674 case rSP_reg: case rBP_reg: case rSI_reg: case rDI_reg:
3675 if (mode_64bit)
3676 {
3677 s = names64[code - rAX_reg + add];
3678 break;
3679 }
3680 code += eAX_reg - rAX_reg;
3681 /* Fall through. */
3682 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
3683 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
3685 if (rex & REX_MODE64)
3686 s = names64[code - eAX_reg + add];
3687 else if (sizeflag & DFLAG)
3688 s = names32[code - eAX_reg + add];
3689 else
3690 s = names16[code - eAX_reg + add];
3692 break;
3693 default:
3695 break;
3696 }
3697 oappend (s);
3698}
#define rBP_reg
Definition: i386-dis.c:514
#define rDX_reg
Definition: i386-dis.c:511
#define rSI_reg
Definition: i386-dis.c:515
#define rCX_reg
Definition: i386-dis.c:510
#define rDI_reg
Definition: i386-dis.c:516
#define rBX_reg
Definition: i386-dis.c:512
#define rSP_reg
Definition: i386-dis.c:513
#define rAX_reg
Definition: i386-dis.c:509

◆ OP_SEG() [1/2]

static void OP_SEG ( int dummy  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 3936 of file i386-dis.c.

3937{
3939}

◆ OP_SEG() [2/2]

static void OP_SEG ( int  ,
int   
)
static

◆ OP_sI()

static void OP_sI ( int  bytemode,
int  sizeflag 
)
static

Definition at line 3851 of file i386-dis.c.

3852{
3854 //bfd_signed_vma mask = -1;
3855
3856 switch (bytemode)
3857 {
3858 case b_mode:
3859 FETCH_DATA (the_info, codep + 1);
3860 op = *codep++;
3861 if ((op & 0x80) != 0)
3862 op -= 0x100;
3863 //mask = 0xffffffff;
3864 break;
3865 case v_mode:
3867 if (rex & REX_MODE64)
3868 op = get32s ();
3869 else if (sizeflag & DFLAG)
3870 {
3871 op = get32s ();
3872 //mask = 0xffffffff;
3873 }
3874 else
3875 {
3876 //mask = 0xffffffff;
3877 op = get16 ();
3878 if ((op & 0x8000) != 0)
3879 op -= 0x10000;
3880 }
3882 break;
3883 case w_mode:
3884 op = get16 ();
3885 //mask = 0xffffffff;
3886 if ((op & 0x8000) != 0)
3887 op -= 0x10000;
3888 break;
3889 default:
3891 return;
3892 }
3893
3894 scratchbuf[0] = '$';
3897}

◆ OP_SIMD_Suffix() [1/2]

static void OP_SIMD_Suffix ( int bytemode  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 4344 of file i386-dis.c.

4345{
4346 unsigned int cmp_type;
4347
4348 FETCH_DATA (the_info, codep + 1);
4349 obufp = obuf + strlen (obuf);
4350 cmp_type = *codep++ & 0xff;
4351 if (cmp_type < 8)
4352 {
4353 char suffix1 = 'p', suffix2 = 's';
4355 if (prefixes & PREFIX_REPZ)
4356 suffix1 = 's';
4357 else
4358 {
4360 if (prefixes & PREFIX_DATA)
4361 suffix2 = 'd';
4362 else
4363 {
4365 if (prefixes & PREFIX_REPNZ)
4366 suffix1 = 's', suffix2 = 'd';
4367 }
4368 }
4369 sprintf (scratchbuf, "cmp%s%c%c",
4370 simd_cmp_op[cmp_type], suffix1, suffix2);
4373 }
4374 else
4375 {
4376 /* We have a bad extension byte. Clean up. */
4377 op1out[0] = '\0';
4378 op2out[0] = '\0';
4379 BadOp ();
4380 }
4381}
static const char * simd_cmp_op[]
Definition: i386-dis.c:4332

◆ OP_SIMD_Suffix() [2/2]

static void OP_SIMD_Suffix ( int  ,
int   
)
static

◆ OP_ST() [1/2]

static void OP_ST ( int bytemode  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 2843 of file i386-dis.c.

2844{
2845 oappend ("%st");
2846}

◆ OP_ST() [2/2]

static void OP_ST ( int  ,
int   
)
static

◆ OP_STi() [1/2]

static void OP_STi ( int bytemode  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 2849 of file i386-dis.c.

2850{
2851 sprintf (scratchbuf, "%%st(%d)", rm);
2853}

◆ OP_STi() [2/2]

static void OP_STi ( int  ,
int   
)
static

◆ OP_T() [1/2]

static void OP_T ( int dummy  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 4088 of file i386-dis.c.

4089{
4090 sprintf (scratchbuf, "%%tr%d", reg);
4092}

◆ OP_T() [2/2]

static void OP_T ( int  ,
int   
)
static

◆ OP_XMM() [1/2]

static void OP_XMM ( int bytemode  ATTRIBUTE_UNUSED,
int sizeflag  ATTRIBUTE_UNUSED 
)
static

Definition at line 4119 of file i386-dis.c.

4120{
4121 int add = 0;
4123 if (rex & REX_EXTX)
4124 add = 8;
4125 sprintf (scratchbuf, "%%xmm%d", reg + add);
4127}

◆ OP_XMM() [2/2]

static void OP_XMM ( int  ,
int   
)
static

◆ OP_XS()

static void OP_XS ( int  bytemode,
int  sizeflag 
)
static

Definition at line 4183 of file i386-dis.c.

4184{
4185 if (mod == 3)
4186 OP_EX (bytemode, sizeflag);
4187 else
4188 BadOp ();
4189}
static void OP_EX(int, int)
Definition: i386-dis.c:4154

◆ PNI_Fixup() [1/2]

static void PNI_Fixup ( int extrachar  ATTRIBUTE_UNUSED,
int  sizeflag 
)
static

Definition at line 4400 of file i386-dis.c.

4401{
4402 if (mod == 3 && reg == 1 && rm <= 1)
4403 {
4404 /* Override "sidt". */
4405 char *p = obuf + strlen (obuf) - 4;
4406
4407 /* We might have a suffix. */
4408 if (*p == 'i')
4409 --p;
4410
4411 if (rm)
4412 {
4413 /* mwait %eax,%ecx */
4414 strcpy (p, "mwait");
4415 }
4416 else
4417 {
4418 /* monitor %eax,%ecx,%edx" */
4419 strcpy (p, "monitor");
4420 strcpy (op3out, names32[2]);
4421 }
4422 strcpy (op1out, names32[0]);
4423 strcpy (op2out, names32[1]);
4424 two_source_ops = 1;
4425
4426 codep++;
4427 }
4428 else
4429 OP_E (0, sizeflag);
4430}
static int two_source_ops
Definition: i386-dis.c:2038
static char op3out[100]
Definition: i386-dis.c:2036

◆ PNI_Fixup() [2/2]

static void PNI_Fixup ( int  ,
int   
)
static

◆ prefix_name()

static const char * prefix_name ( int  pref,
int  sizeflag 
)
static

Definition at line 1967 of file i386-dis.c.

1968{
1969 switch (pref)
1970 {
1971 /* REX prefixes family. */
1972 case 0x40:
1973 return "rex";
1974 case 0x41:
1975 return "rexZ";
1976 case 0x42:
1977 return "rexY";
1978 case 0x43:
1979 return "rexYZ";
1980 case 0x44:
1981 return "rexX";
1982 case 0x45:
1983 return "rexXZ";
1984 case 0x46:
1985 return "rexXY";
1986 case 0x47:
1987 return "rexXYZ";
1988 case 0x48:
1989 return "rex64";
1990 case 0x49:
1991 return "rex64Z";
1992 case 0x4a:
1993 return "rex64Y";
1994 case 0x4b:
1995 return "rex64YZ";
1996 case 0x4c:
1997 return "rex64X";
1998 case 0x4d:
1999 return "rex64XZ";
2000 case 0x4e:
2001 return "rex64XY";
2002 case 0x4f:
2003 return "rex64XYZ";
2004 case 0xf3:
2005 return "repz";
2006 case 0xf2:
2007 return "repnz";
2008 case 0xf0:
2009 return "lock";
2010 case 0x2e:
2011 return "cs";
2012 case 0x36:
2013 return "ss";
2014 case 0x3e:
2015 return "ds";
2016 case 0x26:
2017 return "es";
2018 case 0x64:
2019 return "fs";
2020 case 0x65:
2021 return "gs";
2022 case 0x66:
2023 return (sizeflag & DFLAG) ? "data16" : "data32";
2024 case 0x67:
2025 if (mode_64bit)
2026 return (sizeflag & AFLAG) ? "addr32" : "addr64";
2027 else
2028 return ((sizeflag & AFLAG) && !mode_64bit) ? "addr16" : "addr32";
2029 case FWAIT_OPCODE:
2030 return "fwait";
2031 default:
2032 return NULL;
2033 }
2034}

Referenced by ckprefix(), and print_insn().

◆ print_insn()

static int print_insn ( bfd_vma  pc,
disassemble_info info 
)
static

Definition at line 2086 of file i386-dis.c.

2087{
2088 const struct dis386 *dp;
2089 intptr_t i;
2090 char *first, *second, *third;
2091 int needcomma;
2092 unsigned char uses_SSE_prefix;
2093 int sizeflag;
2094 /*const char *p;*/
2095 struct dis_private priv;
2096
2098 || info->mach == bfd_mach_x86_64);
2099
2100 if (intel_syntax == (char) -1)
2103
2104 if (info->mach == bfd_mach_i386_i386
2105 || info->mach == bfd_mach_x86_64
2108 priv.orig_sizeflag = AFLAG | DFLAG;
2109 else if (info->mach == bfd_mach_i386_i8086)
2110 priv.orig_sizeflag = 0;
2111 else
2112 abort ();
2113
2114#if 0
2115 for (p = info->disassembler_options; p != NULL; )
2116 {
2117 if (strncmp (p, "x86-64", 6) == 0)
2118 {
2119 mode_64bit = 1;
2120 priv.orig_sizeflag = AFLAG | DFLAG;
2121 }
2122 else if (strncmp (p, "i386", 4) == 0)
2123 {
2124 mode_64bit = 0;
2125 priv.orig_sizeflag = AFLAG | DFLAG;
2126 }
2127 else if (strncmp (p, "i8086", 5) == 0)
2128 {
2129 mode_64bit = 0;
2130 priv.orig_sizeflag = 0;
2131 }
2132 else if (strncmp (p, "intel", 5) == 0)
2133 {
2134 intel_syntax = 1;
2135 }
2136 else if (strncmp (p, "att", 3) == 0)
2137 {
2138 intel_syntax = 0;
2139 }
2140 else if (strncmp (p, "addr", 4) == 0)
2141 {
2142 if (p[4] == '1' && p[5] == '6')
2143 priv.orig_sizeflag &= ~AFLAG;
2144 else if (p[4] == '3' && p[5] == '2')
2145 priv.orig_sizeflag |= AFLAG;
2146 }
2147 else if (strncmp (p, "data", 4) == 0)
2148 {
2149 if (p[4] == '1' && p[5] == '6')
2150 priv.orig_sizeflag &= ~DFLAG;
2151 else if (p[4] == '3' && p[5] == '2')
2152 priv.orig_sizeflag |= DFLAG;
2153 }
2154 else if (strncmp (p, "suffix", 6) == 0)
2155 priv.orig_sizeflag |= SUFFIX_ALWAYS;
2156
2157 p = strchr (p, ',');
2158 if (p != NULL)
2159 p++;
2160 }
2161#else
2162#ifdef _M_AMD64
2163 mode_64bit = 1;
2164#else
2165 mode_64bit = 0;
2166#endif
2167 priv.orig_sizeflag = AFLAG | DFLAG;
2168 /*intel_syntax = 0;*/
2169#endif
2170
2171 if (intel_syntax)
2172 {
2180 open_char = '[';
2181 close_char = ']';
2182 separator_char = '+';
2183 scale_char = '*';
2184 }
2185 else
2186 {
2194 open_char = '(';
2195 close_char = ')';
2196 separator_char = ',';
2197 scale_char = ',';
2198 }
2199
2200 /* The output looks better if we put 7 bytes on a line, since that
2201 puts most long word instructions on a single line. */
2202 info->bytes_per_line = 7;
2203
2204 info->private_data = &priv;
2205 priv.max_fetched = priv.the_buffer;
2206 priv.insn_start = pc;
2207
2208 obuf[0] = 0;
2209 op1out[0] = 0;
2210 op2out[0] = 0;
2211 op3out[0] = 0;
2212
2213 op_index[0] = op_index[1] = op_index[2] = -1;
2214
2215 the_info = info;
2216 start_pc = pc;
2217 start_codep = priv.the_buffer;
2218 codep = priv.the_buffer;
2219
2220 if (setjmp (priv.bailout) != 0)
2221 {
2222 const char *name;
2223
2224 /* Getting here means we tried for data but didn't get it. That
2225 means we have an incomplete instruction of some sort. Just
2226 print the first byte as a prefix or a .byte pseudo-op. */
2227 if (codep > priv.the_buffer)
2228 {
2229 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
2230 if (name != NULL)
2231 (*info->fprintf_func) (info->stream, "%s", name);
2232 else
2233 {
2234 /* Just print the first byte as a .byte instruction. */
2235 (*info->fprintf_func) (info->stream, ".byte 0x%x",
2236 (unsigned int) priv.the_buffer[0]);
2237 }
2238
2239 return 1;
2240 }
2241
2242 return -1;
2243 }
2244
2245 obufp = obuf;
2246 ckprefix ();
2247
2248 insn_codep = codep;
2249 sizeflag = priv.orig_sizeflag;
2250
2251 FETCH_DATA (info, codep + 1);
2252 two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
2253
2254 if ((prefixes & PREFIX_FWAIT)
2255 && ((*codep < 0xd8) || (*codep > 0xdf)))
2256 {
2257 const char *name;
2258
2259 /* fwait not followed by floating point instruction. Print the
2260 first prefix, which is probably fwait itself. */
2261 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
2262 if (name == NULL)
2264 (*info->fprintf_func) (info->stream, "%s", name);
2265 return 1;
2266 }
2267
2268 if (*codep == 0x0f)
2269 {
2270 FETCH_DATA (info, codep + 2);