From d363aad7b5b2b347ac29dd61c8419953c849df51 Mon Sep 17 00:00:00 2001 From: neauoire Date: Wed, 6 Oct 2021 09:21:27 -0700 Subject: [PATCH] Improved size report for uxnasm --- src/uxnasm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/uxnasm.c b/src/uxnasm.c index eba6cfc..ff64ab1 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -12,6 +12,7 @@ WITH REGARD TO THIS SOFTWARE. */ #define TRIM 0x0100 +#define LENGTH 0x10000 - TRIM typedef unsigned char Uint8; typedef signed char Sint8; @@ -28,7 +29,7 @@ typedef struct { } Label; typedef struct { - Uint8 data[256 * 256], mlen; + Uint8 data[LENGTH], mlen; Uint16 ptr, length, llen; Label labels[512]; Macro macros[256]; @@ -391,7 +392,12 @@ cleanup(char *filename) continue; /* Ignore capitalized labels(devices) */ else if(!p.labels[i].refs) fprintf(stderr, "--- Unused label: %s\n", p.labels[i].name); - printf("Assembled %s(%d bytes), %d labels, %d macros.\n", filename, (p.length - TRIM), p.llen, p.mlen); + printf("Assembled %s in %.2fkb(%.2f%% used), %d labels, %d macros.\n", + filename, + (p.length - TRIM) / 1000.0, + p.length / 655.360, + p.llen, + p.mlen); } int