DISP: MOV b,#10 ;10进制/10=10进制 显示子程序
div ab
MOV 20H,a ;十位在a
MOV 21H,b ;个位在b
MOV DPTR,#TABLE
MOV A,20H
MOVC A@A+DRTR
LACLL WRITE
LACLL DELAY
MOV A,21H
MOVC A@ADPTR
LACLL WRITE
LACLL DELAY
RET
WRITE:CLR P0.1
LACLL SEND
STEB P0.1
RET
SEND:MOV R5,#02H
SEND1:RLC A
MOV P0.0,C
CLR P0.2
NOP
NOP
NOP
NOP
NOP
SETB P0.2
DJNE R5,SEND1
RET
TABLE: DB 7EH 30H 6DH 79H 33H 5DH 5FH 70H 7FH 7BH
RET
DELAY:R7,#14H
DEL: R6,#8AH
DJNE R6$
DJNE R7,DEL
RET