Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | avr_decoder_t |
Macros | |
#define | MAX_TOKENS 6 |
#define | IS_INDIRECT_ADDRESS_REGISTER(x) ((x)=='x'||(x)=='y'||(x)=='z') |
#define | throw_error(msg, ...) |
#define | return_error_if_empty_input(a, b) |
#define | expected_const_or_error(a, exp) |
#define | parse_register_or_error_limit(rn, rs, min, max) |
#define | parse_register_or_error(rn, rs) |
#define | parse_register_pair_or_error(rn, rs) |
Parse things like "r25:r24" or just "r24". Result would be 24 in both cases. More... | |
#define | parse_unsigned_or_error(rn, rs, limit) |
#define | parse_address_or_error(rn, rs, pc, llow, lhigh) |
#define | parse_signed_or_error(rn, rs, min, max) |
#define | auto_write16(buf, val, be) |
Typedefs | |
typedef ut32(* | Encode) (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
typedef struct avr_decoder_t | AvrInstruction |
Functions | |
static ut32 | avr_unique (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_rdddddrrrr (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_KKddKKKK (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_KKKKddddKKKK (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_cbr (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_dddddcccc (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_dddddcbbb (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_kkkkkkkccc (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_kkkkkccck (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_AAAAAbbb (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_dddddddddd (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_KKKKcccc (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_elpm (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_dddcrrr (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_AAdddddAAAA (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_rrrrrcccc (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_ld (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_ldd (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_lds (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_lpm (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_kkkkkkkkkkkk (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_ddddrrrr (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_ddddrrrr_2x (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_AArrrrrAAAA (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_rrrrrcbbb (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_ddddcccc (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_spm (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_st (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_std (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_sts (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_ssscccc (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static ut32 | avr_kkkkkkksss (ut16 cbins, cchar **tokens, ut32 ntokens, ut8 *data, ut64 pc, bool be) |
static char * | strdup_limit (cchar *begin, cchar *end) |
static void | sanitize_input (char *cinput, st32 input_size) |
static char ** | tokens_new (cchar *input, st32 input_size, ut32 *ntokens) |
static void | tokens_free (char **tokens) |
ut32 | avr_assembler (const char *input, st32 input_size, ut8 *output, st32 output_size, ut64 pc, bool be) |
Variables | |
static const AvrInstruction | instructions [] |
Definition at line 163 of file assembler.c.
#define expected_const_or_error | ( | a, | |
exp | |||
) |
Definition at line 24 of file assembler.c.
Definition at line 8 of file assembler.c.
#define MAX_TOKENS 6 |
Definition at line 7 of file assembler.c.
Definition at line 120 of file assembler.c.
#define parse_register_or_error | ( | rn, | |
rs | |||
) |
Definition at line 49 of file assembler.c.
Definition at line 32 of file assembler.c.
#define parse_register_pair_or_error | ( | rn, | |
rs | |||
) |
Parse things like "r25:r24" or just "r24". Result would be 24 in both cases.
Definition at line 67 of file assembler.c.
Definition at line 145 of file assembler.c.
Definition at line 101 of file assembler.c.
Definition at line 16 of file assembler.c.
#define throw_error | ( | msg, | |
... | |||
) |
Definition at line 10 of file assembler.c.
typedef struct avr_decoder_t AvrInstruction |
Definition at line 172 of file assembler.c.
|
static |
Definition at line 317 of file assembler.c.
References A, auto_write16, b, and parse_unsigned_or_error.
|
static |
Definition at line 407 of file assembler.c.
References A, auto_write16, parse_register_or_error, and parse_unsigned_or_error.
|
static |
Definition at line 640 of file assembler.c.
References A, auto_write16, parse_register_or_error, and parse_unsigned_or_error.
ut32 avr_assembler | ( | const char * | input, |
st32 | input_size, | ||
ut8 * | output, | ||
st32 | output_size, | ||
ut64 | pc, | ||
bool | be | ||
) |
Definition at line 1084 of file assembler.c.
References AVR_INVALID_SIZE, avr_decoder_t::encode, i, input(), instructions, avr_decoder_t::maxtoks, avr_decoder_t::mintoks, output, pc, return_error_if_empty_input, RZ_ARRAY_SIZE, RZ_LOG_ERROR, rz_str_casecmp(), tokens_free(), and tokens_new().
Referenced by assemble().
|
static |
Definition at line 244 of file assembler.c.
References auto_write16, parse_register_or_error_limit, and parse_unsigned_or_error.
|
static |
Definition at line 390 of file assembler.c.
References auto_write16, and parse_register_or_error_limit.
|
static |
Definition at line 668 of file assembler.c.
References auto_write16, and parse_register_or_error_limit.
|
static |
Definition at line 273 of file assembler.c.
References auto_write16, b, parse_register_or_error, and parse_unsigned_or_error.
|
static |
|
static |
|
static |
Definition at line 602 of file assembler.c.
References auto_write16, parse_register_or_error, and throw_error.
|
static |
Definition at line 624 of file assembler.c.
References auto_write16, and parse_register_or_error_limit.
|
static |
Definition at line 358 of file assembler.c.
References auto_write16, expected_const_or_error, parse_register_or_error, and throw_error.
|
static |
Definition at line 205 of file assembler.c.
References auto_write16, parse_register_pair_or_error, parse_unsigned_or_error, and throw_error.
|
static |
|
static |
Definition at line 227 of file assembler.c.
References auto_write16, parse_register_or_error_limit, and parse_unsigned_or_error.
|
static |
Definition at line 298 of file assembler.c.
References auto_write16, k, and parse_unsigned_or_error.
|
static |
Definition at line 288 of file assembler.c.
References auto_write16, k, parse_address_or_error, pc, and st16.
|
static |
Definition at line 591 of file assembler.c.
References auto_write16, k, parse_address_or_error, pc, and st16.
|
static |
Definition at line 866 of file assembler.c.
References auto_write16, b, k, parse_address_or_error, parse_unsigned_or_error, pc, and st16.
|
static |
Definition at line 434 of file assembler.c.
References auto_write16, parse_register_or_error, and throw_error.
|
static |
Definition at line 493 of file assembler.c.
References auto_write16, parse_register_or_error, parse_unsigned_or_error, and throw_error.
|
static |
Definition at line 524 of file assembler.c.
References auto_write16, k, parse_register_or_error, and parse_unsigned_or_error.
|
static |
Definition at line 558 of file assembler.c.
References auto_write16, expected_const_or_error, parse_register_or_error, and throw_error.
|
static |
|
static |
Definition at line 655 of file assembler.c.
References auto_write16, b, parse_register_or_error, and parse_unsigned_or_error.
|
static |
Definition at line 421 of file assembler.c.
References auto_write16, expected_const_or_error, and parse_register_or_error.
|
static |
Definition at line 681 of file assembler.c.
References auto_write16, expected_const_or_error, and throw_error.
|
static |
Definition at line 855 of file assembler.c.
References auto_write16, b, and parse_unsigned_or_error.
|
static |
Definition at line 702 of file assembler.c.
References auto_write16, parse_register_or_error, and throw_error.
|
static |
Definition at line 761 of file assembler.c.
References auto_write16, expected_const_or_error, parse_register_or_error, parse_unsigned_or_error, and throw_error.
|
static |
Definition at line 820 of file assembler.c.
References auto_write16, k, parse_register_or_error, and parse_unsigned_or_error.
|
static |
Definition at line 183 of file assembler.c.
References auto_write16.
|
static |
Definition at line 1002 of file assembler.c.
References test_evm::end, malloc(), memcpy(), NULL, and cmd_descs_generate::str.
Referenced by tokens_new().
|
static |
Definition at line 1073 of file assembler.c.
References free(), i, and MAX_TOKENS.
Referenced by avr_assembler().
Definition at line 1024 of file assembler.c.
References count, test_evm::end, free(), i, input(), MAX_TOKENS, NULL, RZ_NEWS0, rz_str_trim_head_ro(), rz_str_trim_head_wp(), rz_warn_if_fail, rz_warn_if_reached, sanitize_input(), start, strdup(), and strdup_limit().
Referenced by avr_assembler().
|
static |
Definition at line 880 of file assembler.c.
Referenced by anop32(), avr_assembler(), rz_core_write_assembly(), rz_core_write_assembly_fill(), rz_write_assembly_file_handler(), rz_write_assembly_handler(), and rz_write_assembly_inside_handler().