Added an I/O port driver and made it callable from C.

This commit is contained in:
2020-05-08 10:16:41 -05:00
parent e1a1169240
commit 3d4557343f
2 changed files with 15 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
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