From 3adf3f47a9fa9047b25bd70210a5f9f2b57bc08e Mon Sep 17 00:00:00 2001 From: stefanrueger Date: Sat, 24 May 2025 20:07:07 +0200 Subject: [PATCH] Implement disasm option -U/u --- src/disasm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/disasm.c b/src/disasm.c index 090e84d5..3a3c5108 100644 --- a/src/disasm.c +++ b/src/disasm.c @@ -486,6 +486,7 @@ static void lineout(const char *code, const char *comment, if(cx->dis_opts.labels && showlabel) { int match = 0, first = -1; const char *comment = NULL, *name; + Dis_symbol *s; for(int i = 0; i < cx->dis_jumpcallN; i++) if(jc[i].to == here) @@ -530,6 +531,11 @@ static void lineout(const char *code, const char *comment, mmt_free(reflist); } else if(match) { (void) get_label_name(here, &comment); + } else if(cx->dis_opts.unused_labels && (s = find_symbol('L', here))) { + if(!s->comment || !*s->comment || !cx->dis_opts.comments) + disasm_out("%s:\n", s->name); + else + disasm_out("%-*s ; %s\n", commentcol(), str_ccprintf("%s:", s->name), s->comment); } }