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

📄 streams.c

📁 Embedded magazine source code. this is the source code in the year 1989
💻 C
字号:
      case DOS_READ:
         p = (BYTE_PTR) MK_FP(ds, dx) ;
         i = 0 ;
         while (i < cx)   {
            ch = _getch() ;
            /* Check for and process backspace characters */
            if (ch == '\b')   {
               if (i > 0)   {
                  _putch(ch) ;
                  _putch(' ') ;
                  _putch(ch) ;
                  p-- ;
                  i-- ;
               }
               continue ;
            }
            /* Check for the end of the line */
            if (ch == '\r')   {
               _putch(*p++ = ch) ;
               _putch(*p = '\n') ;
               i += 2 ;
               break ;
            }
            /* Put the character in the buffer and echo */
            _putch(*p++ = ch) ;
            i++ ;
         }
         /* Return the number of characters read in AX */
         ax = i ;
         break ;

      case DOS_WRITE:
         p = (BYTE_PTR) MK_FP(ds, dx) ;
         for (i = 0; i < cx; i++)
            _putch(*p++) ;

         /* Return the number of characters written in AX */
         ax = i ;
         break ;

      case DOS_IOCTL:
         if (lowbyte(ax) == 0)   {
            dx = 0x80d3 ;
         }
         else   {
            psw |= 1 ;              /* Signal an error */
            ax = 6 ;                /* Invalid or not open handle */
         }
         break ;


⌨️ 快捷键说明

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