	.mcall	.MODULE
	.MODULE	CTRLC,comment=<Catch ^C>,lib=yes,release=V09,version=05

;**************************************************************;
;                                                              ;
;   Copyright (c) 1988            Bob Schor                    ;
;                                 Eye and Ear Hospital         ;
;                                 230 Lothrop St.              ;
;                                 Pittsburgh, PA   15213       ;
;                                                              ;
; All rights reserved.  May not be copied without this notice. ;
;                                                              ;
;**************************************************************;

;**************************************************************;
;                                                              ;
;   Copyright (c) 1989            Bob Schor                    ;
;                                 Eye and Ear Institute        ;
;                                 203 Lothrop St.              ;
;                                 Pittsburgh, PA   15213       ;
;                                                              ;
; All rights reserved.  May not be copied without this notice. ;
;                                                              ;
;**************************************************************;

;Catch ^C, inhibit abort, as Pascal-callable procedure.

;b schor	october, 1988	After FILSTA v8.10

;modifications --
;	may, 1989	Renamed CTRLC, avoid name conflict with SCCA in SYSLIB
;	may, 1989	Pascal psects, P$CODE and LOCAL, added
;	may, 1989	Psect declarations before SUMAC call

;define our .psects before calling SUMAC to force ours low

	.psect	p$code	ro,i,lcl,rel,con
	.psect	local	rw,d,lcl,rel,con

;uses SUMAC for structured macro code

	.library	/lib:sumac/	;use external macro definition file

	.mcall	SUMAC
	SUMAC

; Uses Oregon Software PASMAC modules for Pascal compatibility.

	.library	/lib:pasmac/	;use Pascal library file

	.mcall	PASMAC
	PASMAC			;defines PASMAC library

; The following macros are included --
; 	PROC	FUNC	PARAM	VAR	SAVE	BEGIN	ENDPR
; In addition, the standard types are defined

	.dsabl	gbl			;if undefined symbol, force error


HEAD	sysmac, <system macros>
	.mcall	.SCCA			;to inhibit ^C

	.sbttl	-----
	.page
	.sbttl	ctrlc
	.sbttl	-----

	.psect	p$code

; The following functions/procedures will be defined by this routine.
; The calling routine should include declarations similar to those in
; this comment.

; PROCEDURE ctrlc (var flag : integer);

; The variable "flag" will serve as a terminal status word.  If bit 15
; is set (flag < 0), two ^C characters have been detected.

PROC	ctrlc
PARAM	flag, address

SAVE	r0

BEGIN
	.SCCA	#emtarg, flag(sp)	;trap ^C
ENDPR

	.sbttl	------------------
	.page
	.sbttl	Internal variables
	.sbttl	------------------

	.psect	local

HEAD	var, <internal variables>
emtarg:	.blkw	10			;emt argument storage
modnam:	.NLCSI				;generates .asciz module string
	.even

	ENDEND

	.end
