ReactOS  0.4.14-dev-52-g6116262
disassembler.h File Reference

Go to the source code of this file.

Classes

struct  code
 
struct  CPU_TYPE
 
struct  x86_inst
 
struct  OPERAND
 
struct  EA
 
struct  modRM_byte
 
struct  SIB_byte
 
struct  x86_table
 

Macros

#define OP_REG   0x100 /* register */
 
#define OP_IMM   0x200 /* immediate value */
 
#define OP_IND   0x300 /* indirect memory reference */
 
#define OP_BPTR   0x400 /* BYTE Pointer */
 
#define OP_WPTR   0x500 /* WORD Pointer */
 
#define OP_DPTR   0x600 /* DWORD Pointer */
 
#define OP_UNK   0x900
 
#define INS_BRANCH   0x01 /* Unconditional branch */
 
#define INS_COND   0x02 /* Conditional branch */
 
#define INS_SUB   0x04 /* Jump to subroutine */
 
#define INS_RET   0x08 /* Return from subroutine */
 
#define INS_ARITH   0x10 /* Arithmetic inst */
 
#define INS_LOGIC   0x20 /* logical inst */
 
#define INS_FPU   0x40 /* Floating Point inst */
 
#define INS_FLAG   0x80 /* Modify flags */
 
#define INS_MOVE   0x0100
 
#define INS_ARRAY   0x0200 /* String and XLAT ops */
 
#define INS_PTR   0x0400 /* Load EA/pointer */
 
#define INS_STACK   0x1000 /* PUSH, POP, etc */
 
#define INS_FRAME   0x2000 /* ENTER, LEAVE, etc */
 
#define INS_SYSTEM   0x4000 /* CPUID, WBINVD, etc */
 
#define BIG_ENDIAN_ORDER   0
 
#define LITTLE_ENDIAN_ORDER   1
 
#define cpu_80386   0x01
 
#define cpu_80486   0x02
 
#define cpu_PENTIUM   0x04
 
#define cpu_PENTMMX   0x08
 
#define cpu_PENTPRO   0x10
 
#define cpu_PENTIUM2   0x20
 
#define cpu_PENTIUM3   0x40
 
#define cpu_PENTIUM4   0x80
 
#define FLAGS_MODRM   0x00001
 
#define FLAGS_8BIT   0x00002
 
#define FLAGS_16BIT   0x00004
 
#define FLAGS_32BIT   0x00008
 
#define FLAGS_REAL   0x00010
 
#define FLAGS_PMODE   0x00020
 
#define FLAGS_PREFIX   0x00040
 
#define FLAGS_MMX   0x00080
 
#define FLAGS_FPU   0x00100
 
#define FLAGS_CJMP   0x00200
 
#define FLAGS_JMP   0x00400
 
#define FLAGS_IJMP   0x00800
 
#define FLAGS_CALL   0x01000
 
#define FLAGS_ICALL   0x02000
 
#define FLAGS_RET   0x04000
 
#define FLAGS_SEGPREFIX   0x08000
 
#define FLAGS_OPERPREFIX   0x10000
 
#define FLAGS_ADDRPREFIX   0x20000
 
#define FLAGS_OMODE16   0x40000
 
#define FLAGS_OMODE32   0x80000
 
#define GENREG_8   0x0001
 
#define GENREG_16   0x0002
 
#define GENREG_32   0x0004
 
#define SEGREG   0x0008
 
#define MMXREG   0x0010
 
#define SIMDREG   0x0020
 
#define DEBUGREG   0x0040
 
#define CONTROLREG   0x0080
 
#define TESTREG   0x0100
 
#define NO_REG   0x100
 
#define DIRECT_REG   0x200
 
#define NO_BASE   0x400
 
#define NO_INDEX   0x800
 
#define DISP8   0x1000
 
#define DISP32   0x2000
 
#define HAS_SIB   0x4000
 
#define HAS_MODRM   0x8000
 

Typedefs

typedef struct x86_inst instr
 
typedef struct x86_table asmtable
 

Enumerations

