JB P3.5,MAIN10 CLR
BELL
ACALL DELAY125 SETB BELL INC A1 ; MOV A,A1
CJNE A,#10,MAIN10 ; MOV A1,#0
AJMP MAIN10
MAIN7: JB P3.5,MAIN10
ACALL DELAY10 JB P3.5,MAIN10 CLR
BELL
ACALL DELAY125 SETB BELL INC A2 MOV A,A2
CJNE A,#10,MAIN10 MOV A2,#0
AJMP MAIN10
MAIN8: JB P3.5,MAIN10
ACALL DELAY10 JB P3.5,MAIN10 CLR
BELL
ACALL DELAY125 SETB BELL INC A3 MOV A,A3
CJNE A,#10,MAIN10 MOV A3,#0
AJMP MAIN10
;
;
29
MAIN9: JB P3.5,MAIN10 ACALL DELAY10 JB P3.5,MAIN10 CLR
BELL
ACALL DELAY125 SETB BELL INC A4
MOV R0,#17 ; LCALL MUL2BY2 MOV R3,#03H MOV R2,#0E8H LCALL DIV4BY2 LCALL DIV4BY2 MOV 40H,R4 MOV A,40H JNZ JJ0 AJMP JJ0
MOV 40H,#0AH ;
JJ0: MOV A,R0
MOV R4,A MOV A,R1 MOV R5,A MOV R3,#0 MOV R2,#100 LCALL DIV4BY2 MOV 41H,R4 MOV A,41H JNZ JJ1
MOV A,40H ; SUBB A,#0AH
JNZ JJ1
;
30
AJMP JJ1
MOV 41H,#0AH ;
JJ1: MOV A,R0
MOV R4,A MOV A,R1 MOV R5,A MOV R3,#0 MOV R2,#10 LCALL DIV4BY2 MOV 42H,R4 MOV A,42H JNZ JJ2
MOV A,41H ; SUBB A,#0AH JNZ JJ2 AJMP JJ2
MOV 42H,#0AH ;
JJ2: MOV 43H,R0
POP B POP PSW POP ACC
RET
MUL2BY2: CLR A ;
MOV R7,A MOV R6,A MOV R5,A MOV R4,A
MOV 46H,#10H
MULLOOP1: CLR C
MOV A,R4
RLC
A
31
MOV R4,A MOV A,R5 RLC
A
MOV R5,A MOV A,R6 RLC
A
MOV R6,A MOV A,R7 RLC
A
MOV R7,A MOV A,R0 RLC
A
MOV R0,A MOV A,R1 RLC
A
MOV R1,A JNC
MULLOOP2
MOV A,R4 ADD
A,R2
MOV R4,A MOV A,R5 ADDC A,R3 MOV R5,A MOV A,R6 ADDC A,#00H MOV R6,A MOV A,R7 ADDC A,#00H MOV R7,A
MULLOOP2: DJNZ 46H,MULLOOP1
RET
32
DIV4BY2: MOV 46H,#20H ; MOV R0, #00H
MOV R1,#00H
DIVLOOP1: MOV RLC
A
MOV R4,A MOV A,R5 RLC
A
MOV R5,A MOV A,R6 RLC
A
MOV R6,A MOV A,R7 RLC
A
MOV R7,A MOV A,R0 RLC
A
MOV R0,A MOV A,R1 RLC
A
MOV R1,A CLR
C
MOV A,R0 SUBB A,R2 MOV B,A MOV A,R1 SUBB A,R3 JC DIVLOOP2 MOV R0,B
MOV R1,A
DIVLOOP2:
CPL
A,R4
C
33