📄 io.asm
字号:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Snixos Project version 1.0, 2003.6; (C) Copyright 2003,2004,2005 Jockeyson,KeqiangGao <Snallie@tom.com>; All Rights Reserved.; Distributed under the terms of the GNU General Public License.; This program is a free and open source software and you can redistribute ; it and/or modify it under the terms of the GNU General Public License as; published by the Free Software Foundation. As no any liability is assumed ; for any incidental or consequential damages in connection with the ; information or program fragments contained herein,so any exception arised; is at your own risk. It is ABSOLUTELY WITHOUT ANY WARRANTY.; Bug report please send to Snallie@tom.com .;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; io.asm : data transfer through low level I/O port ; Author : snallie@tom.com, snallie@tom.com; Time : 2003.6 ;bits 32 global outb, inb, outb_delay, inb_delay ; prototype in C: void outb(int value,int port) ; send value sized in one byte to portoutb: push ebp mov ebp,esp push eax push edx mov eax,dword [esp+16] ; arg value mov edx,dword [esp+20] ; arg port out dx,al pop edx pop eax leave ret ; prototype in C: outb_b(int value,int port) ; send value sized in one byte to port but with a little more delayoutb_delay: push ebp mov ebp,esp push eax push edx mov eax,dword [esp+16] ; arg value mov edx,dword [esp+20] ; arg port out dx,al nop nop nop nop pop edx pop eax leave; prototype in C: unsigned char inb(int port); get a byte value from port and return what just gotinb: push ebp mov ebp,esp push edx mov edx,[esp+12] ; arg port in al,dx ; return value saved in ax pop edx leave ret; prototype in C: unsigned char inb_delay(int port); get a byte value from port and return what just got, but with a little more delayinb_delay: push ebp mov ebp,esp push edx mov edx,[esp+12] ; arg port in al,dx ; return value saved in ax nop nop nop nop pop edx leave ret
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -