6 if (!defined($ARGV[0])) {
9 Perl script to convert NCR script address into label+offset.
10 Useful to find the failed NCR instruction ...
17 my $errpos = hex($ARGV[0])/4;
20 open (INPUT, "cc -E ncr.c 2>/dev/null |");
24 last if /^struct script \{/;
30 my ($label, $size) = /ncrcmd\s+(\S+)\s+\[([^]]+)/;
32 if (defined($label) && $label) {
34 if ($ofs + $size > $errpos) {
35 printf ("%4x: %s\n", $ofs * 4, $label);
36 printf ("%4x: %s + %d\n", $errpos * 4, $label, $errpos - $ofs);
41 printf ("%4x: %s\n", $ofs * 4, $label);