;
; PRTPATH - This .COM file will print the current directory path.
;
; From PC-TECH Journal	Feb 1984. p. 22
; Author: Bruce Kvam.

dos	macro	function
	mov	ah,function
	int	21h
	endm

putc	macro	char
	mov	dl,char
	dos	2
	endm

code	segment

	assume	cs:code,ds:code,es:code
	org 100h
start:

; Get and print the current drive

	dos	19h	; Get default drive code form DOS.
	add	al,'A'
	putc	al	; Display drive code.
	putc	':'
	putc	'\'

; Get and print current pathname

	mov	dl,0	; Default drive from DOS.
	lea	si,pathname
	dos	47h

printloop:
	cmp	byte ptr [si],0 ;pathname terminated by 0.
	jz	exit
	putc	[si]
	inc	si	; point to next character.
	jmp	printloop

exit:
	int	20h		; Return to DOS.

; Storage area where DOS writes the current pathname.  An ASCIIZ string.

pathname	db	65 dup (?)

code	ends
	end	start


