CLR R7  ; count of primes in range
    L:	CMP R3, R4
	BLT DONE

	; check if contents of R3 is prime
	MOV# 2, R5  ; attempted divisor
    L2:	CMP R3, R5
	BGE PRIME  ; done checking divisors; it's prime
	MOV R3, R0
	DIV R5, R0
	TST R1  ; remainder
	BEQ ENDL
	INC R5
	BR L2

 PRIME:	INC R7

  ENDL:	INC R3
	BR L

  DONE:	MOV R7, R0
	HALT