Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!oxy!hammersslammers1 From: hammersslammers1@oxy.edu (David J. Harr) Newsgroups: comp.sys.mac.programmer Subject: Assembly Help Requested Message-ID: <66669@tiger.oxy.edu> Date: 8 Dec 89 06:40:55 GMT Organization: Occidental College, Los Angeles, CA 90041 Lines: 64 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 _InitGraf;Inititalize QuickDraw _InitFonts;Initialize font manager _InitWindows;Initialize Window Manager _InitCursor;Initialize cursor to arrow SUBQ#4,SP;make room for pointer result CLR.L-(SP);allocate on heap PEAWindowSize;push pointer to rectangle PEAWindowName;push pointer to name ST-(SP);yes, window is visible CLR.W-(SP);use document window MOVE.L#-1,-(SP);put window on top SF-(SP);no, window has no goAway box CLR.L-(SP);NIL window refCon _NewWindow;make the window _SetPort;make the window the current port PEACoinSize;push pointer to rectangle _FrameRect;draw rectangle frame MOVE.L#$006E007A,-(SP);specify integer coordinates _MoveTo;move pen to that point PEACoinLetters;push pointer to string _DrawString;draw the string at the pen location FlipCoin _SystemTask;give screen time to resynch SUBQ#4,SP;make room for point result MOVE.LSP,-(SP);push pointer to result space _GetMouse;get cursor coordinate location MOVE.L(SP)+,D3;store point in register SUBQ#2,SP;make room for boolean result MOVE.LD3,-(SP);retrieve cursor point PEACoinSize;push pointer to rectangle _PtInRect;determine if cursor is in rect TST.B(SP)+;set Z flag accordingly BEQ.STryButton;branch if Z is not set (not in rect) PEACoinSize;push pointer to rectangle _InverRect;Invert Rectangle TryButton SUBQ#2,SP;make room for boolean result _Button;see if button is pressed TST.B(SP)+;set Z flag accordingly BEQ.SFlipCoin;branch if Z is set (nosed) _ExitToShell;return to DeskTop WindowSizeDC.W80,60,290,450;window bounds (top,lftneredCoin';window title CoinSizeDC.W80,100,130,290;rectangle bounds CoinLettersDC.B'BlackHeads/n END Well, there you have it. Any ideas? It is very discouraging to start out to program and have the program blow up in your face at the very first instruction. advaTHANKSnce, David