Article View: comp.sys.amiga.tech
Article #8303Re: CTRL-C with assembler
From: Bryce Nesbitt
Date: Wed, 16 Mar 1988 20:37
Date: Wed, 16 Mar 1988 20:37
30 lines
1515 bytes
1515 bytes
In article <> bjc@pollux.UUCP (Betty J. Clay) writes:
>
>Checking for CTRL-C is easy in BASIC, and C does it for us, but I cannot
>find a way to check for it using assembler. Can someone help, please?
#include "libraries/dos.i"
....
moveq #0,d0 ;Set specified signal to zero
move.l #SIGBREAKF_CTRL_C,d1 ;Choose just the CTRL_C signal
move.l 4,a6 ;Get ExecBase
jsr _LVOSetSignal(a6)
btst.l #SIGBREAKB_CTRL_C,d0 ;See if signal was set
bne.s Control_C_hit
....
;SIGBREAKF is the 32 bit number with just the proper bit set.
;SIGBREAKB is the actual bit number (0 to 31).
Don't bother trying to get an interrupt out of this. Too much work,
too may obscure traps.
[Because the question was asked in comp.sys.amiga, I'm coss-posting there]
[I hope we get less and less of this type of question in .amiga, and move]
[it all over to .tech]
|\_/| . ACK!, NAK!, EOT!, SOH!
{O_o} . Bryce Nesbitt
(") BIX: mleeds (temporarily)
U USENET: bryce@eris.berkeley.EDU -or- ucbvax!eris!bryce
Technical Details
Message-ID:
<7742@agate.BERKELEY.EDU>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!pasteur!agate!eris.berkeley.edu!bryceShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!pasteur!agate!eris.berkeley.edu!bryce From: bryce@eris.berkeley.edu (Bryce Nesbitt) Newsgroups: comp.sys.amiga.tech,comp.sys.amiga Subject: Re: CTRL-C with assembler Message-ID: <7742@agate.BERKELEY.EDU> Date: 16 Mar 88 20:37:39 GMT Sender: usenet@agate.BERKELEY.EDU Reply-To: bryce@eris.berkeley.edu (Bryce Nesbitt) Followup-To: comp.sys.amiga.tech Organization: University of California, Berkeley Lines: 30