ORG 0000H
CLR C
MOV R2, #00H
MOV DPTR, #0030H
MOVX A, @DPTR
MOV R0, A
INC DPTR
MOVX A, @DPTR
CPL A
ADD A, #01H
ADD A, R0
MOV R6, A
JNC OVER1
INC R2
MOV DPTR, #0090H
MOVX @DPTR, A
MOV A, R6
INC DPTR
MOVX @DPTR, A
OVER1: MOV DPTR, #0090H
MOV A, R6
CPL A
ADD A, #01H
MOVX @DPTR, A
INC DPTR
MOV A, R2
MOVX @DPTR, A
MOV PCON, #02H
Or
ORG 0000H
CLR C
MOV R1, #00H
MOV DPTR, #0030H
MOVX A, @DPTR
MOV R0, A
INC DPTR
MOVX A, @DPTR
SUBB A, R0
JNC OVER1
INC R1
MOV DPTR, #0090H
MOVX @DPTR, A
MOV A, R1
INC DPTR
MOVX @DPTR, A
OVER1: MOV DPTR, #0090H
MOVX @DPTR, A
INC DPTR
MOV A, R1
MOVX @DPTR, A
MOV PCON, #02H
No comments:
Post a Comment