* Program 	: Rename a file
* Author	: Stephen McNabb
* Creation date : 16th February 1995
* Last update	: 16th February 1995
* Parameters	: Address of filename to be renamed
*		  Address of new filename
*		  Also a parameter '0' which is reserved
* Output	: A negative number will be returned in d0 if
*		  there is an error

start:	jsr	cls		/clear the screen
	move.l	#new,-(sp)	/move address of new filename to stack
	move.l	#old,-(sp)	/move address of old filename to stack
	move.w	#0,-(sp)	/move value '0' to stack  Note: Don't change
	move.w	#$56,-(sp)	/use Frename() function
	trap	#1		/use gemdos
	add.l	#12,sp		/tidy up stack

	cmpi.b	#0,d0		/check to see if there was an error
	blt	err		/if there is display an error message
	
	move.l	#success,d0	/else move address of success message into d0
	bra	skip		/and skip the next line
err:	move.l	#error,d0	/move address of error message into d0
skip:	jsr	ptext		/display message on screen
	
end:	bra	exit		/exit from program

	include	"\SOURCE\FUNCTION.S"	/include standard functions

*** Program Data ***
	
new:	dc.b	'\NEW.S',0		/new filename
old:	dc.b	'\OLD.S',0		/old filename
success:dc.b	'File renamed!',0	/success message
error:	dc.b	'Error!',0		/error message
*** End of file ***	