[C] 产生一个软中断 geninterrupt →→→→→进入此内容的聊天室

来自 , 2019-05-23, 写在 C, 查看 111 次.
URL http://www.code666.cn/view/2a8a8124
  1. #include <conio.h>
  2. #include <dos.h>
  3.  
  4. /* function prototype */
  5. void writechar(char ch);
  6.  
  7. int main(void)
  8. {
  9.    clrscr();
  10.    gotoxy(80,25);
  11.    writechar('*');
  12.    getch();
  13.    return 0;
  14. }
  15.  
  16. /*
  17.    outputs a character at the current cursor
  18.    position using the video BIOS to avoid the
  19.    scrolling of the screen when writing to
  20.    location (80,25).
  21. */
  22.  
  23. void writechar(char ch)
  24. {
  25.    struct text_info ti;
  26.    /* grab current text settings */
  27.    gettextinfo(&ti);
  28.    /* interrupt 0x10 sub-function 9 */
  29.    _AH = 9;
  30.    /* character to be output */
  31.    _AL = ch;
  32.    _BH = 0;                  /* video page */
  33.    _BL = ti.attribute;  /* video attribute */
  34.    _CX = 1;           /* repetition factor */
  35.    geninterrupt(0x10);  /* output the char */
  36. }
  37.  

回复 "产生一个软中断 geninterrupt"

这儿你可以回复上面这条便签

captcha