سؤال

In intel software developer maunal, the call instruction support:

call r/m64
call m16:32
call m16:64

In the user code, if I want to transfer to ring 0 via a 64-bit call-gate with selector 47. How to write the instruction in assembly using intel syntax?

Tested:

call far [mem]; wrong
call qword ptr [mem]; wrong

memory content:

[mem + 0]: qword 0x00
[mem + 8]: word 47
هل كانت مفيدة؟

المحلول

The correct keyword to use is fword ptr. This will generate the m16:32 variant, but since for call gates the offset is ignored and the full 64 bits of RIP will be loaded from the gate, this will be fine. However if you want to keep the m16:64 pointer, then you will have to manually include a REX prefix, like rex64 call fword ptr [mem] or rex.w call fword ptr [mem].

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top