From:	ADVAX::"mcnc!WKUVX1.BITNET!MACRO32" 12-JUN-1991 19:33:43.43
To:	"macro32" <macro32%wkuvx1.bitnet@cunyvm.cuny.edu>
CC:	
Subj:	RE: SHODEF addition...

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Wed, 12 Jun 91 19:30:42 EDT
Received:  from mcnc by ge-dab.GE.COM (5.61/GE-DAB 1.15) with UUCP
	id AA05323 for ; Wed, 12 Jun 91 18:27:14 -0400
Received: from UKCC.uky.edu by mcnc.mcnc.org (5.59/MCNC/3-21-91)
	id AA24253; Wed, 12 Jun 91 14:58:53 -0400
	for ARISIA.DNET.ge.com!EVERHART
Message-Id: <9106121858.AA24253@mcnc.mcnc.org>
Received: from ukcc.uky.edu by UKCC.uky.edu (IBM VM SMTP V2R1)
   with BSMTP id 9262; Wed, 12 Jun 91 14:58:10 EST
Received: from UKCC by ukcc.uky.edu (Mailer R2.07) with BSMTP id 2825; Wed, 12
 Jun 91 14:57:51 EST
Received: from WKUVX1.BITNET by ukcc.uky.edu (Mailer R2.07) with BSMTP id 2772;
 Wed, 12 Jun 91 14:57:04 EST
Received: from CUNYVM.BITNET (MAILER) by WKUVX1 (MX V2.3-1) with BSMTP; Wed, 12
          Jun 1991 13:55:46 CDT
Received: from CUNYVM by CUNYVM.BITNET (Mailer R2.07) with BSMTP id 2434; Wed,
          12 Jun 91 14:53:01 EDT
Received: from nl.nusc.navy.mil by CUNYVM.CUNY.EDU (IBM VM SMTP R1.2.2MX) with
          TCP; Wed, 12 Jun 91 14:52:56 EDT
Date: 12 Jun 91 14:54:00 EST
From: "VIKING::ROLIN" <mcnc!nl.nusc.navy.mil!rolin%viking.decnet>
Reply-To: mcnc!WKUVX1.BITNET!MACRO32
Subject: RE: SHODEF addition...
To: "macro32" <macro32%wkuvx1.bitnet@cunyvm.cuny.edu>
 
>From: "The Silicon Sorcerer ! Use FAGAN@FNAL ONLY" <FAGAN@FNDCD.BITNET>
>
>        You might want to put something in these ast routines to check to
>        see if it's allready been run.   or it WILL do it twice, three
>        times, etc...
 
        I've modified the code which loads the AST into the process allocation
region, so that it checks to see if the Out-of-band AST has already been
enabled.  If it has, the program will exit with a status of:
 
                %SYSTEM-F-VECINUSE, AST vector already enabled
 
        The change was fairly straight forward, the first thing LOAD_CONTROL_D
does now is assign a channel to the terminal.  The channel number is then
used as an index into the Channel Control Block (CCB) table, to find the
CCB for that channel.  The CCB gets us to the UCB where we can check the
field UCB$L_TL_OUTBAND to see if the bit for ^D is set.  If it is set, we
deassign the channel and return error status.  Otherwise, we deassign the
channel and load the code.
 
        I'll send an update to MACROSRV that contains the changes, and also
append the two required changes to the end of this message for anyone that
might be interested.  Thanks for the input,
 
Dave
----
Dave Rolin
Rolin@nusc.nl.navy.mil
 
-------------2 changes follow--------------------------------------------------
Change 1:  Add $CCBDEF, and $TTYUCBDEF to the list of macros invoked from
LIB.MLB, i.e.
                .
                .
                .
                $IODEF
                $SSDEF
                $PSLDEF
                $LNMDEF
                $CCBDEF         ; Add the Channel Control Block symbols
                $TTYUCBDEF      ; Add the terminal specific UCB symbols
                .
                .
Change 2:  Add the following code right after .entry load_control_d,^m<...
 
; Assign a channel, and see if we've already set up this OOB character
 
        $assign_s       devnam=sys_command,chan=channel
        BLBC    R0, BYE
        MOVL    @#CTL$GL_CCBBASE, R2    ; Locate the table of CCBs
        MOVZWL  CHANNEL, R3             ; Stick the offset into the CCB table
                                        ; for this channel into R3
        SUBL2   R3, R2                  ; Point R2 at this channel's CCB
        MOVL    CCB$L_UCB(R2), R3       ; Point R3 at the UCB
 
; now do a bit compare on the outband offset
 
        BBC     #4, -                   ; If the "D" bit (bit 4) is clear
                UCB$L_TL_OUTBAND(R3), - ; in the OUTBAND mask, then we haven't
                NO_PRIOR                ; been here before
 
        $DASSGN_S       CHAN=CHANNEL    ; Deassign the channel
        MOVL    #SS$_VECINUSE, R0       ; Let the caller know that the request
BYE:    RET                             ; to load this again has been denied
 
NO_PRIOR:
        $DASSGN_S       CHAN=CHANNEL    ; Deassign the channel
; End of change, the next line in the original code should be:
; movl  #astlen,r1
 
 
