; 引脚定义
;********************************************************************
ROW0 EQU P2.0
ROW1 EQU P2.1
COL0 EQU P2.2
COL1 EQU P2.3
COL2 EQU P2.4
COL3 EQU P2.5
PIN_DATA EQU P0
;--------------------------------------------------------------------
; 程序入口
;--------------------------------------------------------------------
ORG 0000H
AJMP MAIN
;--------------------------------------------------------------------
; 主程序
;--------------------------------------------------------------------
ORG 0030H
MAIN:
MOV DPTR,#HANZI
MOV R0,#00H ;字模提取信号
MOV R1,#01H ;行选通信号
L1:
MOV PIN_DATA,#00H ;清屏
SETB ROW0
CLR ROW0
SETB ROW1
CLR ROW1
MOV A,R0 ;COL0
MOVC A,@A+DPTR
MOV PIN_DATA,A
SETB COL0
CLR COL0
MOV A,#20H
ADD A,R0 ;COL2
MOVC A,@A+DPTR
MOV PIN_DATA,A
SETB COL2
CLR COL2
INC R0
MOV A,R0;COL1
MOVC A,@A+DPTR
MOV PIN_DATA,A
SETB COL1
CLR COL1
MOV A,#20H
ADD A,R0 ;COL3
MOVC A,@A+DPTR
MOV PIN_DATA,A
SETB COL3
CLR COL3
MOV PIN_DATA,R1 ;送行选通信号
SETB ROW0
CLR ROW0
ACALL DELAY
MOV A,R1
RL A
MOV R1,A
INC R0;
CJNE R0,#16,L1 ;16行是否全部送完
MOV R1,#01H
L2:
MOV PIN_DATA,#00H ;清屏
SETB ROW0
CLR ROW0
SETB ROW1
CLR ROW1
MOV A,R0 ;COL0
MOVC A,@A+DPTR
MOV PIN_DATA,A
SETB COL0
CLR COL0
MOV A,#20H
ADD A,R0 ;COL2
MOVC A,@A+DPTR
MOV PIN_DATA,A
SETB COL2
CLR COL2
INC R0
MOV A,R0 ;COL1
MOVC A,@A+DPTR
MOV PIN_DATA,A
SETB COL1
CLR COL1
MOV A,#20H
ADD A,R0 ;COL3
MOVC A,@A+DPTR
MOV PIN_DATA,A
SETB COL3
CLR COL3
MOV PIN_DATA,R1 ;送行选通信号
SETB ROW1
CLR ROW1
MOV A,R1
RL A
MOV R1,A
ACALL DELAY
INC R0
CJNE R0,#32,L2
OVER:
MOV R1,#01H
MOV R0,#00H
AJMP MAIN
DELAY:
LOOP:
MOV R7,#01h
LO1:
MOV R6,#0FFH
DJNZ R6,$
DJNZ R7,LO1
RET
HANZI: ;横向取模,字节倒序
;-- 文字: 欢 --
;-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --
DB 00H,01H,00H,01H,3FH,01H,0A0H,7FH,0A1H,20H,52H,12H,14H,02H,08H,02H
DB 18H,02H,18H,06H,24H,05H,24H,09H,82H,18H,61H,70H,1CH,20H,00H,00H
;-- 文字: 迎 --
;-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --
DB 02H,00H,84H,01H,6CH,3EH,24H,22H,20H,22H,20H,22H,27H,22H,24H,22H
DB 0A4H,22H,64H,2AH,24H,12H,04H,02H,04H,02H,0AH,00H,0F1H,7FH,00H,00H
END
语言后面都标注了解释 我改了好久都不可以运行 只能麻烦别人了(新手不好意思)