Skip to content

Commit 3a29ead

Browse files
Operand order is reversed
Intel is the default syntax in the new `asm!` which means that one must reverse the operands when switching to it
1 parent 41c25af commit 3a29ead

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ unsafe fn read_from_port(port: u16) -> u32 {
3737
// extracted from the `x86_64` crate.
3838
#[inline]
3939
unsafe fn write_to_port(port: u16, value: u32) {
40-
asm!("outl eax, dx", out("dx") port, in("eax") value);
40+
asm!("outl dx, eax", out("dx") port, in("eax") value);
4141
}
4242

4343

0 commit comments

Comments
 (0)