ReactOS  0.4.13-dev-39-g8b6696f
i386-dis.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
#include <setjmp.h>
#include "dis-asm.h"
Include dependency graph for i386-dis.c:

Go to the source code of this file.

Classes

struct  dis_private
 
struct  dis386
 

Macros

#define NDEBUG
 
#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, "%p", VMA)
 
#define _INC_SETJMPEX
 
#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 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_E, 0 /* lea, lgdt, etc. */
 
#define Mp   OP_E, 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 None   OP_E, 0
 
#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
 
#define m_mode   7 /* d_mode in 32bit, q_mode in 64bit mode. */
 
#define cond_jump_mode   8
 
#define loop_jcxz_mode   9
 
#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 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 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 ULONG_PTR bfd_vma
 
typedef unsigned char bfd_byte
 
typedef voidbfd
 
typedef LONG_PTR bfd_signed_vma
 
typedef void op_rtn PARAMS((int bytemode, int sizeflag))
 

Enumerations

enum  bfd_flavour { bfd_target_unknown_flavour, bfd_target_unknown_flavour }
 
enum  bfd_architecture { bfd_arch_i386, bfd_arch_i386 }
 
enum  bfd_endian {
  BFD_ENDIAN_BIG, BIG_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN, 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 (ULONG_PTR Addr, unsigned char *Data, unsigned int Length, struct disassemble_info *Ignored)
 
static void KdbpMemoryError (int Status, ULONG_PTR Addr, struct disassemble_info *Ignored)
 
static void KdbpPrintAddressInCode (ULONG_PTR Addr, struct disassemble_info *Ignored)
 
static void KdbpNopPrintAddress (ULONG_PTR Addr, struct disassemble_info *Ignored)
 
LONG KdbpGetInstLength (IN ULONG_PTR Address)
 
LONG KdbpDisassemble (IN ULONG_PTR Address, IN ULONG IntelSyntax)
 
static int fetch_data PARAMS ((struct disassemble_info *, bfd_byte *))
 
static void ckprefix PARAMS ((void))
 
static const char *prefix_name PARAMS ((int, int))
 
static int print_insn PARAMS ((bfd_vma, disassemble_info *))
 
static void dofloat PARAMS ((int))
 
static int putop PARAMS ((const char *, int))
 
static void oappend PARAMS ((const char *))
 
static void print_operand_value PARAMS ((char *, int, bfd_vma))
 
static void set_op PARAMS ((bfd_vma, int))
 
static int fetch_data (struct disassemble_info *info, bfd_byte *addr)
 
static void ckprefix ()
 
static const charprefix_name (int pref, int sizeflag)
 
int print_insn_i386_att (bfd_vma pc, disassemble_info *info)
 
int print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
 
static int print_insn (bfd_vma pc, disassemble_info *info)
 
static void dofloat (int sizeflag)
 
static void OP_STi (bytemode, sizeflag)
 
static int putop (char *template, int sizeflag) const
 
static void oappend (char *s) const
 
static void append_seg ()
 
static void OP_indirE (int bytemode, int sizeflag)
 
static void print_operand_value (char *buf, int hex, bfd_vma disp)
 
 USED_REX (REX_EXTZ)
 
 if (rex &REX_EXTZ) add+ = 8
 
 if (mod==3)
 
 if ((sizeflag &AFLAG)||mode_64bit)
 
 USED_REX (REX_EXTX)
 
 switch (bytemode)
 
static bfd_vma get64 ()
 
static bfd_signed_vma get32 ()
 
static bfd_signed_vma get32s ()
 
static int get16 ()
 
static void set_op (bfd_vma op, int riprel)
 
 switch (code)
 
 oappend (s)
 
 print_operand_value (scratchbuf+1, 1, op)
 
 oappend (scratchbuf+intel_syntax)
 
 if (!mode_64bit)
 
static void OP_sI (int bytemode, int sizeflag)
 
 set_op (disp, 0)
 
 print_operand_value (scratchbuf, 1, disp)
 
 oappend (scratchbuf)
 
 if (sizeflag &DFLAG)
 
 if (intel_syntax)
 
 print_operand_value (scratchbuf, 1, off)
 
static void ptr_reg (int code, int sizeflag)
 
static void OP_ESreg (int code, int sizeflag)
 
static void OP_DSreg (int code, int sizeflag)
 
 sprintf (scratchbuf, "%%cr%d", reg+add)
 
static void OP_Rd (int bytemode, int sizeflag)
 
 if (prefixes &PREFIX_DATA) sprintf(scratchbuf
 
else sprintf (scratchbuf, "%%mm%d", reg+add)
 
 sprintf (scratchbuf, "%%xmm%d", reg+add)
 
 if (mod !=3)
 
else sprintf (scratchbuf, "%%mm%d", rm+add)
 
 sprintf (scratchbuf, "%%xmm%d", rm+add)
 
else BadOp ()
 
static void OP_3DNowSuffix (bytemode, sizeflag)
 
static void OP_SIMD_Suffix (bytemode, sizeflag)
 
static void SIMD_Fixup (int extrachar, sizeflag)
 

Variables

static int mode_64bit = 1
 
static int prefixes
 
static int rex
 
static int rex_used
 
static int used_prefixes = (prefixes & PREFIX_DATA)
 
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 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 struct dis386 float_reg [][8]
 
static charfgrps [][8]
 
static void int bytemode ATTRIBUTE_UNUSED
 
static void int bytemode
 
int sizeflag
 
int add = 0
 
int riprel = 0
 
 MODRM_CHECK
 
 disp = 0
 
 else
 
static void int code
 
bfd_signed_vma mask = -1
 
 seg = get16 ()
 
 off = get64 ()
 
xmm d
 
static const charSuffix3DNow []
 
static const charsimd_cmp_op []
 

Macro Definition Documentation

◆ _

#define _ (   X)    X

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

◆ _INC_SETJMPEX

#define _INC_SETJMPEX

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

◆ abort

#define abort (   void)    DbgBreakPoint();

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

◆ AFLAG

#define AFLAG   2

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

◆ AH

#define AH   OP_IMREG, ah_reg

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

◆ ah_reg

#define ah_reg   120

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

◆ AL [1/2]

#define AL   OP_IMREG, al_reg

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

◆ AL [2/2]

#define AL   OP_IMREG, al_reg

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

◆ al_reg

#define al_reg   116

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

◆ Ap

#define Ap   OP_DIR, 0

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

◆ ATTRIBUTE_UNUSED

#define ATTRIBUTE_UNUSED

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

◆ AX

#define AX   OP_IMREG, ax_reg

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

◆ ax_reg

#define ax_reg   124

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

◆ b_mode

#define b_mode   1 /* byte operand */

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

◆ bfd_mach_i386_i386

#define bfd_mach_i386_i386   3

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

◆ bfd_mach_i386_i386_intel_syntax

#define bfd_mach_i386_i386_intel_syntax   2

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

◆ bfd_mach_i386_i8086

#define bfd_mach_i386_i8086   4

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

◆ bfd_mach_x86_64

#define bfd_mach_x86_64   1

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

◆ bfd_mach_x86_64_intel_syntax

#define bfd_mach_x86_64_intel_syntax   0

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

◆ BH

#define BH   OP_IMREG, bh_reg

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

◆ bh_reg

#define bh_reg   123

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

◆ BL

#define BL   OP_IMREG, bl_reg

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

◆ bl_reg

#define bl_reg   119

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

◆ bp_reg

#define bp_reg   129

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

◆ bx_reg

#define bx_reg   127

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

◆ CH

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

◆ ch_reg

#define ch_reg   121

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

◆ CL

#define CL   OP_IMREG, cl_reg

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

◆ cl_reg

#define cl_reg   117

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

◆ Cm

#define Cm   OP_C, m_mode

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

◆ cond_jump_flag

#define cond_jump_flag   NULL, cond_jump_mode

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

◆ cond_jump_mode

#define cond_jump_mode   8

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

◆ cs

static CRITICAL_SECTION cs   OP_REG, cs_reg

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

◆ cs_reg

#define cs_reg   101

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

◆ cx_reg

#define cx_reg   125

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

◆ d_mode

#define d_mode   4 /* double word operand */

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

◆ DFLAG

#define DFLAG   1

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

◆ DH

#define DH   OP_IMREG, dh_reg

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

◆ dh_reg

#define dh_reg   122

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

◆ di_reg

#define di_reg   131

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

◆ DL

#define DL   OP_IMREG, dl_reg

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

◆ dl_reg

#define dl_reg   118

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

◆ Dm

#define Dm   OP_D, m_mode

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

◆ ds

#define ds   OP_REG, ds_reg

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

◆ ds_reg

#define ds_reg   103

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

◆ DSBX

#define DSBX   OP_DSreg, eBX_reg

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

◆ DX

#define DX   OP_IMREG, dx_reg

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

◆ dx_reg

#define dx_reg   126

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

◆ eAX

#define eAX   OP_IMREG, eAX_reg

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

◆ eAX_reg

#define eAX_reg   108

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

◆ Eb

#define Eb   OP_E, b_mode

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

◆ eBP

#define eBP   OP_IMREG, eBP_reg

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

◆ eBP_reg

#define eBP_reg   113

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

◆ eBX

#define eBX   OP_IMREG, eBX_reg

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

◆ eBX_reg

#define eBX_reg   111

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

◆ eCX

#define eCX   OP_IMREG, eCX_reg

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

◆ eCX_reg

#define eCX_reg   109

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

◆ Ed

#define Ed   OP_E, d_mode

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

◆ eDI

#define eDI   OP_IMREG, eDI_reg

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

◆ eDI_reg

#define eDI_reg   115

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

◆ eDX

#define eDX   OP_IMREG, eDX_reg

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

◆ eDX_reg

#define eDX_reg   110

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

◆ EM

#define EM   OP_EM, v_mode

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

◆ es

#define es   OP_REG, es_reg

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

◆ es_reg

#define es_reg   100

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

◆ eSI

#define eSI   OP_IMREG, eSI_reg

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

◆ eSI_reg

#define eSI_reg   114

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

◆ eSP

#define eSP   OP_IMREG, eSP_reg

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

◆ eSP_reg

#define eSP_reg   112

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

◆ Ev

#define Ev   OP_E, v_mode

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

◆ Ew

#define Ew   OP_E, w_mode

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

◆ EX

#define EX   OP_EX, v_mode

Definition at line 441 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)))
static int fetch_data(struct disassemble_info *info, bfd_byte *addr)
Definition: i386-dis.c:314
GLenum const GLvoid * addr
Definition: glext.h:9621

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

◆ FGRPd9_2

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

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

◆ FGRPd9_4

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

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

◆ FGRPd9_5

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

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

◆ FGRPd9_6

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

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

◆ FGRPd9_7

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

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

◆ FGRPda_5

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

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

◆ FGRPdb_4

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

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

◆ FGRPde_3

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

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

◆ FGRPdf_4

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

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

◆ FLOAT

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

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

◆ FLOATCODE

#define FLOATCODE   1

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

◆ fs

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

◆ fs_reg

#define fs_reg   104

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

◆ FWAIT_OPCODE

#define FWAIT_OPCODE   (0x9b)

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

◆ Gb

#define Gb   OP_G, b_mode

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

◆ Gd

#define Gd   OP_G, d_mode

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

