ORG 000H
SJMP START
RESULT EQU 30H
START : MOV R0,#30H
MOV R1,#05H /* R1 declared as a pass counter*/
MOV B,@R0
UP : INC R0
MOV A,@R0
CLR C
SUBB A,B
JC SKIP
MOV B,@R0
SKIP : DJNZ R1,UP
MOV RESULT,A
STOP : SJMP STOP
SJMP START
RESULT EQU 30H
START : MOV R0,#30H
MOV R1,#05H /* R1 declared as a pass counter*/
MOV B,@R0
UP : INC R0
MOV A,@R0
CLR C
SUBB A,B
JC SKIP
MOV B,@R0
SKIP : DJNZ R1,UP
MOV RESULT,A
STOP : SJMP STOP
No comments:
Post a Comment