;******************************************************************************
; Filename: CHDIR.ASM
; Author: Peter Andersson
; Version: 0.0
; Created: 1995.03.10
; Updated:
;******************************************************************************
; Copyright Peter Andersson, 1994-1995.
; All rights reserved.
;******************************************************************************
; Function: LONG @chdir(PSZ path)
; Comment: Changes to a directory
; Input: Eax, path - file path
; Returns: -1 if an error occured or 0 if alright
;******************************************************************************
Include STDDEF.INC
Codeseg
Proc chdir , 1
Mov Edx,Eax
Mov Ah,3Bh
Int 21h
Jc @@Error
Clear Eax
Ret
Align 4
@@Error:
Mov [Word errno],Ax
Ifdef DEBUG
Call printf,Offset ErrChdirMsg,Edx,Ax
Endif
Mov Eax,-1
Ret
Endp
Dataseg
IfDef DEBUG
ErrChdirMsg Db "Error changing directory '%s'! Error: %h",LF,0
Endif
End