enum  argtype {
  ARG_REG =1, ARG_IMM, ARG_NONE, ARG_MODRM,
  ARG_REG_AX, ARG_REG_ES, ARG_REG_CS, ARG_REG_SS,
  ARG_REG_DS, ARG_REG_FS, ARG_REG_GS, ARG_REG_BX,
  ARG_REG_CX, ARG_REG_DX, ARG_REG_SP, ARG_REG_BP,
  ARG_REG_SI, ARG_REG_DI, ARG_IMM8, ARG_RELIMM8,
  ARG_FADDR, ARG_REG_AL, ARG_MEMLOC, ARG_SREG,
  ARG_RELIMM, ARG_16REG_DX, ARG_REG_CL, ARG_REG_DL,
  ARG_REG_BL, ARG_REG_AH, ARG_REG_CH, ARG_REG_DH,
  ARG_REG_BH, ARG_MODREG, ARG_CREG, ARG_DREG,
  ARG_TREG_67, ARG_TREG, ARG_MREG, ARG_MMXMODRM,
  ARG_MODRM8, ARG_IMM_1, ARG_MODRM_FPTR, ARG_MODRM_S,
  ARG_MODRMM512, ARG_MODRMQ, ARG_MODRM_SREAL, ARG_REG_ST0,
  ARG_FREG, ARG_MODRM_PTR, ARG_MODRM_WORD, ARG_MODRM_SINT,
  ARG_MODRM_EREAL, ARG_MODRM_DREAL, ARG_MODRM_WINT, ARG_MODRM_LINT,
  ARG_REG_BC, ARG_REG_DE, ARG_REG_HL, ARG_REG_DE_IND,
  ARG_REG_HL_IND, ARG_REG_BC_IND, ARG_REG_SP_IND, ARG_REG_A,
  ARG_REG_B, ARG_REG_C, ARG_REG_D, ARG_REG_E,
  ARG_REG_H, ARG_REG_L, ARG_IMM16, ARG_REG_AF,
  ARG_REG_AF2, ARG_MEMLOC16, ARG_IMM8_IND, ARG_BIT,
  ARG_REG_IX, ARG_REG_IX_IND, ARG_REG_IY, ARG_REG_IY_IND,
  ARG_REG_C_IND, ARG_REG_I, ARG_REG_R, ARG_IMM16_A,
  ARG_MODRM16, ARG_SIMM8, ARG_IMM32, ARG_STRING,
  ARG_MODRM_BCD, ARG_PSTRING, ARG_DOSSTRING, ARG_CUNICODESTRING,
  ARG_PUNICODESTRING, ARG_NONEBYTE, ARG_XREG, ARG_XMMMODRM
}
 

Macro Definition Documentation

◆ BIG_ENDIAN_ORDER

#define BIG_ENDIAN_ORDER   0

Definition at line 29 of file disassembler.h.

◆ CONTROLREG

#define CONTROLREG   0x0080

Definition at line 115 of file disassembler.h.

◆ cpu_80386

#define cpu_80386   0x01

Definition at line 51 of file disassembler.h.

◆ cpu_80486

#define cpu_80486   0x02

Definition at line 52 of file disassembler.h.

◆ cpu_PENTIUM

#define cpu_PENTIUM   0x04

Definition at line 53 of file disassembler.h.

◆ cpu_PENTIUM2

#define cpu_PENTIUM2   0x20

Definition at line 56 of file disassembler.h.

◆ cpu_PENTIUM3

#define cpu_PENTIUM3   0x40

Definition at line 57 of file disassembler.h.

◆ cpu_PENTIUM4

#define cpu_PENTIUM4   0x80

Definition at line 58 of file disassembler.h.

◆ cpu_PENTMMX

#define cpu_PENTMMX   0x08

Definition at line 54 of file disassembler.h.

◆ cpu_PENTPRO

#define cpu_PENTPRO   0x10

Definition at line 55 of file disassembler.h.

◆ DEBUGREG

#define DEBUGREG   0x0040

Definition at line 114 of file disassembler.h.

◆ DIRECT_REG

#define DIRECT_REG   0x200

Definition at line 119 of file disassembler.h.

◆ DISP32

#define DISP32   0x2000

Definition at line 123 of file disassembler.h.

◆ DISP8

#define DISP8   0x1000

Definition at line 122 of file disassembler.h.

◆ FLAGS_16BIT

#define FLAGS_16BIT   0x00004

Definition at line 62 of file disassembler.h.

◆ FLAGS_32BIT

#define FLAGS_32BIT   0x00008

Definition at line 63 of file disassembler.h.

◆ FLAGS_8BIT

#define FLAGS_8BIT   0x00002

Definition at line 61 of file disassembler.h.

◆ FLAGS_ADDRPREFIX

#define FLAGS_ADDRPREFIX   0x20000

Definition at line 77 of file disassembler.h.

◆ FLAGS_CALL

#define FLAGS_CALL   0x01000

Definition at line 72 of file disassembler.h.

◆ FLAGS_CJMP

