Moving components modules to a more proper directory
This commit is contained in:
9
components/ports/ports.h
Normal file
9
components/ports/ports.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "types.h"
|
||||
|
||||
#ifndef INCLUDE_IO_H
|
||||
#define INCLUDE_IO_H
|
||||
|
||||
void serialport_write_byte(const u16, const u16);
|
||||
|
||||
u8 serial_read_byte(const u16);
|
||||
#endif /* INCLUDE_IO_H */
|
||||
21
components/ports/ports.s
Normal file
21
components/ports/ports.s
Normal file
@@ -0,0 +1,21 @@
|
||||
; Helpers for serial ports which pretty much have to to be
|
||||
; written in asm
|
||||
|
||||
global serialport_write_byte
|
||||
global serial_read_byte
|
||||
|
||||
; write a byte
|
||||
;serialport_write_byte
|
||||
serialport_write_byte:
|
||||
mov al, [esp+8]
|
||||
mov dx, [esp+4]
|
||||
out dx, al
|
||||
ret
|
||||
|
||||
; Read byte from serial port
|
||||
;serialport_read_byte
|
||||
serial_read_byte:
|
||||
mov dx, [esp + 4] ; grab the address of the targeted port
|
||||
in al, dx ; read byte from the port
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user