diff options
author | B. Watson <yalhcru@gmail.com> | 2016-09-06 16:40:38 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2016-09-06 16:40:38 -0400 |
commit | 6c7911db17388131973b8ca50691f0173b7e5f26 (patch) | |
tree | 97e9361f28588f8c95968584288a10a7122286aa /inc2info.pl | |
parent | 89311623faea2da01481be7f96704a4c2b7ccc16 (diff) | |
download | jumpmanjr-6c7911db17388131973b8ca50691f0173b7e5f26.tar.gz |
get rid of .inc file, convert to labels in main.info
Diffstat (limited to 'inc2info.pl')
-rw-r--r-- | inc2info.pl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/inc2info.pl b/inc2info.pl new file mode 100644 index 0000000..e6d9153 --- /dev/null +++ b/inc2info.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl -w + +while(<>) { + chomp; + + s/;.*//; + next if /^\s*$/; + + ($label, $addr) = (/^(\S+)\s+=\s+\$(\S+)/); + $addr = eval "0x$addr"; + $got{$addr} = $label; +} + +for (sort { $a <=> $b } keys %got) { + $addr = sprintf("%04x", $_); + print <<EOF; +label { name "$got{$_}"; addr \$$addr; }; +EOF +} |