
Transfer_Display   IDNT                            ; Title of  Cyclic Section

     SECTION  Sect_Transfer_Display,4,C   ; Declare a noncommon code section.
                                          ; Align to Longwords.

***************************************************************************
*                                                                         *
*   Transfer Display  Event by Event Processing        Rev. 18-JAN-1993   *
*                                                                         *
***************************************************************************

***************************************************************************
*                                                                         *
*  Transfer Display section.                                              *
*                                                                         *
*    This routine will display detailed information about the current     *
*      event that is being transfered to Level 2.                         *
*        Absolute time display                                            *
*        Specific Triggers Fired and Sync Bits Display                    *
*        Status of the Vertical Interconnect reads:                       *
*          Absolute time                                                  *
*          CD Pulsers                                                     *
*          Calo Pulsers                                                   *
*          CTEC Modules                                                   *
*                                                                         *
*        Return to the calling routine.                                   *
*                                                                         *
*                                                                         *
*                                                                         *
*  Control of the Trouble Warning Bits                                    *
*                                                                         *
*    This routine has no control of the Trouble Warning Bits.             *
*                                                                         *
*  Control of the State Bits                                              *
*                                                                         *
*    This routine has no control of the State Bits.                       *
*                                                                         *
***************************************************************************


                    ; As a part of this full display about the transfer
                    ; of this event, display the Absolute Time Information.

Begin_Transfer_Display    PEA.L   BlankLine      ; Skip down to the next line.
                          JSR     ChrStrgOut     ; Send out a space, CR, LF.

        PEA.L   BlankLine             ; Skip a line.
        JSR     ChrStrgOut            ; Send out a space, CR, LF.

        Swap     D1                   ; Now put the words back in their
        Swap     D2                   ; original order for display use below.

        PEA.L   ChrYears              ; First display the Years.
        JSR     ChrWrtOut             ; Label the years information.
        ROL.L   #4,D1                 ; Get the 1st char of years into
        Move.L  D1,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.
        ROL.L   #4,D1                 ; Get the 2nd char of years into
        Move.L  D1,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.

        PEA.L   ChrMonth              ; Next display the Months.
        JSR     ChrWrtOut             ; Label the month information.
        ROL.L   #4,D1                 ; Get the 1st char of months into
        Move.L  D1,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.
        ROL.L   #4,D1                 ; Get the 2nd char of months into
        Move.L  D1,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.

        PEA.L   ChrDays               ; Next display the Days.
        JSR     ChrWrtOut             ; Label the days information.
        ROL.L   #4,D1                 ; Get the 1st char of days into
        Move.L  D1,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.
        ROL.L   #4,D1                 ; Get the 2nd char of days into
        Move.L  D1,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.

        PEA.L   BlankLine             ; Skip down to the next line.
        JSR     ChrStrgOut            ; Send out a space, CR, LF.

        PEA.L   ChrHours              ; Next display the Hours.
        JSR     ChrWrtOut             ; Label the hours information.
        ROL.L   #4,D1                 ; Get the 1st char of hours into
        Move.L  D1,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.
        ROL.L   #4,D1                 ; Get the 2nd char of hours into
        Move.L  D1,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.

        PEA.L   ChrMinute             ; Next display the Minutes.
        JSR     ChrWrtOut             ; Label the minute information.
        ROL.L   #4,D2                 ; Get the 1st char of minute into
        Move.L  D2,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.
        ROL.L   #4,D2                 ; Get the 2nd char of minute into
        Move.L  D2,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.

        PEA.L   ChrSecond             ; Next display the Seconds.
        JSR     ChrWrtOut             ; Label the seconds information.
        ROL.L   #4,D2                 ; Get the 1st char of seconds into
        Move.L  D2,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.
        ROL.L   #4,D2                 ; Get the 2nd char of seconds into
        Move.L  D2,-(A7)              ; position and push it on the stack.
        JSR     BinASCII              ; Convert to ASCII and sent it out.


        PEA.L   TransInfo1                  ; The first part of the Transfer
        JSR     ChrWrtOut                   ; Information message.

        MOVE.L  TrgNumStore,D0              ; Recall the 16 bit TAS Number.
        AND.L   Low4Long,D0                 ; Mask off the part of the TAS Num
        Move.L  D0,-(A7)                    ; that is not Transfer Number sync
        JSR     BinASCII                    ; bits.  Push it convert it into
                                            ; ASCII and send it out.

        PEA.L   TransInfo2                  ; The second part of the Transfer
        JSR     ChrWrtOut                   ; Information message

        MOVE.L  TrgsFired,D0                ; Get the Spec Trig's Fired data.

        FOR.L  TransInfo5 = #1 TO #8  DO.S    ; Loop for all 8 characters of
           ROL.L   #4,D0                      ; the Spec Trig Fired.  Rotate
           Move.L  D0,-(A7)                   ; left into position and push.
           JSR     BinASCII                   ; Convert to ASCII and send out.
        ENDF

        PEA.L   TransInfo3                  ; The third and last part of msg.
        JSR     ChrStrgOut                  ; System Call, write data message.


        IF.L  GetTimeError <EQ> #0  THEN.S   ; Display a message to indicate if
           PEA.L  MsgTimeOK                  ; the Time read went OK.   If the
           JSR    ChrStrgOut                 ; flag  GetTimeError  is zero
        ELSE                                 ; then the Time read had no bus
           PEA.L  MsgTimeBad                 ; errors.  If the flag is non-zero
           JSR    ChrStrgOut                 ; then there was a bus error
        ENDI                                 ; during the Absolute Time read.



        IF.L  GetCentPulsEr <NE> #0  THEN.S  ; If neither bus error flag was
           JMP CEPPR                         ; set while reading the Pulser
        ENDI                                 ; Programing Data then send a
                                             ; pulser data OK message.
        IF.L  GetCalPulsErr <NE> #0  THEN.S  ; Check the Central Detector
           JMP CEPPR                         ; flag and then the Calorimeter
        ENDI                                 ; detector flag.
                                             ;
        PEA.L  MsgPulserOK                   ; Pulser programming data
        JSR    ChrStrgOut                    ; read OK message.


