Added header and asm file for assembly function wrappers
This commit is contained in:
parent
981c224f55
commit
26dd32345f
2 changed files with 29 additions and 0 deletions
16
include/asm.h
Normal file
16
include/asm.h
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
/* asm.h
|
||||||
|
* Assembly wrappers
|
||||||
|
*
|
||||||
|
* Wrapper functions for using assembly files.
|
||||||
|
*/
|
||||||
|
#ifndef ASM_H
|
||||||
|
#define ASM_H
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#define COM1 0x3F8
|
||||||
|
#define COM2 0x2F8
|
||||||
|
|
||||||
|
void outb(uint16_t port, uint8_t data);
|
||||||
|
uint8_t inb(uint16_t port);
|
||||||
|
|
||||||
|
#endif
|
||||||
13
src/asm.s
Normal file
13
src/asm.s
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
global outb, inb
|
||||||
|
section .text
|
||||||
|
outb:
|
||||||
|
mov dx, [esp+4]
|
||||||
|
mov al, [esp+8]
|
||||||
|
out dx, al
|
||||||
|
ret
|
||||||
|
|
||||||
|
inb:
|
||||||
|
mov eax, 0
|
||||||
|
mov dx, [esp+4]
|
||||||
|
in al, dx
|
||||||
|
ret
|
||||||
Loading…
Reference in a new issue