MOV R7,41H
MOV R6,40H
MOV R5,#0AH
LCALL FUN_1
MOV 43H,R6
MOV 44H,R7
;==========================================================================
FUN_1:
SETB C
MOV R3,#00H
MOV R4,#11H
LOOP1:
CPL C
MOV A,R7
RLC A
MOV R7,A
MOV A,R6
RLC A
MOV R6,A
MOV A,R3
RLC A
MOV R3,A ;R3<-R6<-R7
DJNZ R4,LOOP2 ;R4-1!=0转移
RRC A
MOV 10H,A
RET
;------------------------------------------------
LOOP2:
JC LOOP3
SUBB A,R5
JC LOOP1
MOV R3,A
SJMP LOOP1
LOOP3:
CLR C
SUBB A,R5
CLR C
MOV R3,A
SJMP LOOP1
www.16466.com |