ioctrl.c

来自「HT系列掌机部分功能测试程序(含源码)」· C语言 代码 · 共 65 行

C
65
字号
 /*********************************************
 **	    HT IO Control extended functions     **
 **     FOR HT2800                           **
 *********************************************/

  #define __ASM       _asm
  #define __IOCTRL    1

  #include <ioctrl.h>
  #include <alloc.h>
  #include <dos.h>

   unsigned int GetIOsts(void)
   {
       unsigned int result=0;
       __ASM {
          mov  bl, 0
          mov  ax, 143ah
          int  10h
          mov  result, cx
        }
       return(result);
   }

   void SetIOsts(unsigned int status)
   {
       __ASM {
          mov  cx, status
          mov  bl, 1
          mov  ax, 143ah
          int  10h
       }
   }

   unsigned int ReadIOPort(void)
   {
     unsigned int result=0;
       __ASM {
          mov  bl, 2
          mov  ax, 143ah
          int  10h
          mov  result, cx
       }
       return(result);
   }

   void SetIOPort(unsigned int value)
   {
       __ASM {
          mov  cx, value
          mov  bl, 3
          mov  ax, 143ah
          int  10h
       }
   }

   void NormalIOsts(void)
   {
       __ASM {
          mov  bl, 4
          mov  ax, 143ah
          int  10h
       }
   }

⌨️ 快捷键说明

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