将预设的字由点阵作由左至右跑马灯式(左移)显示
;port 3.0~3.6 connect to column ;port 1.0~1.4 connect to row ;delay=0.2s ;========== ;= Main = ;========== .ORG 0000H START: MOV DPTR, #DATA MOV R3, #OK-DATA-4 LOOP: MOV R2, #20 SCAN: ACALL SCAN1 DJNZ R2, SCAN INC DPTR DJNZ R3, LOOP MOV DPTR, #LOGO NEXT: ACALL SCAN1 AJMP NEXT ;========== ;= SCAN = ;========== SCAN1: MOV R1, #00H MOV R5, #11111110B MOV R4, #05 LOOP1: MOV A, R1 MOVC A, @A+DPTR MOV P3, A MOV P1, R5 MOV R6, #5 DL1: MOV R7, #200 DL2: DJNZ R7, DL2 DJNZ R6, DL1 ORL P1, #11111111B MOV A, R5 RL A MOV R5, A INC R1 DJNZ R4, LOOP1 RET ;========== ;= DATA = ;========== ; DATA: .DB 00H .DB 00H .DB 00H .DB 00H .DB 00H .DB 01000010B ;2 .DB 01100001B .DB 01010001B .DB 01001001B .DB 01000110B .DB 00H .DB 00H .DB 00H .DB 00H .DB 00H .DB 00111100B ;6 .DB 01001010B .DB 01001001B .DB 01001001B .DB 00110000B .DB 00H .DB 00H .DB 00H .DB 00H OK: .DB 00H LOGO: .DB 00100110B ;S .DB 01001001B .DB 01001001B .DB 01001001B .DB 00110010B .END
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)