Skip to content

Commit ae60402

Browse files
authored
Improved wording in asm.md
The old version did not make clear that and why rbx was used in the code instead of ebx (this only happens much later at the end of the explanation after the code block), and the difference between which register is used in which cpu mode wasn't clear.
1 parent 07f266c commit ae60402

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/unsafe/asm.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ fn main() {
254254
// String is stored as ascii in ebx, edx, ecx in order
255255
// Because ebx is reserved, the asm needs to preserve the value of it.
256256
// So we push and pop it around the main asm.
257-
// (in 64 bit mode for 64 bit processors, 32 bit processors would use ebx)
257+
// 64 bit mode on 64 bit processors does not allow pushing/popping of
258+
// 32 bit registers (like ebx), so we have to use the extended rbx register instead.
258259

259260
unsafe {
260261
asm!(

0 commit comments

Comments
 (0)