TABLE: EQU 20H
COVNT: EQU 08H
MOV R0,#TABLE
MOV R7,#COVNT
MOV R4,COVNT
MOV R6,#02H
LOOP:
MOV R0,#TABLE
MOV R5,#COVNT
MOV 2CH,#COVNT
MOV 2CH,#COVNT
MOV A,#R0
ADD A,R7
MOV R0,A
DEC R0
NEXT:
MOV A,@R0
MOV 2BH,A
DEC R0
MOV 2AH,@R0
CLR C
SUBB A,@R0
JB ACC.7,LOOP1
JB DZ,LOOP2
SJMP LOOP3
LOOP1:
JB DZ,LOOP3
LOOP2:
MOV @R0,2BH
INC R0
MOV @R0,2AH
MOV R5,2CH
DEC R0
LOOP3:
DEC 2CH
MOV A,2CH
CLR C
SUBB A,R6
JNB ACC.7,NEXT
MOV A,R5
CLR C
SUBB A,R4
NOP
JZ A,DONE
INC R6
SJMP LOOP
RET