disassembler: Improve header error messages
[b43-tools.git] / disassembler / main.c
index 86ed1f483b2773cd7754224aabd18d886c55bc15..09e7643038b64f4d963bc5a9fe255269e80938ae 100644 (file)
@@ -603,6 +603,9 @@ static void disasm_constant_opcodes(struct disassembler_context *ctx,
                }
                break;
        }
+       case 0x000:
+               disasm_opcode_raw(ctx, stmt, 1);
+               break;
        default:
                disasm_opcode_raw(ctx, stmt, (cmdargs.unknown_decode == 0));
                break;
@@ -800,7 +803,7 @@ static void emit_asm(struct disassembler_context *ctx)
                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++) {
@@ -854,11 +857,11 @@ static int read_input(struct disassembler_context *ctx)
        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) {