Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | sh_param_t |
struct | sh_opcode_t |
Macros | |
#define | BITS_PER_BYTE 8 |
#define | SH_REG_SIZE 4 * BITS_PER_BYTE |
#define | SH_ADDR_SIZE 4 * BITS_PER_BYTE |
#define | SH_INSTR_SIZE 2 * BITS_PER_BYTE |
#define | SH_GPR_COUNT 16 |
#define | SH_BANKED_REG_COUNT 8 |
#define | SH_REG_COUNT 61 |
#define | SH_SR_T_BIT 1u << 0 |
#define | SH_SR_T "sr_t" |
SR.T: True/False condition or carry/borrow bit. More... | |
#define | SH_SR_S_BIT 1u << 1 |
#define | SH_SR_S "sr_s" |
SR.S: Specifies a saturation operation for a MAC instruction. More... | |
#define | SH_SR_I_BIT 1u << 4 |
#define | SH_SR_I "sr_i" |
SR.I: Interrupt mask level: External interrupts of a lower level than IMASK are masked. More... | |
#define | SH_SR_Q_BIT 1u << 8 |
#define | SH_SR_Q "sr_q" |
SR.Q: State for divide step (Used by the DIV0S, DIV0U and DIV1 instructions) More... | |
#define | SH_SR_M_BIT 1u << 9 |
#define | SH_SR_M "sr_m" |
SR.M: State for divide step (Used by the DIV0S, DIV0U and DIV1 instructions) More... | |
#define | SH_SR_F_BIT 1u << 15 |
#define | SH_SR_F "sr_f" |
SR.FD: FPU disable bit (cleared to 0 by a reset) More... | |
#define | SH_SR_B_BIT 1u << 28 |
#define | SH_SR_B "sr_b" |
SR.BL: Exception/interrupt block bit (set to 1 by a reset, exception, or interrupt) More... | |
#define | SH_SR_R_BIT 1u << 29 |
#define | SH_SR_R "sr_r" |
SR.RB: General register bank specifier in privileged mode (set to 1 by a reset, exception or interrupt) More... | |
#define | SH_SR_D_BIT 1u << 30 |
#define | SH_SR_D "sr_d" |
SR.MD: Processor mode. More... | |
Typedefs | |
typedef enum sh_addr_mode_t | SHAddrMode |
typedef enum sh_scaling_t | SHScaling |
typedef enum sh_register_index_t | SHRegisterIndex |
typedef struct sh_param_t | SHParam |
typedef struct sh_opcode_t | SHOp |
Functions | |
RZ_IPI RZ_OWN SHOp * | sh_disassembler (ut16 opcode) |
Disassemble opcode and return a SHOp. More... | |
RZ_IPI RZ_OWN char * | sh_op_param_to_str (SHParam param, SHScaling scaling, ut64 pc) |
Return string representation of disassembled param . More... | |
RZ_IPI RZ_OWN char * | sh_op_to_str (RZ_NONNULL const SHOp *op, ut64 pc) |
Return string representation of disassembled op . More... | |
Variables | |
static const ut8 | sh_scaling_size [] = { -1, 1, 2, 4, 8 } |
#define BITS_PER_BYTE 8 |
Definition at line 9 of file disassembler.h.
#define SH_ADDR_SIZE 4 * BITS_PER_BYTE |
Definition at line 11 of file disassembler.h.
#define SH_BANKED_REG_COUNT 8 |
Definition at line 14 of file disassembler.h.
#define SH_GPR_COUNT 16 |
Definition at line 13 of file disassembler.h.
#define SH_INSTR_SIZE 2 * BITS_PER_BYTE |
Definition at line 12 of file disassembler.h.
#define SH_REG_COUNT 61 |
Definition at line 15 of file disassembler.h.
#define SH_REG_SIZE 4 * BITS_PER_BYTE |
Definition at line 10 of file disassembler.h.
#define SH_SR_B "sr_b" |
SR.BL: Exception/interrupt block bit (set to 1 by a reset, exception, or interrupt)
Definition at line 61 of file disassembler.h.
#define SH_SR_B_BIT 1u << 28 |
Definition at line 60 of file disassembler.h.
#define SH_SR_D "sr_d" |
SR.MD: Processor mode.
Definition at line 65 of file disassembler.h.
#define SH_SR_D_BIT 1u << 30 |
Definition at line 64 of file disassembler.h.
#define SH_SR_F "sr_f" |
SR.FD: FPU disable bit (cleared to 0 by a reset)
Definition at line 59 of file disassembler.h.
#define SH_SR_F_BIT 1u << 15 |
Definition at line 58 of file disassembler.h.
#define SH_SR_I "sr_i" |
SR.I: Interrupt mask level: External interrupts of a lower level than IMASK are masked.
Definition at line 53 of file disassembler.h.
#define SH_SR_I_BIT 1u << 4 |
Definition at line 52 of file disassembler.h.
#define SH_SR_M "sr_m" |
SR.M: State for divide step (Used by the DIV0S, DIV0U and DIV1 instructions)
Definition at line 57 of file disassembler.h.
#define SH_SR_M_BIT 1u << 9 |
Definition at line 56 of file disassembler.h.
#define SH_SR_Q "sr_q" |
SR.Q: State for divide step (Used by the DIV0S, DIV0U and DIV1 instructions)
Definition at line 55 of file disassembler.h.
#define SH_SR_Q_BIT 1u << 8 |
Definition at line 54 of file disassembler.h.
#define SH_SR_R "sr_r" |
SR.RB: General register bank specifier in privileged mode (set to 1 by a reset, exception or interrupt)
Definition at line 63 of file disassembler.h.
#define SH_SR_R_BIT 1u << 29 |
Definition at line 62 of file disassembler.h.
#define SH_SR_S "sr_s" |
SR.S: Specifies a saturation operation for a MAC instruction.
Definition at line 51 of file disassembler.h.
#define SH_SR_S_BIT 1u << 1 |
Definition at line 50 of file disassembler.h.
#define SH_SR_T "sr_t" |
SR.T: True/False condition or carry/borrow bit.
Definition at line 49 of file disassembler.h.
#define SH_SR_T_BIT 1u << 0 |
Definition at line 48 of file disassembler.h.
typedef enum sh_addr_mode_t SHAddrMode |
typedef struct sh_opcode_t SHOp |
typedef struct sh_param_t SHParam |
typedef enum sh_register_index_t SHRegisterIndex |
Enum for register indexes
typedef enum sh_scaling_t SHScaling |
enum sh_addr_mode_t |
Definition at line 17 of file disassembler.h.
enum sh_register_index_t |
Enum for register indexes
Definition at line 70 of file disassembler.h.
enum sh_scaling_t |
Enumerator | |
---|---|
SH_SCALING_INVALID | |
SH_SCALING_B | byte |
SH_SCALING_W | word |
SH_SCALING_L | long word |
SH_SCALING_Q | quad word |
Definition at line 35 of file disassembler.h.
enum SHOpMnem |
Definition at line 152 of file disassembler.h.
Disassemble opcode
and return a SHOp.
opcode | 16 bit wide opcode |
Definition at line 130 of file disassembler.c.
References i, mask, sh_op_raw_t::mnemonic, MOVL, NULL, op, sh_op_raw_t::opcode, OPCODE_NUM, sh_op_raw_t::param_builder, RZ_LOG_DEBUG, RZ_NEW, sh_op_raw_t::scaling, sh_op_get_param(), sh_op_get_param_movl(), sh_op_lookup, and sh_op_raw_t::str_mnem.
Referenced by disassemble(), and sh_op().
Return string representation of disassembled param
.
SHParam | to be disassembled |
SHScaling | of the instruction associated with the param |
Definition at line 166 of file disassembler.c.
References sh_param_t::mode, NULL, sh_param_t::param, pc, rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), rz_warn_if_reached, SH_ADDR_INVALID, SH_GBR_INDIRECT_DISP, SH_GBR_INDIRECT_INDEXED, SH_IMM_S, SH_IMM_U, SH_PC_RELATIVE12, SH_PC_RELATIVE8, SH_PC_RELATIVE_DISP, SH_PC_RELATIVE_REG, SH_REG_DIRECT, SH_REG_INDIRECT, SH_REG_INDIRECT_D, SH_REG_INDIRECT_DISP, SH_REG_INDIRECT_I, SH_REG_INDIRECT_INDEXED, sh_registers, sh_scaling_size, st32, and st8.
Referenced by sh_op_to_str().
Return string representation of disassembled op
.
SHOp | to be disassembled |
Definition at line 224 of file disassembler.c.
References free(), NULL, pc, rz_return_val_if_fail, rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), and sh_op_param_to_str().
Referenced by disassemble().
Definition at line 43 of file disassembler.h.
Referenced by sh_il_get_effective_addr_pc_ctx(), sh_il_get_param_pc_ctx(), sh_op_movl_param_bits(), sh_op_param_bits(), and sh_op_param_to_str().