刚才测试的两个模块(汉字 , 键盘 )

其中我把自己做的点阵字模工具转换成了汇编代码 , 同时模拟了c语言的普通按键问题 ,下午的任务就是修改中断了


 .model small 
 .stack 200
 .data
hz  db 00h,00h,00h,00h,00h,00h,00h,00h
 db 00h,00h,00h,00h,00h,00h,00h,00h
 db 00h,00h,00h,0fh,0feh,00h,00h,00h
 db 00h,00h,00h,7fh,0ffh,0c0h,00h,00h
 db 00h,00h,01h,0f0h,01h,0f0h,00h,00h
 db 00h,00h,03h,80h,00h,3ch,00h,00h
 db 00h,00h,0fh,00h,00h,1eh,00h,00h
 db 00h,00h,3ch,00h,00h,07h,80h,00h
 db 00h,00h,78h,00h,00h,03h,0e0h,00h
 db 00h,01h,0e0h,00h,00h,00h,0f8h,00h
 db 00h,07h,0c0h,00h,00h,00h,3eh,00h
 db 00h,1fh,00h,01h,0f8h,00h,0fh,80h
 db 00h,7ch,00h,0fh,0fch,00h,03h,0e0h
 db 01h,0f0h,00h,1eh,0eh,00h,00h,0f0h
 db 03h,0e0h,00h,38h,07h,00h,00h,3ch
 db 0fh,80h,00h,70h,03h,00h,00h,1eh
 db 0eh,00h,00h,60h,01h,80h,00h,06h
 db 1ch,00h,00h,60h,01h,0c0h,00h,06h
 db 18h,00h,00h,60h,00h,0c0h,00h,02h
 db 18h,01h,0ffh,0e0h,00h,0ffh,0c0h,02h
 db 18h,03h,0ffh,0e0h,00h,7fh,0f0h,02h
 db 18h,07h,00h,00h,00h,00h,38h,02h
 db 18h,07h,00h,00h,00h,00h,1ch,02h
 db 0ch,06h,00h,00h,00h,00h,0ch,06h
 db 0ch,06h,00h,00h,00h,00h,0eh,06h
 db 06h,06h,00h,00h,00h,00h,0eh,0ch
 db 07h,8eh,00h,00h,00h,00h,0eh,18h
 db 03h,0feh,00h,00h,00h,00h,0fh,0f0h
 db 00h,07h,00h,00h,0ch,00h,1fh,0e0h
 db 00h,1fh,0ffh,0ffh,0fch,00h,1fh,00h
 db 00h,3fh,0ffh,0ffh,0f8h,00h,3fh,80h
 db 00h,78h,00h,00h,38h,00h,61h,0c0h
 db 00h,60h,00h,00h,18h,00h,0e0h,0c0h
 db 00h,0e0h,00h,00h,1ch,01h,0c0h,60h
 db 00h,0c0h,00h,00h,0eh,03h,80h,60h
 db 00h,0c0h,00h,00h,03h,0feh,00h,60h
 db 00h,0c0h,00h,0fh,0fch,78h,00h,60h
 db 00h,0c0h,00h,3fh,0ffh,00h,00h,60h
 db 00h,0c0h,07h,0f8h,07h,0fch,00h,60h
 db 00h,0c0h,07h,0f0h,03h,0fch,00h,60h
 db 00h,0c0h,06h,60h,01h,8ch,00h,60h
 db 00h,0c0h,06h,60h,01h,8ch,00h,60h
 db 00h,0c0h,06h,0e0h,01h,0fch,00h,60h
 db 00h,0c0h,06h,0e0h,01h,0fch,00h,60h
 db 00h,0c0h,06h,0c0h,01h,0fch,00h,60h
 db 00h,0c0h,07h,0c0h,03h,0dch,00h,60h
 db 00h,0c0h,07h,0c0h,07h,0ch,00h,60h
 db 00h,0c0h,07h,80h,06h,0ch,00h,60h
 db 00h,0c0h,07h,00h,0ch,0ch,00h,60h
 db 01h,0e0h,0ch,00h,0ch,0eh,00h,0f0h
 db 03h,0f0h,3ch,00h,0ch,0fh,01h,0fch
 db 07h,3fh,0f8h,00h,0ch,07h,0ffh,9eh
 db 06h,0fh,0e0h,00h,0eh,03h,0ffh,0eh
 db 0ch,00h,00h,00h,0fh,00h,78h,06h
 db 0ch,00h,00h,00h,1fh,80h,00h,06h
 db 0ch,00h,00h,00h,79h,0c0h,00h,06h
 db 0ch,00h,00h,00h,0f0h,0f0h,00h,06h
 db 0ch,00h,00h,03h,0c0h,3ch,00h,06h
 db 0eh,00h,00h,1fh,80h,1fh,00h,0eh
 db 06h,00h,01h,0fch,00h,07h,0c0h,1ch
 db 07h,80h,7fh,0f0h,00h,00h,0f8h,3ch
 db 03h,0ffh,0ffh,00h,00h,00h,3fh,0f8h
 db 00h,0ffh,0c0h,00h,00h,00h,07h,0e0h
 db 00h,00h,00h,00h,00h,00h,00h,00h

posx dw 40   ;x坐标
posy dw 40   ;y坐标
color db 1
 .code
main proc far
 mov ax , @data
 mov ds , ax
 
 ;设置图形模式
 mov ah , 00
 mov al , 13h
 int 10h
MM:
 mov posx , 40
 mov posy , 40
 inc color
 mov al , color
 cmp al , 255
 jne MM1
 mov color , 1
MM1:
 mov bx , offset hz ;汉字的偏移地址
 mov cx , 512  ;汉字总共的字符数
 mov dx , 0  ;统计字符个数 , 每2个换一行
M: 
 mov al , [bx]  ;取出一个字符
 push cx
 mov cx , 8
M1: 
 rcl  al , 1
 jnc  M2   ;没有进位
 push ax
 push dx
 push cx
 mov ah , 0ch  ;写象素
 mov al , color
 mov dx , posy
 mov cx , posx
 int 10h
 pop cx
 pop dx
 pop ax
 
M2:     inc posx
 loop M1
 pop cx
 inc bx   ;取下一个字符
 inc dx
 cmp dx , 8
 jne M3
 mov dx , 0  ;换行
 inc posy
 mov posx , 40  ;恢复原来x坐标
M3:
 loop M
 
 jmp MM
M_1: 
 mov ah  , 01h
 int 16h 
 jz M_2   ;没按键
 mov ah , 00h  ;取得扫描码
 int 16h
 
 cmp ah ,48h  ;判断扫描码为上
 jz M_3
 cmp ah ,50h  ;判断扫描码为下
  jz M_3
 cmp ah ,4bh  ;判断扫描码为左
  jz M_3
 cmp ah ,4dh  ;判断扫描码为右
  jz M_3
 cmp ah ,01h  ;判断扫描码为ESC
  jz M_3
 cmp ah ,1ch  ;判断扫描码为回车
  jz M_3
M_2: 
 ;mov ah , 02h
 ;mov al , 'a'
 ;int 21h
 jmp M_1
M_3:
  
 ;设置文本模式
 mov ah , 00
 mov al , 03
 int 10h
 mov ah , 4ch
 int 21h
main endp
end main
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值