0

This question refers to assembly x86-64 with at&t syntax.

Assembly has confused me when it gets to the use of * and rip:

To make sure I understand, * ALWAYS means the data in that address?

  1. If so then what all of those mean: (Please add examples to summarise all cases I should know of)

    jmp*, call* etc...
    
  2. When using rip with some command like call label(%rip) it calls label and not label+rip right? Is this always the case when using rip or there are some commands which do rip+something? and what if I want to do rip+5 (for example) How do I right that?

Dan
  • 99
  • 6
  • 1
    1) Those are indirect transfers through a pointer in memory. Without the `*` it uses the operand directly. 2) It's a helpful service of your assembler to transform `label(%rip)` into `offset(%rip)` such that the end result is `label`. Most of the time that is what you want. If not, you can do stuff like `.+5(%rip)` but beware that `.` is the current address while `rip` is the address of the next instruction. – Jester Oct 06 '21 at 11:38
  • As per your other question, apparently gnu assembler leaves numeric constants unchanged so `5(%rip)` would mean `5+rip`. – Jester Oct 06 '21 at 16:16

0 Answers0