The interface works for both IA32 and EM64T. By default, only IA32 capabilities are presented. To enable EM64T feature, the _EM64T_ macro must be defined (and, of course, a proper library version to be used).
The interface is based on the original ia32.h encoder interface, with some simplifications and add-ons - EM64T-specific, SSE and SSE2.
The interface mostly intended for existing legacy code like LIL code generator. From the implementation point of view, it's just a wrapper around the EncoderBase functionality.
Classes | |
class | Opnd |
class | Imm_Opnd |
class | RM_Opnd |
class | R_Opnd |
class | M_Opnd |
class | M_Base_Opnd |
class | M_Index_Opnd |
class | XMM_Opnd |
Defines | |
#define | GR_STACK_SIZE 4 |
#define | FR_STACK_SIZE 8 |
#define | ENCODER_DECLARE_EXPORT inline |
Enumerations | |
enum | Reg_No { eax_reg = 0, ebx_reg, ecx_reg, edx_reg, edi_reg, esi_reg, esp_reg, ebp_reg, xmm0_reg, xmm1_reg, xmm2_reg, xmm3_reg, xmm4_reg, xmm5_reg, xmm6_reg, xmm7_reg, fs_reg, n_reg } |
enum | Opnd_Size { size_8 = 0, size_16, size_32, size_64, n_size, size_platf = size_32 } |
enum | ALU_Opcode { add_opc = 0, or_opc, adc_opc, sbb_opc, and_opc, sub_opc, xor_opc, cmp_opc, n_alu } |
enum | Shift_Opcode { shld_opc, shrd_opc, shl_opc, shr_opc, sar_opc, ror_opc, max_shift_opcode = 6, n_shift = 6 } |
enum | ConditionCode { Condition_O = 0, Condition_NO = 1, Condition_B = 2, Condition_NAE = Condition_B, Condition_C = Condition_B, Condition_NB = 3, Condition_AE = Condition_NB, Condition_NC = Condition_NB, Condition_Z = 4, Condition_E = Condition_Z, Condition_NZ = 5, Condition_NE = Condition_NZ, Condition_BE = 6, Condition_NA = Condition_BE, Condition_NBE = 7, Condition_A = Condition_NBE, Condition_S = 8, Condition_NS = 9, Condition_P = 10, Condition_PE = Condition_P, Condition_NP = 11, Condition_PO = Condition_NP, Condition_L = 12, Condition_NGE = Condition_L, Condition_NL = 13, Condition_GE = Condition_NL, Condition_LE = 14, Condition_NG = Condition_LE, Condition_NLE = 15, Condition_G = Condition_NLE, Condition_Count = 16 } |
enum | InstrPrefix { no_prefix, lock_prefix = 0xF0, hint_branch_taken_prefix = 0x2E, hint_branch_not_taken_prefix = 0x3E, prefix_repne = 0xF2, prefix_repnz = prefix_repne, prefix_repe = 0xF3, prefix_repz = prefix_repe, prefix_rep = 0xF3, prefix_cs = 0x2E, prefix_ss = 0x36, prefix_ds = 0x3E, prefix_es = 0x26, prefix_fs = 0x64, prefix_gs = 0x65 } |
Functions | |
char * | prefix (char *stream, InstrPrefix p) |
char * | push (char *stream, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | push (char *stream, const Imm_Opnd &imm) |
char * | pop (char *stream, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | cmpxchg (char *stream, const RM_Opnd &rm, const R_Opnd &r, Opnd_Size sz=size_platf) |
char * | xchg (char *stream, const RM_Opnd &rm, const R_Opnd &r, Opnd_Size sz=size_platf) |
char * | inc (char *stream, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | dec (char *stream, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | _not (char *stream, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | neg (char *stream, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | nop (char *stream) |
char * | int3 (char *stream) |
char * | alu (char *stream, ALU_Opcode opc, const RM_Opnd &rm, const Imm_Opnd &imm, Opnd_Size sz=size_platf) |
char * | alu (char *stream, ALU_Opcode opc, const M_Opnd &m, const R_Opnd &r, Opnd_Size sz=size_platf) |
char * | alu (char *stream, ALU_Opcode opc, const R_Opnd &r, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | test (char *stream, const RM_Opnd &rm, const Imm_Opnd &imm, Opnd_Size sz=size_platf) |
char * | test (char *stream, const RM_Opnd &rm, const R_Opnd &r, Opnd_Size sz=size_platf) |
char * | shift (char *stream, Shift_Opcode opc, const RM_Opnd &rm, const Imm_Opnd &imm, Opnd_Size sz=size_platf) |
char * | shift (char *stream, Shift_Opcode opc, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | shift (char *stream, Shift_Opcode opc, const RM_Opnd &rm, const R_Opnd &r, const Imm_Opnd &imm, Opnd_Size sz=size_platf) |
char * | shift (char *stream, Shift_Opcode opc, const RM_Opnd &rm, const R_Opnd &r, Opnd_Size sz=size_platf) |
char * | mul (char *stream, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | imul (char *stream, const R_Opnd &r, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | imul (char *stream, const R_Opnd &r, const Imm_Opnd &imm, Opnd_Size sz=size_platf) |
char * | imul (char *stream, const R_Opnd &r, const RM_Opnd &rm, const Imm_Opnd &imm, Opnd_Size sz=size_platf) |
char * | idiv (char *stream, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | mov (char *stream, const M_Opnd &m, const R_Opnd &r, Opnd_Size sz=size_platf) |
char * | mov (char *stream, const R_Opnd &r, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | mov (char *stream, const RM_Opnd &rm, const Imm_Opnd &imm, Opnd_Size sz=size_platf) |
char * | movsx (char *stream, const R_Opnd &r, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | movzx (char *stream, const R_Opnd &r, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | movd (char *stream, const RM_Opnd &rm, const XMM_Opnd &xmm) |
char * | movd (char *stream, const XMM_Opnd &xmm, const RM_Opnd &rm) |
char * | movq (char *stream, const RM_Opnd &rm, const XMM_Opnd &xmm) |
char * | movq (char *stream, const XMM_Opnd &xmm, const RM_Opnd &rm) |
char * | sse_mov (char *stream, const XMM_Opnd &xmm, const M_Opnd &mem, bool dbl) |
char * | sse_mov (char *stream, const M_Opnd &mem, const XMM_Opnd &xmm, bool dbl) |
char * | sse_mov (char *stream, const XMM_Opnd &xmm0, const XMM_Opnd &xmm1, bool dbl) |
char * | sse_add (char *stream, const XMM_Opnd &xmm, const M_Opnd &mem, bool dbl) |
char * | sse_add (char *stream, const XMM_Opnd &xmm0, const XMM_Opnd &xmm1, bool dbl) |
char * | sse_sub (char *stream, const XMM_Opnd &xmm, const M_Opnd &mem, bool dbl) |
char * | sse_sub (char *stream, const XMM_Opnd &xmm0, const XMM_Opnd &xmm1, bool dbl) |
char * | sse_mul (char *stream, const XMM_Opnd &xmm, const M_Opnd &mem, bool dbl) |
char * | sse_mul (char *stream, const XMM_Opnd &xmm0, const XMM_Opnd &xmm1, bool dbl) |
char * | sse_div (char *stream, const XMM_Opnd &xmm, const M_Opnd &mem, bool dbl) |
char * | sse_div (char *stream, const XMM_Opnd &xmm0, const XMM_Opnd &xmm1, bool dbl) |
char * | sse_xor (char *stream, const XMM_Opnd &xmm0, const XMM_Opnd &xmm1) |
char * | sse_compare (char *stream, const XMM_Opnd &xmm0, const XMM_Opnd &xmm1, bool dbl) |
char * | sse_compare (char *stream, const XMM_Opnd &xmm0, const M_Opnd &mem, bool dbl) |
char * | sse_cvt_si (char *stream, const XMM_Opnd &xmm, const M_Opnd &mem, bool dbl) |
char * | sse_cvtt2si (char *stream, const R_Opnd ®, const M_Opnd &mem, bool dbl) |
char * | sse_cvtt2si (char *stream, const R_Opnd ®, const XMM_Opnd &xmm, bool dbl) |
char * | sse_cvt_fp2dq (char *stream, const XMM_Opnd &xmm0, const XMM_Opnd &xmm1, bool dbl) |
char * | sse_cvt_dq2fp (char *stream, const XMM_Opnd &xmm0, const XMM_Opnd &xmm1, bool dbl) |
char * | sse_d2s (char *stream, const XMM_Opnd &xmm0, const M_Opnd &mem64) |
char * | sse_d2s (char *stream, const XMM_Opnd &xmm0, const XMM_Opnd &xmm1) |
char * | sse_s2d (char *stream, const XMM_Opnd &xmm0, const M_Opnd &mem32) |
char * | sse_s2d (char *stream, const XMM_Opnd &xmm0, const XMM_Opnd &xmm1) |
char * | cmov (char *stream, ConditionCode cc, const R_Opnd &r, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | setcc (char *stream, ConditionCode cc, const RM_Opnd &rm8) |
char * | lea (char *stream, const R_Opnd &r, const M_Opnd &m, Opnd_Size sz=size_platf) |
char * | cdq (char *stream) |
char * | wait (char *stream) |
char * | loop (char *stream, const Imm_Opnd &imm) |
char * | jump8 (char *stream, const Imm_Opnd &imm) |
char * | jump32 (char *stream, const Imm_Opnd &imm) |
char * | jump (char *stream, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | jump (char *stream, char *target) |
char * | branch8 (char *stream, ConditionCode cc, const Imm_Opnd &imm, InstrPrefix prefix=no_prefix) |
char * | branch32 (char *stream, ConditionCode cc, const Imm_Opnd &imm, InstrPrefix prefix=no_prefix) |
char * | branch (char *stream, ConditionCode cc, int32 disp, InstrPrefix prefix=no_prefix) |
char * | call (char *stream, const Imm_Opnd &imm) |
char * | call (char *stream, const RM_Opnd &rm, Opnd_Size sz=size_platf) |
char * | call (char *stream, const char *target) |
char * | ret (char *stream) |
char * | ret (char *stream, unsigned short pop) |
char * | ret (char *stream, const Imm_Opnd &imm) |
char * | set_d (char *stream, bool set) |
char * | scas (char *stream, unsigned char prefix) |
char * | stos (char *stream, unsigned char prefix) |
char * | fldcw (char *stream, const M_Opnd &mem) |
char * fcompp(char * stream); | |
char * | fnstcw (char *stream, const M_Opnd &mem) |
char * | fnstsw (char *stream) |
char * | fld (char *stream, const M_Opnd &m, bool is_double) |
char * fchs(char * stream); char * frem(char * stream); char * fxch(char * stream,unsigned i); char * fcomip(char * stream, unsigned i); | |
char * | fist (char *stream, const M_Opnd &mem, bool is_long, bool pop_stk) |
char * fldz(char * stream); char * fld1(char * stream); | |
char * | fst (char *stream, const M_Opnd &m, bool is_double, bool pop_stk) |
char * | fst (char *stream, unsigned i, bool pop_stk) |
char * | fprem (char *stream) |
char *math_fsin(char * stream); char *math_fcos(char * stream); char *math_fabs(char * stream); char *math_fpatan(char * stream); | |
char * | fprem1 (char *stream) |
Variables | |
const int | MAX_GR = 0 |
const int | MAX_FR = 0 |
R_Opnd | eax_opnd |
R_Opnd | ecx_opnd |
R_Opnd | edx_opnd |
R_Opnd | ebx_opnd |
R_Opnd | esp_opnd |
R_Opnd | ebp_opnd |
R_Opnd | esi_opnd |
R_Opnd | edi_opnd |
XMM_Opnd | xmm0_opnd |
XMM_Opnd | xmm1_opnd |
XMM_Opnd | xmm2_opnd |
XMM_Opnd | xmm3_opnd |
XMM_Opnd | xmm4_opnd |
XMM_Opnd | xmm5_opnd |
XMM_Opnd | xmm6_opnd |
XMM_Opnd | xmm7_opnd |
#define GR_STACK_SIZE 4 |
#define FR_STACK_SIZE 8 |
#define ENCODER_DECLARE_EXPORT inline |
enum Reg_No |
enum Opnd_Size |
enum ALU_Opcode |
enum Shift_Opcode |
enum ConditionCode |
enum InstrPrefix |
char* prefix | ( | char * | stream, | |
InstrPrefix | p | |||
) |
char* push | ( | char * | stream, | |
const Imm_Opnd & | imm | |||
) |
char* nop | ( | char * | stream | ) |
char* int3 | ( | char * | stream | ) |
char* alu | ( | char * | stream, | |
ALU_Opcode | opc, | |||
const RM_Opnd & | rm, | |||
const Imm_Opnd & | imm, | |||
Opnd_Size | sz = size_platf | |||
) |
char* alu | ( | char * | stream, | |
ALU_Opcode | opc, | |||
const M_Opnd & | m, | |||
const R_Opnd & | r, | |||
Opnd_Size | sz = size_platf | |||
) |
char* alu | ( | char * | stream, | |
ALU_Opcode | opc, | |||
const R_Opnd & | r, | |||
const RM_Opnd & | rm, | |||
Opnd_Size | sz = size_platf | |||
) |
char* shift | ( | char * | stream, | |
Shift_Opcode | opc, | |||
const RM_Opnd & | rm, | |||
const Imm_Opnd & | imm, | |||
Opnd_Size | sz = size_platf | |||
) |
char* shift | ( | char * | stream, | |
Shift_Opcode | opc, | |||
const RM_Opnd & | rm, | |||
Opnd_Size | sz = size_platf | |||
) |
char* shift | ( | char * | stream, | |
Shift_Opcode | opc, | |||
const RM_Opnd & | rm, | |||
const R_Opnd & | r, | |||
const Imm_Opnd & | imm, | |||
Opnd_Size | sz = size_platf | |||
) |
char* shift | ( | char * | stream, | |
Shift_Opcode | opc, | |||
const RM_Opnd & | rm, | |||
const R_Opnd & | r, | |||
Opnd_Size | sz = size_platf | |||
) |
char* imul | ( | char * | stream, | |
const R_Opnd & | r, | |||
const RM_Opnd & | rm, | |||
const Imm_Opnd & | imm, | |||
Opnd_Size | sz = size_platf | |||
) |
char* cmov | ( | char * | stream, | |
ConditionCode | cc, | |||
const R_Opnd & | r, | |||
const RM_Opnd & | rm, | |||
Opnd_Size | sz = size_platf | |||
) |
char* setcc | ( | char * | stream, | |
ConditionCode | cc, | |||
const RM_Opnd & | rm8 | |||
) |
char* cdq | ( | char * | stream | ) |
char* wait | ( | char * | stream | ) |
char* loop | ( | char * | stream, | |
const Imm_Opnd & | imm | |||
) |
char* jump8 | ( | char * | stream, | |
const Imm_Opnd & | imm | |||
) |
char* jump32 | ( | char * | stream, | |
const Imm_Opnd & | imm | |||
) |
char* jump | ( | char * | stream, | |
char * | target | |||
) |
char* branch8 | ( | char * | stream, | |
ConditionCode | cc, | |||
const Imm_Opnd & | imm, | |||
InstrPrefix | prefix = no_prefix | |||
) |
char* branch32 | ( | char * | stream, | |
ConditionCode | cc, | |||
const Imm_Opnd & | imm, | |||
InstrPrefix | prefix = no_prefix | |||
) |
char* branch | ( | char * | stream, | |
ConditionCode | cc, | |||
int32 | disp, | |||
InstrPrefix | prefix = no_prefix | |||
) |
char* call | ( | char * | stream, | |
const Imm_Opnd & | imm | |||
) |
char* call | ( | char * | stream, | |
const char * | target | |||
) |
char* ret | ( | char * | stream | ) |
char* ret | ( | char * | stream, | |
unsigned short | pop | |||
) |
char* ret | ( | char * | stream, | |
const Imm_Opnd & | imm | |||
) |
char* set_d | ( | char * | stream, | |
bool | set | |||
) |
char* scas | ( | char * | stream, | |
unsigned char | prefix | |||
) |
char* stos | ( | char * | stream, | |
unsigned char | prefix | |||
) |
char* fldcw | ( | char * | stream, | |
const M_Opnd & | mem | |||
) |
char * fcompp(char * stream);
char* fnstcw | ( | char * | stream, | |
const M_Opnd & | mem | |||
) |
char* fnstsw | ( | char * | stream | ) |
char* fld | ( | char * | stream, | |
const M_Opnd & | m, | |||
bool | is_double | |||
) |
char * fchs(char * stream); char * frem(char * stream); char * fxch(char * stream,unsigned i); char * fcomip(char * stream, unsigned i);
char* fist | ( | char * | stream, | |
const M_Opnd & | mem, | |||
bool | is_long, | |||
bool | pop_stk | |||
) |
char * fldz(char * stream); char * fld1(char * stream);
char* fst | ( | char * | stream, | |
const M_Opnd & | m, | |||
bool | is_double, | |||
bool | pop_stk | |||
) |
char* fst | ( | char * | stream, | |
unsigned | i, | |||
bool | pop_stk | |||
) |
char* fprem | ( | char * | stream | ) |
char *math_fsin(char * stream); char *math_fcos(char * stream); char *math_fabs(char * stream); char *math_fpatan(char * stream);
char* fprem1 | ( | char * | stream | ) |
const int MAX_GR = 0 |
const int MAX_FR = 0 |
Genereated on Tue Mar 11 19:25:41 2008 by Doxygen.
(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.