51单片机中用两位数码管现实显示控制,用汇编语言编程序段
MOV 31H,#00H
MOV 32H,#00H
MOV 33H,#01H
MOV 34H,#06H
MOV 35H,#03H
MOV 36H,#02H
ACALL D0
JMP $-2
D0: MOV R0,#31H
MOV R2,#11111110B
MOV DPTR,#TAB
D1: ORL P1,#00111111B
MOV A,@R0
MOVC A,@A+DPTR
MOV R3,#8
D2: RLC A
MOV P3.2,C
SETB P3.3
CLR P3.3
DJNZ R3,D2
INC R0
MOV A,R2
ANL P1,A
D3: MOV R3,#250
DJNZ R3,$
MOV A,R2
RL A
MOV R2,A
JB ACC.6,D1
RET
TAB: DB 3FH,06H,5BH,4FH
DB 66H,6DH,7DH,07H
DB 7FH,6FH,77H,7CH
DB 39H,5EH,79H,71H
DB 40H
END