mirror of https://github.com/garritfra/ditto-os
garritfra
5 years ago
2 changed files with 11 additions and 10 deletions
@ -1,11 +1,11 @@
|
||||
global outb ; make the label outb visible outside this file
|
||||
global outb ; make the label outb visible outside this file
|
||||
|
||||
; 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 be sent 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 to the calling function
|
||||
; 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 be sent 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 to the calling function
|
Loading…
Reference in new issue