41 printf(
"Opcode 0x%x reg %d mode %d operand 0x%x",
42 in->in_opcode,
in->in_reg,
in->in_mode,
in->in_operand);
49 switch (
i2u16(&
d->d_inst)) {
55 strcpy(
d->d_asm,
"nop");
57 case INST_BRK: strcpy(
d->d_asm,
"brk");
break;
59 case INST_SIF: strcpy(
d->d_asm,
"sif");
break;
60 case INST_BC: strcpy(
d->d_asm,
"bc");
break;
61 case INST_BRXL: strcpy(
d->d_asm,
"brxl");
break;
66 case INST_RTS: strcpy(
d->d_asm,
"rts");
break;
68 return d->d_asm[0] != 0;
75 case REG_X:
return "X";
76 case REG_Y:
return "Y";
87 int total =
get_num(
d->d_inst.in_operand, 0);
89 total +=
get_num(
s->s_prefix_val, 8);
91 total +=
get_num(
s->s_prefix_val, 16);
112 switch (
in->in_opcode) {
114 if (
in->in_reg == 0 &&
in->in_mode == 0) {
115 if (
s->s_prefix == 0)
119 if (
s->s_prefix == 2)
120 s->s_prefix_val <<= 8;
124 if (
s->s_nopd &&
in->in_operand == 0x80)
125 strcpy(
s->s_nopd->d_asm,
"");
127 s->s_prefix_val |=
in->in_operand << 8;
129 strcpy(
d->d_asm,
"");
236 switch (
in->in_reg) {
272 switch (
in->in_reg) {
323 switch (
in->in_reg) {
331 strcpy(
s->s_nopd->d_asm,
"");
351 switch (
in->in_reg) {
352 case 0:
op =
"bne";
break;
353 case 1:
op =
"beq";
break;
354 case 2:
op =
"bcc";
break;
355 case 3:
op =
"bcs";
break;
369 if (
idx && (!(
in->in_mode & 2)))
385 if ((strlen(
r) + 4 + strlen(
d->d_asm)) <
sizeof(
d->d_asm)) {
387 strcat(
d->d_asm,
", ");
392 strcat(
d->d_asm,
"@");
395 strcat(
d->d_asm,
"#");
398 strcat(
d->d_asm,
"(");
401 d->d_prefix =
s->s_prefix;
406 if (
d->d_operand < 0) {
411 d->d_operand =
s->s_prefix_val |
in->in_operand;
412 if (
d->d_operand & 0x80) {
415 d->d_operand -= 0x100;
417 d->d_operand |= 0xff00;
427 if (
d->d_operand & 0xff0000)
431 snprintf(fmt,
sizeof(fmt),
"%s0x%%.%dX", sign, fmtsz);
433 strcat(
d->d_asm,
tmp);
440 strcat(
d->d_asm,
tmp);
442 strcat(
d->d_asm,
")");
454 s->s_prefix_val =
s->s_prefix = 0;
458 memcpy(&
d->d_inst,
s->s_buf,
sizeof(
d->d_inst));
459 d->d_off =
s->s_off++;
473 rd = read_text(
s,
d);
486 static void own(
struct state *
s)
496 fnamep = strchr(
fname,
'.');
510 strcpy(last->
d_asm,
"DC\t0x8000");
532 if (flush++ > 10000) {
544 d =
s->s_dirs.d_next;
545 l =
s->s_labels.l_next;
static RZ_NULLABLE RzILOpBitVector * shift(RzILOpBitVector *val, RZ_NULLABLE RzILOpBool **carry_out, arm_shifter type, RZ_OWN RzILOpBitVector *dist)
const lzma_allocator const uint8_t * in
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
#define ADDR_MODE_RELATIVE
#define ADDR_MODE_X_RELATIVE
#define DATA_MODE_INDEXED_X
#define DATA_MODE_IMMEDIATE
unsigned short prefix[65536]
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static bool print_label(void *user, const void *k, const void *v)
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
#define rz_return_if_fail(expr)
struct directive * d_next
static void add_comment(RzCore *core, ut64 addr, const char *prompt)
static void xap_decode(struct state *s, struct directive *d)
static struct state _state
static void decode_unknown(struct state *s, struct directive *d)
static int read_bin(struct state *s, struct directive *d)
static struct directive * next_inst(struct state *s)
static char * regname(int reg)
static struct state * get_state(void)
static int get_operand(struct state *s, struct directive *d)
static int get_num(int num, int shift)
static int decode_fixed(struct state *s, struct directive *d)
static int decode_known(struct state *s, struct directive *d)
static uint16_t i2u16(struct instruction *in)