diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-09-22 21:49:51 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-09-22 21:49:51 -0700 |
commit | c5b9ce0a843f8541138e1e72c9ca473faee610ee (patch) | |
tree | e465b7309f5dc07f5dd11feec177e3851bec835b /disasm.c | |
parent | f04031bbd7811dc5621867d4a416962420ba9e08 (diff) | |
download | nasm-c5b9ce0a843f8541138e1e72c9ca473faee610ee.tar.gz nasm-c5b9ce0a843f8541138e1e72c9ca473faee610ee.tar.bz2 nasm-c5b9ce0a843f8541138e1e72c9ca473faee610ee.zip |
Auto-generate 0x67 prefixes without the need for \30x codes
Auto-generate 0x67 prefixes without the need for \30x codes; the
prefix is automatically added when there is a memory operand with
address size differing from the current address size (and impossible
combinations checked for.)
Diffstat (limited to 'disasm.c')
-rw-r--r-- | disasm.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -561,8 +561,6 @@ static int matches(const struct itemplate *t, uint8_t *data, &ins->oprs[(c >> 3) & 07], ins); if (!data) return FALSE; - } else if (c >= 0300 && c <= 0303) { - a_used = TRUE; } else if (c == 0310) { if (asize != 16) return FALSE; @@ -652,6 +650,11 @@ static int matches(const struct itemplate *t, uint8_t *data, /* * Check for unused rep or a/o prefixes. */ + for (i = 0; i < t->operands; i++) { + if (ins->oprs[i].segment != SEG_RMREG) + a_used = TRUE; + } + ins->nprefix = 0; if (lock) ins->prefixes[ins->nprefix++] = P_LOCK; |