Thread: writing a TSR

  1. #1
    Registered User moi's Avatar
    Join Date
    Jul 2002

    writing a TSR

    i've done a bunch of google searches and come up with some info, but could someone steer me a bit straighter towards the basics of programming a TSR in C? i havent come up with much useful yet.
    hello, internet!

  2. #2
    Registered User
    Join Date
    Apr 2002
    Salem is probly the person to ask, but Ill tell you what I know about them.

    TSR stands for terminate and stay resident, meaning that the program terminates (returning to the shell), yet keeps the memory, so like nothing will over-write it. This can be usefull for a number of reason, hers an example of what I did once (just playing around):

    Theres this old dos game called duke nukem 3d, that im pretty sure runs in 320x200x8, so I wrote a program that hooked something to the keyboard handler so that whenever I pressed F12 it would randomly change all of the palette entrys that the game would look all funky. After the handler was hooked, I terminated the program but stayed resident so that nothing could .......... up my interrupt service routine (or whatever its called). In order to terminate and stay resident there is probably a function in dos.h that will do it, if there isnt you can always use the dos int 21, function 31 thingy.

    mov ah, 31h
    mov al 0
    mov dx (Paragraphs to reserve)
    int 21
    I havent coded in assembly for a while so this might not be correct, and Im not sure how big a paragraph is, Im thinking its 16 bytes but I donno.

    Somebody please correct me if any of this is wrong rocks!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 05-20-2008, 08:57 AM
  2. Folding@Home Cboard team?
    By jverkoey in forum A Brief History of
    Replies: 398
    Last Post: 10-11-2005, 08:44 AM
  3. keyboard handlers & terminate and stay resident (tsr)
    By Triple_X in forum C Programming
    Replies: 19
    Last Post: 12-22-2004, 01:06 AM
  4. help! fifo read problem
    By judoman in forum C Programming
    Replies: 1
    Last Post: 08-16-2004, 09:19 AM
  5. insufficient memory for tsr
    By manmohan in forum C Programming
    Replies: 8
    Last Post: 01-02-2004, 09:48 AM