summaryrefslogtreecommitdiff
path: root/insns.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-05-21 15:09:31 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-21 15:09:31 -0700
commita69ce1d19df4df273c6178c19dc9dbe3df2d4928 (patch)
tree39c157a5b04fb60afd43eb8b97a018fbcad42593 /insns.pl
parent895f56b611949d7e7dee94990c142797d3d9a2f3 (diff)
downloadnasm-a69ce1d19df4df273c6178c19dc9dbe3df2d4928.tar.gz
insnsn.c: cleaner to *not* separate out conditional instructions
The disassembler code gets cleaner if we do *not* separate out the conditional instructions; instead, rely on the fact that the conditionals are always at the end and use FIRST_COND_OPCODE as a barrier.
Diffstat (limited to 'insns.pl')
-rw-r--r--insns.pl26
1 files changed, 2 insertions, 24 deletions
diff --git a/insns.pl b/insns.pl
index a96b6a73..af494101 100644
--- a/insns.pl
+++ b/insns.pl
@@ -284,36 +284,14 @@ if ( !defined($output) || $output eq 'n' ) {
print N "const char * const nasm_insn_names[] = {";
$first = 1;
- foreach $i (@opcodes) {
- print N "," if ( !$first );
- $first = 0;
- $ilower = $i;
- $ilower =~ tr/A-Z/a-z/; # Change to lower case (Perl 4 compatible)
- print N "\n\t\"${ilower}\"";
- }
- print N "\n};\n\n";
- print N "/* Conditional instructions */\n";
- print N "const char * const nasm_cond_insn_names[] = {";
- $first = 1;
- foreach $i (@opcodes_cc) {
+ foreach $i (@opcodes, @opcodes_cc) {
print N "," if ( !$first );
$first = 0;
$ilower = $i;
- $ilower =~ s/cc$//; # Skip cc suffix
+ $ilower =~ s/cc$//; # Remove conditional cc suffix
$ilower =~ tr/A-Z/a-z/; # Change to lower case (Perl 4 compatible)
print N "\n\t\"${ilower}\"";
}
-
- print N "\n};\n\n";
- print N "/* and the corresponding opcodes */\n";
- print N "const enum opcode nasm_cond_insn_opcodes[] = {";
- $first = 1;
- foreach $i (@opcodes_cc) {
- print N "," if ( !$first );
- $first = 0;
- print N "\n\tI_$i";
- }
-
print N "\n};\n";
close N;
}