apple2a/rom_usage.awk

15 lines
333 B
Awk
Raw Normal View History

2018-07-31 23:05:56 +00:00
# Pipe main.map into this to get ROM size info.
/^CODE/ { code_start = ("0x" $2) + 0 }
/^RODATA/ { rodata_end = ("0x" $3) + 0 }
/^VECTORS/ { vectors_start = ("0x" $2) + 0 }
END {
code = rodata_end - code_start + 1
all = vectors_start - code_start
printf "%d of %d ROM bytes (%d%%) used\n", code, all, code*100/all
}