Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use core::arch::asm;
- pub fn outb(port: u16, value: u8) {
- unsafe {
- asm!(
- "out dx, al",
- in("dx") port,
- in("al") value,
- );
- }
- }
- pub fn inb(port: u16) -> u8 {
- let mut value: u8;
- unsafe {
- asm!(
- "in al, dx",
- out("al") value,
- in("dx") port,
- );
- }
- return value;
- }
Advertisement
Add Comment
Please, Sign In to add comment