[comp.lang.c] Help needed with RAM resident program on Microsoft `C'

dipto@umbc3.UMD.EDU (Dipto Chakravarty ) (10/13/87)

Hi folks, 
	  I could use some of your wisdom on this problem.  I am trying to
write a RAM resident / Terminate Stay Resident (TSR) program on an IBM AT,
which is supposed to come back every 20-25 secs and print a message on the
screen, stating that the program segment is RAM resident. This routine is 
to be written in Microsoft `C'. Any idea/wisdom as to how do I go about 
implementing this. 

	  In assembly one would set the origin by doing `ORG 100' and then 
subsequently altering the vectors; but how can we do it from C ? 

	  For your information the main program accesses the 8253 timer 
chip; subsequently processes the value. I want that if this value is valid
the RAM resident program pops a message on the screen.

	  I WOULD GREATLY APPRECIATE ALL THE HELP  that I can get on this 
topic. Please send me e-mail or post it on the net. Thanks in advance.

Dipto Chakravarty			      ARPANET: dipto@umbc3.umd.edu
Administrative Computing Services	       BITNET: dipto@umbc2.umd.edu
U. of Maryland, Baltimore County.

rwhite@nusdhub.UUCP (Robert C. White Jr.) (10/13/87)

In article <506@umbc3.UMD.EDU>, dipto@umbc3.UMD.EDU (Dipto Chakravarty ) writes:
> Hi folks, 
> 	  In assembly one would set the origin by doing `ORG 100' and then 
> subsequently altering the vectors; but how can we do it from C ? 

	Dont sweat this one.  The only reason you set the ORG 100 is
to make the program conform to "*.com" fromat.  MSC takes care of the
*.EXE or *.COM  format of the executables, both of which may be left
resident, so just write the MOST effecent loader "main()" you can
and go for it.

> chip; subsequently processes the value. I want that if this value is valid
> the RAM resident program pops a message on the screen.

	The only thing I know about this is that you must preserve the
old "timer interrupt" value, and call it just before you "return"

	The procedure type "interrupt" is supposed to do some,
but not all, of this for you.  For the syntax of "interrupts" you
will have to look that up yourself.

Robert.