Skip to content

Commit 5a1899f

Browse files
committed
Clarify computation of %rip + (symbol - %rip)
1 parent 3e73641 commit 5a1899f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

text/3848-asm-const-ptr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -961,9 +961,9 @@ This syntax could apply to both `sym` and `const` operands. This kind of
961961
formatting can be quite useful due to assembly language quirks. For example, on
962962
x86:
963963

964-
* On one hand, `symbol(%rip)` means `%rip + (symbol - %rip)`, so it is equal to
965-
just writing `symbol` except that the instruction uses rip-relative
966-
addressing.
964+
* On one hand, `symbol(%rip)` means `%rip + (symbol - %rip)` (where the part in
965+
parentheses is calculated at link time), so it is equal to just writing
966+
`symbol` except that the instruction uses rip-relative addressing.
967967
* On the other hand, `100(%rip)` means `%rip + 100`, so it is *not* equal to
968968
`100`. The thing that actually means 100 in this context is `$100`.
969969

0 commit comments

Comments
 (0)