commit d363aad7b5b2b347ac29dd61c8419953c849df51
parent 10a723f5d6ef79c684b1d51c77fe4e32271e3cea
Author: neauoire <aliceffekt@gmail.com>
Date: Wed, 6 Oct 2021 09:21:27 -0700
Improved size report for uxnasm
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git 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