	; This should be the first file in the link line
	; Upon return from _main(), stdin, stdout and stderr are
	; closed.  All others are the responsibility of the user.
	; (data may be lost from open files; we have no exit(), just
	; _exit().

	XREF	_main
	XREF	__exit
	XREF	_close

	SECTION CODE

	jsr	_main		; First function to call
	move.l	d0,-(sp)	; Return value from main()
	move.l	#0,-(sp)	; Stdin
	jsr	_close
	add.l	#4,sp
	move.l	#1,-(sp)	; Stdout
	jsr	_close
	add.l	#4,sp
	move.l	#2,-(sp)	; Stderr
	jsr	_close
	add.l	#4,sp		; Back to retval from _main()
	jsr	__exit		; Finish and be cleaned up

	SECTION END