◆ GRP10

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

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

◆ GRP11

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

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

◆ GRP12

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

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

◆ GRP13

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

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

◆ GRP14

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

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

◆ GRP1b

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

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

◆ GRP1S

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

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

◆ GRP1Ss

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

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

◆ GRP2b

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

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

◆ GRP2b_cl

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

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

◆ GRP2b_one

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

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

◆ GRP2S

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

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

◆ GRP2S_cl

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

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

◆ GRP2S_one

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

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

◆ GRP3b

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

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

◆ GRP3S

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

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

◆ GRP4

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

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

◆ GRP5

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

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

◆ GRP6

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

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

◆ GRP7

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

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

◆ GRP8

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

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

◆ GRP9

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

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

◆ GRPAMD

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

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

◆ gs

#define gs   OP_REG, gs_reg

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

◆ gs_reg

#define gs_reg   105

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

◆ Gv

#define Gv   OP_G, v_mode

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

◆ Gw

#define Gw   OP_G, w_mode

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

◆ Ib

#define Ib   OP_I, b_mode

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

◆ indir_dx_reg

#define indir_dx_reg   150

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

◆ indirDX

#define indirDX   OP_IMREG, indir_dx_reg

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

◆ indirEb

#define indirEb   OP_indirE, b_mode

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

◆ indirEv

#define indirEv   OP_indirE, v_mode

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

◆ INTERNAL_DISASSEMBLER_ERROR

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

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

◆ Iq

#define Iq   OP_I, q_mode

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

◆ Iv

#define Iv   OP_I, v_mode

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

◆ Iv64

#define Iv64   OP_I64, v_mode

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

◆ Iw

#define Iw   OP_I, w_mode

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

◆ Jb

#define Jb   OP_J, b_mode

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

◆ Jv

#define Jv   OP_J, v_mode

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

◆ loop_jcxz_flag

#define loop_jcxz_flag   NULL, loop_jcxz_mode

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

◆ loop_jcxz_mode

#define loop_jcxz_mode   9

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

◆ M

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

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

◆ m_mode

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

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

◆ Ma

#define Ma   OP_E, v_mode

Definition at line 349 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 1281 of file i386-dis.c.

◆ Mp

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

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

◆ MS

#define MS   OP_MS, v_mode

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

◆ MX

#define MX   OP_MMX, 0

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

◆ NDEBUG

#define NDEBUG

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

◆ None

#define None   OP_E, 0

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

◆ Ob

#define Ob   OP_OFF, b_mode

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

◆ Ob64

#define Ob64   OP_OFF64, b_mode

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

◆ OPSIMD

#define OPSIMD   OP_SIMD_Suffix, 0

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

◆ OPSUF

#define OPSUF   OP_3DNowSuffix, 0

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

◆ Ov

#define Ov   OP_OFF, v_mode

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

◆ Ov64

#define Ov64   OP_OFF64, v_mode

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

◆ PARAMS

#define PARAMS (   X)    X

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

◆ PREFIX_ADDR

#define PREFIX_ADDR   0x400

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

◆ PREFIX_CS

#define PREFIX_CS   8

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

◆ PREFIX_DATA

#define PREFIX_DATA   0x200

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

◆ PREFIX_DS

#define PREFIX_DS   0x20

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

◆ PREFIX_ES

#define PREFIX_ES   0x40

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

◆ PREFIX_FS

#define PREFIX_FS   0x80

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

◆ PREFIX_FWAIT

#define PREFIX_FWAIT   0x800

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

◆ PREFIX_GS

#define PREFIX_GS   0x100

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

◆ PREFIX_LOCK

#define PREFIX_LOCK   4

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

◆ PREFIX_REPNZ

#define PREFIX_REPNZ   2

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

◆ PREFIX_REPZ

#define PREFIX_REPZ   1

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

◆ PREFIX_SS

#define PREFIX_SS   0x10

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

◆ PREGRP0

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

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

◆ PREGRP1

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

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

◆ PREGRP10

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

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

◆ PREGRP11

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

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

◆ PREGRP12

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

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

◆ PREGRP13

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

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

◆ PREGRP14

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

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

◆ PREGRP15

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

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

◆ PREGRP16

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

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

◆ PREGRP17

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

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

◆ PREGRP18

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

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

◆ PREGRP19

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

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

◆ PREGRP2

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

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

◆ PREGRP20

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

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

◆ PREGRP21

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

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

◆ PREGRP22

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

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

◆ PREGRP23

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

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

◆ PREGRP24

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

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

◆ PREGRP25

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

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

◆ PREGRP26

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

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

◆ PREGRP3

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

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

◆ PREGRP4

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

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

◆ PREGRP5

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

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

◆ PREGRP6

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

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

◆ PREGRP7

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

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

◆ PREGRP8

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

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

◆ PREGRP9

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

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

◆ PTR

#define PTR   void*

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

◆ q_mode

#define q_mode   5 /* quad word operand */

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

◆ rAX_reg

#define rAX_reg   132

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

◆ rBP_reg

#define rBP_reg   137

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

◆ rBX_reg

#define rBX_reg   135

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

◆ rCX_reg

#define rCX_reg   133

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

◆ Rd

#define Rd   OP_Rd, d_mode

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

◆ rDI_reg

#define rDI_reg   139

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

◆ rDX_reg

#define rDX_reg   134

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

◆ REX_EXTX

#define REX_EXTX   4

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

◆ REX_EXTY

#define REX_EXTY   2

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

◆ REX_EXTZ

#define REX_EXTZ   1

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

◆ REX_MODE64

#define REX_MODE64   8

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

◆ Rm

#define Rm   OP_Rd, m_mode

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

◆ RMAH

#define RMAH   OP_REG, ah_reg

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

◆ RMAL [1/2]

#define RMAL   OP_REG, al_reg

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

◆ RMAL [2/2]

#define RMAL   OP_REG, al_reg

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

◆ RMAX

#define RMAX   OP_REG, ax_reg

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

◆ RMBH

#define RMBH   OP_REG, bh_reg

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

◆ RMBL

#define RMBL   OP_REG, bl_reg

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

◆ RMCH

#define RMCH   OP_REG, ch_reg

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

◆ RMCL

#define RMCL   OP_REG, cl_reg

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

◆ RMDH

#define RMDH   OP_REG, dh_reg

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

◆ RMDL

#define RMDL   OP_REG, dl_reg

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

◆ RMDX

#define RMDX   OP_REG, dx_reg

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

◆ RMeAX

#define RMeAX   OP_REG, eAX_reg

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

◆ RMeBP

#define RMeBP   OP_REG, eBP_reg

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

◆ RMeBX

#define RMeBX   OP_REG, eBX_reg

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

◆ RMeCX

#define RMeCX   OP_REG, eCX_reg

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

◆ RMeDI

#define RMeDI   OP_REG, eDI_reg

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

◆ RMeDX

#define RMeDX   OP_REG, eDX_reg

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

◆ RMeSI

#define RMeSI   OP_REG, eSI_reg

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

◆ RMeSP

#define RMeSP   OP_REG, eSP_reg

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

◆ RMrAX

#define RMrAX   OP_REG, rAX_reg

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

◆ RMrBP

#define RMrBP   OP_REG, rBP_reg

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

◆ RMrBX

#define RMrBX   OP_REG, rBX_reg

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

◆ RMrCX

#define RMrCX   OP_REG, rCX_reg

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

◆ RMrDI

#define RMrDI   OP_REG, rDI_reg

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

◆ RMrDX

#define RMrDX   OP_REG, rDX_reg

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

◆ RMrSI

#define RMrSI   OP_REG, rSI_reg

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

◆ RMrSP

#define RMrSP   OP_REG, rSP_reg

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

◆ rSI_reg

#define rSI_reg   138

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

◆ rSP_reg

#define rSP_reg   136

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

◆ si_reg

#define si_reg   130

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

◆ sIb

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

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

◆ sp_reg

#define sp_reg   128

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

◆ sprintf_vma

#define sprintf_vma (   BUF,
  VMA 
)    sprintf(BUF, "%p", VMA)

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

◆ ss

#define ss   OP_REG, ss_reg

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

◆ ss_reg

#define ss_reg   102

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

◆ ST

#define ST   OP_ST, 0

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

◆ STi

#define STi   OP_STi, 0

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

◆ SUFFIX_ALWAYS

#define SUFFIX_ALWAYS   4

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

◆ Sw

#define Sw   OP_SEG, w_mode

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

◆ Td

#define Td   OP_T, d_mode

Definition at line 368 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 512 of file i386-dis.c.

◆ USE_PREFIX_USER_TABLE

#define USE_PREFIX_USER_TABLE   3

Definition at line 513 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:269
GLsizei const GLfloat * value
Definition: glext.h:6069

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

◆ v_mode

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

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

◆ w_mode

#define w_mode   3 /* word operand */

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

◆ X86_64_0

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

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

◆ X86_64_SPECIAL

#define X86_64_SPECIAL   4

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

◆ x_mode

#define x_mode   6

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

◆ Xb

#define Xb   OP_DSreg, eSI_reg

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

◆ XM

#define XM   OP_XMM, 0

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

◆ XS

#define XS   OP_XS, v_mode

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

◆ Xv

#define Xv   OP_DSreg, eSI_reg

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

◆ XX

#define XX   NULL, 0

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

◆ Yb

#define Yb   OP_ESreg, eDI_reg

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

◆ Yv

#define Yv   OP_ESreg, eDI_reg

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

Typedef Documentation

◆ bfd

typedef void* bfd

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

◆ bfd_arch

◆ bfd_byte

typedef unsigned char bfd_byte

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

◆ bfd_flavour

◆ bfd_signed_vma

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

◆ bfd_vma

typedef ULONG_PTR bfd_vma

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

◆ PARAMS

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

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

Enumeration Type Documentation

◆ bfd_architecture

Enumerator
bfd_arch_i386 
bfd_arch_i386 

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

22 {
24 } bfd_arch;
enum bfd_architecture bfd_arch

◆ bfd_endian

Enumerator
BFD_ENDIAN_BIG 
BIG_ENDIAN_LITTLE 
BFD_ENDIAN_UNKNOWN 
BFD_ENDIAN_BIG 
BIG_ENDIAN_LITTLE 
BFD_ENDIAN_UNKNOWN 

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

◆ bfd_flavour

Enumerator
bfd_target_unknown_flavour 
bfd_target_unknown_flavour 

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

Function Documentation

◆ append_seg()

append_seg ( )
static

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

3013 {
3014  if (prefixes & PREFIX_CS)
3015  {
3017  oappend ("%cs:" + intel_syntax);
3018  }
3019  if (prefixes & PREFIX_DS)
3020  {
3022  oappend ("%ds:" + intel_syntax);
3023  }
3024  if (prefixes & PREFIX_SS)
3025  {
3027  oappend ("%ss:" + intel_syntax);
3028  }
3029  if (prefixes & PREFIX_ES)
3030  {
3032  oappend ("%es:" + intel_syntax);
3033  }
3034  if (prefixes & PREFIX_FS)
3035  {
3037  oappend ("%fs:" + intel_syntax);
3038  }
3039  if (prefixes & PREFIX_GS)
3040  {
3042  oappend ("%gs:" + intel_syntax);
3043  }
3044 }
static int prefixes
Definition: i386-dis.c:266
static void oappend(char *s) const
Definition: i386-dis.c:3004
#define PREFIX_SS
Definition: i386-dis.c:297
#define PREFIX_FS
Definition: i386-dis.c:300
#define PREFIX_ES
Definition: i386-dis.c:299
#define PREFIX_GS
Definition: i386-dis.c:301
#define PREFIX_CS
Definition: i386-dis.c:296
#define PREFIX_DS
Definition: i386-dis.c:298
static int used_prefixes
Definition: i386-dis.c:290
static char intel_syntax
Definition: i386-dis.c:1986

