# ASMIX Commands and Utilities
# (c) Sergei Zubkov (Cubbi) 1999-2001
#
# pwd.s - Print working directory
# 
# $Id: pwd.s,v 1.2 2001/10/04 19:41:58 cubbi Exp $

	.globl _start
_start:
        movl	$1024,%ecx		
        movl    $linux_buffer,%ebx	
        movl    $183,%eax		
        int     $0x80
        testl   %eax,%eax		
        js      error_exit
        movb    $0x0A,linux_buffer-1(%eax)
        movl    %eax,%edx		
        xorl    %ebx,%ebx		
        movl    $linux_buffer,%ecx	
        incl    %ebx			
        movl    $4,%eax			
        int     $0x80
	xorl	%ebx,%ebx
exit:
	movl	$1,%eax			
	int	$0x80
error_exit:
	xorl	%ebx,%ebx
	incl	%ebx
	jmp	exit

	.bss
	.lcomm linux_buffer,1024	
					
