Category : C Source Code
Archive   : XTCPRO.ZIP
Filename : PMOM.H

 
Output of file : PMOM.H contained in archive : XTCPRO.ZIP
/* -------------- pmom.h ----------------- */

/*
* Include this header file in the source files for
* the root and overlay modules of an overlay program
*/

#define MAXARGS 10

/* --------- the program and DOS context -------- */
typedef struct {
unsigned ss; /* stack segment */
unsigned sp; /* stack pointer */
unsigned psp; /* program segment prefix */
char far *dta; /* disk transfer address */
} CONTEXT;

extern CONTEXT rctx; /* context of the root module */
extern CONTEXT octx; /* context of the overlay module */

#define ROOTREGS IREGS rtregs
#define ROOTFUNCTION far interrupt

/* ------ enter a root function from an overlay call ------- */
#define ENTER \
{ \
disable(); \
octx.ss=_SS; \
octx.sp=_SP; \
_SS=rctx.ss; \
_SP=rctx.sp; \
_BP=_SP; \
enable(); \
octx.dta=getdta(); \
setdta(rctx.dta); \
_AH = 0x51; \
geninterrupt(0x21); \
octx.psp = _BX; \
_BX = _psp; \
_AH = 0x50; \
geninterrupt(0x21); \
}

/* ------- exit from a root function ------- */
#define EXIT \
{ \
_BX = octx.psp; \
_AH = 0x50; \
geninterrupt(0x21); \
setdta(octx.dta); \
disable(); \
_SS=octx.ss; \
_SP=octx.sp; \
_BP=_SP; \
enable(); \
}

/* ----- return a value from a root function ------- */
#define RETURN(r) \
{ \
rtregs.ax=(unsigned)((r) & 0xffff); \
rtregs.dx=(unsigned)((r) >> 16); \
}

/* -------- overlay function prototypes ---------- */
int load_overlay(char *, ...);
void far *getarg(int);


  3 Responses to “Category : C Source Code
Archive   : XTCPRO.ZIP
Filename : PMOM.H

  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/