Skip to content

Commit d8943dd

Browse files
committed
Explain why we need to retain the contents of the si register
1 parent d633408 commit d8943dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bios/boot_sector/src/dap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ impl DiskAddressPacket {
3939
unsafe {
4040
asm!(
4141
"push 0x7a", // error code `z`, passed to `fail` on error
42-
"mov {1:x}, si",
42+
"mov {1:x}, si", // backup the `si` register, whose contents are required by LLVM
4343
"mov si, {0:x}",
4444
"int 0x13",
4545
"jc fail",
4646
"pop si", // remove error code again
47-
"mov si, {1:x}",
47+
"mov si, {1:x}", // restore the `si` register to its prior state
4848
in(reg) self_addr,
4949
out(reg) _,
5050
in("ax") 0x4200u16,

0 commit comments

Comments
 (0)