Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!nbires!hao!oddjob!gargoyle!ihnp4!inuxc!iuvax!pur-ee!j.cc.purdue.edu!i.cc.purdue.edu!aja From: aja@i.cc.purdue.edu (Mike Rowan) Newsgroups: comp.sys.ibm.pc Subject: tsr Message-ID: <2393@i.cc.purdue.edu> Date: Mon, 28-Sep-87 18:18:15 EDT Article-I.D.: i.2393 Posted: Mon Sep 28 18:18:15 1987 Date-Received: Wed, 30-Sep-87 05:17:42 EDT Organization: Insultants of America Lines: 35 Someone asked about a TSR....this is incomplete at best but i have no time for updating things i dont use. Excuse for using Lattice : At a job a while back i was forced to use Lattice 2.14. I wrote out this quickie to terminate and stay resident. Watch out --- youll need to snag a vector (interupt) or something to return control to the caller of TSR(). #include "stdio.h" #include "dos.h" extern unsigned _base; tsr(name) char *name; { union REGS inreg; struct SREGS segreg; long x; segread(&segreg); inreg.x.dx = ((segreg.ds*16)+ _base) - (segreg.cs * 16); /* i didnt need my stack segment... this was so i could use an ATRON debugger on a hoser that forked off :-) */ int86x(0x27,&inreg,&inreg,&segreg); printf("ERROR-- TSR did not succeed. %s not Resident.\n\n",name); }