summaryrefslogtreecommitdiff
path: root/assemble.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-05-30 20:30:15 +0000
committerH. Peter Anvin <hpa@zytor.com>2007-05-30 20:30:15 +0000
commitc6be66fa2088ad68f4072ca001a192c6ea095f0d (patch)
tree4c199e48cd6553d4a84e802e9b7137927d0a8676 /assemble.c
parentff69805feb73c457471f7f411fcc3509e1fe0491 (diff)
downloadnasm-c6be66fa2088ad68f4072ca001a192c6ea095f0d.tar.gz
nasm-c6be66fa2088ad68f4072ca001a192c6ea095f0d.tar.bz2
nasm-c6be66fa2088ad68f4072ca001a192c6ea095f0d.zip
Correct the generation of 67 prefixes.
The recent switch from register numbers (with -1 meaning "none") to register flags (with 0 meaning "none") broke the generation of 67 prefixes, especially in 64-bit mode.
Diffstat (limited to 'assemble.c')
-rw-r--r--assemble.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/assemble.c b/assemble.c
index 0142e7a..831a917 100644
--- a/assemble.c
+++ b/assemble.c
@@ -1960,20 +1960,20 @@ static int chsize(operand * input, int addrbits)
if (input->indexreg < EXPR_REG_START /* Verify as Register */
|| input->indexreg >= REG_ENUM_LIMIT)
- i = -1;
+ i = 0;
else
i = reg_flags[input->indexreg];
if (input->basereg < EXPR_REG_START /* Verify as Register */
|| input->basereg >= REG_ENUM_LIMIT)
- b = -1;
+ b = 0;
else
b = reg_flags[input->basereg];
if (input->scale == 0)
- i = -1;
+ i = 0;
- if (i == -1 && b == -1) /* pure offset */
+ if (!i && !b) /* pure offset */
return (input->addr_size != 0 && input->addr_size != addrbits);
if (!(REG32 & ~i) || !(REG32 & ~b))