Moving components modules to a more proper directory

This commit is contained in:
2023-03-30 22:40:08 -07:00
parent 044d5a75b5
commit cc1bb63e27
26 changed files with 11 additions and 148 deletions

9
components/ports/ports.h Normal file
View 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
View 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