summaryrefslogtreecommitdiff
path: root/gen_x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'gen_x86.c')
-rw-r--r--gen_x86.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gen_x86.c b/gen_x86.c
index c062ac8..2ec4c00 100644
--- a/gen_x86.c
+++ b/gen_x86.c
@@ -359,13 +359,11 @@ uint8_t * x86_rrindex_sizedir(uint8_t * out, uint8_t opcode, uint8_t reg, uint8_
opcode |= BIT_SIZE;
}
*(out++) = opcode | dir;
- *(out++) = MODE_REG_INDIRECT | base | (RSP << 3);
- if (base == RSP) {
- if (scale == 4) {
- scale = 3;
- }
- *(out++) = scale << 6 | (index << 3) | base;
+ *(out++) = MODE_REG_INDIRECT | RSP | (reg << 3);
+ if (scale == 4) {
+ scale = 3;
}
+ *(out++) = scale << 6 | (index << 3) | base;
return out;
}