]>
wirehaze git hosting - MS-DOS.git/blob - v4.0/src/MAPPER/CHDIR.ASM
4 title CP
/DOS DosChDir mapper
6 dosxxx
segment byte public 'dos'
7 assume
cs:dosxxx
,ds:nothing
,es:nothing
,ss:nothing
9 ; ************************************************************************* *
13 ; * FUNCTION: change directory name
15 ; * FUNCTION: This module will change the current directory for the
16 ; * requesting process.
21 ; * PUSH@ ASCIIZ Dirname ; Directory path name
22 ; * PUSH DWORD 0 ; Reserved (must be zero) took out @
23 ; * ; 5/28 to match 3/25 spec
29 ; * IF ERROR (AX NOT = 0)
33 ; * o Invalid directory path
36 ; * DOS int 21h function 3Bh ; Change current directory
38 ; *************************************************************************
49 dtrm006 dd 0h
;reserved (must be zero)
50 dnam006 dd ?
;address of directory path name
54 Enter DosChDir
; push registers
56 mov dx, word ptr [bp].dnam006
;load directory name offset
57 mov ax, word ptr [bp].dnam006
+2 ;load directory name segment
59 push ax ; set segment in DS
62 mov ax,03b00h ; load chdir op code
63 int 21h
; call dos to change the directory
64 jc exit
; jump if error
66 xor ax,ax ; else, good return code
67 exit: mexit
; pop registers
68 ret size
str - 6 ; return