Referenced by OP_DSreg().

◆ BadOp()

static void BadOp ( void  )
Initial value:
{
if (mod == 3)
static void int bytemode
Definition: i386-dis.c:3118
int sizeflag
Definition: i386-dis.c:3119
static void OP_EX(int, int)
Definition: i386-dis.c:4143
static int mod
Definition: i386-dis.c:1273

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

4296 {
4297  /* Throw away prefixes and 1st. opcode byte. */
4298  codep = insn_codep + 1;
4299  oappend ("(bad)");
4300 }
static void oappend(char *s) const
Definition: i386-dis.c:3004
static unsigned char * codep
Definition: i386-dis.c:1271
static unsigned char * insn_codep
Definition: i386-dis.c:1270

Referenced by if(), 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 1802 of file i386-dis.c.

1803 {
1804  int newrex;
1805  rex = 0;
1806  prefixes = 0;
1807  used_prefixes = 0;
1808  rex_used = 0;
1809  while (1)
1810  {
1811  FETCH_DATA (the_info, codep + 1);
1812  newrex = 0;
1813  switch (*codep)
1814  {
1815  /* REX prefixes family. */
1816  case 0x40:
1817  case 0x41:
1818  case 0x42:
1819  case 0x43:
1820  case 0x44:
1821  case 0x45:
1822  case 0x46:
1823  case 0x47:
1824  case 0x48:
1825  case 0x49:
1826  case 0x4a:
1827  case 0x4b:
1828  case 0x4c:
1829  case 0x4d:
1830  case 0x4e:
1831  case 0x4f:
1832  if (mode_64bit)
1833  newrex = *codep;
1834  else
1835  return;
1836  break;
1837  case 0xf3:
1838  prefixes |= PREFIX_REPZ;
1839  break;
1840  case 0xf2:
1842  break;
1843  case 0xf0:
1844  prefixes |= PREFIX_LOCK;
1845  break;
1846  case 0x2e:
1847  prefixes |= PREFIX_CS;
1848  break;
1849  case 0x36:
1850  prefixes |= PREFIX_SS;
1851  break;
1852  case 0x3e:
1853  prefixes |= PREFIX_DS;
1854  break;
1855  case 0x26:
1856  prefixes |= PREFIX_ES;
1857  break;
1858  case 0x64:
1859  prefixes |= PREFIX_FS;
1860  break;
1861  case 0x65:
1862  prefixes |= PREFIX_GS;
1863  break;
1864  case 0x66:
1865  prefixes |= PREFIX_DATA;
1866  break;
1867  case 0x67:
1868  prefixes |= PREFIX_ADDR;
1869  break;
1870  case FWAIT_OPCODE:
1871  /* fwait is really an instruction. If there are prefixes
1872  before the fwait, they belong to the fwait, *not* to the
1873  following instruction. */
1874  if (prefixes)
1875  {
1877  codep++;
1878  return;
1879  }
1881  break;
1882  default:
1883  return;
1884  }
1885  /* Rex is ignored when followed by another prefix. */
1886  if (rex)
1887  {
1888  oappend (prefix_name (rex, 0));
1889  oappend (" ");
1890  }
1891  rex = newrex;
1892  codep++;
1893  }
1894 }
static int prefixes
Definition: i386-dis.c:266
static void oappend(char *s) const
Definition: i386-dis.c:3004
#define PREFIX_ADDR
Definition: i386-dis.c:303
#define FETCH_DATA(info, addr)
Definition: i386-dis.c:309
#define PREFIX_DATA
Definition: i386-dis.c:302
static disassemble_info * the_info
Definition: i386-dis.c:1272
#define PREFIX_SS
Definition: i386-dis.c:297
static unsigned char * codep
Definition: i386-dis.c:1271
#define PREFIX_FS
Definition: i386-dis.c:300
#define PREFIX_ES
Definition: i386-dis.c:299
#define PREFIX_GS
Definition: i386-dis.c:301
#define PREFIX_LOCK
Definition: i386-dis.c:295
#define PREFIX_CS
Definition: i386-dis.c:296
static int rex
Definition: i386-dis.c:269
static int rex_used
Definition: i386-dis.c:271
#define PREFIX_REPNZ
Definition: i386-dis.c:294
#define PREFIX_FWAIT
Definition: i386-dis.c:304
static const char * prefix_name(int pref, int sizeflag)
Definition: i386-dis.c:1900
static int mode_64bit
Definition: i386-dis.c:263
#define PREFIX_DS
Definition: i386-dis.c:298
#define PREFIX_REPZ
Definition: i386-dis.c:293
static int used_prefixes
Definition: i386-dis.c:290
#define FWAIT_OPCODE
Definition: i386-dis.c:260

Referenced by print_insn().

◆ dofloat()

static void dofloat ( int  sizeflag)
static

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

2666 {
2667  const struct dis386 *dp;
2668  unsigned char floatop;
2669 
2670  floatop = codep[-1];
2671 
2672  if (mod != 3)
2673  {
2674  putop (float_mem[(floatop - 0xd8) * 8 + reg], sizeflag);
2675  obufp = op1out;
2676  if (floatop == 0xdb)
2677  OP_E (x_mode, sizeflag);
2678  else if (floatop == 0xdd)
2679  OP_E (d_mode, sizeflag);
2680  else
2681  OP_E (v_mode, sizeflag);
2682  return;
2683  }
2684  /* Skip mod/rm byte. */
2685  MODRM_CHECK;
2686  codep++;
2687 
2688  dp = &float_reg[floatop - 0xd8][reg];
2689  if (dp->name == NULL)
2690  {
2691  putop (fgrps[dp->bytemode1][rm], sizeflag);
2692 
2693  /* Instruction fnstsw is only one with strange arg. */
2694  if (floatop == 0xdf && codep[-1] == 0xe0)
2695  strcpy (op1out, names16[0]);
2696  }
2697  else
2698  {
2699  putop (dp->name, sizeflag);
2700 
2701  obufp = op1out;
2702  if (dp->op1)
2703  (*dp->op1) (dp->bytemode1, sizeflag);
2704  obufp = op2out;
2705  if (dp->op2)
2706  (*dp->op2) (dp->bytemode2, sizeflag);
2707  }
2708 }
static int putop(char *template, int sizeflag) const
Definition: i386-dis.c:2729
const char * name
Definition: i386-dis.c:575
static char op2out[100]
Definition: i386-dis.c:1971
static const char * float_mem[]
Definition: i386-dis.c:2422
static char * obufp
Definition: i386-dis.c:1267
#define x_mode
Definition: i386-dis.c:461
int bytemode1
Definition: i386-dis.c:577
static int rm
Definition: i386-dis.c:1274
static unsigned char * codep
Definition: i386-dis.c:1271
smooth NULL
Definition: ftsmooth.c:416
#define d_mode
Definition: i386-dis.c:459
int sizeflag
Definition: i386-dis.c:3119
static char * fgrps[][8]
Definition: i386-dis.c:2615
static void OP_E(int, int)
Definition: i386-dis.c:3226
static const struct dis386 float_reg[][8]
Definition: i386-dis.c:2510
static char op1out[100]
Definition: i386-dis.c:1971
static int reg
Definition: i386-dis.c:1275
int bytemode2
Definition: i386-dis.c:579
static const char ** names16
Definition: i386-dis.c:1285
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
op_rtn op1
Definition: i386-dis.c:576
#define MODRM_CHECK
Definition: i386-dis.c:1281
op_rtn op2
Definition: i386-dis.c:578
#define v_mode
Definition: i386-dis.c:457
static int mod
Definition: i386-dis.c:1273

Referenced by print_insn().

◆ fetch_data()

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

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

317 {
318  int status;
319  struct dis_private *priv = (struct dis_private *) info->private_data;
320  bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
321 
322  status = (*info->read_memory_func) (start,
323  priv->max_fetched,
324  addr - priv->max_fetched,
325  info);
326  if (status != 0)
327  {
328  /* If we did manage to read at least one byte, then
329  print_insn_i386 will do something sensible. Otherwise, print
330  an error. We do that here because this is where we know
331  STATUS. */
332  if (priv->max_fetched == priv->the_buffer)
333  (*info->memory_error_func) (status, start, info);
334  longjmp (priv->bailout, 1);
335  }
336  else
337  priv->max_fetched = addr;
338  return 1;
339 }
jmp_buf bailout
Definition: i386-dis.c:255
ULONG_PTR bfd_vma
Definition: i386-dis.c:25
bfd_vma insn_start
Definition: i386-dis.c:253
bfd_byte * max_fetched
Definition: i386-dis.c:251
int longjmp(jmp_buf buf, int retval)
GLenum const GLvoid * addr
Definition: glext.h:9621
bfd_byte the_buffer[MAXLEN]
Definition: i386-dis.c:252
GLuint start
Definition: gl.h:1545
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ get16()

static int get16 ( void  )
static

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

3499 {
3500  int x = 0;
3501 
3502  FETCH_DATA (the_info, codep + 2);
3503  x = *codep++ & 0xff;
3504  x |= (*codep++ & 0xff) << 8;
3505  return x;
3506 }
#define FETCH_DATA(info, addr)
Definition: i386-dis.c:309
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static disassemble_info * the_info
Definition: i386-dis.c:1272
static unsigned char * codep
Definition: i386-dis.c:1271

Referenced by if(), and OP_sI().

◆ get32()

static bfd_signed_vma get32 ( void  )
static

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

3470 {
3471  bfd_signed_vma x = 0;
3472 
3473  FETCH_DATA (the_info, codep + 4);
3474  x = *codep++ & (bfd_signed_vma) 0xff;
3475  x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
3476  x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
3477  x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
3478  return x;
3479 }
#define FETCH_DATA(info, addr)
Definition: i386-dis.c:309
LONG_PTR bfd_signed_vma
Definition: i386-dis.c:29
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static disassemble_info * the_info
Definition: i386-dis.c:1272
static unsigned char * codep
Definition: i386-dis.c:1271

Referenced by if().

◆ get32s()

static bfd_signed_vma get32s ( void  )
static

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

3483 {
3484  bfd_signed_vma x = 0;
3485 
3486  FETCH_DATA (the_info, codep + 4);
3487  x = *codep++ & (bfd_signed_vma) 0xff;
3488  x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
3489  x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
3490  x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
3491 
3492  x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);
3493 
3494  return x;
3495 }
#define FETCH_DATA(info, addr)
Definition: i386-dis.c:309
LONG_PTR bfd_signed_vma
Definition: i386-dis.c:29
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static disassemble_info * the_info
Definition: i386-dis.c:1272
static unsigned char * codep
Definition: i386-dis.c:1271

Referenced by if(), and OP_sI().

◆ get64()

static bfd_vma get64 ( void  )
static

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

