gint8.c

来自「操作系统实验教程核心技术与编程实例书中地例子代码」· C语言 代码 · 共 43 行

C
43
字号
void interrupt gint8()
 {  
    oldhandler();
    asm cli
    inregs.h.ah=0x34;
    intdosx(&inregs,&outregs,&segs);
    indos=(char far *)(((long)(segs.es)<<16)+outregs.x.bx);
    if (*indos) goto g_ret;
    asm mov al,0x0B
    asm out 0x20,al
    asm nop
    asm in al,0x20
    asm and al,0x0fe
    asm jnz g_ret
    time_count =time_count - 1;
    if ( time_sch == 0 ) goto g_ret ;
    if (time_count>=1) goto g_ret;
    time_sch=0;
    asm      pop word ptr r_bp
    asm      pop word ptr r_di
    asm      pop word ptr r_si
    asm      pop word ptr r_ds
    asm      pop word ptr r_es
    asm      pop word ptr r_dx
    asm      pop word ptr r_cx
    asm      pop word ptr r_bx
    asm      pop word ptr r_ax
    asm      pop word ptr r_ip
    asm      pop word ptr r_cs
    asm      pop word ptr r_flag
    asm push word ptr gsch_seg
    asm push word ptr gsch_off
    asm ret;
 g_ret:
    asm sti;
 }
void ggret()
  {
    setvect(INTERRUPT,oldhandler);
    printf("\n   Exit from gsch()");
    exit(0);
  }

⌨️ 快捷键说明

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