ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

i386-dis.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
#include <setjmp.h>
#include "dis-asm.h"

Go to the source code of this file.

Data Structures

struct  dis_private
struct  dis386

Defines

#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 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_arch { 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 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)
static void OP_3DNowSuffix (bytemode, sizeflag)
static void OP_SIMD_Suffix (bytemode, sizeflag)
static void SIMD_Fixup (int extrachar, sizeflag)
static void BadOp (void)

Variables

static int mode_64bit = 1
static int prefixes
static int rex
static int rex_used
static int used_prefixes
static struct dis386 dis386 []
static 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 struct dis386 grps [][8]
static struct dis386 prefix_user_table [][4]
static 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 struct dis386 float_reg [][8]
static charfgrps [][8]
static void int bytemode ATTRIBUTE_UNUSED
int sizeflag
 return
static void int bytemode
int riprel
static const charsimd_cmp_op []

Generated on Sat May 26 2012 06:06:48 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.