summaryrefslogtreecommitdiff
path: root/disasm.c
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 /disasm.c
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 'disasm.c')
-rw-r--r--disasm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/disasm.c b/disasm.c
index f4cc6c68..33cdfd42 100644
--- a/disasm.c
+++ b/disasm.c
@@ -1245,14 +1245,13 @@ int32_t disasm(uint8_t *data, char *output, int outbufsize, int segsize,
}
i = (*p)->opcode;
- if (i >= FIRST_COND_OPCODE) {
+ if (i >= FIRST_COND_OPCODE)
slen += snprintf(output + slen, outbufsize - slen, "%s%s",
- nasm_cond_insn_names[i-FIRST_COND_OPCODE],
- condition_name[ins.condition]);
- } else {
+ nasm_insn_names[i], condition_name[ins.condition]);
+ else
slen += snprintf(output + slen, outbufsize - slen, "%s",
nasm_insn_names[i]);
- }
+
colon = false;
length += data - origdata; /* fix up for prefixes */
for (i = 0; i < (*p)->operands; i++) {