
LXI H,2000H
MVI D,10

MVI B,02H

SERIES: NOP
	MOV A,D
    	CPI 00H
        JZ EXIT
        MVI C,02H

WHILE: MOV A,B
CMP C 
JZ PRIME 
LOOP: SUB C
JC NEXT
JZ NOPRIME
JMP LOOP
NEXT: INR C
JMP WHILE
NOPRIME: INR B
	JMP SERIES 
		
PRIME:  MOV M,B
	INR B
        INX H
        DCR D; D--
        JMP SERIES
        
 EXIT: HLT
