aboutsummaryrefslogtreecommitdiff
path: root/src/io/io.c
blob: d617cf2ef834cd1e18ccf4038f4f91ffbea9935a (plain) (blame)
1
2
3
4
5
6
7
8
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));
}