键盘中:上下左右键的ASCII码值是多少?在代码对照表上没找到

lugangxyz 2003-12-27 08:28:51
也可能是我没看清楚
...全文
1355 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
fancy0001 2003-12-28
  • 打赏
  • 举报
回复
sorry ,少贴了一段,^_^
lugangxyz 2003-12-28
  • 打赏
  • 举报
回复
谢谢了,二位
dunkel 2003-12-27
  • 打赏
  • 举报
回复
扫描码的分布示意图:
http://www.otopic.com/usersystem/userupload/zara/big/20031227213620Scancode.gif
dunkel 2003-12-27
  • 打赏
  • 举报
回复
上下左右键, 包括其他的光标移动键和功能键, 都是没有 ascii 码的, 只有通过扫描码来判别究竟是哪个键. 获取扫描码可以通过 int16h 的中断调用来进行, 如:


Interrupt: 16h Functions: 00h and 10h

Title: Read Character from Keyboard

See also: Int 16h Functions 01h and 11h, Keyboard Scan Codes,
ASCII Chart, Character Input, Keyboard Data Memory

Description: [PC] [AT] [PS/2]

Reads a character and scan code from the keyboard type-ahead
buffer. Use Function 10h if the code must handle the additional
keys of the enhanced keyboard (such as F11, F12, and cursor
control keys).

You can use the keyboard data byte at 0000:0496h to
determine if the extended keyboard is available.

Input Output

AH = 00h to read any keyboard AH = Keyboard scan code
= 10h to read extended keyboard AL = ASCII character
fancy0001 2003-12-27
  • 打赏
  • 举报
回复
direction: cmp al,48h
jz near ptr up
cmp al,49h
jz near ptr pgup
cmp al,4bh
jz near ptr left
cmp al,4dh
jz near ptr right
cmp al,50h
jz near ptr down
cmp al,51h
jz near ptr pgdn
cmp al,0eh
jz near ptr bs

21,496

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