2 ; Ullrich von Bassewitz, 2002-12-16
4 ; __sigfunc __fastcall__ signal (int sig, __sigfunc func);
14 ; Default signal functions: The standard specifies explicitly that the values
15 ; for SIG_IGN and SIG_DFL must be distinct, so we make them so by using both
16 ; rts exits we have. This works because signal functions are __fastcall__, so
17 ; we don't have arguments on the stack.
20 ;----------------------------------------------------------------------------
21 ; __sigfunc __fastcall__ signal (int sig, __sigfunc func);
26 stx ptr1+1 ; Remember func
35 ; Signal number is valid. Replace the pointer in the table saving the old
36 ; value temporarily on the stack.
38 asl a ; Prepare for word access
50 ; Get the old value from the stack and return it
58 ; Error entry: We use our knowledge that SIG_ERR is zero here to save a byte