mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-02-17 17:19:35 +08:00
disasm: Fix for disassembly of BOUND
The opcode for BOUND, 62h, has a different meaning in long mode - it is the prefix for EVEX instructions. ndisasm did not take this into account and always tried to disassemble 62h back to an EVEX instruction. Attached patch only permits EVEX disassembly if bitness is 64. In 16/32 bit mode 62h will be not be a prefix and so disassemble to BOUND. Signed-off-by: Mark Scott <nasm@mscott.cx> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
be8a5c8f2d
commit
db6ecf9b76
2
disasm.c
2
disasm.c
@ -1216,7 +1216,7 @@ int32_t disasm(uint8_t *data, char *output, int outbufsize, int segsize,
|
||||
case 0x62:
|
||||
{
|
||||
uint8_t evex_p0 = data[1] & 0x0f;
|
||||
if (segsize == 64 ||
|
||||
if (segsize == 64 &&
|
||||
((evex_p0 >= 0x01) && (evex_p0 <= 0x03))) {
|
||||
data++; /* 62h EVEX prefix */
|
||||
prefix.evex[0] = *data++;
|
||||
|
Loading…
Reference in New Issue
Block a user