jmp [dispatch+ecx*4]
dispatch:
DD label1
DD label2
To assemble with MASM64, I have changed this to:
jmp [dispatch+rcx*8]
dispatch:
DQ label1
DQ label2
The linker produces "error LNK2017: 'ADDR32' relocation to 'dispatch'
invalid without /LARGEADDRESSAWARE:NO"
Is it possible to set up a jump table like this using EM64T?
Regards,
Andrew
EXTRN __ImageBase:BYTE
lea rax,OFFSET __ImageBase
mov ecx,DWORD PTR dispatch[rax+rcx*4]
add rcx,rax
jmp rcx
dispatch:
DD label1
DD label2
However, when I used this code I still got linker "error LNK2017: 'ADDR32'
relocation to 'dispatch' invalid without /LARGEADDRESSAWARE:NO".
"Andrew Jarvis" <someone@somewhere> wrote in message
news:%231ZVFHF...@TK2MSFTNGP06.phx.gbl...
Given this source:
.CODE
main PROC
jmp [dispatch+rcx*8]
nop
label1:
nop
label2:
nop
dispatch:
DQ label1
DQ label2
main ENDP
END
and using ML64 nad LINK 8.00.50727.42, I can assemble and link it
without any errors.