3445 {
3446  bfd_vma x;
3447 #ifdef BFD64
3448  unsigned int a;
3449  unsigned int b;
3450 
3451  FETCH_DATA (the_info, codep + 8);
3452  a = *codep++ & 0xff;
3453  a |= (*codep++ & 0xff) << 8;
3454  a |= (*codep++ & 0xff) << 16;
3455  a |= (*codep++ & 0xff) << 24;
3456  b = *codep++ & 0xff;
3457  b |= (*codep++ & 0xff) << 8;
3458  b |= (*codep++ & 0xff) << 16;
3459  b |= (*codep++ & 0xff) << 24;
3460  x = a + ((bfd_vma) b << 32);
3461 #else
3462  abort ();
3463  x = 0;
3464 #endif
3465  return x;
3466 }
ULONG_PTR bfd_vma
Definition: i386-dis.c:25
#define FETCH_DATA(info, addr)
Definition: i386-dis.c:309
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static disassemble_info * the_info
Definition: i386-dis.c:1272
#define a
Definition: ke_i.h:78
static unsigned char * codep
Definition: i386-dis.c:1271
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define abort()
Definition: i386-dis.c:35
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ if() [1/8]

if ( rex REX_EXTZ) = 8

◆ if() [2/8]

if ( mod  = = 3)

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

3133  {
3134  switch (bytemode)
3135  {
3136  case b_mode:
3137  USED_REX (0);
3138  if (rex)
3139  oappend (names8rex[rm + add]);
3140  else
3141  oappend (names8[rm + add]);
3142  break;
3143  case w_mode:
3144  oappend (names16[rm + add]);
3145  break;
3146  case d_mode:
3147  oappend (names32[rm + add]);
3148  break;
3149  case q_mode:
3150  oappend (names64[rm + add]);
3151  break;
3152  case m_mode:
3153  if (mode_64bit)
3154  oappend (names64[rm + add]);
3155  else
3156  oappend (names32[rm + add]);
3157  break;
3158  case v_mode:
3159  USED_REX (REX_MODE64);
3160  if (rex & REX_MODE64)
3161  oappend (names64[rm + add]);
3162  else if (sizeflag & DFLAG)
3163  oappend (names32[rm + add]);
3164  else
3165  oappend (names16[rm + add]);
3167  break;
3168  case 0:
3169  if (!(codep[-2] == 0xAE && codep[-1] == 0xF8 /* sfence */)
3170  && !(codep[-2] == 0xAE && codep[-1] == 0xF0 /* mfence */)
3171  && !(codep[-2] == 0xAE && codep[-1] == 0xe8 /* lfence */))
3172  BadOp (); /* bad sfence,lea,lds,les,lfs,lgs,lss modrm */
3173  break;
3174  default:
3176  break;
3177  }
3178  return;
3179  }
static const char ** names64
Definition: i386-dis.c:1283
static int prefixes
Definition: i386-dis.c:266
int add
Definition: i386-dis.c:3122
#define w_mode
Definition: i386-dis.c:458
#define m_mode
Definition: i386-dis.c:462
static const char ** names32
Definition: i386-dis.c:1284
static void oappend(char *s) const
Definition: i386-dis.c:3004
#define PREFIX_DATA
Definition: i386-dis.c:302
static int rm
Definition: i386-dis.c:1274
static const char ** names8rex
Definition: i386-dis.c:1287
static const char ** names8
Definition: i386-dis.c:1286
static unsigned char * codep
Definition: i386-dis.c:1271
else BadOp()
Definition: i386-dis.c:4295
static void int bytemode
Definition: i386-dis.c:3118
#define q_mode
Definition: i386-dis.c:460
#define d_mode
Definition: i386-dis.c:459
static int rex
Definition: i386-dis.c:269
int sizeflag
Definition: i386-dis.c:3119
#define REX_MODE64
Definition: i386-dis.c:272
static int mode_64bit
Definition: i386-dis.c:263
#define b_mode
Definition: i386-dis.c:456
#define USED_REX(value)
Definition: i386-dis.c:280
#define INTERNAL_DISASSEMBLER_ERROR
Definition: i386-dis.c:1799
static const char ** names16
Definition: i386-dis.c:1285
static int used_prefixes
Definition: i386-dis.c:290
#define DFLAG
Definition: i386-dis.c:454
#define v_mode
Definition: i386-dis.c:457

◆ if() [3/8]

if ( (sizeflag &AFLAG)||  mode_64bit)

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

3185  {
3186  int havesib;
3187  int havebase;
3188  int base;
3189  int index = 0;
3190  int scale = 0;
3191 
3192  havesib = 0;
3193  havebase = 1;
3194  base = rm;
3195 
3196  if (base == 4)
3197  {
3198  havesib = 1;
3199  FETCH_DATA (the_info, codep + 1);
3200  scale = (*codep >> 6) & 3;
3201  index = (*codep >> 3) & 7;
3202  base = *codep & 7;
3203  USED_REX (REX_EXTY);
3204  USED_REX (REX_EXTZ);
3205  if (rex & REX_EXTY)
3206  index += 8;
3207  if (rex & REX_EXTZ)
3208  base += 8;
3209  codep++;
3210  }
3211 
3212  switch (mod)
3213  {
3214  case 0:
3215  if ((base & 7) == 5)
3216  {
3217  havebase = 0;
3218  if (mode_64bit && !havesib && (sizeflag & AFLAG))
3219  riprel = 1;
3220  disp = get32s ();
3221  }
3222  break;
3223  case 1:
3224  FETCH_DATA (the_info, codep + 1);
3225  disp = *codep++;
3226  if ((disp & 0x80) != 0)
3227  disp -= 0x100;
3228  break;
3229  case 2:
3230  disp = get32s ();
3231  break;
3232  }
3233 
3234  if (!intel_syntax)
3235  if (mod != 0 || (base & 7) == 5)
3236  {
3238  oappend (scratchbuf);
3239  if (riprel)
3240  {
3241  set_op (disp, 1);
3242  oappend ("(%rip)");
3243  }
3244  }
3245 
3246  if (havebase || (havesib && (index != 4 || scale != 0)))
3247  {
3248  if (intel_syntax)
3249  {
3250  switch (bytemode)
3251  {
3252  case b_mode:
3253  oappend ("BYTE PTR ");
3254  break;
3255  case w_mode:
3256  oappend ("WORD PTR ");
3257  break;
3258  case v_mode:
3259  oappend ("DWORD PTR ");
3260  break;
3261  case d_mode:
3262  oappend ("QWORD PTR ");
3263  break;
3264  case m_mode:
3265  if (mode_64bit)
3266  oappend ("DWORD PTR ");
3267  else
3268  oappend ("QWORD PTR ");
3269  break;
3270  case x_mode:
3271  oappend ("XWORD PTR ");
3272  break;
3273  default:
3274  break;
3275  }
3276  }
3277  *obufp++ = open_char;
3278  if (intel_syntax && riprel)
3279  oappend ("rip + ");
3280  *obufp = '\0';
3281  USED_REX (REX_EXTZ);
3282  if (!havesib && (rex & REX_EXTZ))
3283  base += 8;
3284  if (havebase)
3286  ? names64[base] : names32[base]);
3287  if (havesib)
3288  {
3289  if (index != 4)
3290  {
3291  if (intel_syntax)
3292  {
3293  if (havebase)
3294  {
3295  *obufp++ = separator_char;
3296  *obufp = '\0';
3297  }
3298  sprintf (scratchbuf, "%s",
3299  mode_64bit && (sizeflag & AFLAG)
3300  ? names64[index] : names32[index]);
3301  }
3302  else
3303  sprintf (scratchbuf, ",%s",
3304  mode_64bit && (sizeflag & AFLAG)
3305  ? names64[index] : names32[index]);
3306  oappend (scratchbuf);
3307  }
3308  if (!intel_syntax
3309  || (intel_syntax
3310  && bytemode != b_mode
3311  && bytemode != w_mode
3312  && bytemode != v_mode))
3313  {
3314  *obufp++ = scale_char;
3315  *obufp = '\0';
3316  sprintf (scratchbuf, "%d", 1 << scale);
3317  oappend (scratchbuf);
3318  }
3319  }
3320  if (intel_syntax)
3321  if (mod != 0 || (base & 7) == 5)
3322  {
3323  /* Don't print zero displacements. */
3324  if (disp != 0)
3325  {
3326  if ((bfd_signed_vma) disp > 0)
3327  {
3328  *obufp++ = '+';
3329  *obufp = '\0';
3330  }
3331 
3333  oappend (scratchbuf);
3334  }
3335  }
3336 
3337  *obufp++ = close_char;
3338  *obufp = '\0';
3339  }
3340  else if (intel_syntax)
3341  {
3342  if (mod != 0 || (base & 7) == 5)
3343  {
3345  | PREFIX_ES | PREFIX_FS | PREFIX_GS))
3346  ;
3347  else
3348  {
3350  oappend (":");
3351  }
3353  oappend (scratchbuf);
3354  }
3355  }
3356  }
static const char ** names64
Definition: i386-dis.c:1283
static int prefixes
Definition: i386-dis.c:266
#define w_mode
Definition: i386-dis.c:458
disp
Definition: i386-dis.c:3181
#define m_mode
Definition: i386-dis.c:462
#define es_reg
Definition: i386-dis.c:466
static const char ** names32
Definition: i386-dis.c:1284
#define REX_EXTZ
Definition: i386-dis.c:275
int riprel
Definition: i386-dis.c:3123
static char * obufp
Definition: i386-dis.c:1267
static void oappend(char *s) const
Definition: i386-dis.c:3004
#define x_mode
Definition: i386-dis.c:461
#define FETCH_DATA(info, addr)
Definition: i386-dis.c:309
LONG_PTR bfd_signed_vma
Definition: i386-dis.c:29
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
static bfd_signed_vma get32s()
Definition: i386-dis.c:3482
#define ds_reg
Definition: i386-dis.c:469
static char close_char
Definition: i386-dis.c:1988
static disassemble_info * the_info
Definition: i386-dis.c:1272
#define PREFIX_SS
Definition: i386-dis.c:297
static int rm
Definition: i386-dis.c:1274
static char open_char
Definition: i386-dis.c:1987
GLuint base
Definition: 3dtext.c:35
static unsigned char * codep
Definition: i386-dis.c:1271
#define PREFIX_FS
Definition: i386-dis.c:300
#define PREFIX_ES
Definition: i386-dis.c:299
static char separator_char
Definition: i386-dis.c:1989
static void int bytemode
Definition: i386-dis.c:3118
static void print_operand_value(char *buf, int hex, bfd_vma disp)
Definition: i386-dis.c:3057
#define PREFIX_GS
Definition: i386-dis.c:301
GLuint index
Definition: glext.h:6031
static char scale_char
Definition: i386-dis.c:1990
#define d_mode
Definition: i386-dis.c:459
#define PREFIX_CS
Definition: i386-dis.c:296
static void set_op(bfd_vma op, int riprel)
Definition: i386-dis.c:3509
static int rex
Definition: i386-dis.c:269
int sizeflag
Definition: i386-dis.c:3119
static const char ** names_seg
Definition: i386-dis.c:1288
static int mode_64bit
Definition: i386-dis.c:263
#define b_mode
Definition: i386-dis.c:456
#define USED_REX(value)
Definition: i386-dis.c:280
int sprintf(char *str, const char *format,...)
Definition: utprint.c:762
#define PREFIX_DS
Definition: i386-dis.c:298
static char scratchbuf[100]
Definition: i386-dis.c:1268
static char intel_syntax
Definition: i386-dis.c:1986
#define REX_EXTY
Definition: i386-dis.c:274
#define AFLAG
Definition: i386-dis.c:453
#define v_mode
Definition: i386-dis.c:457
static int mod
Definition: i386-dis.c:1273

