⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 casm.h

📁 我写的一个小OS~~
💻 H
字号:
#define KM_DivErr 0x00
#define KM_Debug 0x01
#define KM_NMI 0x02
#define KM_int3 0x03
#define KM_Overflow 0x04
#define KM_Bounds 0x05
#define KM_InvalidOp 0x06
#define KM_DevNotAvail 0x07
#define KM_Double 0x08
#define KM_CopSegOver 0x09
#define KM_InvalidTss 0x0a
#define KM_Segment 0x0b
#define KM_Stack 0x0c
#define KM_General 0x0d
#define KM_Page 0x0e
#define KM_CopErr 0x10

#define cli() __asm__("cli"::)
#define sti() __asm__("sti"::)
#define s_intr() __asm__("pushl %%eax;"\
"pushl %%ebx;"\
"pushl %%ecx;"\
"pushl %%edx;"\
"pushl %%esp;"\
"pushl %%ebp;"\
"pushl %%esi;"\
"pushl %%edi;"\
"pushl %%ds;movw $0x10,%%ax;movw %%ax,%%ds;"::)
#define e_intr() __asm__("popl %%ds;"\
"popl %%edi;"\
"popl %%esi;"\
"popl %%ebp;"\
"popl %%esp;"\
"popl %%edx;"\
"popl %%ecx;"\
"popl %%ebx;"\
"popl %%eax"::)
#define eH_intr() __asm__("pushl %%eax;"\
"movb $0x20,%%al;"\
"outb %%al,$0x20;"\
"popl %%eax"::)
#define iret() __asm__("movl %%ebp,%%esp;popl %%ebp;iret;"::)
#define nop() __asm__(".word 0x00eb"::)
typedef void (*C_Fun)(void);
long spinlock(long *value);
unsigned char import_b(unsigned short port);
unsigned char export_b(unsigned short port,unsigned char value);
unsigned short import_w(unsigned short port);
unsigned short export_w(unsigned short port,unsigned short value);
void set_intr_gate(unsigned long intr_num,C_Fun func);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -