diff options
Diffstat (limited to 'size.pl')
-rw-r--r-- | size.pl | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +#!/usr/bin/perl -w + +my $stack_size = oct(shift) || die "no stack size"; + +open MAP, "<taipan.map" or die $!; +while(<MAP>) { + next unless /^BSS/; + (undef, $bss_start, $bss_end, undef) = split /\s+/; + $bss_start = hex $bss_start; + $bss_end = hex $bss_end; +} +close MAP; + +$free = (0xbc20 - $stack_size) - $bss_end + 1; + +printf " code ends at \$%04x\n", ($bss_start - 1); +printf " BSS ends at \$%04x\n", $bss_end; +printf "stack starts at \$%04x\n", 0xbc20 - $stack_size; +printf "free code space \$%04x (%d, %.1fK)\n", $free, $free, $free / 1024; |