Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  Interrupt 27H (decimal 39) invokes one of the most interesting of all the
  services provided by DOS.

  Like interrupt 20H, interrupt 27H ends a program, but does not erase it
  from memory. Instead, it leaves a specified portion of the program in
  memory (the program stays resident). The program and data that are made
  resident using interrupt 27H become, in effect, an extension of DOS and
  will not be overwritten by other programs.

  --------------------------------------------------------------------------
  NOTE:
    As with interrupt 20H, DOS versions 2.0 and later provide a more
    flexible alternative to interrupt 27H. This is interrupt 21H, function
    31H, which we recommend instead of interrupt 27H unless you are
    concerned about compatibility with DOS version 1.0. See Chapter 17 for
    more about interrupt 21H, function 31H.
  --------------------------------------------------------------------------

  Interrupt 27H (or its function-call equivalent) is used by a number of
  sophisticated "pop-up" programs like SideKick. Terminate-and-stay-resident
  (TSR) programs typically use this service to establish new
  interrupt-handling routines that are meant to stay in effect indefinitely.
  Most often, these interrupt-handling routines replace existing DOS or ROM
  BIOS interrupt handlers in order to change or extend their operation. But
  the resident item is not limited to interrupt handlers and program
  instructions; it could just as easily be data. For example, the same
  programming technique could be used to load status information into a
  common area that various programs would share, allowing them to
  communicate indirectly.

  Normally, a TSR program is designed in two parts: a resident portion that
  remains in memory and a transient portion that installs the resident
  portion by updating interrupt vectors, initializing data, and calling the
  Terminate-and-Stay-Resident service. The transient portion does not remain
  in memory after interrupt 27H is executed.

  To accommodate this process, TSR programs are designed with the resident
  portion first (that is, at lower addresses). The transient portion
  computes the size of the resident portion and places this value in
  register DX when it executes interrupt 27H. DOS then leaves the resident
  portion in memory but reclaims the memory occupied by the transient
  portion for executing other programs.

  Anything left resident by this service normally remains resident as long
  as DOS is also resident. It is not unusual for several different programs
  to leave part of themselves resident. Programs that use this technique are
  usually sophisticated and complicated, so it is also not unusual for them
  to interfere with each other. To operate such a group of resident programs
  successfully, you must sometimes load them in a particular order--an order
  you may have to discover through experimentation (an unfair trick to play
  on an unsuspecting user).

  As with interrupt 20H, the ordinary terminate service, DOS resets the
  address vectors for interrupts 22H through 24H when it performs this
  terminate-and-stay-resident service. Therefore, you can't use this service
  to create resident interrupt handlers for the address interrupts. Although
  seemingly a limitation, this is actually fairly reasonable: The address
  interrupts are not meant to be used globally; they are meant to be used
  only by individual programs. (See the DOS address interrupts section that
  follows for further discussion.)

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson