summaryrefslogtreecommitdiffstats
path: root/kernel/io_ports.asm
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-11-04 13:41:10 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-11-04 13:41:10 +0100
commit7a07b4a4398e02aead731b0c38af143d6a2fe41a (patch)
treecd9ec8490531dfa26e05325f807fb0e8c8e06c24 /kernel/io_ports.asm
parent71e63d03f95d559c709911844ef1fc9907c74f49 (diff)
downloadjeyzuos-7a07b4a4398e02aead731b0c38af143d6a2fe41a.zip
jeyzuos-7a07b4a4398e02aead731b0c38af143d6a2fe41a.tar.gz
add io_ports
Diffstat (limited to 'kernel/io_ports.asm')
-rw-r--r--kernel/io_ports.asm28
1 files changed, 28 insertions, 0 deletions
diff --git a/kernel/io_ports.asm b/kernel/io_ports.asm
new file mode 100644
index 0000000..9ab47d9
--- /dev/null
+++ b/kernel/io_ports.asm
@@ -0,0 +1,28 @@
+SECTION .text
+global outw
+global inw
+
+outw:
+ push ebp;
+ mov ebp,esp
+
+ mov dx, [ebp+8] ; port
+ mov ax, [ebp+12] ; data
+ out dx, ax
+
+ mov esp,ebp
+ pop ebp
+ ret
+
+
+inw:
+ push ebp;
+ mov ebp,esp
+
+ mov dx, [ebp+8] ; port
+ in eax, dx
+
+ mov esp,ebp
+ pop ebp
+ ret
+