qa.hlp (Table of Contents; Topic list)
MakeDir
   Example  Back  Contents  Index
──────────────────────────────────────────────────────────────────────────────
 
;* MakeDir - Creates a specified subdirectory.
;*
;* Shows:   DOS Function - 39h (Create Directory)
;*
;* Params:  pspec - Pointer to ASCIIZ pathname of new subdirectory
;*
;* Return:  Short integer with error code
;*          0 if successful
;*          1 if create error
 
MakeDir PROC \
        USES ds, \
        pspec:PTR BYTE
 
        LoadPtr ds, dx, pspec           ; Point DS:DX to path spec
        mov     ah, 39h                 ; DOS Function 39h
        int     21h                     ; Create Directory
        mov     ax, 0                   ; Set error code, keep flags
        jnc     exit                    ; Exit if successful
        inc     ax                      ; Else set error code to 1
exit:   ret
 
MakeDir ENDP
                                    -♦-