Ai sửa giúp e đoạn code từ mạch 2 sang mạch 1 với, e ko hiểu về vấn đề này lắm, mong mn giúp đỡ!
mach den giao thong.zip
Mạch đèn giao thông!
Mạch 1
Mạch 2
Code Mạch 2:
mach den giao thong.zip
Mạch đèn giao thông!
Mạch 1
Mạch 2
Code Mạch 2:
Code:
ORG 00H MAIN: CALL CTA CALL CTB CALL CTC CALL CTD JMP MAIN CTA: MOV P1,#10000100B MOV R0,#32 MOV R1,#35 LAPA:CALL HIENTHI DEC R0 DEC R1 CJNE R0,#0,LAPA RET CTB: MOV P1,#01000100B MOV R0,#3 MOV R1,#3 LAPB:CALL HIENTHI DEC R0 DEC R1 CJNE R0,#0,LAPB RET CTC: MOV P1,#00110000B MOV R0,#35 MOV R1,#32 LAPC:CALL HIENTHI DEC R0 DEC R1 CJNE R0,#3,LAPC RET CTD: MOV P1,#00101000B MOV R0,#3 MOV R1,#3 LAPD:CALL HIENTHI DEC R0 DEC R1 CJNE R0,#0,LAPD RET HIENTHI: MOV R7,#100 QUET: MOV P3,#00H MOV A,R0 MOV B,#10 DIV AB MOV DPTR,#MALED MOVC A,@A+DPTR MOV P2,A SETB P3.0 CALL DELAY CLR P3.0 MOV A,B MOVC A,@A+DPTR MOV P2,A SETB P3.1 CALL DELAY CLR P3.1 MOV A,R1 MOV B,#10 DIV AB MOV DPTR,#MALED MOVC A,@A+DPTR MOV P2,A SETB P3.2 CALL DELAY CLR P3.2 MOV A,B MOVC A,@A+DPTR MOV P2,A SETB P3.3 CALL DELAY CLR P3.3 DJNZ R7,QUET RET MALED:DB 11000000B,11111001B,10100100B,10110000B,10011001B,10010010B,10000010B,11111000B,10000000B,10010000B RET DELAY: MOV R4,#35 LAP:MOV R5,#32 LAPM: NOP DJNZ R5,LAPM DJNZ R4,LAP RET END
Comment