7.7 Multiplex Interrupt Handlers

A program can provide services to other programs by installing an interrupt handler for Multiplex Interrupt (Interrupt 2Fh). Multiplex Interrupt is a common entry point for MS-DOS resident programs and device drivers that carry out requests for other programs. For example, a program can add files to the print queue (maintained by the resident program PRINT.EXE) by setting registers and issuing Multiplex Interrupt.

To provide services to other programs, a service program must add its multiplex handler to the interrupt chain and choose a multiplex identifier. This identifier is an integer that distinguishes the program's multiplex handler from all others in the interrupt chain. When other programs request service, they place the service program's multiplex identifier in the AH register. When Multiplex Interrupt is issued, each multiplex handler in the interrupt chain must check the AH register; if the register contains its identifier, the handler must process the service request.

Program identifiers must be in the range 0C0h through 0FFh. All other values are reserved for MS-DOS programs and related software. The following are a few of the reserved multiplex identifiers and their associated programs:

Multiplex identifier Provider

01h PRINT.EXE
06h ASSIGN.COM
10h SHARE.EXE
11h Network Redirector
14h NLSFUNC.EXE
1Ah ANSI.SYS
43h Extended Memory Manager (HIMEM.SYS)
48h DOSKEY.COM
4Bh Task Switcher
0ADh KEYB.COM
0AEh APPEND.EXE
0B0h GRAFTABL.COM
0B7h APPEND.EXE

The AL register specifies the function to carry out. Whenever a multiplex handler processes a request, it checks the contents of the AL register to determine what action to take. By convention, 00h in the AL register specifies the Installed State function. A multiplex handler processes this function by returning a nonzero value (typically 0FFh) in the AL register to indicate that it is installed.