markz@microsoft.UUCP (Mark Zbikowski) (10/11/84)
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.