home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / section5 / fxn4406h.asm < prev    next >
Encoding:
Assembly Source File  |  1988-08-11  |  1.7 KB  |  35 lines

  1.         ;************************************************************;
  2.         ;                                                            ;
  3.         ;   Function 44H, Subfunctions 06H,07H:                      ;
  4.         ;                 IOCTL Input/Output Status                  ;
  5.         ;                                                            ;
  6.         ;   int ioctl_char_status(outputflag,handle)                 ;
  7.         ;       int outputflag;                                      ;
  8.         ;       int handle;                                          ;
  9.         ;                                                            ;
  10.         ;   Set outputflag = 0 for input status, 1 for output status.;
  11.         ;                                                            ;
  12.         ;   Returns -1 for all errors, 0 for not ready,              ;
  13.         ;   and 1 for ready.                                         ;
  14.         ;                                                            ;
  15.         ;************************************************************;
  16.  
  17. cProc   ioctl_char_status,PUBLIC
  18. parmB   outputflag
  19. parmW   handle
  20. cBegin
  21.         mov     al,outputflag   ; Get outputflag.
  22.         and     al,1            ; Keep only lsb.
  23.         add     al,6            ; AL = 06H for input status, 07H for output
  24.                                 ; status.
  25.         mov     bx,handle       ; Get handle.
  26.         mov     ah,44h          ; Set function code.
  27.         int     21h             ; Call MS-DOS.
  28.         jnc     isnoerr         ; Branch if no error.
  29.         mov     ax,-1           ; Return error code.
  30.         jmp     short isx
  31. isnoerr:
  32.         and     ax,1            ; Keep only lsb for return value.
  33. isx:
  34. cEnd
  35.