- UID
- 1023166
- 性别
- 男
- 来自
- 燕山大学
|
;动态扫描数码显示程序
ORG 00H
MOV 20H,#3FH
MOV 21H,#06H
MOV 22H,#5BH
MOV 23H,#4FH
MOV 24H,#66H
MOV 25H,#6DH
MOV 26H,#7DH
MOV 27H,#07H
START:CALL SCAN
JMP START
SCAN: MOV A,#0 ;扫描子程序
MOV R0,#20H
MOV R2,#8
LOOP:
MOV P2,A
MOV P0,@R0
INC R0
CALL DELAY
ADD A,#01H
DJNZ R2,LOOP
MOV R2,#8
CLR A
RET
DELAY:MOV R3,#1 ;扫描延时
D1:MOV R4,#2
D2:MOV R5,#248
DJNZ R5,$
DJNZ R4,D2
DJNZ R3,D1
RET
END |
|