summaryrefslogtreecommitdiff
path: root/regs.pl
diff options
context:
space:
mode:
authorKeith Kanios <spook@dynatos.net>2007-04-15 01:37:13 +0000
committerKeith Kanios <spook@dynatos.net>2007-04-15 01:37:13 +0000
commitb7314d83f1464055f3f36e71b8aecb135db8e4ce (patch)
tree80638fd92c0f41bfca55d914911e437d462cb9d6 /regs.pl
parent61ff53c80d3aa89dc8fe091427aceafe0ff9cc28 (diff)
downloadnasm-b7314d83f1464055f3f36e71b8aecb135db8e4ce.tar.gz
nasm-b7314d83f1464055f3f36e71b8aecb135db8e4ce.tar.bz2
nasm-b7314d83f1464055f3f36e71b8aecb135db8e4ce.zip
Fixed regdis.c generation.
Diffstat (limited to 'regs.pl')
-rwxr-xr-xregs.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/regs.pl b/regs.pl
index ee2e640..5835493 100755
--- a/regs.pl
+++ b/regs.pl
@@ -102,10 +102,15 @@ if ( $fmt eq 'h' ) {
foreach $class ( sort(keys(%disclass)) ) {
printf "static const int %-8s[] = {", $class;
@foo = @{$disclass{$class}};
+ @bar = 0;
+ $counter = 0;
for ( $i = 0 ; $i < scalar(@foo) ; $i++ ) {
- $foo[$i] = defined($foo[$i]) ? "R_\U$foo[$i]\E" : '0';
+ if (defined($foo[$i])) {
+ $bar[$counter] = "R_\U$foo[$i]\E";
+ $counter ++;
+ }
}
- print join(',', @foo), "};\n";
+ print join(',', @bar), "};\n";
}
} else {
die "$0: Unknown output format\n";