diff options
Diffstat (limited to 'src/io/io.c')
-rw-r--r-- | src/io/io.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/io/io.c b/src/io/io.c new file mode 100644 index 0000000..d617cf2 --- /dev/null +++ b/src/io/io.c @@ -0,0 +1,9 @@ +unsigned char receive(unsigned short port) { + unsigned char value; + __asm__ __volatile__ ("inb %1, %0" : "=a" (value) : "dN" (port)); + return value; +} + +void send(unsigned short _port, unsigned char _data) { + __asm__ __volatile__ ("outb %1, %0" : : "dN" (_port), "a" (_data)); +} |