options intsize=2, CPU=68020
      program erathostenes

c *** benchmark zur berechnung der primzahlen mit dem sieb des
c *** erathostenes

      implicit none
      parameter size = 8190
      common flags
      logical*1 flags(0:size)
      integer   i, prime, k, count, iter, is 
      equivalence (i, d7), (k, d6), (count, d5), (prime, d4)

      type *,'10 Iterations', char(7)
c      call lib$init_timer
      do iter = 1, 10
        count = 0
        do i = 0, size
          flags(i) = .true.
        end do
        do i = 0, size
          if (flags(i)) then
            prime = i + i + 3
            k     = i + prime
            do while (k .le. size)
              flags(k) = .false.
              k = k + prime
            end do
            count = count + 1
          end if
        end do
      end do
c      call lib$show_timer
      call shell('procs', is)
      type *, char(7), count,' primes.'
      end
