What does an asterisk * before an address mean in x86-64 AT&T assembly?

前端 未结 7 1372
故里飘歌
故里飘歌 2020-12-15 17:11

What does the following line mean:

...
401147: ff 24 c5 80 26 40 00    jmpq   *0x402680(,%rax,8)
...

What does the asterisk in front of the

相关标签:
7条回答
  • 2020-12-15 17:34

    Minimal example

    To make things clearer:

    .data
        # Store he address of the label in the data section.
        symbol: .int label   
    .text   
        # Jumps to label.
        jmp *symbol
        label:
    

    GitHub upstream.

    Without the *, it would jump to the address of symbol in the .data section and segfault.

    I feel this syntax is a bit inconsistent, because for most instructions:

    mov symbol, %eax
    mov label, %eax
    

    already moves the data at the address symbol, and $symbol is used for the address. Intel syntax is more consistent in this point as it always uses [] for dereference.

    The * is of course a mnemonic for the C dereference operator *ptr.

    0 讨论(0)
提交回复
热议问题