summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-05-26 19:32:52 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-26 19:32:52 -0700
commitbb4aad4a1f43e98d8849c1ff1a03883df299197b (patch)
tree977cdaa8f40d797655a6b0391b6cb1dc74ca8110
parent4c2529dd779f1e01264ef234b64a337fbbe008d5 (diff)
downloadnasm-bb4aad4a1f43e98d8849c1ff1a03883df299197b.tar.gz
nasm-bb4aad4a1f43e98d8849c1ff1a03883df299197b.tar.bz2
nasm-bb4aad4a1f43e98d8849c1ff1a03883df299197b.zip
regs.pl: add comments to regflags.c and regvals.c
Add comments to regflags.c and regvals.c, to make it easier to spot errors.
-rwxr-xr-xregs.pl15
1 files changed, 9 insertions, 6 deletions
diff --git a/regs.pl b/regs.pl
index 9c0d96e..49a34c6 100755
--- a/regs.pl
+++ b/regs.pl
@@ -116,21 +116,24 @@ if ( $fmt eq 'h' ) {
print "#include \"tables.h\"\n";
print "#include \"nasm.h\"\n\n";
print "const int32_t nasm_reg_flags[] = {\n";
- print " 0"; # Dummy entry for 0
+ printf " 0,\n"; # Dummy entry for 0
foreach $reg ( sort(keys(%regs)) ) {
- print ",\n ", $regs{$reg}; # Print the class of the register
+ # Print the class of the register
+ printf " %-15s /* %-5s */\n",
+ $regs{$reg}.',', $reg;
}
- print "\n};\n";
+ print "};\n";
} elsif ( $fmt eq 'vc' ) {
# Output regvals.c
print "/* automatically generated from $file - do not edit */\n\n";
print "#include \"tables.h\"\n\n";
print "const int nasm_regvals[] = {\n";
- print " -1"; # Dummy entry for 0
+ print " -1,\n"; # Dummy entry for 0
foreach $reg ( sort(keys(%regs)) ) {
- printf ",\n %2d", $regvals{$reg}; # Print the regval of the register
+ # Print the x86 value of the register
+ printf " %2d, /* %-5s */\n", $regvals{$reg}, $reg;
}
- print "\n};\n";
+ print "};\n";
} elsif ( $fmt eq 'dc' ) {
# Output regdis.c
print "/* automatically generated from $file - do not edit */\n\n";