其他分享
首页 > 其他分享> > 350【毕设课设】微机原理-基于8086矩阵键盘数码管显示

350【毕设课设】微机原理-基于8086矩阵键盘数码管显示

作者:互联网

【资源下载】下载地址如下:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl



 ;245读入,273输出 

;别忘记先全部熄灭
mov al,0xff
out port_7seg,al

begin: 
;先从整体判断有无按键按下
mov al,0x0f 
out port_273,al 

no_key_down:
in al,port_245
and al,0fh;屏蔽高8位
cmp al,0fh;比较有无按键按下
jz no_key_down;无按键按下则循环
;有按键按下则先等待20ms
call delay20ms
;再次检测有无按键按下
in al,port_245
and al,0fh;屏蔽高8位
cmp al,0fh;比较有无按键按下
jz no_key_down;如果是抖动则返回开始

;扫描0列
mov al,0efh
out port_273,al
in al,port_245
not al  ;反相,如果第一行按下al=1
test al,1
jnz D0 ;0行0列按下,按键值是0
test al,2
jnz D1
test al,4

  

 

标签:8086,毕设,课设,0fh,al,245,按下,按键,port
来源: https://www.cnblogs.com/ythero/p/14082501.html