#NO_APP
	.globl	_version
	.text
LC0:
	.ascii "$VER: MyCopy 1.0 (20.02.2002)\0"
	.data
	.even
_version:
	.long	LC0
	.globl	_author
	.text
LC1:
	.ascii "by Sante Nocciolino\0"
	.data
	.even
_author:
	.long	LC1
	.text
LC2:
	.ascii "Usage: MyCopy {infile} {outfile}\0"
LC3:
	.ascii "r\0"
LC4:
	.ascii "Error opening input file\0"
LC5:
	.ascii "w\0"
LC6:
	.ascii "Error opening target file\0"
LC7:
	.ascii "Done!\0"
	.even
	.globl	_main
_main:
	link a5,#-8192
	moveml #0x2030,sp@-
	movel a5@(12),a2
	jbsr ___main
	moveq #3,d0
	cmpl a5@(8),d0
	jeq L2
	pea LC2
	jra L22
	.even
L2:
	pea LC3
	movel a2@(4),sp@-
	jbsr _fopen
	movel d0,a3
	addql #8,sp
	tstl d0
	jne L3
	pea LC4
	.even
L22:
	jbsr _puts
	jra L21
	.even
L3:
	pea LC5
	movel a2@(8),sp@-
	jbsr _fopen
	movel d0,d2
	addql #8,sp
	jne L4
	pea LC6
	jbsr _puts
	movel a3,sp@-
	jbsr _fclose
	.even
L21:
	moveq #10,d0
	jra L1
	.even
L4:
	movew a3@(12),d0
	andw #32,d0
	movew d0,d1
	jne L18
	.even
L16:
	lea 0:w,a2
	tstw d1
	jne L9
	.even
L13:
	movel a3,sp@-
	jbsr _fgetc
	moveb d0,a2@(-8192,a5:l)
	addql #4,sp
	addql #1,a2
	cmpw #8191,a2
	jgt L9
	movew a3@(12),d0
	andw #32,d0
	jeq L13
L9:
	movew a3@(12),d0
	andw #32,d0
	jne L14
	movel d2,sp@-
	pea 1:w
	movel a2,sp@-
	jra L20
	.even
L14:
	movel d2,sp@-
	pea 1:w
	pea a2@(-1)
L20:
	pea a5@(-8192)
	jbsr _fwrite
	addw #16,sp
	movew a3@(12),d1
	andw #32,d1
	jeq L16
L18:
	pea LC7
	jbsr _puts
	movel a3,sp@-
	lea _fclose,a2
	jbsr a2@
	movel d2,sp@-
	jbsr a2@
	clrl d0
L1:
	moveml a5@(-8204),#0xc04
	unlk a5
	rts
