.TITLE VSexit Alvin Exit .Psect VSEXIT,Gbl,Con .Ident /LVL51C/ .GLOBL VSEXIT ; Internal entry points. .Globl TSXLead, RTTCC ; Setup now by AlvEna when console enabled. .GLOBL GETYN, CMDCANCEL, ALVEXIT .Globl Send, AlvUpdate, Crlf .MCALL .SERR,.EXIT,.SRESET,.WAIT,.SCCA,.Print,.Dstat,.Gval .MCALL $RESTORE,$RTDEF,$SAVE,$LIST,$IFTSX, $GetYN .MCALL $ALVIN $RTDEF $ALVIN ;;********************************************************************** ;; Alvin Exit command handler. Checks that the user wishs to exit ;; and reverts all Alvin controlled devices to their state prior to ;; this invocation of ALVIN. ;; VSEXIT:: $SAVE ;SAVE THE REGISTERS. 1$: $GetYN ,DoExit,Exiterror,Exiterror DoExit: ;YES, OK TO EXIT Jsr Pc,Crlf ;Go to a new line. EXITList: Mov #ExitRT,R4 ;Default return message for RT. Tst TSXLead ;Did we enter from TSX-Plus? Bpl ExitMSG ;No, branch Mov #ExitTSX,R4 ;Return message for TSX-Plus. ExitMSG: Jsr R5,Send ;Use Alvin to List a string .Word List!String ;Using the logical list device number (typ=1) .Word 0 ;Say "Returning to the ----- monitor..." Br EXITList ;Loop until message starts Mov R0,R2 ;Save the device descriptor address. ;; ListWait: Jsr Pc,AlvUPD ;Make sure final Output gets to RT Bit #Complete,(R2) ;CHECK FOR I/O COMPLETION AT THE CONSOLE. Beq LISTwait ;BRANCH UNTIL OPERATION IS COMPLETE. JSR PC,ALVEXIT ;REVERT ALL ALVIN DEVICES TO STATE ; PREVIOUS TO ALVIN INITIALIZATION. CLR R0 ;EXIT WITH R0 ZERO TO RESET ENVIRONMENT .EXIT ;EXIT to the RT-11 monitor. EXITERROR: JSR PC,CMDCANCEL ;'COMMAND CANCELED' $RESTORE RTS PC ;RETURN. ;;**************************************************************************** ;; HICHAN: .WORD 14. ;NUMBER OF I/O CHANNELS. CHANL: .WORD 0 ;TEMPORARY STORAGE FOR THE CHANNEL NUMBER. EMTWORK: .Word 0,0,0,0,0,0 ;Working location for EMT's. ;;**************************************************************************** ;; EXITRT: .Word RTRET ;String descriptor "Returning to RT ..." .Word RTRETEND EXITTSX: .Word TSXret ;String descriptor "Returning to TSX ..." .Word TSXREnd RTRET: .Ascii 'Returning to the RT-11 monitor. ' RTREtend=.-1 TSXRET: .Ascii 'Returning to the TSX-Plus monitor. ' TSXREnd=.-1 .EVEN ;;*********************************** .END