Skip to content

Commit 9ba3614

Browse files
committed
fix the addition instruction in the naked asm example
1 parent c5c53c4 commit 9ba3614

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/Rust-1.88.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ For example:
5353
pub unsafe extern "sysv64" fn wrapping_add(a: u64, b: u64) -> u64 {
5454
// Equivalent to `a.wrapping_add(b)`.
5555
core::arch::naked_asm!(
56-
"add rax, rdi, rsi",
56+
"lea rax, [rdi + rsi]",
5757
"ret"
5858
);
5959
}

0 commit comments

Comments
 (0)