From 074c293a045d2258d6f876868044a63f386c2b71 Mon Sep 17 00:00:00 2001 From: Nero <41307858+nero@users.noreply.github.com> Date: Fri, 7 Jan 2022 22:06:03 +0000 Subject: [PATCH] Improve output format and add more encodings --- asm.awk | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/asm.awk b/asm.awk index 74b86c8..a53cf2e 100644 --- a/asm.awk +++ b/asm.awk @@ -97,12 +97,12 @@ BEGIN { # error string to insert into listing function err(str) { errors++ - printf("ERR: %s:\n", str) + if (of=="lst") printf("**** %s:\n", str) } # submit a assembling result to output # set label of current line to off function submit(off) { - if (of=="lst") printf("%04X %-10s %s\n", off, hex, $0) + if (of=="lst") printf("%04X %-18s %s\n", off, hex, $0) if (of=="hex" && hex) printf("%s", hex) if (label) { if (of=="sym") printf("%s\tsym\t%d\n", label, off) @@ -174,8 +174,8 @@ function modrm(str, spare, rs) { } # dont process empty lines or comment lines -/^( |\t)*;/ || /^( |\t)*$/ { - if (of=="lst") printf("%16s%s\n","",$0) +/^( |\t)*(;|%)/ || /^( |\t)*$/ { + if (of=="lst") printf("%24s%s\n","",$0) next } # load symbols from previous pass @@ -273,39 +273,38 @@ op=="db" { for(j=2;j