From 1d977e4e175baf2538c46b3cb6ca17da43f95af0 Mon Sep 17 00:00:00 2001 From: stefanrueger Date: Mon, 31 Aug 2026 09:09:02 +0200 Subject: [PATCH] Refrain from generating label for fill disassembly --- src/disasm.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/disasm.c b/src/disasm.c index c1095282..7442fa41 100644 --- a/src/disasm.c +++ b/src/disasm.c @@ -548,7 +548,6 @@ 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++) @@ -573,24 +572,26 @@ static void lineout(const char *code, const char *comment, strcpy(r, str_ccprintf(&", L%0*x"[2*(r == reflist)], cx->dis_addrwidth, jc[i].from)); r += strlen(r); } - name = get_label_name(here, &comment); - if(!comment && strlen(reflist) + commentcol() < 70 && one_mne) { // Refs line with label - const char *mnestr = avr_opcodes[mne].opcode; + const char *comment = NULL, *name; + if((name = get_label_name(here, &comment))) { + if(!comment && strlen(reflist) + commentcol() < 70 && one_mne) { // Refs line with label + const char *mnestr = avr_opcodes[mne].opcode; - if(cx->dis_opts.comments) - disasm_out("%-*s ; %s\n", commentcol(), str_ccprintf("%s:", name), - str_ccprintf("%c%s from %s", toupper(*mnestr & 0xff), mnestr + 1, reflist)); - else - disasm_out("%s:\n", name); - } else { - if(cx->dis_opts.comments) - output_references(avr_opcodes[mne].opcode, reflist); - if(!comment || !*comment || !cx->dis_opts.comments) - disasm_out("%s:\n", name); - else - disasm_out("%-*s ; %s\n", commentcol(), str_ccprintf("%s:", name), comment); + if(cx->dis_opts.comments) + disasm_out("%-*s ; %s\n", commentcol(), str_ccprintf("%s:", name), + str_ccprintf("%c%s from %s", toupper(*mnestr & 0xff), mnestr + 1, reflist)); + else + disasm_out("%s:\n", name); + } else { + if(cx->dis_opts.comments) + output_references(avr_opcodes[mne].opcode, reflist); + if(!comment || !*comment || !cx->dis_opts.comments) + disasm_out("%s:\n", name); + else + disasm_out("%-*s ; %s\n", commentcol(), str_ccprintf("%s:", name), comment); + } + cx->dis_para = -1; } - cx->dis_para = -1; mmt_free(reflist); } else if(match) { // Register potential L label in pass 1 as to be printed (void) get_label_name(here, &comment);