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

  1.         ;************************************************************;
  2.         ;                                                            ;
  3.         ;        Function 44H, Subfunctions 00H,01H:                 ;
  4.         ;                      Get/Set IOCTL Device Data             ;
  5.         ;                                                            ;
  6.         ;        int ioctl_char_flags(setflag,handle,newflags)       ;
  7.         ;            int setflag;                                    ;
  8.         ;            int handle;                                     ;
  9.         ;            int newflags;                                   ;
  10.         ;                                                            ;
  11.         ;        Set setflag = 0 to get flags, 1 to set flags.       ;
  12.         ;                                                            ;
  13.         ;        Returns -1 for error, else returns flags.           ;
  14.         ;                                                            ;
  15.         ;************************************************************;
  16.  
  17. cProc   ioctl_char_flags,PUBLIC
  18. parmB   setflag
  19. parmW   handle
  20. parmW   newflags
  21. cBegin
  22.         mov     al,setflag      ; Get setflag.
  23.         and     al,1            ; Save only lsb.
  24.         mov     bx,handle       ; Get handle to character device.
  25.         mov     dx,newflags     ; Get new flags (they are used only
  26.                                 ; by "set" option).
  27.         mov     ah,44h          ; Set function code.
  28.         int     21h             ; Call MS-DOS.
  29.         mov     ax,dx           ; Assume success - prepare to return
  30.                                 ; flags.
  31.         jnc     iocfx           ; Branch if no error.
  32.         mov     ax,-1           ; Else return error flag.
  33. iocfx:
  34. cEnd
  35.