Improved size report for uxnasm

This commit is contained in:
neauoire 2021-10-06 09:21:27 -07:00
parent 10a723f5d6
commit d363aad7b5
1 changed files with 8 additions and 2 deletions

View File

@ -12,6 +12,7 @@ WITH REGARD TO THIS SOFTWARE.
*/ */
#define TRIM 0x0100 #define TRIM 0x0100
#define LENGTH 0x10000 - TRIM
typedef unsigned char Uint8; typedef unsigned char Uint8;
typedef signed char Sint8; typedef signed char Sint8;
@ -28,7 +29,7 @@ typedef struct {
} Label; } Label;
typedef struct { typedef struct {
Uint8 data[256 * 256], mlen; Uint8 data[LENGTH], mlen;
Uint16 ptr, length, llen; Uint16 ptr, length, llen;
Label labels[512]; Label labels[512];
Macro macros[256]; Macro macros[256];
@ -391,7 +392,12 @@ cleanup(char *filename)
continue; /* Ignore capitalized labels(devices) */ continue; /* Ignore capitalized labels(devices) */
else if(!p.labels[i].refs) else if(!p.labels[i].refs)
fprintf(stderr, "--- Unused label: %s\n", p.labels[i].name); 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 int