.title sys_trap_controlc .ident "X1-001" ;+ ; Version: X1-001 ; ; Facility: System routines. ; ; Abstract: Enable control/c trapping on TT:. ; ; Environment: User mode. ; ; History: ; ; 11-Jul-1994, DBS, Version X1-001 ; 001 - Original version. ;- ;++ ; Functional Description: ; This routine will enable control/c trapping on TT: and setup the ; ast routine specified as the routine to invoke when control/c is ; typed. ; ; Calling Sequence: ; call sys_trap_controlc (%ref(ast_routine), %ref(iosb)) ; ; Formal Argument(s): ; astadr.rl.r Address of the AST routine to be invoked when a ; control/c is typed. ; iosb.wq.r The address of a quadword to receive the iosb from ; the $qio calls. ; ; Implicit Inputs: ; None ; ; Implicit Outputs: ; None ; ; Completion Codes: ; ss$_normal Successful completion. ; ss$_insfarg Insufficient arguments supplied. ; ss$_ovrmaxarg Too many arguments supplied. ; Any other completion code returned by $assign or $qio. ; ; Side Effects: ; None ;-- .library "SYS$LIBRARY:LIB.MLB" .library "SYS$LIBRARY:STARLET.MLB" .library "DBSLIBRARY:SYS_MACROS.MLB" .link "SYS$SYSTEM:SYS.STB" /selective_search .disable global $iodef $ssdef def_psect _sys_data, type=DATA, alignment=LONG def_psect _sys_code, type=CODE, alignment=LONG set_psect _sys_data arg_count = 2 ; MUST have 2 parameters astadr = 4 ; offsets to arguments iosb = 8 tt: .ascid "TT:" ; always use TT tt_channel: .long 0 ; for the $assigned channel controlc = 3 reset_psect set_psect _sys_code .entry - sys_trap_controlc, ^m<> movl #ss$_insfarg, r0 ; be cynical... cmpb (ap), #arg_count ; check the number of arguments beql 20$ ; ok, so carry on bgtru 10$ ; too many brw exit ; too few, so bail out 10$: movl #ss$_ovrmaxarg, r0 ; too many, let them know brw exit ; and bail out 20$: $assign_s - devnam=tt, - chan=tt_channel blbc r0, exit $qiow_s chan=tt_channel, - func=#, - iosb=@iosb(ap), - p1=@astadr(ap) exit: ret .end