 ;------------------------------------------------------------------------
 ; CHDIR to specified directory
 ;
 ; Usage: CDAPP F:\SOMEDIR\SOMEPLAC\FOOBLAT
 ;
 ; Changes to F: drive in the \SOMEDIR\SOMEPLAC\FOOBLAT directory
 ;
 ;------------------------------------------------------------------------
 xxx    segment para public 'code'
	assume  cs:xxx
	org     100h
 start  label   near
	CLD                                        
	MOV     DI,0081h
	PUSH    DI                                 
	MOV     CX,-1
	MOV     AL,0Dh                              
	REPNZ   SCASB
	DEC     DI
	MOV     BYTE PTR [DI],00h                   
	POP     DI                                 
L0111:
	CMP     BYTE PTR [DI],20h                   
	JZ      L0142                               
	CMP     BYTE PTR [DI],09h                   
	JZ      L0142                               
	CMP     BYTE PTR [DI],00h                   
	JZ      L013D                               
	MOV     DX,DI                              
	MOV     AH,3Bh                              
	INT     21h                                 
	CMP     BYTE PTR [DI+01],3Ah                
	JNZ     L013D                               
	MOV     DL,[DI]                            
	CMP     DL,61h                              
	JB      L0136                               
	SUB     DL,20h                              
L0136:
	SUB     DL,41h                              
	MOV     AH,0Eh                              
	INT     21h                                 
L013D:
	MOV     AX,4C00h                            
	INT     21h                                 
L0142:
	INC     DI                                 
	JMP     L0111                               

	db      "Copyright (C) 1995 IBM Corp."

xxx     ends
	end     start

