bryce@eris.berkeley.edu (Bryce Nesbitt) (03/17/88)
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