CEPPR   IF.L  GetCentPulsEr <NE> #0  THEN.S  ; There was a bus error while
           PEA.L  MsgCentErr                 ; reading Central Detector Pulser
           JSR    ChrStrgOut                 ; Programming Data so send out
        ENDI                                 ; an error message.


        Move.L  GetCalPulsErr,D0             ; Error Flags from reading Calo
        ANDI.L  #1,D0                        ; Pulsers.  Mask all but #1.
        IF.L  D0 <EQ> #1  THEN.S             ; There was a bus error while
           PEA.L  MsgCalEr1                  ; reading North EC Pulsers 0,1
           JSR    ChrStrgOut                 ; Programming Data so send out
        ENDI                                 ; an error message.

        Move.L  GetCalPulsErr,D0             ; Error Flags from reading Calo
        ANDI.L  #2,D0                        ; Pulsers.  Mask all but #2.
        IF.L  D0 <EQ> #2  THEN.S             ; There was a bus error while
           PEA.L  MsgCalEr2                  ; reading Central Calo Pulsers 2,3
           JSR    ChrStrgOut                 ; Programming Data so send out
        ENDI                                 ; an error message.

        Move.L  GetCalPulsErr,D0             ; Error Flags from reading Calo
        ANDI.L  #4,D0                        ; Pulsers.  Mask all but #4.
        IF.L  D0 <EQ> #4  THEN.S             ; There was a bus error while
           PEA.L  MsgCalEr4                  ; reading South EC Pulsers 4,5,6,7
           JSR    ChrStrgOut                 ; Programming Data so send out
        ENDI                                 ; an error message.

        Move.L  GetCalPulsErr,D0             ; Error Flags from reading Calo
        ANDI.L  #8,D0                        ; Pulsers.  Mask all but #8.
        IF.L  D0 <EQ> #8  THEN.S             ; There was a bus error while
           PEA.L  MsgCalEr8                  ; reading Central Calo Pulsers 8,9
           JSR    ChrStrgOut                 ; Programming Data so send out
        ENDI                                 ; an error message.

        Move.L  GetCalPulsErr,D0             ; Error Flags from reading Calo
        ANDI.L  #16,D0                       ; Pulsers.  Mask all but #16.
        IF.L  D0 <EQ> #16  THEN.S            ; There was a bus error while
           PEA.L  MsgCalEr16                 ; reading North EC Pulsers A,B
           JSR    ChrStrgOut                 ; Programming Data so send out
        ENDI                                 ; an error message.

        Move.L  GetCalPulsErr,D0             ; Error Flags from reading Calo
        ANDI.L  #32,D0                       ; Pulsers.  Mask all but #32.
        IF.L  D0 <EQ> #32  THEN.S            ; There was a bus error while
           PEA.L  MsgCalEr32                 ; reading South EC CETEC
           JSR    ChrStrgOut                 ; Programming Data so send out
        ENDI                                 ; an error message.

        Move.L  GetCalPulsErr,D0             ; Error Flags from reading Calo
        ANDI.L  #64,D0                       ; Pulsers.  Mask all but #64.
        IF.L  D0 <EQ> #64  THEN.S            ; There was a bus error while
           PEA.L  MsgCalEr64                 ; reading Central Calo CETEC
           JSR    ChrStrgOut                 ; Programming Data so send out
        ENDI                                 ; an error message.

        Move.L  GetCalPulsErr,D0             ; Error Flags from reading Calo
        ANDI.L  #128,D0                      ; Pulsers.  Mask all but #128.
        IF.L  D0 <EQ> #128  THEN.S           ; There was a bus error while
           PEA.L  MsgCalEr128                ; reading North EC CETEC
           JSR    ChrStrgOut                 ; Programming Data so send out
        ENDI                                 ; an error message.

        Move.L  GetCalPulsErr,D0             ; Error Flags from reading Calo
        ANDI.L  #256,D0                      ; Pulsers.  Mask all but #256.
        IF.L  D0 <EQ> #256  THEN.S           ; There was a bus error while
           PEA.L  MsgICDEr256                ; reading ICD Pulsers C,D
           JSR    ChrStrgOut                 ; Programming Data so send out
        ENDI                                 ; an error message.

        Move.L  GetCalPulsErr,D0             ; Error Flags from reading Calo
        ANDI.L  #512,D0                      ; Pulsers.  Mask all but #512.
        IF.L  D0 <EQ> #512  THEN.S           ; There was a bus error while
           PEA.L  MsgICDEr512                ; reading In-Spill Ped Pulser
           JSR    ChrStrgOut                 ; Programming Data so send out
        ENDI                                 ; an error message.


        PEA.L   DCDFHI                      ; Push Transfer Finished on stack.
        JSR     ChrStrgOut                  ; System Call, write message.

        RTS                                 ; Return to the calling routine.



