alcedo/kernel/arch/i386/io.nim

17 lines
244 B
Nim

type
IOPacket* = tuple
port: uint16
value: uint8
{.push stackTrace:off.}
proc outb*(data: IOPacket) =
asm """
outb `data.value` `data.port`
"""
proc inb*(port: uint16): uint =
asm """
inb `port` `result`
"""
{.pop.}