◆ if() [4/8]

if ( mode_64bit)

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

3701  {
3702  OP_I (bytemode, sizeflag);
3703  return;
3704  }
static void int bytemode
Definition: i386-dis.c:3118
int sizeflag
Definition: i386-dis.c:3119
static void OP_I(int, int)
Definition: i386-dis.c:3737

◆ if() [5/8]

if ( sizeflag DFLAG)

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

3850  {
3851  offset = get32 ();
3852  seg = get16 ();
3853  }
static int get16()
Definition: i386-dis.c:3498
static bfd_signed_vma get32()
Definition: i386-dis.c:3469
GLintptr offset
Definition: glext.h:5920
seg
Definition: i386-dis.c:3857

◆ if() [6/8]

if ( intel_syntax  )

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

3871 {
3872  bfd_vma off;
3873 
3874  append_seg ();
3875 
3876  if ((sizeflag & AFLAG) || mode_64bit)
3877  off = get32 ();
3878  else
3879  off = get16 ();
3880 
3881  if (intel_syntax)
3882  {
3883  if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
3884  | PREFIX_ES | PREFIX_FS | PREFIX_GS)))
3885  {
3887  oappend (":");
3888  }
3889  }
3891  oappend (scratchbuf);
3892 }
ULONG_PTR bfd_vma
Definition: i386-dis.c:25
static int prefixes
Definition: i386-dis.c:266
#define es_reg
Definition: i386-dis.c:466
static void oappend(char *s) const
Definition: i386-dis.c:3004
static int get16()
Definition: i386-dis.c:3498
static void append_seg()
Definition: i386-dis.c:3012
static bfd_signed_vma get32()
Definition: i386-dis.c:3469
#define ds_reg
Definition: i386-dis.c:469
#define PREFIX_SS
Definition: i386-dis.c:297
#define PREFIX_FS
Definition: i386-dis.c:300
#define PREFIX_ES
Definition: i386-dis.c:299
static void print_operand_value(char *buf, int hex, bfd_vma disp)
Definition: i386-dis.c:3057
#define PREFIX_GS
Definition: i386-dis.c:301
#define PREFIX_CS
Definition: i386-dis.c:296
int sizeflag
Definition: i386-dis.c:3119
static const char ** names_seg
Definition: i386-dis.c:1288
static int mode_64bit
Definition: i386-dis.c:263
#define PREFIX_DS
Definition: i386-dis.c:298
static char scratchbuf[100]
Definition: i386-dis.c:1268
static char intel_syntax
Definition: i386-dis.c:1986
#define AFLAG
Definition: i386-dis.c:453
off
Definition: i386-dis.c:3909

◆ if() [7/8]

if ( prefixes PREFIX_DATA)

◆ if() [8/8]

if ( mod = 3)
Initial value:
{
int add = 0
int add
Definition: i386-dis.c:3122

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

4066  {
4067  OP_E (bytemode, sizeflag);
4068  return;
4069  }
static void int bytemode
Definition: i386-dis.c:3118
int sizeflag
Definition: i386-dis.c:3119
static void OP_E(int, int)
Definition: i386-dis.c:3226

◆ KdbpDisassemble()

LONG KdbpDisassemble ( IN ULONG_PTR  Address,
IN ULONG  IntelSyntax 
)

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

124 {
126 
127  info.fprintf_func = KdbpPrintDisasm;
128  info.stream = NULL;
129  info.application_data = NULL;
131  info.arch = bfd_arch_i386;
133  info.insn_sets = 0;
134  info.flags = 0;
135  info.read_memory_func = KdbpReadMemory;
136  info.memory_error_func = KdbpMemoryError;
137  info.print_address_func = KdbpPrintAddressInCode;
138  info.symbol_at_address_func = NULL;
139  info.buffer = NULL;
140  info.buffer_vma = info.buffer_length = 0;
141  info.bytes_per_chunk = 0;
142  info.display_endian = BIG_ENDIAN_LITTLE;
143  info.disassembler_options = NULL;
144 
145  return(print_insn_i386(Address, &info));
146 }
int KdbpPrintDisasm(void *Ignored, const char *fmt,...)
Definition: i386-dis.c:48
struct _test_info info[]
Definition: SetCursorPos.c:19
#define bfd_mach_i386_i386
Definition: i386-dis.c:33
static void KdbpPrintAddressInCode(ULONG_PTR Addr, struct disassemble_info *Ignored)
Definition: i386-dis.c:81
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
static int KdbpReadMemory(ULONG_PTR Addr, unsigned char *Data, unsigned int Length, struct disassemble_info *Ignored)
Definition: i386-dis.c:68
#define bfd_mach_i386_i386_intel_syntax
Definition: i386-dis.c:32
int print_insn_i386(bfd_vma pc, struct disassemble_info *info)
Definition: i386-dis.c:2016
static void KdbpMemoryError(int Status, ULONG_PTR Addr, struct disassemble_info *Ignored)
Definition: i386-dis.c:75

Referenced by KdbpCliMainLoop(), and KdbpCmdDisassembleX().

◆ KdbpGetInstLength()

LONG KdbpGetInstLength ( IN ULONG_PTR  Address)

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

98 {
100 
101  info.fprintf_func = KdbpNopPrintDisasm;
102  info.stream = NULL;
103  info.application_data = NULL;
105  info.arch = bfd_arch_i386;
106  info.mach = bfd_mach_x86_64;
107  info.insn_sets = 0;
108  info.flags = 0;
109  info.read_memory_func = KdbpReadMemory;
110  info.memory_error_func = KdbpMemoryError;
111  info.print_address_func = KdbpNopPrintAddress;
112  info.symbol_at_address_func = NULL;
113  info.buffer = NULL;
114  info.buffer_vma = info.buffer_length = 0;
115  info.bytes_per_chunk = 0;
116  info.display_endian = BIG_ENDIAN_LITTLE;
117  info.disassembler_options = NULL;
118 
119  return(print_insn_i386(Address, &info));
120 }
static void KdbpNopPrintAddress(ULONG_PTR Addr, struct disassemble_info *Ignored)
Definition: i386-dis.c:90
struct _test_info info[]
Definition: SetCursorPos.c:19
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
static int KdbpReadMemory(ULONG_PTR Addr, unsigned char *Data, unsigned int Length, struct disassemble_info *Ignored)
Definition: i386-dis.c:68
#define bfd_mach_x86_64
Definition: i386-dis.c:31
int print_insn_i386(bfd_vma pc, struct disassemble_info *info)
Definition: i386-dis.c:2016
static void KdbpMemoryError(int Status, ULONG_PTR Addr, struct disassemble_info *Ignored)
Definition: i386-dis.c:75
int KdbpNopPrintDisasm(void *Ignored, const char *fmt,...)
Definition: i386-dis.c:62

Referenced by KdbpStepOverInstruction().

◆ KdbpMemoryError()

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

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

77 {
78 }

Referenced by KdbpDisassemble(), and KdbpGetInstLength().

◆ KdbpNopPrintAddress()

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

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

91 {
92 }

Referenced by KdbpGetInstLength().

◆ KdbpNopPrintDisasm()

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

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

63 {
64  return(0);
65 }

Referenced by KdbpGetInstLength().

◆ KdbpPrintAddressInCode()

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

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

82 {
83  if (!KdbSymPrintAddress((void*)Addr))
84  {
85  DbgPrint("<%p>", Addr);
86  }
87 }
BOOLEAN KdbSymPrintAddress(IN PVOID Address, IN PKTRAP_FRAME Context)
Print address...
Definition: kdb_symbols.c:148
#define DbgPrint
Definition: loader.c:25

Referenced by KdbpDisassemble().

◆ KdbpPrintDisasm()

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

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

49 {
50  va_list ap;
51  static char buffer[256];
52  int ret;
53 
54  va_start(ap, fmt);
55  ret = vsprintf(buffer, fmt, ap);
56  DbgPrint("%s", buffer);
57  va_end(ap);
58  return(ret);
59 }
#define DbgPrint
Definition: loader.c:25
GLuint buffer
Definition: glext.h:5915
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
int ret
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
#define va_start(ap, A)
Definition: acmsvcex.h:91
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
Definition: dsound.c:943

Referenced by KdbpDisassemble().

◆ KdbpReadMemory()

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

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

70 {
71  return KdbpSafeReadMemory(Data, (void *)Addr, Length); /* 0 means no error */
72 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
NTSTATUS KdbpSafeReadMemory(OUT PVOID Dest, IN PVOID Src, IN ULONG Bytes)
Definition: kdb.c:1734

Referenced by KdbpDisassemble(), and KdbpGetInstLength().

◆ oappend() [1/4]

static void oappend ( char s) const
static

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

3006 {
3007  strcpy (obufp, s);
3008  obufp += strlen (s);
3009 }
static char * obufp
Definition: i386-dis.c:1267
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLdouble s
Definition: gl.h:2039
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by append_seg(), BadOp(), ckprefix(), if(), OP_3DNowSuffix(), OP_ESreg(), OP_indirE(), OP_sI(), OP_SIMD_Suffix(), OP_STi(), print_insn(), ptr_reg(), and switch().

◆ oappend() [2/4]

◆ oappend() [3/4]

oappend ( scratchbuf intel_syntax)

◆ oappend() [4/4]

oappend ( scratchbuf  )

◆ OP_3DNowSuffix()

static void OP_3DNowSuffix ( bytemode  ,
sizeflag   
)
static

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

4200 {
4201  const char *mnemonic;
4202 
4203  FETCH_DATA (the_info, codep + 1);
4204  /* AMD 3DNow! instructions are specified by an opcode suffix in the
4205  place where an 8-bit immediate would normally go. ie. the last
4206  byte of the instruction. */
4207  obufp = obuf + strlen (obuf);
4208  mnemonic = Suffix3DNow[*codep++ & 0xff];
4209  if (mnemonic)
4210  oappend (mnemonic);
4211  else
4212  {
4213  /* Since a variable sized modrm/sib chunk is between the start
4214  of the opcode (0x0f0f) and the opcode suffix, we need to do
4215  all the modrm processing first, and don't know until now that
4216  we have a bad opcode. This necessitates some cleaning up. */
4217  op1out[0] = '\0';
4218  op2out[0] = '\0';
4219  BadOp ();
4220  }
4221 }
static char op2out[100]
Definition: i386-dis.c:1971
static char * obufp
Definition: i386-dis.c:1267
static void oappend(char *s) const
Definition: i386-dis.c:3004
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define FETCH_DATA(info, addr)
Definition: i386-dis.c:309
static const char * Suffix3DNow[]
Definition: i386-dis.c:4129
static disassemble_info * the_info
Definition: i386-dis.c:1272
static unsigned char * codep
Definition: i386-dis.c:1271
else BadOp()
Definition: i386-dis.c:4295
static char obuf[100]
Definition: i386-dis.c:1266
static char op1out[100]
Definition: i386-dis.c:1971

◆ OP_DSreg()

static void OP_DSreg ( int  code,
int  sizeflag 
)
static

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

3967 {
3968  if ((prefixes
3969  & (PREFIX_CS
3970  | PREFIX_DS
3971  | PREFIX_SS
3972  | PREFIX_ES
3973  | PREFIX_FS
3974  | PREFIX_GS)) == 0)
3975  prefixes |= PREFIX_DS;
3976  append_seg ();
3977  ptr_reg (code, sizeflag);
3978 }
static int prefixes
Definition: i386-dis.c:266
static void append_seg()
Definition: i386-dis.c:3012
#define PREFIX_SS
Definition: i386-dis.c:297
#define PREFIX_FS
Definition: i386-dis.c:300
#define PREFIX_ES
Definition: i386-dis.c:299
#define PREFIX_GS
Definition: i386-dis.c:301
#define PREFIX_CS
Definition: i386-dis.c:296
int sizeflag
Definition: i386-dis.c:3119
static void ptr_reg(int code, int sizeflag)
Definition: i386-dis.c:3925
#define PREFIX_DS
Definition: i386-dis.c:298

◆ OP_ESreg()

static void OP_ESreg ( int  code,
int  sizeflag 
)
static

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

3958 {
3959  oappend ("%es:" + intel_syntax);
3960  ptr_reg (code, sizeflag);
3961 }
static void oappend(char *s) const
Definition: i386-dis.c:3004
int sizeflag
Definition: i386-dis.c:3119
static void ptr_reg(int code, int sizeflag)
Definition: i386-dis.c:3925
static char intel_syntax
Definition: i386-dis.c:1986

◆ OP_indirE()

static void OP_indirE ( int  bytemode,
int  sizeflag 
)
static

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

3050 {
3051  if (!intel_syntax)
3052  oappend ("*");
3053  OP_E (bytemode, sizeflag);
3054 }
static void oappend(char *s) const
Definition: i386-dis.c:3004
static void int bytemode
Definition: i386-dis.c:3118
int sizeflag
Definition: i386-dis.c:3119
static void OP_E(int, int)
Definition: i386-dis.c:3226
static char intel_syntax
Definition: i386-dis.c:1986

◆ OP_Rd()

static void OP_Rd ( int  bytemode,
int  sizeflag 
)
static

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

4022 {
4023  if (mod == 3)
4024  OP_E (bytemode, sizeflag);
4025  else
4026  BadOp ();
4027 }
else BadOp()
Definition: i386-dis.c:4295
static void int bytemode
Definition: i386-dis.c:3118
int sizeflag
Definition: i386-dis.c:3119
static void OP_E(int, int)
Definition: i386-dis.c:3226
static int mod
Definition: i386-dis.c:1273

◆ OP_sI()

static void OP_sI ( int  bytemode,
int  sizeflag 
)
static

Definition at line 3746 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  if ((op & 0x80) != 0)
3759  op -= 0x100;
3760  mask = 0xffffffff;
3761  break;
3762  case v_mode:
3763  USED_REX (REX_MODE64);
3764  if (rex & REX_MODE64)
3765  op = get32s ();
3766  else if (sizeflag & DFLAG)
3767  {
3768  op = get32s ();
3769  mask = 0xffffffff;
3770  }
3771  else
3772  {
3773  mask = 0xffffffff;
3774  op = get16 ();
3775  if ((op & 0x8000) != 0)
3776  op -= 0x10000;
3777  }
3779  break;
3780  case w_mode:
3781  op = get16 ();
3782  mask = 0xffffffff;
3783  if ((op & 0x8000) != 0)
3784  op -= 0x10000;
3785  break;
3786  default:
3788  return;
3789  }
3790 
3791  scratchbuf[0] = '$';
3792  print_operand_value (scratchbuf + 1, 1, op);
3794 }
static int prefixes
Definition: i386-dis.c:266
#define w_mode
Definition: i386-dis.c:458
static void oappend(char *s) const
Definition: i386-dis.c:3004
static int get16()
Definition: i386-dis.c:3498
#define FETCH_DATA(info, addr)
Definition: i386-dis.c:309
LONG_PTR bfd_signed_vma
Definition: i386-dis.c:29
static bfd_signed_vma get32s()
Definition: i386-dis.c:3482
#define PREFIX_DATA
Definition: i386-dis.c:302
static disassemble_info * the_info
Definition: i386-dis.c:1272
GLenum GLint GLuint mask
Definition: glext.h:6028
static unsigned char * codep
Definition: i386-dis.c:1271
static void int bytemode
Definition: i386-dis.c:3118
static void print_operand_value(char *buf, int hex, bfd_vma disp)
Definition: i386-dis.c:3057
static int rex
Definition: i386-dis.c:269
int sizeflag
Definition: i386-dis.c:3119
#define REX_MODE64
Definition: i386-dis.c:272
#define b_mode
Definition: i386-dis.c:456
#define USED_REX(value)
Definition: i386-dis.c:280
#define INTERNAL_DISASSEMBLER_ERROR
Definition: i386-dis.c:1799
static char scratchbuf[100]
Definition: i386-dis.c:1268
UINT op
Definition: effect.c:223
static int used_prefixes
Definition: i386-dis.c:290
static char intel_syntax
Definition: i386-dis.c:1986
#define DFLAG
Definition: i386-dis.c:454
#define v_mode
Definition: i386-dis.c:457

