Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | ftable |
Macros | |
#define | mnem(n, mn) { #mn " ", &mnem_##mn, n }, |
#define | zeroarg_mnem(mn) { #mn, &mnem_##mn, 0 }, |
Typedefs | |
typedef bool(* | parse_mnem_args) (char const *const *, ut16, ut8 **) |
#define zeroarg_mnem | ( | mn | ) | { #mn, &mnem_##mn, 0 }, |
Definition at line 278 of file 8051_ass.c.
attempts to parse the given string as a bit-address
Definition at line 399 of file 8051_ass.c.
References address_direct(), bit, test_evm::end, free(), malloc(), rz_str_lchr(), and rz_str_ncpy().
Referenced by mnem_jb(), mnem_jbc(), mnem_jnb(), and singlearg_bit().
attempts to parse the given string as an 8bit-wide address
Definition at line 385 of file 8051_ass.c.
References parse_hexadecimal().
Referenced by address_bit(), mnem_anl(), mnem_cjne(), mnem_djnz(), mnem_mov(), mnem_orl(), mnem_xrl(), and singlearg_direct().
Definition at line 1183 of file 8051_ass.c.
References a, free(), get_arguments(), len, mnem, mnemonic(), rz_strbuf_set(), rz_strbuf_setbin(), and terminates_asm_line().
splits up the given string into multiple chucks, separated by unquoted commas. It will then copy chunk n-1 into dest, with the leading and trailing whitespace stripped.
if chunk n-1 does not exist or is empty, it will return false;
only text before newlines, NUL, and unquoted semicolons is chunked.
any text after a single-quote and before the next single-quote is considered quoted. There is no escaping.
Definition at line 126 of file 8051_ass.c.
Referenced by get_arguments().
tokenizes the argument list arg parameter must be 3 char pointers wide. TODO: merge with get_arg, as this is now the only user
Definition at line 189 of file 8051_ass.c.
References free(), get_arg(), malloc(), realloc(), and autogen_x86imm::tmp.
Referenced by assemble_8051().
matches registers r0 and r1 when they are indirectly-addressed. 8051-style syntax @r0, but also r2 defacto [r0]
Definition at line 333 of file 8051_ass.c.
References rz_str_ansi_nlen(), cmd_descs_generate::str, and tolower.
Referenced by mnem_addc(), mnem_anl(), mnem_cjne(), mnem_dec(), mnem_inc(), mnem_mov(), mnem_movx(), mnem_orl(), mnem_subb(), mnem_xch(), mnem_xchd(), mnem_xrl(), and register_number().
returns true if the given string denotes an 'r'-register
Definition at line 352 of file 8051_ass.c.
References rz_str_ansi_nlen(), cmd_descs_generate::str, and tolower.
Referenced by mnem_add(), mnem_addc(), mnem_anl(), mnem_cjne(), mnem_dec(), mnem_djnz(), mnem_inc(), mnem_mov(), mnem_orl(), mnem_subb(), mnem_xch(), mnem_xrl(), and register_number().
|
static |
Definition at line 311 of file 8051_ass.c.
References ftable::args, args, pattern_match(), ftable::res, and cmd_descs_generate::str.
Referenced by mnemonic().
Definition at line 533 of file 8051_ass.c.
References is_reg(), out, rz_str_casecmp(), singlearg_direct(), singlearg_immediate(), and singlearg_register().
Definition at line 552 of file 8051_ass.c.
References is_indirect_reg(), is_reg(), out, rz_str_casecmp(), singlearg_direct(), singlearg_immediate(), and singlearg_register().
Definition at line 568 of file 8051_ass.c.
References out, and to_address().
Referenced by mnem_jmp().
Definition at line 579 of file 8051_ass.c.
References address_direct(), imm, is_indirect_reg(), is_reg(), out, resolve_immediate(), rz_str_casecmp(), singlearg_bit(), singlearg_direct(), singlearg_immediate(), and singlearg_register().
Definition at line 617 of file 8051_ass.c.
References address_direct(), imm, is_indirect_reg(), is_reg(), out, pc, register_number(), relative_address(), resolve_immediate(), rz_str_casecmp(), and to_address().
Definition at line 669 of file 8051_ass.c.
References out, rz_str_casecmp(), single_byte_instr(), and singlearg_bit().
Definition at line 679 of file 8051_ass.c.
References out, rz_str_casecmp(), single_byte_instr(), and singlearg_bit().
Definition at line 689 of file 8051_ass.c.
References out, and single_a_arg_instr().
Definition at line 693 of file 8051_ass.c.
References is_indirect_reg(), is_reg(), out, rz_str_casecmp(), single_byte_instr(), singlearg_direct(), and singlearg_register().
Definition at line 706 of file 8051_ass.c.
References out, rz_str_casecmp(), and single_byte_instr().
Definition at line 713 of file 8051_ass.c.
References address_direct(), is_reg(), out, pc, register_number(), relative_address(), and to_address().
Definition at line 739 of file 8051_ass.c.
References is_indirect_reg(), is_reg(), out, rz_str_casecmp(), single_byte_instr(), singlearg_direct(), and singlearg_register().
Definition at line 755 of file 8051_ass.c.
References address_bit(), out, pc, relative_address(), and to_address().
Definition at line 771 of file 8051_ass.c.
References address_bit(), out, pc, relative_address(), and to_address().
Definition at line 787 of file 8051_ass.c.
References out, pc, and singlearg_reladdr().
Definition at line 1056 of file 8051_ass.c.
References mnem_ajmp(), mnem_ljmp(), mnem_sjmp(), out, pc, single_byte_instr(), str_iwhitecasecmp(), and to_address().
Definition at line 791 of file 8051_ass.c.
References address_bit(), out, pc, relative_address(), and to_address().
Definition at line 807 of file 8051_ass.c.
References out, pc, and singlearg_reladdr().
Definition at line 811 of file 8051_ass.c.
References out, pc, and singlearg_reladdr().
Definition at line 815 of file 8051_ass.c.
References out, pc, and singlearg_reladdr().
Definition at line 831 of file 8051_ass.c.
References out, and to_address().
Referenced by mnem_jmp().
Definition at line 847 of file 8051_ass.c.
References address_direct(), imm, is_indirect_reg(), is_reg(), out, register_number(), resolve_immediate(), rz_str_casecmp(), singlearg_bit(), singlearg_direct(), singlearg_immediate(), and singlearg_register().
Definition at line 843 of file 8051_ass.c.
References out, and singlearg_bit().
Referenced by mnemonic().
Definition at line 929 of file 8051_ass.c.
References out, rz_str_casecmp(), single_byte_instr(), and str_iwhitecasecmp().
Definition at line 942 of file 8051_ass.c.
References is_indirect_reg(), out, rz_str_casecmp(), single_byte_instr(), singlearg_register(), and str_iwhitecasecmp().
Definition at line 963 of file 8051_ass.c.
References out, rz_str_ncasecmp(), and single_byte_instr().
Definition at line 970 of file 8051_ass.c.
References out, and single_byte_instr().
Definition at line 974 of file 8051_ass.c.
References address_direct(), imm, is_indirect_reg(), is_reg(), out, resolve_immediate(), rz_str_casecmp(), singlearg_bit(), singlearg_direct(), singlearg_immediate(), and singlearg_register().
Definition at line 1013 of file 8051_ass.c.
References out, and singlearg_direct().
Definition at line 1017 of file 8051_ass.c.
References out, and singlearg_direct().
Definition at line 1021 of file 8051_ass.c.
References out, and single_byte_instr().
Definition at line 1025 of file 8051_ass.c.
References out, and single_byte_instr().
Definition at line 1029 of file 8051_ass.c.
References out, and single_a_arg_instr().
Definition at line 1033 of file 8051_ass.c.
References out, and single_a_arg_instr().
Definition at line 1037 of file 8051_ass.c.
References out, and single_a_arg_instr().
Definition at line 1041 of file 8051_ass.c.
References out, and single_a_arg_instr().
Definition at line 1045 of file 8051_ass.c.
References out, rz_str_casecmp(), single_byte_instr(), and singlearg_bit().
Definition at line 1052 of file 8051_ass.c.
References out, pc, and singlearg_reladdr().
Referenced by mnem_jmp().
Definition at line 1081 of file 8051_ass.c.
References is_indirect_reg(), is_reg(), out, rz_str_casecmp(), singlearg_direct(), singlearg_immediate(), and singlearg_register().
Definition at line 1097 of file 8051_ass.c.
References out, and single_a_arg_instr().
Definition at line 1135 of file 8051_ass.c.
References is_indirect_reg(), is_reg(), out, rz_str_casecmp(), singlearg_direct(), and singlearg_register().
Definition at line 1148 of file 8051_ass.c.
References is_indirect_reg(), out, rz_str_casecmp(), and singlearg_register().
Definition at line 1101 of file 8051_ass.c.
References address_direct(), imm, is_indirect_reg(), is_reg(), out, resolve_immediate(), rz_str_casecmp(), singlearg_direct(), singlearg_immediate(), and singlearg_register().
|
static |
Definition at line 1162 of file 8051_ass.c.
References add(), jmp, match_prefix_f(), mnem, mnem_mov_c(), mov(), mul(), cmd_descs_generate::nargs, swap, and zeroarg_mnem.
Referenced by assemble_8051().
Definition at line 92 of file 8051_ass.c.
Referenced by address_direct(), resolve_immediate(), and to_address().
Definition at line 286 of file 8051_ass.c.
References isspace, si, cmd_descs_generate::str, and tolower.
Referenced by match_prefix_f().
figures out which register is denoted by the given string returns 8 if invalid
Definition at line 444 of file 8051_ass.c.
References is_indirect_reg(), is_reg(), and reg.
Referenced by mnem_cjne(), mnem_djnz(), mnem_mov(), and singlearg_register().
returns true if the given number is a valid relative address from the given pc, the relative address is stored in the *out parameter.
Definition at line 360 of file 8051_ass.c.
References INT8_MAX, INT8_MIN, out, pc, and st16.
Referenced by mnem_cjne(), mnem_djnz(), mnem_jb(), mnem_jbc(), mnem_jnb(), and singlearg_reladdr().
Definition at line 370 of file 8051_ass.c.
References parse_hexadecimal().
Referenced by mnem_anl(), mnem_cjne(), mnem_mov(), mnem_orl(), mnem_xrl(), and singlearg_immediate().
Definition at line 511 of file 8051_ass.c.
References out, rz_str_casecmp(), and single_byte_instr().
Referenced by mnem_da(), mnem_rl(), mnem_rlc(), mnem_rr(), mnem_rrc(), and mnem_swap().
Definition at line 458 of file 8051_ass.c.
References out.
Referenced by mnem_clr(), mnem_cpl(), mnem_dec(), mnem_div(), mnem_inc(), mnem_jmp(), mnem_movc(), mnem_movx(), mnem_mul(), mnem_nop(), mnem_ret(), mnem_reti(), mnem_setb(), single_a_arg_instr(), and singlearg_register().
Definition at line 464 of file 8051_ass.c.
References address_bit(), and out.
Referenced by mnem_anl(), mnem_clr(), mnem_cpl(), mnem_mov(), mnem_mov_c(), mnem_orl(), and mnem_setb().
Definition at line 485 of file 8051_ass.c.
References address_direct(), and out.
Referenced by mnem_add(), mnem_addc(), mnem_anl(), mnem_dec(), mnem_inc(), mnem_mov(), mnem_orl(), mnem_pop(), mnem_push(), mnem_subb(), mnem_xch(), and mnem_xrl().
Definition at line 496 of file 8051_ass.c.
References imm, out, and resolve_immediate().
Referenced by mnem_add(), mnem_addc(), mnem_anl(), mnem_mov(), mnem_orl(), mnem_subb(), and mnem_xrl().
Definition at line 507 of file 8051_ass.c.
References out, reg, register_number(), and single_byte_instr().
Referenced by mnem_add(), mnem_addc(), mnem_anl(), mnem_dec(), mnem_inc(), mnem_mov(), mnem_movx(), mnem_orl(), mnem_subb(), mnem_xch(), mnem_xchd(), and mnem_xrl().
|
static |
Definition at line 475 of file 8051_ass.c.
References out, pc, relative_address(), and to_address().
Referenced by mnem_jc(), mnem_jnc(), mnem_jnz(), mnem_jz(), and mnem_sjmp().
Like rz_str_casecmp, but ignores all isspace characters
Definition at line 245 of file 8051_ass.c.
References a, b, isspace, and tolower.
Referenced by mnem_jmp(), mnem_movc(), and mnem_movx().
|
static |
returns true if there is no more valid assembly code after this character
Definition at line 238 of file 8051_ass.c.
References c.
Referenced by assemble_8051().
Definition at line 376 of file 8051_ass.c.
References parse_hexadecimal().
Referenced by mnem_acall(), mnem_ajmp(), mnem_cjne(), mnem_djnz(), mnem_jb(), mnem_jbc(), mnem_jmp(), mnem_jnb(), mnem_lcall(), mnem_ljmp(), and singlearg_reladdr().