문제

Because the address xxxx:yyyyyyyy is 32 bits in protected mode, I put a 48-bits address in a piece of memory and want to give indirect jmp, here is what I wrote:

mov eax,s1
mov [address],eax
mov ax,SelectorCode32
mov [address+4],ax
jmp  fword [address]

address:dd 0
        dw 0

But the nasm shows that jmp fword [address] is wrong, I've read some suggestions like this, but didn't help either, so what should I do?

도움이 되었습니까?

해결책

The NASM's syntax for near and far calls is different from those of TASM and MASM.

Here are the two options for indirect jumps:

jmp [fptr] ; jump to CS:0x12345678
jmp far [fptr] ; jump to 0xABCD:0x12345678

fptr dd 0x12345678
     dw 0xABCD

You can also always push the far address onto the stack and do retf.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top