# 第 17 章：使用 BIOS 进行键盘输入和磁盘读写

## 检测点 17.1

“在 int16h 中断例程中，一定有设置 IF=1 的指令。”这种说法对吗？

答案：**对。**

int 16h 中断的 0 号功能，若缓冲区空，则循环等待，直到缓冲区中有数据。所以缓冲区空的时候，它又会继续检测，也就是可以说返回上一步。&#x20;

int 9h 是将按键信息放入缓冲区。 若没有设置 IF=1 的指令，也即 IF=0，则不会处理任何（可屏蔽）中断，当然也就不能屏蔽 int 9 中断，则缓冲区永远不会有数据放入，这将造成 int 16h 的死循环检测。显然不允许这样的事发生，所以一定有设置 IF=1 的指令。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hansimov.gitbook.io/asm-lang/solutions/ch17-bios-keyboard-input-and-disk-io.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
