diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-11-04 13:41:10 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-11-04 13:41:10 +0100 |
commit | 7a07b4a4398e02aead731b0c38af143d6a2fe41a (patch) | |
tree | cd9ec8490531dfa26e05325f807fb0e8c8e06c24 /kernel/io_ports.asm | |
parent | 71e63d03f95d559c709911844ef1fc9907c74f49 (diff) | |
download | jeyzuos-7a07b4a4398e02aead731b0c38af143d6a2fe41a.zip jeyzuos-7a07b4a4398e02aead731b0c38af143d6a2fe41a.tar.gz |
add io_ports
Diffstat (limited to 'kernel/io_ports.asm')
-rw-r--r-- | kernel/io_ports.asm | 28 |
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 + |