#define FLAGS_CJMP   0x00200

Definition at line 69 of file disassembler.h.

◆ FLAGS_FPU

#define FLAGS_FPU   0x00100

Definition at line 68 of file disassembler.h.

◆ FLAGS_ICALL

#define FLAGS_ICALL   0x02000

Definition at line 73 of file disassembler.h.

◆ FLAGS_IJMP

#define FLAGS_IJMP   0x00800

Definition at line 71 of file disassembler.h.

◆ FLAGS_JMP

#define FLAGS_JMP   0x00400

Definition at line 70 of file disassembler.h.

◆ FLAGS_MMX

#define FLAGS_MMX   0x00080

Definition at line 67 of file disassembler.h.

◆ FLAGS_MODRM

#define FLAGS_MODRM   0x00001

Definition at line 60 of file disassembler.h.

◆ FLAGS_OMODE16

#define FLAGS_OMODE16   0x40000

Definition at line 78 of file disassembler.h.

◆ FLAGS_OMODE32

#define FLAGS_OMODE32   0x80000

Definition at line 79 of file disassembler.h.

◆ FLAGS_OPERPREFIX

#define FLAGS_OPERPREFIX   0x10000

Definition at line 76 of file disassembler.h.

◆ FLAGS_PMODE

#define FLAGS_PMODE   0x00020

Definition at line 65 of file disassembler.h.

◆ FLAGS_PREFIX

#define FLAGS_PREFIX   0x00040

Definition at line 66 of file disassembler.h.

◆ FLAGS_REAL

#define FLAGS_REAL   0x00010

Definition at line 64 of file disassembler.h.

◆ FLAGS_RET

#define FLAGS_RET   0x04000

Definition at line 74 of file disassembler.h.

◆ FLAGS_SEGPREFIX

#define FLAGS_SEGPREFIX   0x08000

Definition at line 75 of file disassembler.h.

◆ GENREG_16

#define GENREG_16   0x0002

Definition at line 109 of file disassembler.h.

◆ GENREG_32

#define GENREG_32   0x0004

Definition at line 110 of file disassembler.h.

◆ GENREG_8

#define GENREG_8   0x0001

Definition at line 108 of file disassembler.h.

◆ HAS_MODRM

#define HAS_MODRM   0x8000

Definition at line 125 of file disassembler.h.

◆ HAS_SIB

#define HAS_SIB   0x4000

Definition at line 124 of file disassembler.h.

◆ INS_ARITH

#define INS_ARITH   0x10 /* Arithmetic inst */

Definition at line 16 of file disassembler.h.

◆ INS_ARRAY

#define INS_ARRAY   0x0200 /* String and XLAT ops */

Definition at line 22 of file disassembler.h.

◆ INS_BRANCH

#define INS_BRANCH   0x01 /* Unconditional branch */

Definition at line 11 of file disassembler.h.

◆ INS_COND

#define INS_COND   0x02 /* Conditional branch */

Definition at line 12 of file disassembler.h.

◆ INS_FLAG

#define INS_FLAG   0x80 /* Modify flags */

Definition at line 19 of file disassembler.h.

◆ INS_FPU

#define INS_FPU   0x40 /* Floating Point inst */

Definition at line 18 of file disassembler.h.

◆ INS_FRAME

#define INS_FRAME   0x2000 /* ENTER, LEAVE, etc */

Definition at line 25 of file disassembler.h.

◆ INS_LOGIC

#define INS_LOGIC   0x20 /* logical inst */

Definition at line 17 of file disassembler.h.

◆ INS_MOVE

#define INS_MOVE   0x0100

Definition at line 21 of file disassembler.h.

◆ INS_PTR

#define INS_PTR   0x0400 /* Load EA/pointer */

Definition at line 23 of file disassembler.h.

◆ INS_RET

#define INS_RET   0x08 /* Return from subroutine */

Definition at line 14 of file disassembler.h.

◆ INS_STACK

#define INS_STACK   0x1000 /* PUSH, POP, etc */

Definition at line 24 of file disassembler.h.

◆ INS_SUB

#define INS_SUB   0x04 /* Jump to subroutine */

Definition at line 13 of file disassembler.h.

◆ INS_SYSTEM

#define INS_SYSTEM   0x4000 /* CPUID, WBINVD, etc */

Definition at line 26 of file disassembler.h.

◆ LITTLE_ENDIAN_ORDER

#define LITTLE_ENDIAN_ORDER   1

Definition at line 30 of file disassembler.h.

◆ MMXREG

