	implicit integer (a-z)
	character*30 src, dest
	byte input(512),output(512)
	equivalence (input,input2)
	type *,'enter source file name'
	accept *,src
	type *,'enter desitnation file name'
	accept *,dest
	open(	unit=1,
     *		file=src,
     *		form='formatted',
     *		readonly,
     *		status='old')
	open(	unit=2,
     *		carriagecontrol='none',
     *		dispose='keep',
     *		file=dest,
     *		form='unformatted',
     *		status='new',
     *		recl=512/4,
     *		recordtype='fixed')
	out=0
    1	format(q,132a1)
   10	continue
	read(1,1,end=30)len,(input(i),i=1,len)
c	type 3,len,(input(i),i=1,len)
c    3	format(1x,'len=',i3/(10x,16(1x,z2.2)))
	do 20 i=1,len
	  if( out .eq. 512) then
	    write(2)output
	    do 18 j=1,512
	      output(i) = 0
   18	    continue
	    out = 0
	  endif
	  out = out + 1
	  output(out) = input(i)
   20	continue
	goto 10
   30	continue
	write(2)output
	close(unit=1)
	close(unit=2)
	end