◆ OP_SIMD_Suffix()

static void OP_SIMD_Suffix ( bytemode  ,
sizeflag   
)
static

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

4238 {
4239  unsigned int cmp_type;
4240 
4241  FETCH_DATA (the_info, codep + 1);
4242  obufp = obuf + strlen (obuf);
4243  cmp_type = *codep++ & 0xff;
4244  if (cmp_type < 8)
4245  {
4246  char suffix1 = 'p', suffix2 = 's';
4248  if (prefixes & PREFIX_REPZ)
4249  suffix1 = 's';
4250  else
4251  {
4253  if (prefixes & PREFIX_DATA)
4254  suffix2 = 'd';
4255  else
4256  {
4258  if (prefixes & PREFIX_REPNZ)
4259  suffix1 = 's', suffix2 = 'd';
4260  }
4261  }
4262  sprintf (scratchbuf, "cmp%s%c%c",
4263  simd_cmp_op[cmp_type], suffix1, suffix2);
4265  oappend (scratchbuf);
4266  }
4267  else
4268  {
4269  /* We have a bad extension byte. Clean up. */
4270  op1out[0] = '\0';
4271  op2out[0] = '\0';
4272  BadOp ();
4273  }
4274 }
static int prefixes
Definition: i386-dis.c:266
static char op2out[100]
Definition: i386-dis.c:1971
static char * obufp
Definition: i386-dis.c:1267
static void oappend(char *s) const
Definition: i386-dis.c:3004
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define FETCH_DATA(info, addr)
Definition: i386-dis.c:309
#define PREFIX_DATA
Definition: i386-dis.c:302
static disassemble_info * the_info
Definition: i386-dis.c:1272
static unsigned char * codep
Definition: i386-dis.c:1271
else BadOp()
Definition: i386-dis.c:4295
#define PREFIX_REPNZ
Definition: i386-dis.c:294
static const char * simd_cmp_op[]
Definition: i386-dis.c:4223
static char obuf[100]
Definition: i386-dis.c:1266
static char op1out[100]
Definition: i386-dis.c:1971
int sprintf(char *str, const char *format,...)
Definition: utprint.c:762
static char scratchbuf[100]
Definition: i386-dis.c:1268
#define PREFIX_REPZ
Definition: i386-dis.c:293
static int used_prefixes
Definition: i386-dis.c:290

◆ OP_STi()

static void OP_STi ( bytemode  ,
sizeflag   
)
static

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

2722 {
2723  sprintf (scratchbuf, "%%st(%d)", rm);
2725 }
static void oappend(char *s) const
Definition: i386-dis.c:3004
static int rm
Definition: i386-dis.c:1274
int sprintf(char *str, const char *format,...)
Definition: utprint.c:762
static char scratchbuf[100]
Definition: i386-dis.c:1268
static char intel_syntax
Definition: i386-dis.c:1986

◆ PARAMS() [1/9]

static int fetch_data PARAMS ( (struct disassemble_info *, bfd_byte *)  )
static

◆ PARAMS() [2/9]

