;***********************************************************************
;
;               HANG.M68
;       This SBR will flib the RTS bit on an ADIT IO port so as to
;       allow disconnect of a modem under hardware/software control.
;       To change the length of time the RTS is down, change the #10000
;       in the SLEEP    #10000. line. #10000 = 1 second.
;
;       To call this from within a BASIC program,  XCALL HANG
;
;       Author: Cary Fitch, CARY/AM     12/16/86

       SEARCH  sys
       SEARCH  trm





       OBJNAM  0,0,[SBR]

       JOBIDX                          ; get job pointer in A6
       MOVL    JOBTRM(A6),A5           ; get term pointer in A5
       MOVL    T.IDV(A5),A6            ; get interface driver pointer in A6
       MOVB    #2,D2                   ; we want to flip bit 2
       MOVB    #10.,D4                 ; #10 is ADIT operating system toggle
                                       ; instruction
       CALL    10(A6)                  ; call the ADIT idv operating software
       SLEEP   #10000.                 ; pause for effect to take place
       JOBIDX                          ; see above
       MOVL    JOBTRM(A6),A5           ; see above
       MOVL    T.IDV(A5),A6            ; see above
       CALL    2(A6)                   ; call INIT to reset port from scratch
                                       ; because for some reason, reseting
                                       ; RTS did not work.
       RTN
       END