程序设计项目六
在屏幕中间显示:“中华”两个字。参看demo0.png示例。
提示:
通过字模提取工具,可以提取字的显示信息。
分析:
跟lcd12864自定义图形差不多吧
直接用字模提取软件
参考代码:
1 assume cs:code 2 data segment 3 ; -- zhong -- 4 db 00h, 1Ch, 00h, 00h, 1Ch, 00h, 00h, 1Ch, 00h 5 db 00h, 1Ch, 00h, 00h, 1Ch, 00h, 1Fh,0FFh,0FCh 6 db 1Fh,0FFh,0FCh, 1Fh,0FFh,0FCh, 1Ch, 1Ch, 1Ch 7 db 1Ch, 1Ch, 1Ch, 1Ch, 1Ch, 1Ch, 1Ch, 1Ch, 1Ch 8 db 1Ch, 1Ch, 1Ch, 1Ch, 1Ch, 1Ch, 1Fh,0FFh,0FCh 9 db 1Fh,0FFh,0FCh, 1Fh,0FFh,0FCh, 1Ch, 1Ch, 1Ch 10 db 00h, 1Ch, 00h, 00h, 1Ch, 00h, 00h, 1Ch, 00h 11 db 00h, 1Ch, 00h, 00h, 1Ch, 00h, 00h, 1Ch, 00h 12 13 ; -- hua -- 14 db 03h, 0Eh, 00h, 03h, 8Eh, 10h, 07h, 0Eh, 38h 15 db 0Eh, 0Eh,0F8h, 0Eh, 0Fh,0F0h, 1Eh, 0Fh,0C0h 16 db 3Eh, 1Fh, 00h, 7Eh,0FEh, 00h, 6Eh,0FEh, 00h 17 db 2Eh,0CEh, 1Ch, 0Eh, 0Fh,0FCh, 0Eh, 0Fh,0FCh 18 db 0Eh, 07h,0F8h, 0Eh, 38h, 00h, 00h, 38h, 00h 19 db 00h, 38h, 00h, 7Fh,0FFh,0FEh, 7Fh,0FFh,0FEh 20 db 00h, 38h, 00h, 00h, 38h, 00h, 00h, 38h, 00h 21 db 00h, 38h, 00h, 00h, 38h, 00h, 00h, 00h, 00h 22 data ends 23 24 stack segment 25 dw 16 dup (0) 26 stack ends 27 28 code segment 29 start: 30 31 mov ax,0b800h 32 mov es,ax 33 mov ax,data 34 mov ds,ax 35 mov ax,stack 36 mov ss,ax 37 mov sp,20h 38 mov si,0 39 call clear_scr 40 mov bh,100b 41 mov bl,03h 42 mov ah,0 43 mov dh,0 ;三个一循环 44 mov di,16 45 jmp get_bmp 46 47 get_bmp: 48 mov al,ds:[si] 49 inc si 50 inc dh 51 jmp do_16to2 52 doom: 53 mov cx,8 54 ss1: 55 pop ax 56 cmp ax,0 57 je next 58 mov es:[di],bx 59 next: 60 add di,2 61 loop ss1 62 63 cmp si,72 ;判断是否输出完中 64 jne nn 65 mov di,136 66 nn: 67 cmp si,144 ;同上,判断是否输出完 68 je over 69 cmp dh,3 70 jne get_bmp 71 mov dh,0 72 add di,112 73 jmp get_bmp 74 75 over: 76 mov ax,4c00h 77 int 21h 78 79 do_16to2: ;16进制转换 80 push cx 81 mov cx,8 82 sd0: 83 mov dl,2 84 div dl 85 mov dl,al 86 mov al,0 87 push ax 88 mov al,dl 89 loop sd0 90 jmp doom 91 92 clear_scr: 93 push cx 94 push bp 95 push di 96 mov bp,0 97 mov cx,16h 98 cs1: 99 mov di,0 100 push cx 101 mov cx,50h 102 cs2: 103 mov word ptr es:[di+bp],0 104 add di,2 105 loop cs2 106 107 add bp,0a0h 108 pop cx 109 loop cs1 110 pop di 111 pop bp 112 pop cx 113 ret 114 115 code ends 116 end start
hj6.asm
因为字模不同:
时间: 2024-10-15 17:06:51