static void ckprefix PARAMS ( (void )
static

◆ PARAMS() [3/9]

static const char* prefix_name PARAMS ( (int, int )
static

◆ PARAMS() [4/9]

static int print_insn PARAMS ( (bfd_vma, disassemble_info *)  )
static

◆ PARAMS() [5/9]

static void dofloat PARAMS ( (int )
static

◆ PARAMS() [6/9]

static int putop PARAMS ( (const char *, int )
static

◆ PARAMS() [7/9]

static void oappend PARAMS ( (const char *)  )
static

◆ PARAMS() [8/9]

static void print_operand_value PARAMS ( (char *, int, bfd_vma )
static

◆ PARAMS() [9/9]

static void set_op PARAMS ( (bfd_vma, int )
static

◆ prefix_name()

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

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

1903 {
1904  switch (pref)
1905  {
1906  /* REX prefixes family. */
1907  case 0x40:
1908  return "rex";
1909  case 0x41:
1910  return "rexZ";
1911  case 0x42:
1912  return "rexY";
1913  case 0x43:
1914  return "rexYZ";
1915  case 0x44:
1916  return "rexX";
1917  case 0x45:
1918  return "rexXZ";
1919  case 0x46:
1920  return "rexXY";
1921  case 0x47:
1922  return "rexXYZ";
1923  case 0x48:
1924  return "rex64";
1925  case 0x49:
1926  return "rex64Z";
1927  case 0x4a:
1928  return "rex64Y";
1929  case 0x4b:
1930  return "rex64YZ";
1931  case 0x4c:
1932  return "rex64X";
1933  case 0x4d:
1934  return "rex64XZ";
1935  case 0x4e:
1936  return "rex64XY";
1937  case 0x4f:
1938  return "rex64XYZ";
1939  case 0xf3:
1940  return "repz";
1941  case 0xf2:
1942  return "repnz";
1943  case 0xf0:
1944  return "lock";
1945  case 0x2e:
1946  return "cs";
1947  case 0x36:
1948  return "ss";
1949  case 0x3e:
1950  return "ds";
1951  case 0x26:
1952  return "es";
1953  case 0x64:
1954  return "fs";
1955  case 0x65:
1956  return "gs";
1957  case 0x66:
1958  return (sizeflag & DFLAG) ? "data16" : "data32";
1959  case 0x67:
1960  if (mode_64bit)
1961  return (sizeflag & AFLAG) ? "addr32" : "addr64";
1962  else
1963  return ((sizeflag & AFLAG) && !mode_64bit) ? "addr16" : "addr32";
1964  case FWAIT_OPCODE:
1965  return "fwait";
1966  default:
1967  return NULL;
1968  }
1969 }
smooth NULL
Definition: ftsmooth.c:416
int sizeflag
Definition: i386-dis.c:3119
static int mode_64bit
Definition: i386-dis.c:263
#define AFLAG
Definition: i386-dis.c:453
#define FWAIT_OPCODE
Definition: i386-dis.c:260
#define DFLAG
Definition: i386-dis.c:454

Referenced by ckprefix(), and print_insn().

◆ print_insn()

static int print_insn ( bfd_vma  pc,
disassemble_info info 
)
static

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

2029 {
2030  const struct dis386 *dp;
2031  int i;
2032  int two_source_ops;
2033  char *first, *second, *third;
2034  int needcomma;
2035  unsigned char uses_SSE_prefix;
2036  int sizeflag;
2037  /*const char *p;*/
2038  struct dis_private priv;
2039 
2041  || info->mach == bfd_mach_x86_64);
2042 
2043  if (intel_syntax == -1)
2045  || info->mach == bfd_mach_x86_64_intel_syntax);
2046 
2047  if (info->mach == bfd_mach_i386_i386
2048  || info->mach == bfd_mach_x86_64
2050  || info->mach == bfd_mach_x86_64_intel_syntax)
2051  priv.orig_sizeflag = AFLAG | DFLAG;
2052  else if (info->mach == bfd_mach_i386_i8086)
2053  priv.orig_sizeflag = 0;
2054  else
2055  abort ();
2056 
2057 #if 0
2058  for (p = info->disassembler_options; p != NULL; )
2059  {
2060  if (strncmp (p, "x86-64", 6) == 0)
2061  {
2062  mode_64bit = 1;
2063  priv.orig_sizeflag = AFLAG | DFLAG;
2064  }
2065  else if (strncmp (p, "i386", 4) == 0)
2066  {
2067  mode_64bit = 0;
2068  priv.orig_sizeflag = AFLAG | DFLAG;
2069  }
2070  else if (strncmp (p, "i8086", 5) == 0)
2071  {
2072  mode_64bit = 0;
2073  priv.orig_sizeflag = 0;
2074  }
2075  else if (strncmp (p, "intel", 5) == 0)
2076  {
2077  intel_syntax = 1;
2078  }
2079  else if (strncmp (p, "att", 3) == 0)
2080  {
2081  intel_syntax = 0;
2082  }
2083  else if (strncmp (p, "addr", 4) == 0)
2084  {
2085  if (p[4] == '1' && p[5] == '6')
2086  priv.orig_sizeflag &= ~AFLAG;
2087  else if (p[4] == '3' && p[5] == '2')
2088  priv.orig_sizeflag |= AFLAG;
2089  }
2090  else if (strncmp (p, "data", 4) == 0)
2091  {
2092  if (p[4] == '1' && p[5] == '6')
2093  priv.orig_sizeflag &= ~DFLAG;
2094  else if (p[4] == '3' && p[5] == '2')
2095  priv.orig_sizeflag |= DFLAG;
2096  }
2097  else if (strncmp (p, "suffix", 6) == 0)
2098  priv.orig_sizeflag |= SUFFIX_ALWAYS;
2099 
2100  p = strchr (p, ',');
2101  if (p != NULL)
2102  p++;
2103  }
2104 #else
2105  mode_64bit = 1;
2106  priv.orig_sizeflag = AFLAG | DFLAG;
2107  intel_syntax = 1;
2108 #endif
2109 
2110  if (intel_syntax)
2111  {
2115  names8 = intel_names8;
2119  open_char = '[';
2120  close_char = ']';
2121  separator_char = '+';
2122  scale_char = '*';
2123  }
2124  else
2125  {
2126  names64 = att_names64;
2127  names32 = att_names32;
2128  names16 = att_names16;
2129  names8 = att_names8;
2132  index16 = att_index16;
2133  open_char = '(';
2134  close_char = ')';
2135  separator_char = ',';
2136  scale_char = ',';
2137  }
2138 
2139  /* The output looks better if we put 7 bytes on a line, since that
2140  puts most long word instructions on a single line. */
2141  info->bytes_per_line = 7;
2142 
2143  info->private_data = (PTR) &priv;
2144  priv.max_fetched = priv.the_buffer;
2145  priv.insn_start = pc;
2146 
2147  obuf[0] = 0;
2148  op1out[0] = 0;
2149  op2out[0] = 0;
2150  op3out[0] = 0;
2151 
2152  op_index[0] = op_index[1] = op_index[2] = -1;
2153 
2154  the_info = info;
2155  start_pc = pc;
2156  start_codep = priv.the_buffer;
2157  codep = priv.the_buffer;
2158 
2159  if (_setjmp (priv.bailout) != 0)
2160  {
2161  const char *name;
2162 
2163  /* Getting here means we tried for data but didn't get it. That
2164  means we have an incomplete instruction of some sort. Just
2165  print the first byte as a prefix or a .byte pseudo-op. */
2166  if (codep > priv.the_buffer)
2167  {
2168  name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
2169  if (name != NULL)
2170  (*info->fprintf_func) (info->stream, "%s", name);
2171  else
2172  {
2173  /* Just print the first byte as a .byte instruction. */
2174  (*info->fprintf_func) (info->stream, ".byte 0x%x",
2175  (unsigned int) priv.the_buffer[0]);
2176  }
2177 
2178  return 1;
2179  }
2180 
2181  return -1;
2182  }
2183 
2184  obufp = obuf;
2185  ckprefix ();
2186 
2187  insn_codep = codep;
2188  sizeflag = priv.orig_sizeflag;
2189 
2190  FETCH_DATA (info, codep + 1);
2191  two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
2192 
2193  if ((prefixes & PREFIX_FWAIT)
2194  && ((*codep < 0xd8) || (*codep > 0xdf)))
2195  {
2196  const char *name;
2197 
2198  /* fwait not followed by floating point instruction. Print the
2199  first prefix, which is probably fwait itself. */
2200  name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
2201  if (name == NULL)
2203  (*info->fprintf_func) (info->stream, "%s", name);
2204  return 1;
2205  }
2206 
2207  if (*codep == 0x0f)
2208  {
2209  FETCH_DATA (info, codep + 2);
2210  dp = &dis386_twobyte[*++codep];
2212  uses_SSE_prefix = twobyte_uses_SSE_prefix[*codep];
2213  }
2214  else
2215  {
2216  dp = &dis386[*codep];
2218  uses_SSE_prefix = 0;
2219  }
2220  codep++;
2221 
2222  if (!uses_SSE_prefix && (prefixes & PREFIX_REPZ))
2223  {
2224  oappend ("repz ");
2226  }
2227  if (!uses_SSE_prefix && (prefixes & PREFIX_REPNZ))
2228  {
2229  oappend ("repnz ");
2231  }
2232  if (prefixes & PREFIX_LOCK)
2233  {
2234  oappend ("lock ");
2236  }
2237 
2238  if (prefixes & PREFIX_ADDR)
2239  {
2240  sizeflag ^= AFLAG;
2241  if (dp->bytemode3 != loop_jcxz_mode || intel_syntax)
2242  {
2243  if ((sizeflag & AFLAG) || mode_64bit)
2244  oappend ("addr32 ");
2245  else
2246  oappend ("addr16 ");
2248  }
2249  }
2250 
2251  if (!uses_SSE_prefix && (prefixes & PREFIX_DATA))
2252  {
2253  sizeflag ^= DFLAG;
2254  if (dp->bytemode3 == cond_jump_mode
2255  && dp->bytemode1 == v_mode
2256  && !intel_syntax)
2257  {
2258  if (sizeflag & DFLAG)
2259  oappend ("data32 ");
2260  else
2261  oappend ("data16 ");
2263  }
2264  }
2265 
2266  if (need_modrm)
2267  {
2268  FETCH_DATA (info, codep + 1);
2269  mod = (*codep >> 6) & 3;
2270  reg = (*codep >> 3) & 7;
2271  rm = *codep & 7;
2272  }
2273 
2274  if (dp->name == NULL && dp->bytemode1 == FLOATCODE)
2275  {
2276  dofloat (sizeflag);
2277  }
2278  else
2279  {
2280  int index;
2281  if (dp->name == NULL)
2282  {
2283  switch (dp->bytemode1)
2284  {
2285  case USE_GROUPS:
2286  dp = &grps[dp->bytemode2][reg];
2287  break;
2288 
2289  case USE_PREFIX_USER_TABLE:
2290  index = 0;
2292  if (prefixes & PREFIX_REPZ)
2293  index = 1;
2294  else
2295  {
2297  if (prefixes & PREFIX_DATA)
2298  index = 2;
2299  else
2300  {
2302  if (prefixes & PREFIX_REPNZ)
2303  index = 3;
2304  }
2305  }
2306  dp = &prefix_user_table[dp->bytemode2][index];
2307  break;
2308 
2309  case X86_64_SPECIAL:
2310  dp = &x86_64_table[dp->bytemode2][mode_64bit];
2311  break;
2312 
2313  default:
2315  break;
2316  }
2317  }
2318 
2319  if (putop (dp->name, sizeflag) == 0)
2320  {
2321  obufp = op1out;
2322  op_ad = 2;
2323  if (dp->op1)
2324  (*dp->op1) (dp->bytemode1, sizeflag);
2325 
2326  obufp = op2out;
2327  op_ad = 1;
2328  if (dp->op2)
2329  (*dp->op2) (dp->bytemode2, sizeflag);
2330 
2331  obufp = op3out;
2332  op_ad = 0;
2333  if (dp->op3)
2334  (*dp->op3) (dp->bytemode3, sizeflag);
2335  }
2336  }
2337 
2338  /* See if any prefixes were not used. If so, print the first one
2339  separately. If we don't do this, we'll wind up printing an
2340  instruction stream which does not precisely correspond to the
2341  bytes we are disassembling. */
2342  if ((prefixes & ~used_prefixes) != 0)
2343  {
2344  const char *name;
2345 
2346  name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
2347  if (name == NULL)
2349  (*info->fprintf_func) (info->stream, "%s", name);
2350  return 1;
2351  }
2352  if (rex & ~rex_used)
2353  {
2354  const char *name;
2355  name = prefix_name (rex | 0x40, priv.orig_sizeflag);
2356  if (name == NULL)
2358  (*info->fprintf_func) (info->stream, "%s ", name);
2359  }
2360 
2361  obufp = obuf + strlen (obuf);
2362  for (i = strlen (obuf); i < 6; i++)
2363  oappend (" ");
2364  oappend (" ");
2365  (*info->fprintf_func) (info->stream, "%s", obuf);
2366 
2367  /* The enter and bound instructions are printed with operands in the same
2368  order as the intel book; everything else is printed in reverse order. */
2370  {
2371  first = op1out;
2372  second = op2out;
2373  third = op3out;
2374  op_ad = op_index[0];
2375  op_index[0] = op_index[2];
2376  op_index[2] = op_ad;
2377  }
2378  else
2379  {
2380  first = op3out;
2381  second = op2out;
2382  third = op1out;
2383  }
2384  needcomma = 0;
2385  if (*first)
2386  {
2387  if (op_index[0] != -1 && !op_riprel[0])
2388  (*info->print_address_func) ((bfd_vma) op_address[op_index[0]], info);
2389  else
2390  (*info->fprintf_func) (info->stream, "%s", first);
2391  needcomma = 1;
2392  }
2393  if (*second)
2394  {
2395  if (needcomma)
2396  (*info->fprintf_func) (info->stream, ",");
2397  if (op_index[1] != -1 && !op_riprel[1])
2398  (*info->print_address_func) ((bfd_vma) op_address[op_index[1]], info);
2399  else
2400  (*info->fprintf_func) (info->stream, "%s", second);
2401  needcomma = 1;
2402  }
2403  if (*third)
2404  {
2405  if (needcomma)
2406  (*info->fprintf_func) (info->stream, ",");
2407  if (op_index[2] != -1 && !op_riprel[2])
2408  (*info->print_address_func) ((bfd_vma) op_address[op_index[2]], info);
2409  else
2410  (*info->fprintf_func) (info->stream, "%s", third);
2411  }
2412  for (i = 0; i < 3; i++)
2413  if (op_index[i] != -1 && op_riprel[i])
2414  {
2415  (*info->fprintf_func) (info->stream, " # ");
2416  (*info->print_address_func) ((bfd_vma) (start_pc + codep - start_codep
2417  + op_address[op_index[i]]), info);
2418  }
2419  return codep - priv.the_buffer;
2420 }
static const char ** names64
Definition: i386-dis.c:1283
ULONG_PTR bfd_vma
Definition: i386-dis.c:25
static int prefixes
Definition: i386-dis.c:266
static char op3out[100]
Definition: i386-dis.c:1971
static int putop(char *template, int sizeflag) const
Definition: i386-dis.c:2729
const char * name
Definition: i386-dis.c:575
int bytemode3
Definition: i386-dis.c:581
static const char * intel_names32[]
Definition: i386-dis.c:1295
static void ckprefix()
Definition: i386-dis.c:1802
static const char ** names32
Definition: i386-dis.c:1284
static const char * att_names32[]
Definition: i386-dis.c:1321
static char op2out[100]
Definition: i386-dis.c:1971
static char * obufp
Definition: i386-dis.c:1267
static void oappend(char *s) const
Definition: i386-dis.c:3004
static bfd_vma op_riprel[3]
Definition: i386-dis.c:1974
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define PREFIX_ADDR
Definition: i386-dis.c:303
#define FETCH_DATA(info, addr)
Definition: i386-dis.c:309
#define FLOATCODE
Definition: i386-dis.c:511
static const char * att_names16[]
Definition: i386-dis.c:1325
const GLint * first
Definition: glext.h:5794
int bytemode1
Definition: i386-dis.c:577
#define PREFIX_DATA
Definition: i386-dis.c:302
static const char * att_names8rex[]
Definition: i386-dis.c:1332
static const char * att_names8[]
Definition: i386-dis.c:1329
static int op_index[3]
Definition: i386-dis.c:1972
static char close_char
Definition: i386-dis.c:1988
static unsigned char * start_codep
Definition: i386-dis.c:1269
static disassemble_info * the_info
Definition: i386-dis.c:1272
static const char * intel_names8rex[]
Definition: i386-dis.c:1306
static const char * intel_names64[]
Definition: i386-dis.c:1291
struct _test_info info[]
Definition: SetCursorPos.c:19
static const char * intel_names8[]
Definition: i386-dis.c:1303
static int rm
Definition: i386-dis.c:1274
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define bfd_mach_i386_i386
Definition: i386-dis.c:33
static char open_char
Definition: i386-dis.c:1987
static const char ** names8rex
Definition: i386-dis.c:1287
static const char ** names8
Definition: i386-dis.c:1286
static unsigned char * codep
Definition: i386-dis.c:1271
#define bfd_mach_i386_i8086
Definition: i386-dis.c:34
static char separator_char
Definition: i386-dis.c:1989
smooth NULL
Definition: ftsmooth.c:416
static bfd_vma start_pc
Definition: i386-dis.c:1975
GLuint index
Definition: glext.h:6031
#define PREFIX_LOCK
Definition: i386-dis.c:295
static char scale_char
Definition: i386-dis.c:1990
static const unsigned char twobyte_uses_SSE_prefix[256]
Definition: i386-dis.c:1243
static int rex
Definition: i386-dis.c:269
static unsigned char need_modrm
Definition: i386-dis.c:1276
static const char * intel_names_seg[]
Definition: i386-dis.c:1310
#define PTR
Definition: i386-dis.c:16
int sizeflag
Definition: i386-dis.c:3119
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
static int rex_used
Definition: i386-dis.c:271
static const char ** names_seg
Definition: i386-dis.c:1288
#define PREFIX_REPNZ
Definition: i386-dis.c:294
#define X86_64_SPECIAL
Definition: i386-dis.c:514
#define PREFIX_FWAIT
Definition: i386-dis.c:304
static int two_source_ops
Definition: i386-dis.c:2031
static const char * prefix_name(int pref, int sizeflag)
Definition: i386-dis.c:1900
static int mode_64bit
Definition: i386-dis.c:263
#define SUFFIX_ALWAYS
Definition: i386-dis.c:452
#define index(s, c)
Definition: various.h:29
#define bfd_mach_x86_64
Definition: i386-dis.c:31
static const struct dis386 x86_64_table[][2]
Definition: i386-dis.c:1792
#define cond_jump_mode
Definition: i386-dis.c:463
static const struct dis386 dis386_twobyte[]
Definition: i386-dis.c:906
#define loop_jcxz_mode
Definition: i386-dis.c:464
#define bfd_mach_i386_i386_intel_syntax
Definition: i386-dis.c:32
op_rtn op3
Definition: i386-dis.c:580
static const char * intel_names16[]
Definition: i386-dis.c:1299
static unsigned char * insn_codep
Definition: i386-dis.c:1270
static char obuf[100]
Definition: i386-dis.c:1266
static bfd_vma op_address[3]
Definition: i386-dis.c:1973
static char op1out[100]
Definition: i386-dis.c:1971
#define abort()
Definition: i386-dis.c:35
static const struct dis386 prefix_user_table[][4]
Definition: i386-dis.c:1600
static const char * att_names64[]
Definition: i386-dis.c:1317
static int reg
Definition: i386-dis.c:1275
int bytemode2
Definition: i386-dis.c:579
#define INTERNAL_DISASSEMBLER_ERROR
Definition: i386-dis.c:1799
static void dofloat(int sizeflag)
Definition: i386-dis.c:2664
static const char ** names16
Definition: i386-dis.c:1285
char * strchr(const char *String, int ch)
Definition: utclib.c:501
static const char * att_index16[]
Definition: i386-dis.c:1339
static const struct dis386 grps[][8]
Definition: i386-dis.c:1343
#define PREFIX_REPZ
Definition: i386-dis.c:293
Definition: name.c:36
static const char * intel_index16[]
Definition: i386-dis.c:1313
#define USE_PREFIX_USER_TABLE
Definition: i386-dis.c:513
static int op_ad
Definition: i386-dis.c:1972
static const char * att_names_seg[]
Definition: i386-dis.c:1336
op_rtn op1
Definition: i386-dis.c:576
static const char ** index16
Definition: i386-dis.c:1289
static int used_prefixes
Definition: i386-dis.c:290
static char intel_syntax
Definition: i386-dis.c:1986
GLfloat GLfloat p
Definition: glext.h:8902
#define AFLAG
Definition: i386-dis.c:453
static const unsigned char twobyte_has_modrm[256]
Definition: i386-dis.c:1220
#define DFLAG
Definition: i386-dis.c:454
#define USE_GROUPS
Definition: i386-dis.c:512
static const unsigned char onebyte_has_modrm[256]
Definition: i386-dis.c:1197
op_rtn op2
Definition: i386-dis.c:578
#define bfd_mach_x86_64_intel_syntax
Definition: i386-dis.c:30
#define v_mode
Definition: i386-dis.c:457
static int mod
Definition: i386-dis.c:1273
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by print_insn_i386(), print_insn_i386_att(), and print_insn_i386_intel().

◆ print_insn_i386()

int print_insn_i386 ( bfd_vma  pc,
struct disassemble_info info 
)

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

2019 {
2020  intel_syntax = -1;
2021 
2022  return print_insn (pc, info);
2023 }
static int print_insn(bfd_vma pc, disassemble_info *info)
Definition: i386-dis.c:2026
static char intel_syntax
Definition: i386-dis.c:1986

Referenced by KdbpDisassemble(), and KdbpGetInstLength().

◆ print_insn_i386_att()

int print_insn_i386_att ( bfd_vma  pc,
disassemble_info info 
)

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

1999 {
2000  intel_syntax = 0;
2001 
2002  return print_insn (pc, info);
2003 }
static int print_insn(bfd_vma pc, disassemble_info *info)
Definition: i386-dis.c:2026
static char intel_syntax
Definition: i386-dis.c:1986

◆ print_insn_i386_intel()

int print_insn_i386_intel ( bfd_vma  pc,
disassemble_info info 
)

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

2009 {
2010  intel_syntax = 1;
2011 
2012  return print_insn (pc, info);
2013 }
static int print_insn(bfd_vma pc, disassemble_info *info)
Definition: i386-dis.c:2026
static char intel_syntax
Definition: i386-dis.c:1986

◆ print_operand_value() [1/4]

static void print_operand_value ( char buf,
int  hex,
bfd_vma  disp 
)
static

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

3061 {
3062  if (mode_64bit)
3063  {
3064  if (hex)
3065  {
3066  char tmp[30];
3067  int i;
3068  buf[0] = '0';
3069  buf[1] = 'x';
3070  sprintf_vma (tmp, disp);
3071  for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++);
3072  strcpy (buf + 2, tmp + i);
3073  }
3074  else
3075  {
3076  bfd_signed_vma v = disp;
3077  char tmp[30];
3078  int i;
3079  if (v < 0)
3080  {
3081  *(buf++) = '-';
3082  v = -disp;
3083  /* Check for possible overflow on 0x8000000000000000. */
3084  if (v < 0)
3085  {
3086  strcpy (buf, "9223372036854775808");
3087  return;
3088  }
3089  }
3090  if (!v)
3091  {
3092  strcpy (buf, "0");
3093  return;
3094  }
3095 
3096  i = 0;
3097  tmp[29] = 0;
3098  while (v)
3099  {
3100  tmp[28 - i] = (v % 10) + '0';
3101  v /= 10;
3102  i++;
3103  }
3104  strcpy (buf, tmp + 29 - i);
3105  }
3106  }
3107  else
3108  {
3109  if (hex)
3110  sprintf (buf, "0x%x", (unsigned int) disp);
3111  else
3112  sprintf (buf, "%d", (int) disp);
3113  }
3114 }
disp
Definition: i386-dis.c:3181
#define sprintf_vma(BUF, VMA)
Definition: i386-dis.c:39
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
LONG_PTR bfd_signed_vma
Definition: i386-dis.c:29
static const char hex[16]
Definition: profile.c:123
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int mode_64bit
Definition: i386-dis.c:263
const GLdouble * v
Definition: gl.h:2040
int sprintf(char *str, const char *format,...)
Definition: utprint.c:762
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by if(), and OP_sI().

◆ print_operand_value() [2/4]

print_operand_value ( scratchbuf 1,
,
op   
)

◆ print_operand_value() [3/4]

print_operand_value ( scratchbuf  ,
,
disp   
)

◆ print_operand_value() [4/4]

print_operand_value ( scratchbuf  ,
,
off   
)

◆ ptr_reg()

static void ptr_reg ( int  code,
int  sizeflag 
)
static

Definition at line 3925 of file