Understanding %rip register in intel assembly

RIP addressing is always relative to RIP (64bit Instruction Pointer) register. So it can be use for global variables only. The 0 offset is equal to address of the following instruction after the RIP-addressed instruction. For example: mov al,[rip+2] al=53 jmp short next (length=2 bytes) db 53 next: mov bl,[rip-7] (length=6 bytes) bl=53 You wouldn’t … Read more