Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!usc!jarthur!nntp-server.caltech.edu!toddpw From: toddpw@nntp-server.caltech.edu (Todd P. Whitesel) Newsgroups: comp.sys.apple2 Subject: Re: Starting/Shutting Tools Down (was GS/OS Strings in Orca/C?) Message-ID: <1991Jan13.224859.352@nntp-server.caltech.edu> Date: 13 Jan 91 22:48:59 GMT References: <1991Jan12.200743.24625@ee.ualberta.ca> Organization: California Institute of Technology, Pasadena Lines: 48 jpenne@ee.ualberta.ca (Jerry Penner) writes: >I'm using Orca/C v 1.1 and to be quick my program looks like this: Your initTools and shutDownTools declarations are OK, but they are not necessarily the problem. Are you using any #pragma optimizes, because you can turn the stack repair code off -- which means that ANY ints-instead-of- longs will do you in. also make sure you declare argc as int and argv as char ** or char *[]. Sorry this is dumb-dumb checking but I've caught myself for things like it before. >int main( argc, argv ) /* I TRIED void'ing THESE w/ same results */ >{ > if (initTools()) > { > shutDownTools(); > exit(); /* This part has never executed as initTools() > hasn't got any errors for me yet */ > } > /* DRAW a simple graphic */ > shutDownTools(); > <------ This is where it hangs >} ok, this should also be fine. I'd suggest adding the variable int sp; and the following code just inside the enclosing brackets of main: asm { tsc sta sp } printf("stack pointer is $%x\n", sp); If you see both printf's and the values are different then something is definately wrong somewhere. You may want to try an isolate-and-test strategy to figure out where the offending statement is -- and it might be a library function but keep your mind open. >Anyhow, I will try startdesk and enddesk but I still wish I could do it >my way. I like knowing how everything works in my programs. My sentiments exactly. Todd Whitesel toddpw @ tybalt.caltech.edu