X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=assembler%2Fmain.c;h=54252dabe95fe89b762524ced673fd3d4a80fd5c;hb=0d23a756ee29394d72a9b74002c1659b4ceecda2;hp=3562a048ca0d19b58beaaed36f0482ff23926d44;hpb=7300a854837ee58f13af1e66acd96295b8811d05;p=b43-tools.git diff --git a/assembler/main.c b/assembler/main.c index 3562a04..54252da 100644 --- a/assembler/main.c +++ b/assembler/main.c @@ -823,8 +823,8 @@ static void assemble_instruction(struct assembler_context *ctx, /* Search the last insn. */ if (out->type == OUT_INSN) { if (out->is_jump_insn) { - asm_error(ctx, "RET instruction directly after " - "jump instruction. The hardware won't like this."); + asm_warn(ctx, "RET instruction directly after " + "jump instruction. The hardware won't like this."); } break; } @@ -1026,21 +1026,17 @@ does_not_exist: static void emit_code(struct assembler_context *ctx) { FILE *fd; - char *fn; - size_t fn_len; + const char *fn; struct code_output *c; uint64_t code; unsigned char outbuf[8]; unsigned int insn_count = 0; struct fw_header hdr; - fn_len = strlen(outfile_name) + 20; - fn = xmalloc(fn_len); - snprintf(fn, fn_len, "%s.ucode", outfile_name); + fn = outfile_name; fd = fopen(fn, "w+"); if (!fd) { fprintf(stderr, "Could not open microcode output file \"%s\"\n", fn); - free(fn); exit(1); } if (IS_VERBOSE_DEBUG) @@ -1125,8 +1121,13 @@ static void emit_code(struct assembler_context *ctx) break; } } + + if (arg_print_sizes) { + printf("%s: text = %u instructions (%u bytes)\n", + fn, insn_count, insn_count * sizeof(uint64_t)); + } + fclose(fd); - free(fn); } static void assemble(void)