Skip to content

Commit

Permalink
Operand order is reversed
Browse files Browse the repository at this point in the history
Intel is the default syntax in the new `asm!` which means that one must reverse the operands when switching to it
  • Loading branch information
kennystrawnmusic authored Jul 16, 2020
1 parent 41c25af commit 3a29ead
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ unsafe fn read_from_port(port: u16) -> u32 {
// extracted from the `x86_64` crate.
#[inline]
unsafe fn write_to_port(port: u16, value: u32) {
asm!("outl eax, dx", out("dx") port, in("eax") value);
asm!("outl dx, eax", out("dx") port, in("eax") value);
}


Expand Down

0 comments on commit 3a29ead

Please sign in to comment.