🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #708

Re: software "exceptions"

#708
From: Frank J. Edwards
Date: Wed, 02 Aug 1989 18:22
51 lines
2416 bytes
In article <7526@cbmvax.UUCP> jesup@cbmvax.UUCP (Randell Jesup) writes:
>In article <143@ckctpa.UUCP> crash@ckctpa.UUCP (Frank J. Edwards) writes:
>>I've been trying to use the Amiga's signalling system to cause an
>>"exception" (thats CBM's term, not Motorola's).  The idea is not
>>to have to perform a Wait() for the CLOSEWINDOW gadget or to
>>poll the tc_SigRecvd member of the Task Control Block...
>...
>>Compiled under Manx 3.6a with
>>long flag;
>>
>>#asm
>>_except:
>>	moveq.l	#99,d1		; this is to let me know it worked!
>>	move.l	d1,_flag
>>	rts
>>#endasm
>
>	I suspect the Manx assembler is referencing flag off of A4, which of
>course has a random value.  The Manx AS is rather nasty about changing your
>code without asking you to what it "knows" is right.  Try large code/data 
>or some such (I don't use manx).
>
>-- 
>Randell Jesup, Keeper of AmigaDos, Commodore Engineering.

Yes, that's probably it.  I'll check the assembler code generated.

And later ...

>	Oh yes, standard disclaimer: you can't assume that your program
>isn't in a ROM routine with resources locked, so you can't safely change
>the PC of the program (unless you're 101% certain it can't have anything
>locked).

Good point.  AmigaDOS isn't re-entrant, is it?

I had hoped, at least in the case of CLOSEWINDOW, that since my handler
ran in user-mode it could take care of task cleanup (memory allocations,
windows, screens, etc) and then call exit().  But exit() calls Close()
and probably other DOS/Exec routines so that's not safe.

Hmmm.  Sounds like no matter what I do, I'm required to set a flag and
process it in the normal execution of the program.  Which means I'm back
to polling a flag variable somewhere ... might as well be tc_SigRecvd.

--
#include <std/disclaimer.h>	/* My employer isn't even involved! */

Frank J. Edwards		ComputerKnowledge Corporation
2677 Arjay Court		12740 Hillcrest Rd, Suite 212
Palm Harbor, FL  34684-4505	Dallas, TX  75230      (800) 385-9700
Technical Details
Message-ID: <148@ckctpa.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!usc!cs.utexas.edu!uunet!pdn!boake2!ckctpa
References: <7526@cbmvax.UUCP> <143@ckctpa.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!usc!cs.utexas.edu!uunet!pdn!boake2!ckctpa
From: crash@ckctpa.UUCP (Frank J. Edwards)
Newsgroups: comp.sys.amiga.tech
Subject: Re: software "exceptions"
Message-ID: <148@ckctpa.UUCP>
Date: 2 Aug 89 18:22:39 GMT
References: <7526@cbmvax.UUCP> <143@ckctpa.UUCP>
Organization: ComputerKnowledge Corp, Clearwater FL
Lines: 51