Path: utzoo!utgpu!watserv1!watmath!att!ucbvax!van-bc!rsoft!mindlink!a275 From: a275@mindlink.UUCP (Travers Naran) Newsgroups: comp.sys.amiga.tech Subject: AmigaDos Process structure questions Message-ID: <2006@mindlink.UUCP> Date: 4 Jun 90 14:09:04 GMT Organization: MIND LINK! - British Columbia, Canada Lines: 27 I was trying to write a replacement for the system() command so I can write front ends that don't require using 'run'. Anyways, the program works except for one thing: The Exit() command. Now, I noticed that in the Process structure there is a pr_ReturnAddr varialbe. So I looked it up in the AmigaDos Technical Ref. Manual (1.2) and found this: "The Exit function uses the value of ReturnAddr which points to just above the return address on the currently active stack. If a program exits by performing an RTS on an empty stack, then control passes to the code address pushed on the stack by CreateProc or by the CLI. If a program terminates with a call to Exit, then AmigaDOS uses this pointer to extract the same return address." Well, my question is this: What the hell does that mean!? I assumed it meant that pr_ReturnAddr is pointing to the same location the stack pointer would point to when the code is entered. But I keep guru'ing (CPU Trap #4 - Illegal instruction so I guess that means it is going to the wrong address). So to put the question mildly: What value should pr_ReturnAddr be set to if I want all Exits to return back to my calling program? -- ------------------------------------------------------------------- Travers "T'aran" Naran (I am male) Simon Fraser University, Computing Science Whovian, Prober, Treker, Quantum Leaper.... Mailing addresses: Usenet Travers_Naran@mindlink.UUCP or uunet!van-bc!rsoft!mindlink!Travers_Naran ------------------------------------------------------------------