Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site utah-cs.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!genrad!panda!talcott!harvard!seismo!utah-cs!brownc From: brownc@utah-cs.UUCP (Eric C. Brown) Newsgroups: net.micro Subject: Re: Re: DOS EXEC FUNCTION CALL Message-ID: <3465@utah-cs.UUCP> Date: Sun, 8-Sep-85 01:02:56 EDT Article-I.D.: utah-cs.3465 Posted: Sun Sep 8 01:02:56 1985 Date-Received: Tue, 10-Sep-85 02:59:52 EDT References: <1267@brl-tgr.ARPA> <11416@styx.UUCP> Reply-To: brownc@utah-cs.UUCP (Eric C. Brown) Organization: Univ of Utah CS Dept Lines: 20 In article <11416@styx.UUCP> jlt@styx.UUCP (John L. Thomas) writes: >> when you return back to TURBO all your stack and data is garbage. The >> solution is to push all your necessary registers and then save the SS >> and SP in a location in your code segment. > >Just to clear up a ?minor? point of confusion: >How could the return from interrupt have happened if the SS:SP is garbage? >In fact, the restoration of CS:IP comes from the return, which requires >that SS:SP be correct. > Well, actually, according to a note in the Zenith MS-DOS 2.0 Programmer's Utility Package, all registers (including the stack) are altered because control is returned from the executed program, not the system. My guess is that the 2.0 Exec function sets up the program exit address of the called program to point back to the calling program. Eric C. Brown brownc@utah-cs ...{ihnp4, decvax}!utah-cs!brownc Execute Programs, not People!