From 9ba36142357f781c99bb79101ac114d9265ef725 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 26 Jun 2025 22:11:07 +0200 Subject: [PATCH] fix the addition instruction in the naked asm example --- content/Rust-1.88.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/Rust-1.88.0.md b/content/Rust-1.88.0.md index 861c8082e..ac7273167 100644 --- a/content/Rust-1.88.0.md +++ b/content/Rust-1.88.0.md @@ -53,7 +53,7 @@ For example: pub unsafe extern "sysv64" fn wrapping_add(a: u64, b: u64) -> u64 { // Equivalent to `a.wrapping_add(b)`. core::arch::naked_asm!( - "add rax, rdi, rsi", + "lea rax, [rdi + rsi]", "ret" ); }