io.asm
Code: Select all
PUBLIC _outb ;Making them visible in C++ Files
PUBLIC _inb
PUBLIC _outw
PUBLIC _inw
.386 ;Pentium 386
.MODEL FLAT, C
.CODE ;Code segment
_outb PROC
push ebp
mov ebp, esp
mov dx, [ebp+4]
mov al, [ebp+6]
out dx, al
pop ebp
ret
_outb ENDP
_inb PROC
push ebp
mov ebp, esp
mov dx, [ebp+4]
in al, dx
pop ebp
ret
_inb ENDP
_outw PROC
push ebp
mov ebp, esp
mov dx, [ebp+4]
mov ax, [ebp+6]
out dx, ax
pop ebp
ret
_outw ENDP
_inw PROC
push ebp
mov ebp, esp
mov dx, [ebp+4]
in ax, dx
pop ebp
ret
_inw ENDP
END
hal.h
Code: Select all
extern uint8 inb(uint16 id);
extern void outb(uint16 id, uint8 value);
extern uint16 inw(uint16 id);
extern void outw(uint16 id, uint16 value);
I have enabled Microsoft Macro ASM.
Any help would be welcome.