disasm_std_operand(stmt, 0, 0);
disasm_std_operand(stmt, 1, 1);
break;
+ case 0x0D6:
+ stmt->u.insn.name = "@D6"; /* FIXME */
+ stmt->u.insn.is_labelref = 2;
+ stmt->u.insn.labeladdr = stmt->u.insn.bin->operands[2];
+ disasm_std_operand(stmt, 0, 0);
+ disasm_std_operand(stmt, 1, 1);
+ break;
+ case (0x0D6 | 0x1):
+ stmt->u.insn.name = "@D7"; /* FIXME */
+ stmt->u.insn.is_labelref = 2;
+ stmt->u.insn.labeladdr = stmt->u.insn.bin->operands[2];
+ disasm_std_operand(stmt, 0, 0);
+ disasm_std_operand(stmt, 1, 1);
+ case 0x0D8:
+ stmt->u.insn.name = "@D8"; /* FIXME */
+ stmt->u.insn.is_labelref = 2;
+ stmt->u.insn.labeladdr = stmt->u.insn.bin->operands[2];
+ disasm_std_operand(stmt, 0, 0);
+ disasm_std_operand(stmt, 1, 1);
+ break;
+ case (0x0D8 | 0x1):
+ stmt->u.insn.name = "@D9"; /* FIXME */
+ stmt->u.insn.is_labelref = 2;
+ stmt->u.insn.labeladdr = stmt->u.insn.bin->operands[2];
+ disasm_std_operand(stmt, 0, 0);
+ disasm_std_operand(stmt, 1, 1);
+ break;
case 0x0DA:
stmt->u.insn.name = "jl";
stmt->u.insn.is_labelref = 2;
static void emit_asm(struct disassembler_context *ctx)
{
struct statement *stmt;
- int first, i;
+ int first;
int err;
- unsigned int addr = 0;
+ unsigned int i, addr = 0;
err = open_output_file();
if (err)
switch (stmt->type) {
case STMT_INSN:
if (cmdargs.print_addresses)
- fprintf(outfile, "/* %03X */", addr);
+ fprintf(outfile, "/* %04X */", addr);
fprintf(outfile, "\t%s", stmt->u.insn.name);
first = 1;
for (i = 0; i < ARRAY_SIZE(stmt->u.insn.operands); i++) {
if (!stmt->u.insn.operands[i] &&
- stmt->u.insn.is_labelref != i)
+ (stmt->u.insn.is_labelref < 0 ||
+ (unsigned int)stmt->u.insn.is_labelref != i))
continue;
if (first)
fprintf(outfile, "\t");
if (!first)
fprintf(outfile, ", ");
first = 0;
- if (stmt->u.insn.is_labelref == i) {
+ if (stmt->u.insn.is_labelref >= 0 &&
+ (unsigned int)stmt->u.insn.is_labelref == i) {
fprintf(outfile, "%s",
stmt->u.insn.labelref->u.label.name);
} else {
case FMT_B43:
ret = fread(&hdr, 1, sizeof(hdr), infile);
if (ret != sizeof(hdr)) {
- fprintf(stderr, "Corrupt input file (not fwcutter output)\n");
+ fprintf(stderr, "Corrupt input file (no b43 header found)\n");
goto err_close;
}
if (hdr.type != FW_TYPE_UCODE) {
- fprintf(stderr, "Corrupt input file. Not a microcode image.\n");
+ fprintf(stderr, "Corrupt input file. Not a b43 microcode image.\n");
goto err_close;
}
if (hdr.ver != FW_HDR_VER) {