1、LJMP CHINESE显示8幅画面子程序,SCREE专用,用字模软件字要倒置(表必须深256字节)DD: MOV B,#00HMOV R0,#08H ;显示8幅画面AJMP CCCC0: MOV A,BADD A,#20H ;指向下一幅画面MOV B,ACC: MOV R7,#08H ;画面停留时间MOV R3,BMOV 37H,R0LCALL ENTERDIS00: LCALL DISPLAYDJNZ R7,DIS00MOV R0,37HDJNZ R0,CC0RET汉字上移子程序,可显示8个汉字,(表必须深256字节)HZ: MOV R3,#00H ;查表偏移量MOV R5,#81H ;查
2、表128次MOVBACK: MOV R4,#10H ;使显示完一个汉字MOVBACK0: MOV R7,#02H ;一桢画面显示时间MOV R0,#6DH ;低8位R0指向显示缓存倒数第3个字节,以备与最后1个字节交换MOV R1,#6CH ;高8位R1指向显示缓存倒数第4个字节,以备与倒数第2个字节交换MOV R2,#10H ;内存后移的次数DJNZ R5,MOVBACK1RET ;显示完该表,返回MOVBACK1: MOV A,R0 ;低8位被后移的内存单元数据暂存入AINC R0 ;后移两字节MOV R0,A ;放入要移的低8位数据MOV A,R0 ;R0指向下一个要后移的内存单元SUB
3、B A,#04HMOV R0,AMOV A,R1 ;高8位被后移的内存单元数据暂存入AINC R1 ;INC R1MOV R1,A ;放入要移高8位的数据MOV A,R1 ;R1指向下一个要后移的内存单元MOV R1,A ;DJNZ R2,MOVBACK1 ;显示缓存数据依次后移MOV A,R3 ;从表TAB1读入要移进50H,51H的数据MOVC A,A+DPTR;先给50H读数据MOV 50H,A指向下一字节INC AMOV R3,A再给51H读数据MOV 51H,AMOV 30H,R3 ;保护数据MOV 31H,R4MOV 32H,R5DISMOV: LCALL DISPLAY ;显示当
4、前数据DJNZ R7,DISMOVMOV R3,30HMOV R4,31HMOV R5,32HDJNZ R4,MOVBACK0MOV R7,#24H ;显示当前数据延时DISMOV0:DJNZ R7,DISMOV0LJMP MOVBACK放进一幅显示数据到显示缓存子程序,要先设好指针DPTR和R3,影响R1,R2,R3ENTER: MOV R1,#50H ;从50H单元起把表存入MOV R2,#20H ;查表次数MOV A,R3CLLOOP_: MOVC A,A+DPTR ;查表将表放进5X,6X单元R1指向下一个地址空间查表指针后移MOV R3,A ;将指针修改结果存入R3DJNZ R2,C
5、LLOOP_;没查完转CLLOOP_15MS,显示子程序,一桢32个字节,影响A,R0,R1,R3,R4,R5,R6;单片机网提供汉字取模工具,可显示任意汉字DISPLAY: MOV A,#0FFHSETB CMOV R6,#7FH ;赋扫描字初值,左移后初值为0FEHMOV R5,#00H ;列扫描低8位控制行的高8(p1)位要显示的数据起始地址MOV R1,#10H ;扫描次数DISLOOP:从内存读数据MOV P2,#0FFH ;装入数据时不显示任何东西MOV P3,#0FFHCPL A ;数据取反以适合显示MOV P1,A ;送入行的高8(p1)位要显示的数据修改R0指向低8位要显示的
6、数据MOV A,R0 ;读低8位要显示的数据MOV P0,A ;送入行的低8(p0)位要显示的数据R0指向下一个高8(p0)位要显示的数据LCALL NEXT ;调用列扫描程序LCALL DELAY1MS ;显示延时DJNZ R1,DISLOOP;一桢显示完返回MOV P3,#0FFH ;全灭列扫描子程序DISLOOP专用NEXT: JNC NEXT1 ;C=0转扫描高8(p3)位行MOV A,R6 ;修改扫描字RL AMOV R6,AINC R5CJNE R5,#09H,NEXT0 ;R6=#0FEH时C=0AJMP NEXT1BACK: RETNEXT0: MOV P2,R6 ;扫描低8(
7、p2)位行AJMP BACKNEXT1: MOV P2,#0FFHMOV P3,R6 ;扫描高8(p3)位行延时1MS子程序DELAY1MS: MOV R3,#10D0: MOV R4,#50D1: DJNZ R4,D1DJNZ R3,D0TAB1:DB 01FH,0F8H,001H,000H,07FH,0FEH,041H,004H,01DH,070H,001H,000H,01DH,070H,000H,000HDB 01FH,0F0H,011H,010H,01FH,0F0H,011H,010H,01FH,0F2H,001H,002H,001H,002H,000H,0FEH;電DB 000H,0
8、00H,03FH,0F0H,000H,020H,000H,040H,000H,080H,001H,000H,001H,000H,001H,004HDB 0FFH,0FEH,001H,000H,001H,000H,001H,000H,001H,000H,001H,000H,005H,000H,002H,000H;子DB 008H,000H,008H,0FCH,07EH,084H,008H,084H,0FFH,094H,041H,088H,022H,080H,014H,0FEHDB 07EH,0A4H,008H,0A4H,008H,098H,0FFH,098H,008H,0A4H,008H,0A6
9、H,008H,0C4H,008H,080H;報DB 000H,000H,000H,010H,03FH,0F8H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB 000H,000H,000H,000H,000H,000H,000H,004H,07FH,0FEH,000H,000H,000H,000H,000H,000H;二DB 01FH,0F8H,001H,000H,07FH,0FEH,041H,004H,01DH,070H,001H,000H,01DH,070H,002H,080HDB 004H,060H,01AH,01EH,0E1H,0
10、08H,01FH,0E0H,000H,040H,002H,080H,001H,000H,001H,000H;零DB 004H,000H,003H,000H,001H,080H,001H,000H,0FFH,0FEH,000H,000H,000H,000H,004H,080HDB 006H,040H,004H,020H,008H,010H,008H,018H,010H,00CH,020H,00CH,040H,008H,000H,000H;六DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,0
11、00HDB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H;(空)- 水纹 - * 宋体, 12 * 当前所选字体下一个汉字对应的点阵为: 宽度x高度=128x16, 调整后为: 128x16TAB2:DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,001H,080HDB 001H,080H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000
12、H,000H,000H,000H,000HDB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,001H,080H,003H,0C0HDB 003H,0C0H,001H,080H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB 000H,000H,000H,000H,000H,000H,000H,000H,001H,080H,002H,040H,004H,020H,008H,010HDB 008H,010H,004H,020H,002H,040H,
13、001H,080H,000H,000H,000H,000H,000H,000H,000H,000HDB 000H,000H,001H,0C0H,006H,030H,008H,008H,008H,008H,010H,004H,020H,002H,020H,002HDB 020H,002H,010H,004H,008H,008H,008H,008H,006H,030H,001H,0C0H,000H,000H,000H,000HDB 003H,0C0H,00CH,030H,010H,008H,010H,008H,060H,006H,040H,002H,080H,001H,080H,001HDB 08
14、0H,001H,080H,001H,040H,002H,060H,006H,010H,008H,010H,008H,00CH,030H,003H,0C0HDB 000H,000H,038H,01CH,046H,062H,081H,081H,080H,001H,040H,002H,040H,002H,020H,004HDB 020H,004H,040H,002H,040H,002H,080H,001H,081H,081H,046H,062H,038H,01CH,000H,000HDB 0C0H,003H,0A0H,005H,058H,01EH,024H,024H,024H,024H,01EH,0
15、78H,005H,0A0H,002H,040HDB 002H,040H,005H,0A0H,01AH,078H,024H,024H,024H,024H,058H,01AH,0A0H,005H,0C0H,003HDB 000H,000H,0C0H,003H,0B0H,00DH,088H,011H,044H,022H,025H,0A4H,012H,048H,00DH,0B0HDB 00DH,0B0H,012H,048H,025H,0A4H,044H,022H,088H,011H,0B0H,00DH,0C0H,003H,000H,000H-福- * 宋体, 12 * 宽度x高度=16x16, 调整后
16、为: 16x16TAB3:DB 0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAHDB 055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055HDB 0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H,054H,02AH,0A8H,015H,050H,00AHDB 050H,00AH,0A8H,015H,054H,02AH,0AAH,055
17、H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055HDB 0AAH,055H,054H,02AH,0A8H,015H,050H,00AH,0A0H,005H,040H,002H,080H,001H,000H,000HDB 000H,000H,080H,001H,040H,002H,0A0H,005H,050H,00AH,0A8H,015H,054H,02AH,0AAH,055HDB 0A0H,005H,040H,002H,091H,0F9H,000H,000H,074H,0F0H,019H,008H,031H,008H,058H,0F0HDB 014H,000H,
18、011H,0F8H,012H,044H,013H,0FCH,012H,044H,091H,0F9H,040H,002H,0A0H,005HDB 020H,000H,013H,0FEH,010H,000H,0FDH,0FCH,005H,004H,009H,004H,011H,0FCH,030H,000HDB 05BH,0FEH,096H,022H,012H,022H,013H,0FEH,012H,022H,012H,022H,013H,0FEH,012H,002HDB 000H,004H,07FH,0C8H,000H,008H,03FH,0BFH,020H,0A0H,020H,090H,03FH
19、,088H,000H,00CHDB 07FH,0DAH,044H,069H,044H,048H,07FH,0C8H,044H,048H,044H,048H,07FH,0C8H,040H,048HDB 010H,040H,010H,080H,091H,000H,073H,0FFH,014H,080H,018H,040H,040H,0FFH,05EH,092HDB 052H,092H,052H,092H,052H,0FEH,052H,092H,052H,092H,05EH,092H,040H,0FFH,000H,000HDB 012H,002H,013H,0FEH,012H,022H,012H,0
20、22H,013H,0FEH,012H,022H,096H,022H,05BH,0FEHDB 030H,000H,011H,0FCH,009H,004H,005H,004H,0FDH,0FCH,010H,000H,013H,0FEH,020H,000HTAB4:DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F8H,0FFH,0F8H,0FFH,0C0H,0FFH,0C0HDB 0FEH,000H,0FEH,000H,0F0H,000H,0F0H,007H,0B0H,002H,0C8H,002H,048H,006H,030H,002H;STEP1
21、DB 0FEH,000H,0FEH,000H,0F6H,000H,0F9H,007H,089H,002H,086H,001H,000H,005H,000H,002H;STEP2DB 0FEH,0C0H,0FFH,020H,0F1H,020H,0F0H,0C7H,080H,001H,080H,007H,000H,001H,000H,007H;STEP3DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F8H,0FFH,0F8H,0FFH,0D8H,0FFH,0E4HDB 0FEH,024H,0FEH,018H,0F0H,000H,0F0H,001H
22、,080H,001H,080H,007H,000H,005H,000H,005H;STEP4DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FBH,0FFH,0FCH,0FFH,0C4H,0FFH,0C3HDB 0FEH,000H,0FEH,000H,0F0H,000H,0F0H,007H,080H,001H,080H,007H,000H,004H,000H,007H;STEP5DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,000H,000H,000H,000H,000H,000HDB
23、 000H,000H,000H,000H,000H,000H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFHDB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFHDB 000H,000H,0F4H,058H,084H,0D4H,085H,052H,0F5H,052H,085H,052H,086H,054H,0F4H,058HDB 000H,000H,022H,05EH,022H,050H,022H,050H,023H,0DEH,022
24、H,050H,022H,050H,0FAH,05EHEND咕哝了很多天终于成功了,发出来供大家交流,没准儿还能对别人有些帮助,总之百利无一害点阵大小是16*32的。 #include#defineBLKN27F3F8C6A1F7F1F0F7F7F9F5C7F1F1F1F7F7F3F8C6A1F7F1F0F7F7F9F5C7F1F1F1F7F 3f0f3F3F7F0C2C3F7F7F4A4A2C7F0A0A3F7F0C2C3F7F7F4A4A2C3F7F1F7F7F0F0F3F2009年05月10日GI文件的支持运行 */ initgraph(&gd, &gm, );void drawmat(c
25、har *mat,int matsize,int x,int y,int color)/*依次:字模指针、点阵大小、起始坐标(x,y)、颜色*/ int i, j, k, n; n = (matsize - 1) / 8 + 1; for(j = 0; j matsize; j+) for(i = 0; i n; i+) for(k = 0;k k) /*测试为1的位则显示*/ putpixel(x + i * 8 + k, y + j, color);char yi12=/* 以下是 1 的 12点阵宋体 字模,24 byte */0x00,0x00,0x0C,0x00,0x1C,0x00,
26、0x3C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,;char er12=20x00,0x00,0x3E,0x00,0x63,0x00,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,0x63,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,char dian12=点0x04,0x00,0x07,0xC0,0x04,0x00,0x04,0x00,0x3F,0x80,0x20,0x80,0x20,0x80,0x3F,0x80,0x00,0x00,0x49,0x40,0xC9,0x20,0x00,0x00,char zhen12=阵0xF2,0x00,0x9F,0xE0,0x92,0x00,0xA5,0x00,0xA5,0x00,0x97,0xE0,0x91,0x00,0xB1,0x00,0x8F,0xE0,0x81,0x00,0x81,0x00,0x00,0x00,char song16=宋 的 16点阵宋体 字模,32 byte
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1