MOV DPTR,#CSR1
MOV A,R4
MOVX @DPTR,A
RL ACC
MOV R4,ACC
INC R5
LCALL DELAY
CJNE R5,#8H,DISP
MOV A,#0H
MOVX @DPTR,A
MOV R5,#08H
MOV R4,#01H
DISP2:
MOV A,R5
MOV DPTR,#ASCE
MOVC A,@A+DPTR
CPL ACC
MOV DPTR,#CSC2
MOVX @DPTR,A
MOV DPTR,#CSR2
MOV A,R4
MOVX @DPTR,A
RL ACC
MOV R4,ACC
INC R5
LCALL DELAY
CJNE R5,#10H,DISP2
MOV A,#0H
MOVX @DPTR,A
SJMP D
;******** 延时子程序,协调字符显示速度 *************
DELAY: MOV R7,#1H
DL1: MOV R6,#00H
DL2: DJNZ R6,DL2
DJNZ R7,DL1
RET
;******** 字符点阵字库 ***************
; ASC16 字符编码排列
; 0
; 1
; |
; |
; 14
; 15
; 高位 D7--D0
; 请注意编码的排列次序和实际显示点阵分布的关系
ASCA:DB 00H,00H,10H,38H,6CH,0C6H,0C6H,0FEH
DB 0C6H,0C6H,0C6H,0C6H,00H,00H,00H,00H
ASCE:DB 00H,00H,0FEH,66H,62H,68H,78H,68H
DB 60H,62H,66H,0FEH,00H,00H,00H,00H
ASCD:DB 00H,00H,0F8H,6CH,66H,66H,66H,66H
DB 66H,66H,6CH,0F8H,00H,00H,00H,00H
ASCK:DB 00H,00H,0E6H,66H,66H,6CH,78H,78H
DB 6CH,66H,66H,0E6H,00H,00H,00H,00H
;****************************************************
END
(二)LEDHZ51两个示例程序。和Hz16字符的简单点阵显示。
;*********LED 点阵显示示例程序***********************
;** 该程序显示 hz16字符 **
;** 为了简单起见,程序只显示一个字符 **
;** 该程序针对T598实验机的模块14 **
;****************************************************
CSLED EQU 8000H
CSR1 EQU CSLED ;行1 273
CSR2 EQU CSLED+1H ;行2 273
CSC1 EQU CSLED+2H ;列1 374
CSC2 EQU CSLED+3H ;列2 374
ORG 0000H
MOV SP,#60H
INIT: MOV A,#0H ;关闭LED显示
MOV DPTR,#CSR1
MOVX @DPTR,A
MOV DPTR,#CSR2
MOVX @DPTR,A
MOV A,#0FFH ;关闭LED显示
MOV DPTR,#CSC1
MOVX @DPTR,A
MOV DPTR,#CSC2
MOVX @DPTR,A
D: MOV R5,#00H
MOV R4,#01H
DISP:
MOV A,R5
RL ACC
MOV DPTR,#HZAI
MOVC A,@A+DPTR
CPL ACC
MOV DPTR,#CSC2
MOVX @DPTR,A
MOV A,R5
RL ACC
INC ACC
MOV DPTR,#HZAI
MOVC A,@A+DPTR
CPL ACC
MOV DPTR,#CSC1
MOVX @DPTR,A
MOV DPTR,#CSR1
MOV A,R4
MOVX @DPTR,A
RL ACC
MOV R4,ACC
INC R5
LCALL DELAY
CJNE R5,#8H,DISP
MOV A,#0H
MOVX @DPTR,A
MOV R5,#08H
MOV R4,#01H
DISP2:
MOV A,R5
RL ACC
MOV DPTR,#HZAI
MOVC A,@A+DPTR
CPL ACC
MOV DPTR,#CSC2
MOVX @DPTR,A
MOV A,R5
RL ACC
INC ACC
MOV DPTR,#HZAI
MOVC A,@A+DPTR
CPL ACC
MOV DPTR,#CSC1
MOVX @DPTR,A
MOV DPTR,#CSR2
MOV A,R4
MOVX @DPTR,A
RL ACC
MOV R4,ACC
INC R5
LCALL DELAY
CJNE R5,#10H,DISP2
MOV A,#0H
MOVX @DPTR,A
SJMP D
;******** 延时子程序,协调字符显示速度 *************
DELAY: MOV R7,#1H
DL1: MOV R6,#00H
DL2: DJNZ R6,DL2
DJNZ R7,DL1
RET
;******** 字符点阵字库 ***************
; HZ16 字符编码排列
; 0 1
; 2 3
; |
; |
; 28 29
; 30 31
; 高位 D7--D0
HZAI:DB 00H,78H,3FH,80H,11H,10H,09H,20H
DB 7FH,0FEH,42H,02H,82H,04H,7FH,0F8H
DB 04H,00H,07H,0F0H,0AH,20H,09H,40H
DB 10H,80H,11H,60H,22H,1CH,0CH,08H
HZDI:DB 00H,80H,40H,80H,20H,88H,2FH,0FCH
DB 08H,88H,08H,88H,0E8H,88H,2FH,0F8H
DB 28H,88H,28H,88H,28H,88H,2FH,0F8H
DB 28H,08H,50H,06H,8FH,0FCH,00H,00H
HZKE:DB 01H,00H,01H,04H,0FFH,0FEH,01H,00H
DB 01H,10H,1FH,0F8H,10H,10H,10H,10H
DB 10H,10H,1FH,0F0H,14H,50H,04H,40H
DB 04H,40H,08H,42H,10H,42H,60H,3EH
;****************************************************
END