Xref: utzoo comp.sys.amiga.tech:56 comp.sys.amiga:16150 Path: 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 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