📄 xsys0.s
字号:
/* Project: HARTIK 3.0 */
/* Description: Hard Real TIme Kernel for 386 & higher machines */
/* Author: Gerardo Lamastra */
/* Date: 9/5/96 */
/* Revision: Beta 1.0 */
/* Assembler portion of the library! */
/* Use X standard GDT selectors */
#include "sel.h"
.text
.globl __exit
.globl __x_callBIOS
#ifdef __NO_INLINE_PORT__
.globl _outp
.globl _inp
.globl _outpw
.globl _inpw
.globl _outpd
.globl _inpd
#endif
/* Simple function to terminate PM application */
/* void _exit(int code) */
__exit: pushl %ebp
movl %esp,%ebp
movl 8(%ebp),%eax
.byte 0x0ea /* Direct gate jmp */
.long 0
.word X_RM_BACK_GATE
/* Invoke 16 bit BIOS function from PM application */
/* void _x_callBIOS(void) */
__x_callBIOS: .byte 0x09a /* Direct gate call */
.long 0
.word X_CALLBIOS_GATE
ret
#ifdef __NO_INLINE_PORT__
/* void outp(int port,char value) */
_outp: movl 4(%esp),%edx
movl 8(%esp),%eax
outb %al,%dx
ret
/* char inp(int port) */
_inp: movl 4(%esp),%edx
inb %dx,%al
movzb %al,%eax
ret
/* void outpw(int port,unsigned short value) */
_outpw: movl 4(%esp),%edx
movl 8(%esp),%eax
outw %ax,%dx
ret
/* unsigned short inpw(int port) */
_inpw: movl 4(%esp),%edx
inw %dx,%ax
movzwl %ax,%eax
ret
/* void outpd(int port,unsigned long value) */
_outpd: movl 4(%esp),%edx
movl 8(%esp),%eax
outl %eax,%dx
ret
/* unsigned long inpd(int port) */
_inpd: movl 4(%esp),%edx
inl %dx,%eax
ret
#endif /* __NO_INLINE_PORTS__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -