mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-03-13 17:57:12 +08:00
BR 2062342: ndisasm: r12 *can* be an index register
R12 can be used as an index register. Special encodings in the modr/m byte are done *without* consideration for the REX prefix, but special encodings in the SIB byte *do* take the REX prefix into consideration, since it doesn't affect the overall instruction format.
This commit is contained in:
parent
2a09b3bf11
commit
83b2e4f82c
4
disasm.c
4
disasm.c
@ -319,8 +319,8 @@ static uint8_t *do_ea(uint8_t *data, int modrm, int asize,
|
||||
|
||||
op->scale = 1 << scale;
|
||||
|
||||
if (index == 4)
|
||||
op->indexreg = -1; /* ESP/RSP/R12 cannot be an index */
|
||||
if (index == 4 && !(rex & REX_X))
|
||||
op->indexreg = -1; /* ESP/RSP cannot be an index */
|
||||
else if (a64)
|
||||
op->indexreg = nasm_rd_reg64[index | ((rex & REX_X) ? 8 : 0)];
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user