From c74bd1baa844eac1fcb17a266ef720ed0c1ae616 Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Fri, 9 Oct 2026 09:06:04 -0700 Subject: Bit o a refactah --- src/io.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/io.c (limited to 'src/io.c') diff --git a/src/io.c b/src/io.c new file mode 100644 index 0000000..1d9db60 --- /dev/null +++ b/src/io.c @@ -0,0 +1,12 @@ +#include +#include "utils.h" + +uint8_t inportb(uint16_t port) { + uint8_t r; + asm("inb %1, %0" : "=a" (r) : "dN" (port)); + return r; +} + +void outportb(uint16_t port, uint8_t data) { + asm("outb %1, %0" : : "dN" (port), "a" (data)); +} \ No newline at end of file -- cgit v1.3