#define MMXREG   0x0010

Definition at line 112 of file disassembler.h.

◆ NO_BASE

#define NO_BASE   0x400

Definition at line 120 of file disassembler.h.

◆ NO_INDEX

#define NO_INDEX   0x800

Definition at line 121 of file disassembler.h.

◆ NO_REG

#define NO_REG   0x100

Definition at line 118 of file disassembler.h.

◆ OP_BPTR

#define OP_BPTR   0x400 /* BYTE Pointer */

Definition at line 5 of file disassembler.h.

◆ OP_DPTR

#define OP_DPTR   0x600 /* DWORD Pointer */

Definition at line 7 of file disassembler.h.

◆ OP_IMM

#define OP_IMM   0x200 /* immediate value */

Definition at line 3 of file disassembler.h.

◆ OP_IND

#define OP_IND   0x300 /* indirect memory reference */

Definition at line 4 of file disassembler.h.

◆ OP_REG

#define OP_REG   0x100 /* register */

Definition at line 2 of file disassembler.h.

◆ OP_UNK

#define OP_UNK   0x900

Definition at line 8 of file disassembler.h.

◆ OP_WPTR

#define OP_WPTR   0x500 /* WORD Pointer */

Definition at line 6 of file disassembler.h.

◆ SEGREG

#define SEGREG   0x0008

Definition at line 111 of file disassembler.h.

◆ SIMDREG

#define SIMDREG   0x0020

Definition at line 113 of file disassembler.h.

◆ TESTREG

#define TESTREG   0x0100

Definition at line 116 of file disassembler.h.

Typedef Documentation

◆ asmtable

◆ instr

Enumeration Type Documentation

◆ argtype

Enumerator
ARG_REG 
ARG_IMM 
ARG_NONE 
ARG_MODRM 
ARG_REG_AX 
ARG_REG_ES 
ARG_REG_CS 
ARG_REG_SS 
ARG_REG_DS 
ARG_REG_FS 
ARG_REG_GS 
ARG_REG_BX 
ARG_REG_CX 
ARG_REG_DX 
ARG_REG_SP 
ARG_REG_BP 
ARG_REG_SI 
ARG_REG_DI 
ARG_IMM8 
ARG_RELIMM8 
ARG_FADDR 
ARG_REG_AL 
ARG_MEMLOC 
ARG_SREG 
ARG_RELIMM 
ARG_16REG_DX 
ARG_REG_CL 
ARG_REG_DL 
ARG_REG_BL 
ARG_REG_AH 
ARG_REG_CH 
ARG_REG_DH 
ARG_REG_BH 
ARG_MODREG 
ARG_CREG 
ARG_DREG 
ARG_TREG_67 
ARG_TREG 
ARG_MREG 
ARG_MMXMODRM 
ARG_MODRM8 
ARG_IMM_1 
ARG_MODRM_FPTR 
ARG_MODRM_S 
ARG_MODRMM512 
ARG_MODRMQ 
ARG_MODRM_SREAL 
ARG_REG_ST0 
ARG_FREG 
ARG_MODRM_PTR 
ARG_MODRM_WORD 
ARG_MODRM_SINT 
ARG_MODRM_EREAL 
ARG_MODRM_DREAL 
ARG_MODRM_WINT 
ARG_MODRM_LINT 
ARG_REG_BC 
ARG_REG_DE 
ARG_REG_HL 
ARG_REG_DE_IND 
ARG_REG_HL_IND 
ARG_REG_BC_IND 
ARG_REG_SP_IND 
ARG_REG_A 
ARG_REG_B 
ARG_REG_C 
ARG_REG_D 
ARG_REG_E 
ARG_REG_H 
ARG_REG_L 
ARG_IMM16 
ARG_REG_AF 
ARG_REG_AF2 
ARG_MEMLOC16 
ARG_IMM8_IND 
ARG_BIT 
ARG_REG_IX 
ARG_REG_IX_IND 
ARG_REG_IY 
ARG_REG_IY_IND 
ARG_REG_C_IND 
ARG_REG_I 
ARG_REG_R 
ARG_IMM16_A 
ARG_MODRM16 
ARG_SIMM8 
ARG_IMM32 
ARG_STRING 
ARG_MODRM_BCD 
ARG_PSTRING 
ARG_DOSSTRING 
ARG_CUNICODESTRING 
ARG_PUNICODESTRING 
ARG_NONEBYTE 
ARG_XREG 
ARG_XMMMODRM 

Definition at line 81 of file disassembler.h.

81  {