#include <x86asm.h>
Inheritance diagram for x86asm:
Public Member Functions | |
x86asm (int opsize, int addrsize) | |
virtual | ~x86asm () |
virtual asm_insn * | alloc_insn () |
virtual asm_code * | encode (asm_insn *asm_insn, int options, CPU_ADDR cur_address) |
virtual char * | get_name () |
virtual int | translate_str (asm_insn *asm_insn, const char *s) |
Public Attributes | |
int | opsize |
int | addrsize |
Protected Member Functions | |
void | delete_nonsense () |
int | delete_nonsense_insn (asm_code *c) |
void | emitdisp (dword disp, int size) |
void | emitfarptr (dword s, dword o, bool big) |
void | emitimm (dword imm, int size) |
void | emitmodrm (int modrm) |
void | emitmodrm_mod (int mod) |
void | emitmodrm_reg (int reg) |
void | emitmodrm_rm (int rm) |
void | emitsib_base (int base) |
void | emitsib_index (int index) |
void | emitsib_scale (int scale) |
int | encode_insn (x86asm_insn *insn, x86opc_insn *opcode, int opcodeb, int additional_opcode, int prefix, int eopsize, int eaddrsize) |
int | encode_modrm (x86_insn_op *op, char size, int allow_reg, int allow_mem, int eopsize, int eaddrsize) |
int | encode_modrm_v (x86addrcoding(*modrmc)[3][8], x86_insn_op *op, int mindispsize, int *mod, int *rm, int *dispsize) |
int | encode_op (x86_insn_op *op, x86opc_insn_op *xop, int *esize, int eopsize, int eaddrsize) |
int | encode_sib_v (x86_insn_op *op, int mindispsize, int *ss, int *index, int *base, int *mod, int *dispsize, int *disp) |
int | esizeaddr (char c, int size) |
int | esizeop (char c, int size) |
int | fetch_number (char **s, dword *value) |
char | flsz2hsz (int size) |
char * | immlsz2hsz (int size, int opsize) |
char * | lsz2hsz (int size, int opsize) |
int | match_allops (x86asm_insn *insn, x86opc_insn *xinsn, int opsize, int addrsize) |
void | match_fopcodes (x86asm_insn *insn) |
void | match_opcode (x86opc_insn *opcode, x86asm_insn *insn, int prefix, byte opcodebyte, int additional_opcode) |
int | match_opcode_name (char *input_name, char *opcodelist_name) |
int | match_opcode_final (x86opc_insn *opcode, x86asm_insn *insn, int prefix, byte opcodebyte, int additional_opcode, int opsize, int addrsize) |
void | match_opcodes (x86opc_insn *opcodes, x86asm_insn *insn, int prefix) |
int | match_size (x86_insn_op *op, x86opc_insn_op *xop, int opsize) |
int | match_type (x86_insn_op *op, x86opc_insn_op *xop, int addrsize) |
int | opfarptr (x86_insn_op *op, char *xop) |
int | opimm (x86_insn_op *op, char *xop) |
int | opplugimm (x86_insn_op *op, char *xop) |
int | opmem (x86asm_insn *asm_insn, x86_insn_op *op, char *xop) |
int | opreg (x86_insn_op *op, char *xop) |
int | opseg (x86_insn_op *op, char *xop) |
int | opspecialregs (x86_insn_op *op, char *xop) |
int | simmsize (dword imm, int immsize) |
void | splitstr (const char *s, char *name, char *op[3]) |
Protected Attributes | |
int | esizes [3] |
int | modrmv |
int | sibv |
int | disp |
int | dispsize |
int | imm |
int | imm2 |
int | immsize |
int | address |
bool | ambiguous |
bool | namefound |
bool | addrsize_depend |
|
|
|
|
|
Reimplemented from Assembler. |
|
Definition at line 208 of file x86asm.cc. References delete_nonsense_insn(), and asm_code::next. Referenced by encode(). |
|
Definition at line 218 of file x86asm.cc. References byte, asm_code::context, asm_code::data, Assembler::deletecode(), asm_code::next, asm_code::size, and size. Referenced by delete_nonsense(). |
|
Definition at line 247 of file x86asm.cc. References disp, dispsize, and size. Referenced by encode_modrm(), and encode_op(). |
|
Definition at line 259 of file x86asm.cc. References imm, imm2, and immsize. Referenced by encode_op(). |
|
Definition at line 253 of file x86asm.cc. References imm, immsize, and size. Referenced by encode_op(). |
|
Definition at line 271 of file x86asm.cc. References modrmv. Referenced by encode_insn(). |
|
Definition at line 277 of file x86asm.cc. References modrmv. Referenced by encode_modrm(). |
|
Definition at line 283 of file x86asm.cc. References modrmv. Referenced by encode_insn(), and encode_op(). |
|
Definition at line 289 of file x86asm.cc. References modrmv. Referenced by encode_modrm(), and encode_op(). |
|
Definition at line 295 of file x86asm.cc. References sibv. Referenced by encode_modrm(). |
|
Definition at line 301 of file x86asm.cc. References sibv. Referenced by encode_modrm(). |
|
Definition at line 307 of file x86asm.cc. References sibv. Referenced by encode_modrm(). |
|
Reimplemented from Assembler. Definition at line 313 of file x86asm.cc. References CPU_ADDR::addr32, address, addrsize_depend, ambiguous, asm_insn, delete_nonsense(), Assembler::encode(), esizes, Assembler::free_asm_codes(), match_fopcodes(), match_opcodes(), x86asm_insn::name, namefound, Assembler::newcode(), x86asm_insn::op, options, Assembler::set_error_msg(), x86_insn_op::type, x86_insns, x86_insns_ext, X86_OPTYPE_MEM, X86ASM_ERRMSG_INVALID_OPERANDS, X86ASM_ERRMSG_UNKNOWN_COMMAND, X86ASM_PREFIX_0F, and X86ASM_PREFIX_NO. |
|
|
Definition at line 452 of file x86asm.cc. References addrsize, disp, dispsize, emitdisp(), emitmodrm_mod(), emitmodrm_rm(), emitsib_base(), emitsib_index(), emitsib_scale(), encode_modrm_v(), encode_sib_v(), x86_insn_op::mem, modrm16, modrm32, x86_insn_op::reg, simmsize(), x86_insn_op::type, X86_ADDRSIZE16, X86_ADDRSIZEUNKNOWN, X86_OPTYPE_MEM, and X86_OPTYPE_REG. Referenced by encode_op(). |
|
Definition at line 499 of file x86asm.cc. References x86addrcoding::dispsize, x86_insn_op::mem, x86addrcoding::reg1, and x86addrcoding::reg2. Referenced by encode_modrm(). |
|
Definition at line 522 of file x86asm.cc. References address, x86_insn_op::crx, x86_insn_op::drx, emitdisp(), emitfarptr(), emitimm(), emitmodrm_reg(), emitmodrm_rm(), encode_modrm(), esizeop(), x86opc_insn_op::extendedsize, x86_insn_op::farptr, x86_insn_op::imm, x86_insn_op::mem, x86_insn_op::reg, x86_insn_op::seg, asm_code::size, x86opc_insn_op::size, size, x86_insn_op::size, x86_insn_op::stx, x86_insn_op::trx, x86_insn_op::type, x86opc_insn_op::type, TYPE_0, TYPE_A, TYPE_C, TYPE_D, TYPE_E, TYPE_F, TYPE_Fx, TYPE_G, TYPE_I, TYPE_Is, TYPE_Ix, TYPE_J, TYPE_M, TYPE_O, TYPE_P, TYPE_Q, TYPE_R, TYPE_Rx, TYPE_S, TYPE_Sx, TYPE_T, X86_ADDRSIZE16, X86_ADDRSIZE32, X86_OPTYPE_FARPTR, and X86_REG_NO. Referenced by encode_insn(). |
|
Definition at line 639 of file x86asm.cc. References dispsize, x86_insn_op::mem, X86_REG_BP, X86_REG_NO, and X86_REG_SP. Referenced by encode_modrm(). |
|
Definition at line 719 of file x86asm.cc. References size, SIZE_A, SIZE_B, SIZE_C, SIZE_D, SIZE_P, SIZE_Q, SIZE_V, SIZE_W, and X86_ADDRSIZE16. |
|
Definition at line 742 of file x86asm.cc. References size, SIZE_B, SIZE_C, SIZE_D, SIZE_L, SIZE_P, SIZE_Q, SIZE_S, SIZE_T, SIZE_V, SIZE_W, and X86_OPSIZE16. Referenced by encode_op(), and match_size(). |
|
Definition at line 769 of file x86asm.cc. Referenced by opfarptr(), opimm(), and opmem(). |
|
Definition at line 789 of file x86asm.cc. References size, SIZE_L, SIZE_S, and SIZE_T. Referenced by match_size(). |
|
Reimplemented from Assembler. |
|
Definition at line 807 of file x86asm.cc. References immhsz16_16, immhsz16_32, immhsz32_16, immhsz32_32, immhsz8_16, immhsz8_32, size, and X86_OPSIZE16. Referenced by match_size(). |
|
Definition at line 831 of file x86asm.cc. References hsz16_16, hsz16_32, hsz32_16, hsz32_32, hsz48_16, hsz48_32, hsz64_16, hsz64_32, hsz8_16, hsz8_32, size, and X86_OPSIZE16. Referenced by match_size(). |
|
Definition at line 916 of file x86asm.cc. References match_size(), match_type(), x86opc_insn::op, and x86asm_insn::op. Referenced by match_fopcodes(), and match_opcode_final(). |
|
Definition at line 994 of file x86asm.cc. References addrsize, encode_insn(), x86opc_finsn::group, x86opc_finsn::insn, match_allops(), match_opcode_name(), MATCHOPNAME_NOMATCH, x86opc_insn::name, x86asm_insn::name, namefound, Assembler::newcode(), opsize, Assembler::pushcode(), X86_ADDRSIZE16, X86_ADDRSIZE32, x86_float_group_insns, x86_modfloat_group_insns, and X86ASM_PREFIX_D8. Referenced by encode(). |
|
Definition at line 949 of file x86asm.cc. References addrsize, addrsize_depend, ADDRSIZE_INV, match_opcode_final(), match_opcode_name(), MATCHOPNAME_MATCH_IF_OPSIZE16, MATCHOPNAME_MATCH_IF_OPSIZE32, MATCHOPNAME_NOMATCH, x86opc_insn::name, x86asm_insn::name, namefound, opsize, OPSIZE_INV, X86_OPSIZE16, and X86_OPSIZE32. Referenced by match_opcodes(). |
|
Definition at line 965 of file x86asm.cc. References encode_insn(), match_allops(), Assembler::newcode(), and Assembler::pushcode(). Referenced by match_opcode(). |
|
Definition at line 930 of file x86asm.cc. References MATCHOPNAME_MATCH, MATCHOPNAME_MATCH_IF_OPSIZE16, MATCHOPNAME_MATCH_IF_OPSIZE32, and MATCHOPNAME_NOMATCH. Referenced by match_fopcodes(), and match_opcode(). |
|
Definition at line 978 of file x86asm.cc. References x86opc_insn_op_special::data, match_opcode(), x86opc_insn::name, x86opc_insn::op, SPECIAL_TYPE_GROUP, x86opc_insn_op_special::type, and x86_group_insns. Referenced by encode(). |
|
Definition at line 887 of file x86asm.cc. References address, esizeop(), x86opc_insn_op::extendedsize, flsz2hsz(), x86_insn_op::imm, immlsz2hsz(), lsz2hsz(), x86_insn_op::mem, NULL, simmsize(), asm_code::size, size, x86opc_insn_op::size, x86_insn_op::size, x86opc_insn_op::type, x86_insn_op::type, TYPE_0, TYPE_Is, TYPE_J, X86_OPTYPE_EMPTY, X86_OPTYPE_IMM, X86_OPTYPE_MEM, and X86_OPTYPE_STX. Referenced by match_allops(). |
|
Definition at line 863 of file x86asm.cc. References x86opc_insn_op::extra, x86_insn_op::imm, lop2hop, x86_insn_op::mem, x86_insn_op::reg, x86_insn_op::seg, x86_insn_op::stx, x86opc_insn_op::type, x86_insn_op::type, TYPE_0, TYPE_Fx, TYPE_Ix, TYPE_Rx, TYPE_Sx, X86_ADDRSIZEUNKNOWN, X86_OPTYPE_EMPTY, and X86_OPTYPE_MEM. Referenced by match_allops(). |
|
Definition at line 1083 of file x86asm.cc. References dword, x86_insn_op::farptr, fetch_number(), x86_insn_op::size, x86_insn_op::type, and X86_OPTYPE_FARPTR. Referenced by translate_str(). |
|
Definition at line 1099 of file x86asm.cc. References dword, fetch_number(), x86_insn_op::imm, x86_insn_op::size, x86_insn_op::type, and X86_OPTYPE_IMM. Referenced by translate_str(). |
|
Definition at line 1123 of file x86asm.cc. References addrsize, asm_insn, buf, disp, dword, fetch_number(), Assembler::imm_eval_proc, x86_insn_op::mem, opsize, x86_insn_op::size, x86_insn_op::type, X86_ADDRSIZE16, X86_ADDRSIZE32, X86_ADDRSIZEUNKNOWN, X86_OPTYPE_MEM, X86_PREFIX_CS, X86_PREFIX_DS, X86_PREFIX_ES, X86_PREFIX_FS, X86_PREFIX_GS, X86_PREFIX_SS, X86_REG_NO, x86_regs, and x86_segs. Referenced by translate_str(). |
|
Definition at line 1110 of file x86asm.cc. References dword, x86_insn_op::imm, Assembler::imm_eval_proc, x86_insn_op::size, x86_insn_op::type, and X86_OPTYPE_IMM. Referenced by translate_str(). |
|
Definition at line 1055 of file x86asm.cc. References x86_insn_op::reg, reg2size, x86_insn_op::size, x86_insn_op::type, X86_OPTYPE_REG, and x86_regs. Referenced by translate_str(). |
|
Definition at line 1070 of file x86asm.cc. References x86_insn_op::seg, x86_insn_op::size, x86_insn_op::type, X86_OPTYPE_SEG, and x86_segs. Referenced by translate_str(). |
|
Definition at line 1305 of file x86asm.cc. References x86_insn_op::crx, x86_insn_op::drx, x86_insn_op::size, x86_insn_op::stx, x86_insn_op::trx, x86_insn_op::type, X86_OPTYPE_CRX, X86_OPTYPE_DRX, X86_OPTYPE_STX, and X86_OPTYPE_TRX. Referenced by translate_str(). |
|
Definition at line 1395 of file x86asm.cc. References sint16, sint32, and sint8. Referenced by encode_modrm(), and match_size(). |
|
Definition at line 1417 of file x86asm.cc. References isnotwhitespace(), and iswhitespace(). Referenced by translate_str(). |
|
Reimplemented from Assembler. Definition at line 1345 of file x86asm.cc. References asm_insn, isnotwhitespace(), iswhitespace(), x86asm_insn::lockprefix, x86asm_insn::n, x86asm_insn::name, x86asm_insn::op, opfarptr(), opimm(), opmem(), opplugimm(), opreg(), opseg(), opspecialregs(), x86asm_insn::repprefix, x86asm_insn::segprefix, Assembler::set_error_msg(), splitstr(), x86_insn_op::type, X86_OPTYPE_EMPTY, X86_PREFIX_LOCK, X86_PREFIX_NO, X86_PREFIX_REPNZ, X86_PREFIX_REPZ, and X86ASM_ERRMSG_UNKNOWN_SYMBOL. |
|
Definition at line 63 of file x86asm.h. Referenced by encode(), encode_op(), and match_size(). |
|
Definition at line 52 of file x86asm.h. Referenced by encode_insn(), encode_modrm(), match_fopcodes(), match_opcode(), opmem(), and x86asm(). |
|
Definition at line 66 of file x86asm.h. Referenced by encode(), and match_opcode(). |
|
Definition at line 64 of file x86asm.h. Referenced by encode(). |
|
Definition at line 58 of file x86asm.h. Referenced by emitdisp(), encode_insn(), encode_modrm(), and opmem(). |
|
Definition at line 59 of file x86asm.h. Referenced by emitdisp(), encode_insn(), encode_modrm(), and encode_sib_v(). |
|
Definition at line 54 of file x86asm.h. Referenced by encode(), and encode_insn(). |
|
Definition at line 60 of file x86asm.h. Referenced by emitfarptr(), emitimm(), and encode_insn(). |
|
Definition at line 61 of file x86asm.h. Referenced by emitfarptr(), and encode_insn(). |
|
Definition at line 62 of file x86asm.h. Referenced by emitfarptr(), emitimm(), and encode_insn(). |
|
Definition at line 56 of file x86asm.h. Referenced by emitmodrm(), emitmodrm_mod(), emitmodrm_reg(), emitmodrm_rm(), and encode_insn(). |
|
Definition at line 65 of file x86asm.h. Referenced by encode(), match_fopcodes(), and match_opcode(). |
|
Definition at line 51 of file x86asm.h. Referenced by encode_insn(), match_fopcodes(), match_opcode(), opmem(), and x86asm(). |
|
Definition at line 57 of file x86asm.h. Referenced by emitsib_base(), emitsib_index(), emitsib_scale(), and encode_insn(). |