*************************************************************************
*  Define Constants:                                                    *
*                                                                       *
*  Data used to send messages to the 68k terminal screen.               *
*                                                                       *
*************************************************************************

              ALIGN   4                ; Align to Longword Address.

TransInfo1    DC.B    14,$0D,$0A,'SYNC BITS = '
TransInfo2    DC.B    20,'  SPEC TRIG FIRED = '
TransInfo3    DC.B    2,'  '

              Align 4

TransInfo5    DS.L    1

DCDFHI        DC.B    19,'Transfer Finished',$0D,$0A

MsgTimeOK     DC.B   21,'Absolute Time Read OK'
MsgTimeBad    DC.B   25,'Absolute Time Read Failed'

MsgPulserOK   DC.B   14,'Pulser Read OK'
MsgCentErr    DC.B   25,'Central Pulser Read Error'

MsgCalEr1     DC.B   34,'Error Reading North EC Pulsers 0,1'
MsgCalEr2     DC.B   38,'Error Reading Central Calo Pulsers 2,3'
MsgCalEr4     DC.B   38,'Error Reading South EC Pulsers 4,5,6,7'
MsgCalEr8     DC.B   38,'Error Reading Central Calo Pulsers 8,9'
MsgCalEr16    DC.B   34,'Error Reading North EC Pulsers A,B'
MsgCalEr32    DC.B   28,'Error Reading South EC CETEC'
MsgCalEr64    DC.B   32,'Error Reading Central Calo CETEC'
MsgCalEr128   DC.B   28,'Error Reading North EC CETEC'
MsgICDEr256   DC.B   29,'Error Reading ICD Pulsers C,D'
MsgICDEr512   DC.B   38,'Error Reading In-Spill Pedestal Pulser'

BlankLine        DC.B    1,' '
ChrYears         DC.B    5,'Year '
ChrMonth         DC.B   10,'    Month '
ChrDays          DC.B   10,'      Day '
ChrHours         DC.B    5,'Hour '
ChrMinute        DC.B   10,'   Minute '
ChrSecond        DC.B   10,'   Second '


*************************************************************************
*  Define Constants:                 External References                *
*                                                                       *
*************************************************************************

       XDEF   Begin_Transfer_Display                ; Export this symbol
                                                    ; to other modules.

       XREF   BinASCII                              ; Symbols referenced
       XREF   ChrsTrgOut                            ; in this program
       XREF   ChrWrtOut                             ; module but defined
       XREF   GetCalPulserr                         ; in another module
       XREF   GetCentPulser                         ; Main_Symbols.Include
       XREF   GetTimeError
       XREF   Low4Long
       XREF   TrgNumStore
       XREF   TrgsFired


       END

