Mercurial > hg > Members > kono > nitros9-code
view scripts/list2crc.pl @ 3047:a951ab0b3003
level1 6309: Switch to native mode early in rel.asm
Otherwise it will crash in the first F$Link call.
author | Robert Gault <robert.gault@att.net> |
---|---|
date | Sat, 24 Jan 2015 23:15:55 +0100 |
parents | a0b770fab355 |
children |
line wrap: on
line source
#!/usr/bin/perl # Copyright 2014 Tormod Volden # # Digests assembly listings generated by lwasm, and stores the # module body listing in a file named by the module CRC. # Example: for f in *.lst; do ../scripts/list2crc.pl $f; done open(CRCFILE, ">", "crc.tmp") or die "cannot create crc.tmp: $!"; while (<>) { ($hoffset, $opbytes, $filepath, $lineno, $label, $opcode, $operand, $comment) = ( $_ =~ /^(\w+) (\w+)\s+\((.*)\):(\d+) (\S+)?\s+(\w+)\s*(\S+)?\s*(.*)?/ ); # print $hoffset, "\t", $opcode, "\t", $comment, "\n"; if (lc($opcode) eq "mod") { $in_module = 1; } if (lc($opcode) eq "emod") { die "double emod" if $found_emod; $found_emod = 1; $crc = $opbytes; $in_module = 0; } # if ($in_module && $hoffset) { # $offset = hex($hoffset); # print CRCFILE "$offset\t$filepath\t$lineno\n"; # } if ($in_module) { print CRCFILE $_ } } close(CRCFILE); if ($crc) { print "writing $crc.crc\n"; rename "crc.tmp", $crc . ".crc"; }