home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / FUNK108A.ZIP / DOS32V30.ZIP / PAL / FILEIO / CHDIR.ASM next >
Encoding:
Assembly Source File  |  1995-05-20  |  1020 b   |  44 lines

  1. ;******************************************************************************
  2. ; Filename: CHDIR.ASM
  3. ;   Author: Peter Andersson
  4. ;  Version: 0.0
  5. ;  Created: 1995.03.10
  6. ;  Updated: 
  7. ;******************************************************************************
  8. ; Copyright Peter Andersson, 1994-1995.
  9. ; All rights reserved.
  10. ;******************************************************************************
  11. ; Function: LONG @chdir(PSZ path)
  12. ;  Comment: Changes to a directory
  13. ;    Input: Eax, path - file path
  14. ;  Returns: -1 if an error occured or 0 if alright
  15. ;******************************************************************************
  16.  
  17.     Include    STDDEF.INC
  18.  
  19.     Codeseg
  20.  
  21. Proc    chdir , 1
  22.         Mov    Edx,Eax
  23.         Mov    Ah,3Bh
  24.         Int    21h
  25.         Jc    @@Error
  26.         Clear    Eax
  27.         Ret
  28.     Align    4
  29. @@Error:    Mov    [Word errno],Ax
  30.     Ifdef    DEBUG
  31.         Call    printf,Offset ErrChdirMsg,Edx,Ax
  32.     Endif
  33.         Mov    Eax,-1
  34.         Ret
  35. Endp
  36.  
  37.     Dataseg
  38.  
  39.     IfDef    DEBUG
  40. ErrChdirMsg    Db    "Error changing directory '%s'! Error: %h",LF,0
  41.     Endif
  42.  
  43.     End
  44.