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

  1.         ;************************************************************;
  2.         ;                                                            ;
  3.         ;            Function 29H: Parse Filename into FCB           ;
  4.         ;                                                            ;
  5.         ;            int FCB_parse(uXFCB,name,ctrl)                  ;
  6.         ;                char *uXFCB;                                ;
  7.         ;                char *name;                                 ;
  8.         ;                int ctrl;                                   ;
  9.         ;                                                            ;
  10.         ;            Returns -1 if error,                            ;
  11.         ;                     0 if no wildcards found,               ;
  12.         ;                     1 if wildcards found.                  ;
  13.         ;                                                            ;
  14.         ;************************************************************;
  15.  
  16. cProc   FCB_parse,PUBLIC,<ds,si,di>
  17. parmDP  puXFCB
  18. parmDP  pname
  19. parmB   ctrl
  20. cBegin
  21.         loadDP  es,di,puXFCB    ; Pointer to unopened extended FCB.
  22.         push    di              ; Save DI.
  23.         xor     ax,ax           ; Fill all 22 (decimal) words of the
  24.                                 ; extended FCB with zeros.
  25.         cld                     ; Make sure direction flag says UP.
  26.         mov     cx,22d
  27.         rep     stosw
  28.         pop     di              ; Recover DI.
  29.         mov     byte ptr [di],0ffh ; Set flag byte to mark this as an
  30.                                    ; extended FCB.
  31.         add     di,7            ; Advance pointer to start of regular
  32.                                 ; FCB.
  33.         loadDP  ds,si,pname     ; Get pointer to filename into DS:SI.
  34.         mov     al,ctrl         ; Get parse control byte.
  35.         mov     ah,29h          ; Parse filename, please.
  36.         int     21h
  37.         cbw                     ; Set return parameter.
  38. cEnd
  39.