So here's the code (I'm using clang, which is gnu as compatible I think- well it compiles it all, at least )
Code: Select all
.code32
.intel_syntax noprefix
.section .text
.globl io_wait
io_wait:
xor eax, eax
//this port is apparantly open cf linux :)
out 0x80, al
ret
.globl outb
outb:
mov al, byte ptr [esp+0x8]
mov dx, word ptr [esp+0xc]
out dx, al
ret
.globl outw
outw:
mov ax, word ptr [esp+0x8]
mov dx, word ptr [esp+0xc]
out dx, ax
ret
.globl outl
outl:
mov eax, dword ptr [esp+0x8]
mov dx, word ptr [esp+0xc]
out dx, ax
ret
.globl inb
inb:
mov dx, word ptr [esp+0x8]
in al, dx
ret
.globl inw
inw:
mov dx, word ptr [esp+0x8]
in ax, dx
ret
.globl inl
inl:
mov dx, word ptr [esp+0x8]
in eax, dx
ret