c - 装配 16h BIOS 调用不起作用
问题描述
char getchar() {
char a;
__asm {
int 16h
mov [a], AL
}
return a;
}
我试图从键盘获取用户输入,但不是等待按键,而是在不按键盘上的任何键的情况下返回奇怪的字符。
解决方案
As mentioned here, 16H interrupt has several services and you have to select one of them using ah
register.
function code for reading key press is 0
so you have to xor ah, ah
(set ah to zero) before int 16h
.
推荐阅读
- sharepoint - 使用 ms-word 协议直接在 Desktop Word 中打开位于 oneDrive/sharepoint 中的文档
- python - 根据时间戳选择数据后,无法使用地理数据框几何调用 LineString(来自 shapely)
- json - 需要 AWS S3 QuickSight 清单文件 URI?
- events - CALL METHOD 和 -> 对于 ALV 事件的行为不同。为什么?
- authentication - SSO 移动应用到 Web 的最佳实践
- php - 一个类别的 WordPress 分页问题 - 分页修复
- php - 将压缩图像文件上传到 Moodle 服务器
- cmake - 使用安装/导出的 CMake 和版本配置文件
- eloquent - Eloquent leftJoin where 附加查询
- html - 在要显示的属性内添加换行符
模板角中的标签