diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-05-21 15:09:31 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-05-21 15:09:31 -0700 |
commit | a69ce1d19df4df273c6178c19dc9dbe3df2d4928 (patch) | |
tree | 39c157a5b04fb60afd43eb8b97a018fbcad42593 /insns.pl | |
parent | 895f56b611949d7e7dee94990c142797d3d9a2f3 (diff) | |
download | nasm-a69ce1d19df4df273c6178c19dc9dbe3df2d4928.tar.gz nasm-a69ce1d19df4df273c6178c19dc9dbe3df2d4928.tar.bz2 nasm-a69ce1d19df4df273c6178c19dc9dbe3df2d4928.zip |
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.pl | 26 |
1 files changed, 2 insertions, 24 deletions
@@ -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; } |