diff --git a/dis.c b/dis.c index 641fc64..c0e0ef7 100644 --- a/dis.c +++ b/dis.c @@ -438,6 +438,13 @@ int dis_decode(u_int8_t *code, u_int16_t offset, u_int16_t len, find_cgens(insn); find_emulated_ops(insn); + if (insn->is_byte_op) { + if (insn->src_mode == MSP430_AMODE_IMMEDIATE) + insn->src_addr &= 0xff; + if (insn->dst_mode == MSP430_AMODE_IMMEDIATE) + insn->dst_addr &= 0xff; + } + insn->len = ret; return ret; } @@ -538,7 +545,6 @@ static int format_addr(msp430_amode_t amode, u_int16_t addr) const char *prefix = ""; switch (amode) { - case MSP430_AMODE_SYMBOLIC: case MSP430_AMODE_REGISTER: case MSP430_AMODE_INDIRECT: case MSP430_AMODE_INDIRECT_INC: @@ -553,6 +559,9 @@ static int format_addr(msp430_amode_t amode, u_int16_t addr) case MSP430_AMODE_ABSOLUTE: prefix = "&"; break; + + case MSP430_AMODE_SYMBOLIC: + break; } len = printf("%s", prefix); @@ -672,7 +681,7 @@ static void dis_format(const struct msp430_instruction *insn) printf(","); count++; - while (count < 19) { + while (count < 23) { count++; printf(" "); } diff --git a/main.c b/main.c index 8675fac..d66613f 100644 --- a/main.c +++ b/main.c @@ -185,7 +185,7 @@ static int cmd_dis(char **arg) char *len_text = get_arg(arg); int offset = 0; int length = 0x40; - u_int8_t buf[512]; + u_int8_t buf[4096]; if (!off_text) { fprintf(stderr, "md: offset must be specified\n"); @@ -1034,6 +1034,9 @@ int main(int argc, char **argv) while (optind < argc) process_command(argv[optind++], 0); } else { + printf("\n"); + cmd_help(NULL); + do { reader_loop(); } while (syms_modify_check()); diff --git a/util.c b/util.c index 501d2e3..83bcdee 100644 --- a/util.c +++ b/util.c @@ -165,9 +165,6 @@ static char *readline(const char *prompt) void reader_loop(void) { - printf("\n"); - cmd_help(NULL); - for (;;) { char *buf = readline("(mspdebug) ");