Skip to content
Surf Wiki
Save to docs
general

From Surf Wiki (app.surf) — the open knowledge base

INT 16H


Column 1Column 2
This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (June 2015) (Learn how and when to remove this message)

INT 16h, INT 0x16, INT 16H or INT 22 is shorthand for BIOS interrupt call 16hex, the 23rd interrupt vector in an x86-based computer system. The BIOS typically sets up a real mode interrupt handler at this vector that provides keyboard services. This interrupt is responsible for control of the PC keyboard.

This interrupt is responsible for obtaining basic keyboard functionality, i.e. is responsible for collecting the keystrokes, obtain the status of the buffer of keyboard, etc. The standard encoding of the keyboard that offers the INT 16h is a US keyboard. To adapt the coding of the INT 16h to another type of keyboard (for example, an international keyboard), the code must analyze the scan-code of the key pressed, and then perform suitable interpreting.

For keyboards with 101 letters or more, there are some keys that INT 16h interprets as expanded keys, which have a scan-code that is different from normal keys (e.g., key pause).

FunctionFunction code(AH)Device
Read key press00hKeyboard
Get the State of the keyboard buffer01hKeyboard
Get the State of the keyboard02hKeyboard
Establish repetition factor03hKeyboard
Keyboard Click adjustment04hKeyboard
Simulate a keystroke05hKeyboard
Get the ID of the keyboard0AhKeyboard
Read expanded keyboard character10hExpanded keyboard
Obtain status of the expanded keyboard buffer11hExpanded keyboard
Get expanded keyboard status12hExpanded keyboard
FunctionFunction code(AH)DeviceInputsReturn
Read key press0hKeyboardNoneAH = Scan code of the key pressed downAL = ASCII character of the button pressed
Get the State of the keyboard buffer1hKeyboardNoneAH = Scan code, ZF = 0 if key pressed downAL = ASCII character, AX = 0 if no Scan codes
Get the State of the keyboard2hKeyboardNoneAH = BIOS Keyboard flags
Establish repetition factor3hKeyboardAL = Mode, BH = Repeat delay (if AL = 5), BL = Typematic rateNone
Keyboard Click adjustment4hKeyboardAL = 0 (off) or 1 (on)None
Simulate a keystroke5hKeyboardCH = Scan code, CL = ASCII CharacterAL = 0 If successful, 1 otherwise
Get the ID of the keyboardAhKeyboardNoneAL = Keyboard Id
  • BIOS

  • PS/2 port

  • explained and complete list of interrupt 16h

Want to explore this topic further?

Ask Mako anything about INT 16H — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report