How MS-DOS 6.22 Print Screen Captures Work

In MS-DOS 6.22, pressing the Print Screen key does not save a file to disk or copy an image to a clipboard as modern operating systems do; instead, it initiates a physical data dump from the video display memory directly to a parallel printer. This process relies on a sequence of low-level hardware interrupts, the system BIOS, and optional DOS-level terminate-and-stay-resident (TSR) utilities to read video memory line by line and stream that data over standard printer ports.

The Hardware Interrupt Sequence

When the user presses the Print Screen key, the keyboard controller generates hardware Interrupt Request 1 (IRQ 1). The central processing unit suspends the current routine and invokes the BIOS keyboard handler mapped to Interrupt 09h (INT 09h).

The INT 09h handler processes the keyboard scan code. When it detects the specific scan code associated with the Print Screen key, it checks a dedicated status byte located in the BIOS Data Area at memory address 0050:0000h. This byte tracks the current screen print state:

  • 00h: Ready / inactive
  • 01h: Print operation in progress
  • FFh: Error encountered during last operation

If the status is 01h, the system is already dumping screen data, and the keystroke is discarded to prevent overlapping print jobs. If the status is 00h or FFh, the handler sets the flag to 01h and immediately triggers software Interrupt 05h (INT 05h).

Default Text Mode Execution

By default, the ROM BIOS provides the baseline handler for INT 05h. In standard MS-DOS text modes (such as 80x25 alphanumeric mode), this handler performs a direct memory dump:

  1. Locating Video RAM: The handler queries the BIOS Data Area to determine the current display mode, number of columns (typically 80), and number of rows (typically 25). It locates the video buffer, mapped either to segment B800h for color displays (CGA/EGA/VGA) or B000h for monochrome displays (MDA).
  2. Parsing Characters: In text mode, video RAM stores display data in alternating bytes of character codes and color attributes. The BIOS loops through the buffer row by row, reading only the character byte and ignoring the attribute byte.
  3. Dispatching via INT 17h: Each character is transmitted sequentially to the default parallel printer port (LPT1) using BIOS Interrupt 17h (INT 17h), function 00h (Write Character to Printer).
  4. Line Termination: At the end of each display row, the handler transmits a Carriage Return (0Dh) and a Line Feed (0Ah) sequence to advance the printer to the next line.
  5. Completion: Once all rows have been pushed to the printer, the handler sets the status byte at 0050:0000h back to 00h and executes an IRET (Interrupt Return) instruction, returning control to the interrupted application.

Handling Graphics Modes via GRAPHICS.COM

The native ROM BIOS INT 05h handler cannot interpret graphics modes. If a user presses Print Screen inside a graphical DOS application without additional software running, the system will either output garbage characters, send non-printable control codes, or ignore the command entirely.

To capture graphics screens, MS-DOS 6.22 requires the GRAPHICS.COM command to be loaded prior to running the application. GRAPHICS.COM acts as a TSR driver:

  1. Interrupt Vector Hooking: Upon execution, GRAPHICS.COM replaces the default INT 05h vector in the interrupt table with its own memory address.
  2. Reading Pixel Planes: When INT 05h is triggered while in graphics mode, the new TSR handler reads the display hardware directly, interpreting the active resolution and color depth (such as Mode 12h, which is 640x480 16-color VGA).
  3. Raster Conversion: The utility translates the screen's bitmapped pixels into dot-matrix or laser raster patterns according to printer profiles defined in the GRAPHICS.PRO configuration file.
  4. Printer Output: The translated raster escape codes and binary bitmap data are then routed via INT 17h to the printer, rendering the graphic image on paper.