;to check the number is prime or not
org 00h
mov r0,#0ah;this is the no to check
mov r2,#00h ;for storing result
mov a,r0
mov r1,a
l2:mov a,r0
mov b,r1
div ab
mov a,b
cjne a,#00h,l1
inc r2;if r2 is 02 then the number is prime if not it is not prime
l1:djnz r1,l2
end
Did this program work?
ReplyDelete