program cdump implicit integer (a-z) integer*4 loc, block dimension buffer(256), fname(12), pat(8) data filelu / 3 / 1 continue type *,'Enter CDA binary file name.' read (5, 1000, end=900, err=1)fname 1000 format(12A2) error = 0 open (unit=filelu, status='old', err=1, file=fname, * access='sequential', form='unformatted', * recordtype='fixed', * blocksize=2048, * readonly, shared) type *,'Open successful.' 2 continue close (5) type *,'Enter number of consecutive locations (1-8)' read (5, 1005, end=900, err=2) npat 1005 format(I2) if (npat .le. 0) go to 2 type *,'Enter pattern(s) to search for (octal).' read (5, 1010, end=900, err=2) (pat(jj), jj = 1,npat) 1010 format(O6) p = 1 nfound = 0 do 150 r=1,10000 read (filelu, end=200, err=190) buffer block = r-1 do 100 i=1,256 if (buffer(i) .eq. pat(p)) then if (p .eq. 1) then loc = block * 512 + ((i - 1) * 2) fblock = block+1 endif p = p + 1 if (p .gt. npat) then nfound = nfound + 1 write (5,1030) loc, fblock 1030 format (1x,'Location = ',O12,' Block = ',O12) p = 1 endif else p = 1 endif 100 continue 150 continue type *,'Total number of times pattern found = ',nfound go to 200 C C Error processing C 190 continue type *,'*** File read error. ***' C C Close the file C 200 continue close (unit=filelu) go to 1 900 continue call exit END