Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 beta 3/9/83; site microsoft.UUCP
Path: utzoo!linus!decvax!tektronix!uw-beaver!microsoft!markz
From: markz@microsoft.UUCP (Mark Zbikowski)
Newsgroups: net.micro.pc
Subject: RE: loading in programs by not using EXEC
Message-ID: <8721@microsoft.UUCP>
Date: Wed, 10-Oct-84 21:00:49 EDT
Article-I.D.: microsof.8721
Posted: Wed Oct 10 21:00:49 1984
Date-Received: Sat, 13-Oct-84 02:47:32 EDT
Organization: Microsoft Corporation
Lines: 16


	Help!  I am struggling to understand an apparent inconsistency
	in the MS/PC-DOS (2.X) operating system.  I am trying to run a
	program by loading it in, setting up the Program Segment Prefix,
	registers, etc., and setting the Terminate Exit Address to my
	own termination trap routine.

EEKS!  Why are you attempting to do this?  The exec system call (4B) is
substantially better than this.  Think of all the code duplication!

Several observations:

o   You *must* use the create program segment system call to initialize the
	new program segment.  Merely copying one around is NOT good enough.

o   You must set the terminate address *before* you duplicate the PSP.