Added inb and outb functions
This commit is contained in:
13
src/pio.S
Normal file
13
src/pio.S
Normal 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
8
src/pio.hpp
Normal 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
|
||||||
Reference in New Issue
Block a user