🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #34810

Re: Cntrl-C Exception Handling

#34810
From: Allan Pratt
Date: Mon, 31 Oct 1988 22:45
21 lines
1479 bytes
In article <5078@louie.udel.EDU> kerly@udel.EDU (Philip Kerly) writes:
> an assembly routine written by Mark Williams Co. called setrte() which is

Your ^C handler routine should end with RTS, not RTE.  Don't call setrte();
just end your function (or use "return;").

The ^C handler vector is meant to be used to clean things up as you are
being terminated.  In particular, if you have interrupt service routines
installed, your ^C handler should un-install them.  Your ^C handler is
called if you get bombs, too.  In fact, it's called no matter HOW you
terminate: it's even called when you call Pterm(). 

If you really want to trap ^C and *not* exit, you should know that
the terminate handler vector gets called from Supervisor mode.  
You can use setjmp/longjmp to get back to your program, as long as
your setjmp/longjmp save the SR and SP's properly.  I don't know
if MWC's do.

============================================
Opinions expressed above do not necessarily	-- Allan Pratt, Atari Corp.
reflect those of Atari Corp. or anyone else.	  ...ames!atari!apratt
Technical Details
Message-ID: <1210@atari.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!portal!atari!apratt
References: <5078@louie.udel.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!portal!atari!apratt
From: apratt@atari.UUCP (Allan Pratt)
Newsgroups: comp.sys.atari.st
Subject: Re: Cntrl-C Exception Handling
Message-ID: <1210@atari.UUCP>
Date: 31 Oct 88 22:45:32 GMT
References: <5078@louie.udel.EDU>
Reply-To: apratt@atari.UUCP (Allan Pratt)
Distribution: na
Organization: Atari (US) Corporation, Sunnyvale, California
Lines: 21