From 77805f60889a9fbe942d03ceec5f7a3c961af3ed Mon Sep 17 00:00:00 2001 From: A77377 <28602523+A77377@users.noreply.github.com> Date: Sat, 5 Mar 2022 16:55:43 +0000 Subject: [PATCH] Typo fixed in description of inline ASM cpuid function --- src/unsafe/asm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unsafe/asm.md b/src/unsafe/asm.md index c97021f3de..10d4a9b278 100644 --- a/src/unsafe/asm.md +++ b/src/unsafe/asm.md @@ -265,7 +265,7 @@ fn main() { ``` In the example above we use the `cpuid` instruction to read the CPU manufacturer ID. -This instruction writes to `eax` with the maximum supported `cpuid` argument and `ebx`, `esx`, and `ecx` with the CPU manufacturer ID as ASCII bytes in that order. +This instruction writes to `eax` with the maximum supported `cpuid` argument and `ebx`, `edx`, and `ecx` with the CPU manufacturer ID as ASCII bytes in that order. Even though `eax` is never read we still need to tell the compiler that the register has been modified so that the compiler can save any values that were in these registers before the asm. This is done by declaring it as an output but with `_` instead of a variable name, which indicates that the output value is to be discarded.