INT 16H

{{Short description|BIOS interrupt call}}

{{more footnotes|date=June 2015}}

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.

Features

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).

List of services of the INT 16 h

class = "wikitable" align = "center" border = "1" cellpadding = "3" cellspacing ="0" width = "95%"

!Function

!Function code(AH)

!Device

Read key press

| 00h

| Keyboard

Get the State of the keyboard buffer

| 01h

| Keyboard

Get the State of the keyboard

| 02h

| Keyboard

Establish repetition factor

| 03h

| Keyboard

Keyboard Click adjustment

|04h

|Keyboard

Simulate a keystroke

| 05h

| Keyboard

Get the ID of the keyboard

| 0Ah

| Keyboard

Read expanded keyboard character

| 10h

| Expanded keyboard

Obtain status of the expanded keyboard buffer

| 11h

| Expanded keyboard

Get expanded keyboard status

| 12h

| Expanded keyboard

INT 16h Detailed Function List

class = "wikitable"

!Function

!Function code(AH)

!Device

!Inputs

! colspan="2" |Return

Read key press

| 0h

| Keyboard

|None

| AH{{Cite web|url=https://stanislavs.org/helppc/scan_codes.html|title=Scan codes}} = Scan code of the key pressed down

| AL = ASCII character of the button pressed

Get the State of the keyboard buffer

|1h

|Keyboard

|None

|AH = Scan code, ZF = 0 if key pressed down

|AL = ASCII character, AX = 0 if no Scan codes

Get the State of the keyboard

|2h

|Keyboard

|None

| colspan="2" |AH = BIOS Keyboard flags

Establish repetition factor

|3h

|Keyboard

|AL = Mode, BH = Repeat delay (if AL = 5), BL = Typematic rate

| colspan="2" |None

Keyboard Click adjustment

|4h

|Keyboard

|AL = 0 (off) or 1 (on)

| colspan="2" |None

Simulate a keystroke

|5h

|Keyboard

|CH = Scan code, CL = ASCII Character

| colspan="2" |AL = 0 If successful, 1 otherwise

Get the ID of the keyboard

|Ah

|Keyboard

|None

| colspan="2" |AL = Keyboard Id

See also

References

{{reflist}}