Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!osu-eddie!dsacg1!dsacg3!ntm1458 From: ntm1458@dsacg3.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: Funtion 4BH of interruption 21H Message-ID: <121@dsacg3.UUCP> Date: Wed, 1-Apr-87 10:18:34 EST Article-I.D.: dsacg3.121 Posted: Wed Apr 1 10:18:34 1987 Date-Received: Sat, 4-Apr-87 06:38:33 EST References: <1379@imag.UUCP> Distribution: world Organization: Defense Logistics Agency Systems Automation Center, Columbus Lines: 35 Summary: ? Explanation of Function 4bh load only In article <1379@imag.UUCP>, serge@imag.UUCP writes: > We have got a problem with the function 4BH of interruption 21H (load only) > > We don't understand : > > -if the PSP is created or not ? > > -if we must allocate the memory ourselves or if the INT 21H do it for us > > -How to calculate the start segment ? > Is it the segment address obtained by memory allocation? > > Thank you for replying. According to Zenith Data Systems and the Microsoft Programmer's Utility Pack, no PSP is created on a load only. MSDOS does not begin program execution. 1. You must supply: the WORD segment address where the file will be loaded and the WORD relocation factor to be applied to the image in the parameter block. 2. Memory allocation is modified by using the SETBLOCK macro (function 4AH) before this function(4b) is invoked. The environment strings contain the configuration parameters inherited from the parent process. All open files are duplicated in the child process after an exec. The environment strings (max 32k (max 32K bytes) begin on the paragraph boundary followed by the parameter block. MSDOS gets segment info from the program loaded. DS:DX point to the path name, filename and ES:BX point to the parameter block. To avoid program corruption: save SS:SP in a data location reachable from your CS. On a successful return from an EXEC all registers are altered except CS:IP. John Darby.