Files
kernel3/kernel/io.s
T

22 lines
653 B
ArmAsm

global outb
; outb - Send a byte to an I/O port.
; stack: [esp + 8] The data byte
; [esp + 4] The I/O port
; [esp ] Return address
outb:
mov al, [esp + 8] ; Move the data to send into the AL register
mov dx, [esp + 4] ; Move the address of the I/O port into the DX register
out dx, al ; Send the data to the I/O port
ret ; Return
global inb
; inb - Returns a byte from the give I/O port.
; stack: [esp + 4] The address of the I/O port
; [esp ] The return address
inb:
mov dx, [esp + 4] ; Move the address of the I/O port to the dx register.
in al, dx ; Read a byte from the I/O port and store it in the al register
ret