![]() |
The ROme OpTimistic Simulator
2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
x86 ISA disassembler header More...
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | insn_info_x86 |
struct | disassembly_state |
struct | _insn |
Macros | |
#define | DATA_32 0x01 |
Data fields in instructions are 32-bits. | |
#define | ADDR_32 0x02 |
Address fields in instructions are 32-bits. | |
#define | DATA_64 0x04 |
Data fields in instructions are 64-bits. | |
#define | ADDR_64 0x08 |
Address fields in instructions are 64-bits. | |
#define | I_MEMRD 0x1 |
#define | I_MEMWR 0x2 |
#define | I_CTRL 0x4 |
#define | I_JUMP 0x8 |
#define | I_CALL 0x10 |
#define | I_RET 0x20 |
#define | I_CONDITIONAL 0x40 |
#define | I_STRING 0x80 |
#define | I_ALU 0x100 |
#define | I_FPU 0x200 |
#define | I_MMX 0x400 |
#define | I_XMM 0x800 |
#define | I_SSE 0x1000 |
#define | I_SSE2 0x2000 |
#define | I_PUSHPOP 0x4000 |
#define | I_STACK 0x8000 |
#define | I_JUMPIND 0x10000 |
#define | I_CALLIND 0x20000 |
#define | I_MEMIND 0x40000 |
#define | IS_MEMRD(X) ((X)->flags & I_MEMRD) |
#define | IS_MEMWR(X) ((X)->flags & I_MEMWR) |
#define | IS_MEMIND(X) ((X)->flags & I_MEMIND) |
#define | IS_CTRL(X) ((X)->flags & I_CTRL) |
#define | IS_JUMP(X) ((X)->flags & I_JUMP) |
#define | IS_JUMPIND(X) ((X)->flags & I_JUMPIND) |
#define | IS_CALL(X) ((X)->flags & I_CALL) |
#define | IS_CALLIND(X) ((X)->flags & I_CALLIND) |
#define | IS_RET(X) ((X)->flags & I_RET) |
#define | IS_CONDITIONAL(X) ((X)->flags & I_CONDITIONAL) |
#define | IS_STRING(X) ((X)->flags & I_STRING) |
#define | IS_ALU(X) ((X)->flags & I_ALU) |
#define | IS_FPU(X) ((X)->flags & I_FPU) |
#define | IS_MMX(X) ((X)->flags & I_MMX) |
#define | IS_XMM(X) ((X)->flags & I_XMM) |
#define | IS_SSE(X) ((X)->flags & I_SSE) |
#define | IS_SSE2(X) ((X)->flags & I_SSE2) |
#define | IS_PUSHPOP(X) ((X)->flags & I_PUSHPOP) |
#define | IS_STACK(X) ((X)->flags & I_STACK) |
#define | I_MEMRD_S "I_MEMRD" |
#define | I_MEMWR_S "I_MEMWR" |
#define | I_MEMIND_S "I_MEMIND" |
#define | I_CTRL_S "I_CTRL" |
#define | I_JUMP_S "I_JUMP" |
#define | I_JUMPIND_S "I_JUMPIND" |
#define | I_CALL_S "I_CALL" |
#define | I_CALLIND_S "I_CALLIND" |
#define | I_RET_S "I_RET" |
#define | I_CONDITIONAL_S "I_CONDITIONAL" |
#define | I_STRING_S "I_STRING" |
#define | I_ALU_S "I_ALU" |
#define | I_FPU_S "I_FPU" |
#define | I_MMX_S "I_MMX" |
#define | I_XMM_S "I_XMM" |
#define | I_SSE_S "I_SSE" |
#define | I_SSE2_S "I_SSE2" |
#define | I_PUSHPOP_S "I_PUSHPOP" |
#define | I_STACK_S "I_STACK" |
#define | UNRECOG_INSN 0 |
#define | X86_INSN 7 |
#define | A32(f) ((f) & ADDR_32) |
#define | D32(f) ((f) & DATA_32) |
#define | A64(f) ((f) & ADDR_64) |
#define | D64(f) ((f) & DATA_64) |
#define | p_is_group1(p) |
#define | p_is_group2(p) |
#define | p_is_group3(p) ((p) == 0x66) /* opsize override */ |
#define | p_is_group4(p) ((p) == 0x67) /* addr size override */ |
#define | is_prefix(o) |
#define | is_sse_prefix(o) (((o) == 0xf2) || ((o) == 0xf3) || ((o) == 0x66)) |
#define | is_rex_prefix(r, mode64) (((r) >= 0x40 && (r) <= 0x4f ) && (mode64)) |
#define | REXW(r) (((r) & 0x08) >> 3) |
#define | REXR(r) (((r) & 0x04) >> 2) |
#define | REXX(r) (((r) & 0x02) >> 1) |
#define | REXB(r) (((r) & 0x01)) |
#define | is_jcc_insn(o) (((o) == 0xe3) || (((o) >= 0x70) && ((o) <= 0x7f))) |
#define | is_esc_jcc_insn(o) (((o) >= 0x80) && ((o) <= 0x8f)) |
#define | has_modrm(addr) |
#define | has_sib(modrm, addr) |
#define | disp_size(modrm, addr) |
Typedefs | |
typedef struct insn_info_x86 | insn_info_x86 |
typedef struct _insn | insn |
typedef struct _insn * | insn_table |
Functions | |
void | x86_disassemble_instruction (unsigned char *text, unsigned long *pos, insn_info_x86 *instrument, char flags) |
x86 ISA disassembler header
This is an x86 ISA disassembler. The disassembly (which is table-based) extracts every possible information from an instruction, given a pointer to it.
This is a complete disassembler until SSE2 instructions. Newer instructions support is far from complete. Although it has been extensively tested (it has correctly disassembled the Linux kernel and Photoshop), it is extremely possible that some bugs are hidden somewhere.
This file is part of ROOT-Sim (ROme OpTimistic Simulator).
ROOT-Sim is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; only version 3 of the License applies.
ROOT-Sim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with ROOT-Sim; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file disassemble.h.
#define disp_size | ( | modrm, | |
addr | |||
) |
Definition at line 237 of file disassemble.h.
#define has_modrm | ( | addr | ) |
Definition at line 211 of file disassemble.h.
#define has_sib | ( | modrm, | |
addr | |||
) |
Definition at line 226 of file disassemble.h.
#define is_prefix | ( | o | ) |
Definition at line 185 of file disassemble.h.
#define p_is_group1 | ( | p | ) |
Definition at line 170 of file disassemble.h.
#define p_is_group2 | ( | p | ) |
Definition at line 174 of file disassemble.h.