From f65442bb4a6c0b38229ea46b035144f64ce008ee Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Mon, 24 Mar 2014 21:02:27 +0400 Subject: [PATCH] cr16: fix biti command --- libr/asm/arch/cr16/cr16_disas.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libr/asm/arch/cr16/cr16_disas.c b/libr/asm/arch/cr16/cr16_disas.c index c1989bf083..e727bde35f 100644 --- a/libr/asm/arch/cr16/cr16_disas.c +++ b/libr/asm/arch/cr16/cr16_disas.c @@ -1125,13 +1125,17 @@ int cr16_decode_biti(const ut8 *instr, struct cr16_cmd *cmd) return -1; } + reg = cr16_get_dstreg(c); + position = cr16_get_srcreg(c); + + if (!(reg & 0x6)) { + return -1; + } + snprintf(cmd->instr, CR16_INSTR_MAXLEN - 1, "%s%c", ops_biti[(c >> 6) & 0x3], cr16_get_opcode_i(c) ? 'w' : 'b'); - reg = cr16_get_dstreg(c); - position = cr16_get_srcreg(c); - switch (((c >> 13) & 0x2) | (c & 0x1)) { case 0x0: ret = 4;