Added inb and outb functions

This commit is contained in:
2020-07-09 21:58:02 -05:00
parent 722d6a77f5
commit be7a17596d
2 changed files with 21 additions and 0 deletions

13
src/pio.S Normal file
View File

@@ -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

8
src/pio.hpp Normal file
View File

@@ -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