(long)((addr + 2 + dst) & 0xfffff));
}
}
+ else
+ return -1;
}
else if (regd == 2)
{
sprintf (op, "&0x%05x", dst & 0xfffff);
}
}
+ else
+ return -1;
}
else
{
}
sprintf (op, "%d(r%d)", dst, regd);
}
+ else
+ return -1;
}
}
break;
sprintf (comm, "#0x%05x", dst);
}
}
+ else
+ return -1;
}
else
* cycles = print_as3_reg_name (regd, op, comm, 1, 1, 3);
(long)((addr + 2 + dst) & 0xfffff));
}
}
+ else
+ return -1;
}
else if (regd == 2)
{
sprintf (op, "&0x%05x", dst & 0xfffff);
}
}
+ else
+ return -1;
}
else if (regd == 3)
{
if (dst > 9 || dst < 0)
sprintf (comm, "%05x", dst);
}
+ else
+ return -1;
}
}
break;
(long)((addr + 2 + dst) & 0xfffff));
}
}
+ else
+ return -1;
}
else if (regd == 2)
{
if (src != dst)
return 0;
}
+ else
+ return -1;
cmd_len += 4;
*cycles = 6;
sprintf (op1, "&0x%04x", PS (dst));
sprintf (op1, "&0x%05x", dst & 0xfffff);
}
}
+ else
+ return -1;
}
else
{
if (dst > 9 || dst < -9)
sprintf (comm1, "#0x%05x", dst);
}
+ else
+ return -1;
}
}
sprintf (comm1, "0x%05x", dst & 0xfffff);
}
}
+ else
+ return -1;
}
else
* cycles = print_as3_reg_name (regs, op1, comm1, 1, 1, 2);
(long) ((addr + 2 + dst) & 0xfffff));
}
}
+ else
+ return -1;
}
else if (regs == 2)
{
* comm1 = 0;
}
}
+ else
+ return -1;
}
else if (regs == 3)
{
if (dst > 9 || dst < -9)
sprintf (comm1, "0x%05x", dst);
}
+ else
+ return -1;
}
}
(long)((addr + cmd_len + dst) & 0xfffff));
}
}
+ else
+ return -1;
cmd_len += 2;
}
else if (regd == 2)
sprintf (op2, "&0x%05x", dst & 0xfffff);
}
}
+ else
+ return -1;
}
else
{
}
sprintf (op2, "%d(r%d)", dst, regd);
}
+ else
+ return -1;
}
}
cmd_len += 2;
sprintf (op1, "#0x%04x", PS (udst));
}
+ else
+ return -1;
}
else
* cycles = print_as3_reg_name (regs, op1, comm1, 1, 1, 2);
sprintf (comm1, "PC rel. 0x%04x",
PS ((short) addr + 2 + dst));
}
+ else
+ return -1;
}
else if (regs == 2)
{
cmd_len += 2;
sprintf (op1, "&0x%04x", PS (udst));
}
+ else
+ return -1;
}
else if (regs == 3)
{
cmd_len += 2;
sprintf (op1, "%d(r%d)", dst, regs);
}
+ else
+ return -1;
}
}
else
sprintf (comm1, "0x%05x", dst);
}
+ else
+ return -1;
break;
case 6: /* CALLA @Rdst */
sprintf (op1, "&%d", (ureg << 16) + udst);
sprintf (comm1, "0x%05x", (ureg << 16) + udst);
}
+ else
+ return -1;
break;
case 9: /* CALLA pcrel-sym */
sprintf (comm1, "PC rel. 0x%05lx",
(long) (addr + 2 + dst + (reg << 16)));
}
+ else
+ return -1;
break;
case 11: /* CALLA #imm20 */
sprintf (op1, "#%d", (ureg << 16) + udst);
sprintf (comm1, "0x%05x", (ureg << 16) + udst);
}
+ else
+ return -1;
break;
default:
unsigned short bits;
if (! msp430dis_opcode_unsigned (addr, info, &insn, NULL))
- {
- prin (stream, ".word 0xffff; ????");
- return 2;
- }
+ return -1;
if (((int) addr & 0xffff) > 0xffdf)
{
extension_word = insn;
addr += 2;
if (! msp430dis_opcode_unsigned (addr, info, &insn, NULL))
- {
- prin (stream, ".word 0x%04x, 0xffff; ????",
- extension_word);
- return 4;
- }
+ return -1;
}
for (opcode = msp430_opcodes; opcode->name; opcode++)
&& (insn & 0x000f) == 0
&& (insn & 0x0080) == 0)
{
- cmd_len +=
+ int ret =
msp430_branchinstr (info, opcode, addr, insn, op1, comm1,
&cycles);
+
+ if (ret == -1)
+ return -1;
+ cmd_len += ret;
if (cmd_len)
break;
}
{
int n;
int reg;
+ int ret;
case 4:
- cmd_len += msp430x_calla_instr (info, addr, insn,
- op1, comm1, & cycles);
+ ret = msp430x_calla_instr (info, addr, insn,
+ op1, comm1, & cycles);
+ if (ret == -1)
+ return -1;
+ cmd_len += ret;
break;
case 5: /* PUSHM/POPM */
if (n > 9 || n < 0)
sprintf (comm1, "0x%05x", n);
}
+ else
+ return -1;
cmd_len = 4;
}
sprintf (op2, "r%d", reg);
if (strcmp (opcode->name, "bra") != 0)
sprintf (op2, "r%d", reg);
}
+ else
+ return -1;
break;
case 3: /* MOVA x(Rsrc), Rdst */
sprintf (comm1, "0x%05x", n);
}
}
+ else
+ return -1;
break;
case 6: /* MOVA Rsrc, &abs20 */
if (reg > 9 || reg < 0)
sprintf (comm2, "0x%05x", reg);
}
+ else
+ return -1;
break;
case 7: /* MOVA Rsrc, x(Rdst) */
sprintf (comm2, "0x%05x", n);
}
}
+ else
+ return -1;
break;
case 8: /* MOVA #imm20, Rdst */
if (strcmp (opcode->name, "bra") != 0)
sprintf (op2, "r%d", reg);
}
+ else
+ return -1;
break;
case 12: /* MOVA Rsrc, Rdst */
switch (opcode->insn_opnumb)
{
+ int ret;
+
case 0:
cmd_len += msp430_nooperands (opcode, addr, insn, comm1, &cycles);
break;
case 2:
- cmd_len +=
+ ret =
msp430_doubleoperand (info, opcode, addr, insn, op1, op2,
comm1, comm2,
extension_word,
&cycles);
+
+ if (ret == -1)
+ return -1;
+ cmd_len += ret;
if (insn & BYTE_OPERATION)
{
if (extension_word != 0 && ((extension_word & BYTE_OPERATION) == 0))
break;
case 1:
- cmd_len +=
+ ret =
msp430_singleoperand (info, opcode, addr, insn, op1, comm1,
extension_word,
&cycles);
+
+ if (ret == -1)
+ return -1;
+ cmd_len += ret;
if (extension_word
&& (strcmp (opcode->name, "swpb") == 0
|| strcmp (opcode->name, "sxt") == 0))