sp;
WDATNYR: PUSH Acc
MOV R2,#16 ;写汉字的上半部分
LOOP4: MOV A,R1
MOV DPTR,#tabNYR
MOVC A,@A+DPTR
MOV DAT,A
CALL WDAT
INC R1
DJNZ R2,LOOP4
INC 34H ;移到下一页
MOV com,34h
LCALL Wcom
MOV com,35h
LCALL Wcom
MOV R2,#16 ;写汉字的下半部分
LOOP5: MOV A,R1
MOVC A,@A+DPTR
MOV DAT,A
CALL WDAT
INC R1
DJNZ R2,LOOP5
DEC 34H ;再退回到上一页
MOV com,34H
LCALL Wcom
MOV A,35H
ADD A,#16 ;加当前字的宽度
MOV 35H,A
POP Acc
RET
;**************************************************写数字8x16
WDATSZ: PUSH Acc
MOV R2,#8
LOOP2: MOV A,R1
MOV DPTR,#tabSZ
MOVC A,@A+DPTR
MOV DAT,A
CALL WDAT
INC R1
DJNZ R2,LOOP2
INC 34H ;移到下一页
MOV com,34h
LCALL Wcom
MOV com,35h
LCALL Wcom
MOV R2,#8
LOOP3: MOV A,R1
MOVC A,@A+DPTR
MOV DAT,A
CALL WDAT
INC R1
DJNZ R2,LOOP3
DEC 34H ;再退回到上一页
MOV com,34H
LCALL Wcom
MOV A,35H
ADD A,#8 ;加当前字的宽度
MOV 35H,A
POP Acc
RET
;***************************************************清屏
CLEAR: MOV R3,#0B8H
MOV COM,R3 ;设置页地址为0
LCALL Wcom
MOV COM,#40H ;设置列地址0
LCALL Wcom
MOV R1,#00H
MOV R2,#00H
LOOP1: MOV DAT,#00H ;输入数据为0则为清掉屏幕
CALL Wdat
INC R1
CJNE R1,#40H,LOOP1 ;看看是否到了64列了,如果没有满则继续刷新列
MOV R1,#00H
INC R2 ;用来控制页数的
INC R3 ;下一页,设置地址为下一页
MOV COM,R3
LCALL Wcom
MOV COM,#40H ;重新设置列地址0
LCALL Wcom
CJNE R2,#08H,LOOP1
RET
;***************************************************复位行页列
CSH: PUSH Acc
CLR CS2
CLR CS1
MOV 33H,#0C0H ;设行单元初值
MOV 34H,#0B8H ;设页单元初值
MOV 35H,#40H ;设列单元初值
MOV com,33H ;设置起始为第1行
LCALL Wcom
MOV com,34H ;设置第1行0页
LCALL Wcom
MOV com,35H ;设置第1行0列
LCALL Wcom
SETB CS1
SETB CS2
POP Acc
RET
;****************************************************写命令
Wcom: LCALL DBF
clr E
NOP
NOP
CLR RW
CLR RS
MOV P0,com
setb E
NOP
LCALL DBF
RET
;***************************************************写数据
WDAT: clr E
NOP
NOP
CLR RW
SETB RS
MOV P0,DAT
setb E
NOP
LCALL DBF
RET
;***************************************************读数据
RDAT: clr E
NOP
NOP
SETB RW
SETB RS
setb E
NOP
LCALL DBF
MOV DATZC,P0
RET
;***************************************************查忙
DBF: CLR E
NOP
NOP
SETB RW
clr RS
ANL P0,#0B0H
ORL P0,#80H
setb E
NOP
JB P0.7,$
JB P0.4,$
RET
;***************************************************延时300mS
YS300: MOV R7,#00H
YS11: MOV R6,#00H
YS22: DJNZ R6,YS22
DJNZ R7,YS11
RET
;***************************************************纵向取模下高位从左到右从上到下8X16
org 0A00h
TABSZ:
DB 000h,000h,0F0h,0F8h,008h,068h,0F8h,0F0h,000h,000h,007h,00Fh,00Bh,008h,00Fh,007h ;0-lhf
DB 000h,020h,020h,030h,0F8h,0F8h,000h,000h,000h,000h,000h,000h,00Fh,00Fh,000h,000h ;1-lhf
DB 000h,0x30,0x38,008h,088h,0f8h,070h,000h,000h,00ch,00eh,0x0B,0x09,008h,008h,000h ;2-lhf
DB 000h,0x30,0x38,088h,088h,0f8h,070h,000h,000h,006h,00eh,008h,008h,00fh,007h,000h ;3-lhf
DB 000h,000h,0f8h,0f8h,000h,0xE0,0xE0,000h,000h,003h,003h,002h,002h,00fh,00fh,002h ;4-lhf
DB 000h,0f8h,0f8h,088h,088h,088h,008h,000h,000h,008h,008h,008h,00ch,007h,003h,000h ;5-lhf
DB 000h,0xC0,0xE0,0x78,0x58,0xC8,080h,000h,000h,007h,00fh,008h,008h,00fh,007h,000h ;6-lhf
DB 000h,008h,008h,088h,0xE8,0x78,0x18,000h,000h,000h,00eh,00fh,0x01,000h,000h,000h ;7-lhf
DB 000h,070h,0f8h,0xC8,088h,0f8h,070h,000h,000h,007h,00fh,008h,0x09,00fh,007h,000h ;8-lhf
DB 000h,0f0h,0f8h,008h,008h,0f8h,0f0h,000h,000h,000h,0x09,0x0D,00fh,003h,0x01,000h ;9-lhf
DB 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ;空格
DB 00h, 00h, 00h, 30h, 30h, 00h, 00h, 00h, 00h, 00h, 00h, 06h, 06h, 00h, 00h, 00h ;-:-
;****************************************************纵向取模下高位从左到右从上到下16X16
org 0B00h
TABNYR:
db 00h, 20h, 10h, 0CCh, 47h, 44h, 44h, 0FCh, 44h, 44h, 44h, 64h, 46h, 04h, 00h, 00h ;年
db 04h, 04h, 04h, 07h, 04h, 04h, 04h, 0FFh, 04h, 04h, 04h, 04h, 04h, 06h, 04h, 00h
db 00h, 00h, 00h, 00h, 0FEh, 22h, 22h, 22h, 22h, 22h, 22h, 0FFh, 02h, 00h, 00h, 00h ;月
db 00h, 80h, 40h, 30h, 0Fh, 02h, 02h, 02h, 02h, 42h, 82h, 7Fh, 00h, 00h, 00h, 00h
db 00h, 00h, 00h, 0FEh, 82h, 82h, 82h, 82h, 82h, 82h, 82h, 0FFh, 02h, 00h, 00h, 00h ;日
db 00h, 00h, 00h, 7Fh, 20h, 20h, 20h, 20h, 20h, 20h, 20h, 7Fh, 00h, 00h, 00h, 00h
;***************************************************纵向取模下高位从左到右从上到下12X12
org 0B80h
lxazz:
db 00h, 00h, 0FCh, 84h, 86h, 85h, 0A4h, 0A4h ;"乌"
db 0BEh, 84h, 0C0h, 80h, 02h, 02h, 02h, 02h
db 02h, 02h, 02h, 02h, 0Ah, 08h, 07h, 00h
db 02h, 82h, 42h, 0F2h, 2Ah, 26h, 22h, 22h ;"石"
db 22h, 0F2h, 23h, 02h, 01h, 00h, 00h, 0Fh
db 04h, 04h, 04h, 04h, 04h, 0Fh, 00h, 00h
db 40h, 20h, 0F8h, 07h, 00h, 80h,0FFh, 40h ;"化"
db 20h, 10h, 08h, 00h, 00h, 00h, 0Fh, 00h
db 01h, 00h, 07h, 08h, 08h, 08h, 08h, 0Eh
db 08h, 06h, 02h, 0FAh, 2Ah, 2Ah, 2Bh,0EAh ;"宾"
db 2Ah, 22h, 8Ah, 06h, 09h, 09h, 09h, 05h
db 05h, 01h, 01h, 01h, 05h, 05h, 09h, 01h
db 10h, 0Ch, 0F7h, 04h, 0Ch, 04h,0F4h, 55h ;"馆"
db 56h, 54h, 74h, 0Ch, 00h, 00h, 07h, 02h
db 01h, 00h, 0Fh, 05h, 05h, 05h, 0Fh, 00h
db 20h, 22h, 12h, 2Ah, 26h, 22h, 0BFh, 66h ;"李"
db 2Ah, 12h, 0B3h, 12h, 01h, 01h, 01h, 01h
db 05h, 09h, 07h, 01h, 01h, 01h, 01h, 01h
db 00h, 80h, 40h, 38h, 00h, 00h, 0FFh, 00h ;"小"
db 08h, 10h, 60h, 80h, 01h, 00h, 00h, 00h
db 04h, 08h, 0Fh, 00h, 00h, 00h, 00h, 01h
db 28h, 26h, 22h, 0A2h, 62h, 3Bh, 22h, 22h ;"安"
db 0E2h, 22h, 2Ah, 26h, 08h, 08h, 08h, 05h
db 05h, 02h, 02h, 03h, 04h, 04h, 08h, 00h
db 18h, 0D6h, 54h, 0FFh, 54h, 54h,0D4h, 00h ;"制"
db 0FCh, 00h, 0FFh, 00h, 00h, 07h, 00h, 0Fh
db 00h, 04h, 07h, 00h, 05h, 08h, 0Fh, 00h
db 20h, 22h, 0E4h, 10h, 18h,0D6h, 54h, 5Fh ;"造"
db 54h, 0D6h, 14h, 10h, 08h, 04h, 03h, 04h
db 08h, 0Bh, 0Ah, 0Ah, 0Ah, 0Bh, 08h, 08h
db 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h ;" "
db 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
db 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
;***************************************************纵向取模下高位从左到右从上到下12X12
org 0D00h
TABxq:
db 20h, 20h, 90h, 88h, 84h, 93h,0A2h, 84h ;"今"
db 88h, 10h, 20h, 20h, 00h, 00h, 00h, 00h
db 00h, 00h, 0Ch, 03h, 00h, 00h, 00h, 00h
db 10h, 12h, 12h, 12h, 12h,0FEh, 92h, 12h ;"天"
db 12h, 13h, 12h, 10h, 08h, 08h, 04h, 02h
db 01h, 00h, 00h, 01h, 02h, 04h, 0Ch, 04h
db 40h, 40h, 40h, 5Fh, 55h, 55h,0D5h, 55h ;"是"
db 5Fh, 40h, 60h, 40h, 08h, 08h, 04h, 03h
db 04h, 04h, 0Fh, 09h, 09h, 09h, 09h, 08h
db 00h, 00h, 0FEh, 0AAh, 0AAh, 0EAh, 0AAh, 0AAh ;"星"
db 0AAh,0BFh, 82h, 00h, 0Ah, 09h, 0Ah, 0Ah
db 0Ah, 0Fh, 0Ah, 0Ah, 0Ah, 0Ah, 08h, 08h
db 04h,0FFh, 54h, 54h,0FFh, 04h, 00h,0FEh ;"期"
db 92h, 92h, 92h,0FFh, 09h, 05h, 03h, 01h
db 03h, 09h, 04h, 03h, 00h, 04h, 08h, 07h
TABxqsz:
db 20h, 20h, 20h, 20h, 20h, 20h, 20h, 20h ;"一"
db 20h, 20h, 30h, 20h, 00h, 00h, 00h, 00h
db 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h
db 00h, 04h, 04h, 04h, 04h, 04h, 04h, 04h ;"二"
db 04h, 06h, 04h, 00h, 04h, 04h, 04h, 04h
db 04h, 04h, 04h, 04h, 04h, 04h, 06h, 04h
db 00h, 02h, 22h, 22h, 22h, 22h, 22h, 22h ;"三"
db 32h, 23h, 02h, 00h, 04h, 04h, 04h, 04h
db 04h, 04h, 04h, 04h, 04h, 04h, 06h, 04h
db 00h,0FEh, 02h, 82h, 7Eh, 02h, 02h, 7Eh ;"四"
db 82h, 82h,0FFh, 02h, 00h, 0Fh, 05h, 04h
db 04h, 04h, 04h, 04h, 04h, 04h, 0Fh, 00h
db 02h, 02h, 22h, 22h,0E2h, 3Eh, 22h, 22h ;"五"
db 0F2h, 22h, 03h, 02h, 08h, 08h, 08h, 08h
db 0Fh, 08h, 08h, 08h, 0Fh, 08h, 0Ch, 08h
db 08h, 08h, 08h,0C8h, 29h, 0Ah, 2Ch, 48h ;"六"
db 88h, 08h, 0Ch, 08h, 04h, 02h, 01h, 00h
db 00h, 00h, 00h, 00h, 00h, 01h, 06h, 00h
db 00h, 00h, 00h,0FEh, 22h, 22h, 22h, 22h