what does “mov offset(%rip), %rax” do?

The next. That’s a general rule on x86 (see also branches).

In Intel’s manual volume 2 section 2.2.1.6 RIP-Relative Addressing:

A new addressing form, RIP-relative (relative instruction-pointer) addressing, is implemented in 64-bit mode. An effective address is formed by adding displacement to the 64-bit RIP of the next instruction.

Leave a Comment