From be7a17596db0130486dc2cadfe6f4fe5f53aa93f Mon Sep 17 00:00:00 2001 From: Nathan Giddings Date: Thu, 9 Jul 2020 21:58:02 -0500 Subject: [PATCH] Added inb and outb functions --- src/pio.S | 13 +++++++++++++ src/pio.hpp | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/pio.S create mode 100644 src/pio.hpp diff --git a/src/pio.S b/src/pio.S new file mode 100644 index 0000000..7681ee0 --- /dev/null +++ b/src/pio.S @@ -0,0 +1,13 @@ +.global outb +outb: + mov 4(%esp), %dx + mov 8(%esp), %al + out %al, %dx + ret + +.global inb +inb: + mov 4(%esp), %dx + xor %eax, %eax + in %dx, %al + ret \ No newline at end of file diff --git a/src/pio.hpp b/src/pio.hpp new file mode 100644 index 0000000..68aed33 --- /dev/null +++ b/src/pio.hpp @@ -0,0 +1,8 @@ +#ifndef PIO_H +#define PIO_H + +extern "C" void outb(short port, char data); + +extern "C" char inb(short port); + +#endif \ No newline at end of file