Dark abstract pattern of faint binary digits and circuit-like lines on a near-black background, subtle green tint

INT 23H: Ctrl-Break Exit Address

The interrupt vector that handles Ctrl-Break and Ctrl-C signals in DOS programs.

Overview

The INT 23H vector, located at 0000:008c, points to the code that receives control when DOS senses that the user has pressed Ctrl-Break or Ctrl+C (ASCII 03H). This interrupt is a critical part of DOS program termination and break-handling logic.

PSP Integration

The address stored at the INT 23H vector is copied into the pfCtlBrk field of the Program Segment Prefix (PSP) by DOS function 26H (create PSP) and function 4BH (EXEC). When a program exits, the original address of the Ctrl-Break handler is restored from the PSP. This ensures that the parent process's Ctrl-Break handler is reinstated upon exit from a child process.

Break Sensing

DOS invokes INT 23H when it detects that the user has pressed Ctrl+C or Ctrl-Break. The level of DOS Ctrl-Break sensing can be checked or set via DOS function 33H.

Key detail: A program may install its own custom break handler by replacing the vector at 0000:008c. When doing so, the original handler address should be saved so it can be restored before the program terminates, preserving the chain of responsibility back to the parent process.

Vector Summary

Item Value / Detail
Interrupt Number 23H
Vector Address 0000:008c
Trigger Ctrl-Break or Ctrl+C (ASCII 03H)
Stored in PSP Field pfCtlBrk
Related DOS Functions 26H (create PSP), 4BH (EXEC), 33H (break sensing)

The INT 23H vector serves as a fundamental mechanism for handling user interruptions in DOS programs. When a user presses Ctrl-Break or Ctrl+C during program execution, DOS transfers control to the address stored in this vector rather than continuing the current operation. This interrupt vector is located at a fixed position in the interrupt table, allowing both the operating system and application programs to intercept or modify break handling behavior. Understanding this vector is essential for assembly language programmers who need to implement custom break handling routines or ensure their programs respond appropriately to user interruption signals. The ability to redirect this vector gives developers fine-grained control over program termination behavior.

The relationship between INT 23H and the Program Segment Prefix is critical for understanding DOS program structure. When DOS loads a program for execution, it copies the current INT 23H vector address into a specific field within the PSP. This integration ensures that when a program terminates, DOS can restore or chain to the appropriate break handler. The PSP field stores this address as part of the program's initial setup, and any modifications made to the INT 23H vector during program execution must be carefully managed to avoid corrupting the program's termination sequence. Assembly programmers must understand this relationship when writing TSR programs or custom interrupt handlers.

Proper management of the INT 23H vector is essential for writing robust DOS programs in assembly language. Programmers typically save the original vector address before installing their own handler, ensuring they can restore it before program termination. A custom INT 23H handler might set a flag indicating that a break was detected, allowing the main program to check this flag at convenient points and perform cleanup operations before exiting. This approach prevents abrupt termination that could leave files open or data structures in an inconsistent state. The flat, square-cornered design aesthetic of modern reference documentation mirrors the clean, structured approach needed when implementing these interrupt handling routines in assembly code.

The behavior of INT 23H differs from other DOS interrupt vectors in its relationship to program flow control. Unlike INT 21H function calls which return control to the caller, the INT 23H handler can either terminate the program or return control to the point of interruption. This dual nature makes it a versatile tool for assembly programmers who need to implement custom break handling logic. The interrupt is invoked automatically by DOS when it detects the Ctrl-Break or Ctrl+C key sequence during character I/O operations. Understanding when and how DOS triggers this interrupt helps programmers design more responsive and user-friendly applications that handle interruptions gracefully without data loss or system instability.

The INT 23H vector interacts closely with other DOS interrupt services, particularly those related to program termination and process management. When a program exits through standard DOS termination functions, the system uses the INT 23H address stored in the PSP to ensure proper cleanup of break-related resources. Assembly language programmers working with memory-resident programs must pay special attention to this vector, as TSRs often need to chain their break handlers with those of other resident programs. The green accent color and clean sans-serif typography of modern DOS reference materials reflect the clarity and precision required when documenting these interrupt interactions. Mastering INT 23H is a key milestone for any programmer seeking to write professional-quality DOS applications.