Skip to content

Commit

Permalink
Improved wording in asm.md
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PhilVoel authored Jun 5, 2023
1 parent 07f266c commit ae60402
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/unsafe/asm.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ fn main() {
// String is stored as ascii in ebx, edx, ecx in order
// Because ebx is reserved, the asm needs to preserve the value of it.
// So we push and pop it around the main asm.
// (in 64 bit mode for 64 bit processors, 32 bit processors would use ebx)
// 64 bit mode on 64 bit processors does not allow pushing/popping of
// 32 bit registers (like ebx), so we have to use the extended rbx register instead.

unsafe {
asm!(
Expand Down

0 comments on commit ae60402

Please sign in to comment.