How MS-DOS 6.22 Uses Interrupt 10h for Video

This article explains how MS-DOS 6.22 interfaces with PC video hardware via Interrupt 10h (INT 10h), detailing the low-level communication process between the operating system, the system BIOS, and the display adapter. It covers the mechanics of software interrupts, register conventions, the role of device drivers, and the trade-offs between BIOS-level abstraction and direct video memory manipulation.

The Role of Interrupt 10h

MS-DOS 6.22 does not include modern, monolithic graphics drivers. Instead, it relies on the PC's ROM BIOS to act as a hardware abstraction layer (HAL). Interrupt 10h is the standard software interrupt provided by the video BIOS (typically mapped to memory address C000:0000h) to handle low-level video tasks, such as switching video modes, positioning the cursor, scrolling the screen, and writing text or pixels.

When an application or the MS-DOS kernel needs to interact with the screen using standard system calls, it issues software interrupts that eventually resolve to INT 10h instructions.

The Communication Process

The execution flow between MS-DOS 6.22 and the video hardware occurs in several discrete steps:

  1. Parameter Loading: The calling routine prepares the CPU registers with parameters that define the requested operation. The AH register holds the specific function number. Depending on the function, other registers (AL, BX, CX, DX) hold parameters like character codes, attribute bytes, coordinates, or display modes.
  2. Interrupt Invocation: The CPU executes the INT 10h assembly instruction.
  3. Vector Lookup: The CPU queries the Interrupt Vector Table (IVT) located in the first kilobyte of memory (0000:0000h to 0000:03FFh). The entry for interrupt 10h resides at memory address 0000:0040h (vector 16 × 4 bytes), which contains the segment and offset address of the video BIOS handler.
  4. BIOS Execution: Execution transfers to the video BIOS ROM. The BIOS routine parses the value in the AH register, processes the request, and directly addresses the video controller hardware through I/O ports (such as 0x3C0 through 0x3DA on standard VGA hardware) or direct reads and writes to video RAM.
  5. Return: The BIOS routine finishes by executing an IRET (Interrupt Return) instruction, which restores the processor flags and instruction pointer, returning control to MS-DOS or the calling program.

Common INT 10h Functions in MS-DOS

MS-DOS 6.22 utilizes several primary INT 10h sub-functions through its console output routines:

  • Function 00h (AH = 00h) - Set Video Mode: Instructs the video adapter to change display modes, such as text mode 03h (80x25 16-color text) or graphics mode 13h (320x200 256-color raster).
  • Function 02h (AH = 02h) - Set Cursor Position: Configures the row and column coordinates of the active blinking cursor for a given display page.
  • Function 0Eh (AH = 0Eh) - Teletype Output: Writes a single character to the screen at the current cursor position, automatically advancing the cursor and handling line wraps, carriage returns, and vertical scrolling when reaching the bottom edge.

Integration with MS-DOS Subsystems

MS-DOS 6.22 interacts with INT 10h primarily through its lower-level I/O layer, IO.SYS. Standard output operations initiated by DOS API calls—such as Interrupt 21h, Function 02h (Character Output) or Function 09h (Print String)—delegate character output to the console device driver (CON). The default CON implementation translates these text streams into sequential calls to INT 10h, Function 0Eh.

When the ANSI.SYS driver is loaded via CONFIG.SYS, it intercepts console output. ANSI.SYS parses ANSI escape sequences (for cursor relocation, screen clearing, and color changes) and maps those sequences directly into corresponding INT 10h function calls.

Direct Video Memory Access vs. INT 10h

While INT 10h provides universal compatibility across CGA, EGA, VGA, and SVGA hardware, it is relatively slow due to the overhead of context switching, parameter verification, and generic BIOS code.

Because MS-DOS 6.22 operates entirely in real mode without memory protection, performance-intensive applications (such as games and full-screen text editors) often used INT 10h strictly for initialization—such as querying hardware capabilities or setting the video mode—and then bypassed INT 10h entirely. These applications wrote directly to mapped video memory buffers, located at physical address B800:0000h for color text or A000:0000h for VGA graphics, achieving real-time display updates.