2002-11-25 01:45:40 +03:00
|
|
|
#!/usr/bin/perl
|
|
|
|
#
|
2008-01-26 12:15:27 +03:00
|
|
|
# $Id: makesym.perl,v 1.2 2008-01-26 09:15:27 sshwarts Exp $
|
2002-11-25 01:45:40 +03:00
|
|
|
#
|
2008-01-26 12:15:27 +03:00
|
|
|
# Read output file from as86 (e.g. rombios.txt) and write out a symbol
|
2002-11-25 01:45:40 +03:00
|
|
|
# table suitable for the Bochs debugger.
|
|
|
|
#
|
|
|
|
|
|
|
|
$WHERE_BEFORE_SYM_TABLE = 0;
|
|
|
|
$WHERE_IN_SYM_TABLE = 1;
|
|
|
|
$WHERE_AFTER_SYM_TABLE = 2;
|
|
|
|
|
|
|
|
$where = $WHERE_BEFORE_SYM_TABLE;
|
|
|
|
while (<STDIN>) {
|
|
|
|
chop;
|
|
|
|
if ($where == WHERE_BEFORE_SYM_TABLE && /^Symbols:/) {
|
|
|
|
$where = $WHERE_IN_SYM_TABLE;
|
|
|
|
} elsif ($where == $WHERE_IN_SYM_TABLE && /^$/) {
|
|
|
|
$where = $WHERE_AFTER_SYM_TABLE;
|
|
|
|
}
|
|
|
|
if ($where == $WHERE_IN_SYM_TABLE) {
|
|
|
|
@F = split (/\s+/);
|
|
|
|
($name[0], $junk, $addr[0], $junk, $name[1], $junk, $addr[1]) = @F;
|
|
|
|
foreach $col (0,1) {
|
|
|
|
next if length $addr[$col] < 1;
|
|
|
|
$addr[$col] =~ tr/A-Z/a-z/;
|
|
|
|
$addr[$col] = "000f" . $addr[$col];
|
|
|
|
print "$addr[$col] $name[$col]\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|