Category : Files from Magazines
Archive   : WDMAY92.ZIP
Filename : 3N05024A

 
Output of file : 3N05024A contained in archive : WDMAY92.ZIP
#include
#include
#include
#include
/*
******************************************************************
Title: TSR.C - DOS Component of TSR Interface
Author: Thomas W. Olsen
Version: 3.0
Compiler: Microsoft C 6.0
cl /AS /Zi tsr.c
******************************************************************
*/
void (interrupt far *OldIntHandler)();

void (interrupt _far IntHandler)(int es, int ds, int di, int si, int bp,
int sp, int bx, int dx, int cx, int ax,
int ip, int cs, int flags)
{
static char _far *buffer = {"These are the contents of the TSR buffer!"};

if (ax != 0xBEEF) /* If Multiplex Handle doesn't */
_chain_intr(OldIntHandler); /* match ... forward the interrupt */

dx = FP_SEG(buffer); /* DX:AX = Buffer address */
ax = FP_OFF(buffer);
cx = _fstrlen(buffer); /* CX = Max. buffer length */
}

int main(int argc, char *argv[]) /* Here's the TSR format: */
{ /* CODE */
extern unsigned end; /* STATIC DATA */
unsigned _far *upperLimit; /* STACK */
unsigned paragraphs, actual, stackSize; /* HEAP */

upperLimit = &end; /* top of static data */
stackSize = ((stackavail() + 2048) / 2048) * 2048; /* compute stack size */
paragraphs = (FP_SEG(upperLimit) - _psp) + (FP_OFF(upperLimit) + stackSize) / 16 + 1;
OldIntHandler = _dos_getvect(0x2F); /* get old INT 2Fh vector */
_dos_setvect(0x2F, IntHandler); /* set INT 2Fh vector to our handler */
_dos_setblock(paragraphs, _psp, &actual); /* relinquish unused heap */
_dos_keep(0, paragraphs); /* terminate & stay resident */
return(-1); /* error must have occurred */
}


  3 Responses to “Category : Files from Magazines
Archive   : WDMAY92.ZIP
Filename : 3N05024A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/