disassembler: Use 4 digits for code address
authorMichael Buesch <mb@bu3sch.de>
Mon, 20 Sep 2010 17:19:57 +0000 (19:19 +0200)
committerMichael Buesch <mb@bu3sch.de>
Mon, 20 Sep 2010 17:19:57 +0000 (19:19 +0200)
Signed-off-by: Michael Buesch <mb@bu3sch.de>
disassembler/args.c
disassembler/main.c

index 45a39b0266fbf8774f762ce84521060eff6f3041..08e3a402c3ac25cb68b5ae7d7adb9595876e3654 100644 (file)
@@ -103,7 +103,7 @@ static void usage(FILE *fd, int argc, char **argv)
        fprintf(fd, "  -a|--arch ARCH      The architecture type of the input file (5 or 15)\n");
        fprintf(fd, "  -f|--format FMT     Input file format. FMT must be one of:\n");
        fprintf(fd, "                      raw-le32, raw-be32, b43\n");
        fprintf(fd, "  -a|--arch ARCH      The architecture type of the input file (5 or 15)\n");
        fprintf(fd, "  -f|--format FMT     Input file format. FMT must be one of:\n");
        fprintf(fd, "                      raw-le32, raw-be32, b43\n");
-       fprintf(fd, "  --paddr             Print the code addresses\n");
+       fprintf(fd, "  -p|--paddr          Print the code addresses\n");
        fprintf(fd, "  -u|--unkdec         Decode operands of unknown instructions\n");
        fprintf(fd, "  -d|--debug          Print verbose debugging info\n");
        fprintf(fd, "                      Repeat for more verbose debugging\n");
        fprintf(fd, "  -u|--unkdec         Decode operands of unknown instructions\n");
        fprintf(fd, "  -d|--debug          Print verbose debugging info\n");
        fprintf(fd, "                      Repeat for more verbose debugging\n");
@@ -134,7 +134,7 @@ int parse_args(int argc, char **argv)
                                fprintf(stderr, "Invalid -f|--format\n");
                                return -1;
                        }
                                fprintf(stderr, "Invalid -f|--format\n");
                                return -1;
                        }
-               } else if ((res = cmp_arg(argv, &i, "--paddr", NULL, NULL)) == ARG_MATCH) {
+               } else if ((res = cmp_arg(argv, &i, "--paddr", "-p", NULL)) == ARG_MATCH) {
                        cmdargs.print_addresses = 1;
                } else if ((res = cmp_arg(argv, &i, "--unkdec", "-u", NULL)) == ARG_MATCH) {
                        cmdargs.unknown_decode = 1;
                        cmdargs.print_addresses = 1;
                } else if ((res = cmp_arg(argv, &i, "--unkdec", "-u", NULL)) == ARG_MATCH) {
                        cmdargs.unknown_decode = 1;
index 601c84a9796022459b4af5a93fcb5ebfbcdd3018..cf716df8fb9b21bb14812a8428f9549965d792f3 100644 (file)
@@ -803,7 +803,7 @@ static void emit_asm(struct disassembler_context *ctx)
                switch (stmt->type) {
                case STMT_INSN:
                        if (cmdargs.print_addresses)
                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++) {
                        fprintf(outfile, "\t%s", stmt->u.insn.name);
                        first = 1;
                        for (i = 0; i < ARRAY_SIZE(stmt->u.insn.operands); i++) {