Terminate-and-stay-resident program

[1] This technique partially overcame DOS's limitation of executing only one program, or task, at a time.

Some TSRs are utility software that a computer user might call up several times a day, while working in another program, by using a hotkey.

MS-DOS version 2.0 introduced an improved call, INT 21h/31h ('Keep Process'), which removed this limitation and let the program return an exit code.

Installing a software interrupt vector allows it to be called by the currently running program.

TSRs can be loaded at any time; either during the DOS startup sequence (for example, from AUTOEXEC.BAT), or at the user's request (for example, Borland's Sidekick and Turbo Debugger, Quicken's QuickPay, or FunStuff Software's Personal Calendar).

[3] To manage problems with many TSRs sharing the same interrupt, a method called Alternate Multiplex Interrupt Specification (AMIS) was proposed by Ralf D. Brown as an improvement over previously used services offered via INT 2Fh.

A TSR can have one of two behaviors: The terminate-and-stay-resident method is used by most DOS viruses and other malware, which can either take control of the PC or stay in the background.

This meant that writing a TSR was a challenge of achieving the smallest possible size for it, and checking it for compatibility with a lot of software products from different vendors—often a very frustrating task.

In the late 1980s and early 1990s, many video games on the PC platform pushed up against this limit and left less and less space for TSRs—even essential ones like CD-ROM drivers—and arranging things so that there was enough free RAM to run the games, while keeping the necessary TSRs present, became very complicated.

[citation needed] Because programming with many overlays is a challenge in and of itself, once the program was too big to fit entirely into about 512 KB, use of extended memory was almost always done using a third-party DOS extender implementing VCPI or DPMI, because it becomes much easier and faster to access memory above the 1 MB boundary, and possible to run code in that area, when the x86 processor is switched from real mode to protected mode.

Some memory managers are QRAM and QEMM by Quarterdeck, 386MAX by Qualitas, CEMM by Compaq, and later EMM386 by Microsoft.

Instead these operating systems have modern driver and service frameworks with memory protection and preemptive multitasking, allowing multiple programs and device drivers to run simultaneously without the need for special programming tricks; the kernel and its modules have been made exclusively responsible for modifying the interrupt table.