.TITLE ASKEOF ; ; .IDENT /Y06.10/ ; ; ; .ENABL LC ; ; ; Copyright (C) Shell Research Ltd. 1982 ; ; ; The copyright in this computer program and associated user ; instructions contained in this document is the property of ; Shell Research Ltd.. No guarantee is given or may be implied ; as to the adequacy of the program or its suitability for any ; particular purpose and no liability is accepted for any loss ; or damage arising out of its use. ; ; ; ; Version: Y06 ; ; ; Original author: R J Carpenter 19-Mar-82 ; ; ; This version: Ray Carpenter 23-Feb-84 ; ; .PAGE .SBTTL DESCRIPTON ; ; ;++ ; This module deals with ^Z input. Under RSX, the normal i.e. default ; condition, is that ^Z is treated as logical end-of-input and the program ; exits. This may not always be acceptable. If the user wants to handle his ; own ^Z input, then he must call the routine ASKSCZ with the ADDRESS of his ; error routine as the second arguement. For more details of ASKSCZ see the ; appropriate code. ; ;-- ; .PAGE .SBTTL MACROS AND DEFINITONS ; ; .PSECT $ASK$ ; .GLOBL ASKERR,EXIT ; .DSABL GBL ; ; .PAGE .SBTTL ASKEOF ; ; ASKEOF:: mov #4,errnum ;assume dieing message movb qctrlz,mflag ;copy action flag to master flag tst $usrtn ;user supplied routine ? beq 10$ ;br if no movb qctrlz,flag ;set initial flag state (same as action flag) mov #flag,arglst+2 ;set up addr. of flag mov #arglst,r5 ;set up our own arguement list call @$usrtn ;call users routine ; ; if user wants we may never get here ; mov flag,mflag ;copy users flag to master flag ; 10$: tst mflag ;see what users wants beq 20$ ;br if kill (flag = 0) bmi 30$ ;br if continue with no message (flag -ve) mov #1,errnum ;set up error number (flag +ve) 20$: mov #errnum,arglst+2 ;set up addr. of error number mov #arglst,r5 ;set arglst in r5 for fortran call askerr ;print error ; 30$: movb #377,qrpt ;assume ask is to repeat the question tst mflag ;dieing ? bne 40$ ;br if no call exit ;call exit to kill task ; 40$: bpl 50$ ;continue and repeat question clrb qrpt ;don't repeat 50$: return ;return to caller ; ; .PAGE .SBTTL LOCAL STORAGE ; ; arglst: .word 1,0 ;fortran arg. list ; mflag: .word 0 ;master flag flag: .word 0 ;return flag from user errnum: .word 0 ;error number ; ; .end