; ; Exit printing message following call ; erxit: call crlf xra a sta optsav; Reset option to zero for TELL ; " " erxit1: pop d; message pointer mvi a,print call dos call catch; Clear the input ; " " ; Finished, clean up and return to CP/M exit: lda olddrv; Restore the original drive call dskset lda oldusr; Restore the original number call usrset lxi d,tbuf; Reset to default DMA address mvi a,stdma call dos mvi a,close call fileop; Close any file(s) still open lda oldbd mov e,a; Restore parity etc to input value mvi a,sgbaud; harmless if BYERSX not running call dos mvi a,resetsecure call dorsx; remove security lock, fileops done lhld wpmask xchg mvi a,swrtprt; restore entry write protection call dos lhld stack; Get original return address back sphl; Put on the stack pointer ; " " ; Set exit state for return to the appropriate console mode ; We are using the CCP stack, with the CCP ret on TOS call getstatus; get current state mov e,a ani remon; If remote console enabled jnz waitxit; don't go into terminal mode call ilprt db cr,lf,'Returning to terminal mode (CTL-E exits)',cr,lf,0 mov a,e; Shut console off, enable remote for ori conoff+remon; immediate return to console mode call setstatus; set i/o configuration state jmp constat; which triggers the transfer ; Terminal exit will return to CCP