jumps
.model small
.code
org 100h
start:  mov di,	80h
	cmp byte ptr [di], 0
	je errusg
	mov al, [di]
	mov ah, 0
	mov dx, ax
	dec dx
	mov di, 82h
	mov si,	offset fname1
	mov cx,	0
loop1:	mov al, [di]
	mov [si], al
	inc di
	inc si
	inc cx
	cmp cx, dx
	je errusg
	cmp byte ptr [di], ' '
	je nextloop2
	jmp loop1
nextloop2:
	mov byte ptr [si], 0
loop2:  inc di
	inc cx
 	cmp byte ptr [di], ' '
	je loop2
	mov si,	offset fname2
loop3:  mov al, [di]
	mov [si], al
	inc di
	inc si
	inc cx
	cmp cx, dx
	je begcopy
	cmp byte ptr [di], ' '
	je begcopy
	jmp loop3
begcopy:mov byte ptr [si], 0
	mov ax, 3d00h
	mov dx,	offset fname1
	int 21h
	jc openerr
	mov si,	ax
        mov ah,	3ch
	mov cx,	0
	mov dx,	offset fname2
	int 21h
	jc openerr
	mov di, ax
;------------------------
loop4:  mov bx, si
	mov ah, 3fh
	mov dx,	offset buf
	mov cx,	10000
	int 21h
	mov cx, ax
	mov ah, 40h
	mov bx, di
	int 21h
	cmp ax, 10000
	jb  loopend
        jmp loop4
loopend:mov bx,si
	mov ah,	3eh
	int 21h
        mov bx, di
	mov ah,	3eh
	int 21h
	int 20h
openerr:mov ah,	09h
	mov dx,	offset errstr2
	int 21h
	int 20h
errusg: mov ah,	09h
	mov dx,	offset errstr
	int 21h
	int 20h
errstr  db 'usage: "mycopy.exe source dest"$'
errstr2 db 'File not found!$'
fname1	db 13 dup (?)
fname2	db 13 dup (?)
buf	db 10000 dup (?)
end start