Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!bu-cs!dartvax!eleazar.dartmouth.edu!earleh From: earleh@eleazar.dartmouth.edu (Earle R. Horton) Newsgroups: comp.sys.mac.programmer Subject: Re: Assembly Help Requested Message-ID: <17857@dartvax.Dartmouth.EDU> Date: 10 Dec 89 19:41:46 GMT References: <66669@tiger.oxy.edu> Sender: news@dartvax.Dartmouth.EDU Reply-To: earleh@eleazar.dartmouth.edu (Earle R. Horton) Organization: Between jobs. Lines: 23 In article <66669@tiger.oxy.edu> hammersslammers1@oxy.edu (David J. Harr) writes: >Let's try this again. It is very possible that you have read a partial >message dealing with this same subject, but my terminal hiccupped while >I was typing it in but before I had finished it. Anyway, I was having >trouble with an assembly program crashing s soon as it called _InitGraf >in the program, ie as soon as it executed the first instruction. The >following is a listing of the program. Any help would be greatly appreciated > >;Program CorneredCoin >INCLUDE'Traps.a';define trap names >MAIN >PEA-4(A5);push pointer to QuickDraw globals The problem is that "-4(A5)" does not point to the QuickDraw globals, unless you are using an old version of the MDS linker which specifically reserved space at this location for this purpose. From the name of your include file, I would guess that you are using the MPW assembler and linker. You need to allocate sufficient space for the QuickDraw globals, and pass the pointer to that storage to _InitGraf. The file 'QuickEqu.a' has the necessary declarations for you to figure out how much storage to allocate. So does the sample application which comes with the assembler, probably. Earle R. Horton