
Initialize_Hard_Soft    IDNT                  ; Title of  Initialize Hardware
                                              ; and Software

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

***************************************************************************
*                                                                         *
*   Initialize Hardware and Software                Rev.   23-APRIL-1991  *
***************************************************************************

***************************************************************************
*                                                                         *
*    Address Map of the Level 1 Trigger VME Crate (133A's view)           *
*                                                                         *
*        0000 0000  through  000F FFFF     133A Module Memory             *
*        0030 0000  through  0030 7FFF     VME 214 Module for Trig Block  *
*        0038 0000  through  003F FFFF     VBD Buffer Memory              *
*                                                                         *
*        FFFF 9000  through  FFFF 97FF     Short 214 IO Space Memory      *
*        FFFF A000  through  FFFF BFFF     VBD Control Memory             *
*        FFFF C000  through  FFFF C0FF     Crate ID Register Card         *
*        FFFF F000  through  FFFF F00F     Ironics 1623 Digital IO Card   *
*                            FFFF ????     Vertical Interconnect Reg.     *
*                                                                         *
*                                                                         *
*  The following is a list of the memory locations that will be used in   *
*  the VME-214 Memory module.   Recall that this module lives in VME      *
*  addresses $00300000  through  $00307FFF.                               *
*                                                                         *
*      VME Address Range                     Contents                     *
*  ---------------------------      --------------------------------      *
*  $00300000 through $00300FFF       Current Beam Crossing Data           *
*  $00301000 through $00301FFF       Previous Beam Crossing Data          *
*                                                                         *
*  $00301FB8 through $00302          Specific Trigger Programming vs      *
*                                    Ref Sets and Spec Trigs Fired Data.  *
*                                                                         *
*  $00304000 through $003040FF       Central Detector Pulser Data         *
*  $00304100 through $003041FF       Calorimeter Pulser Data              *
*  $00304400 through $003047FF       CAMAC Data                           *
*                                                                         *
*  $00305000 through $0030501F       Crate Header data 5 longwords        *
*                                                                         *
*  $00306000 through $003069FF       The VBD reads the Current Beam       *
*                                    Crossing CTFE Data from here.        *
*  $00307000 through $003079FF       The VBD reads the Previous Beam      *
*                                    Crossing CTFE Data from here.        *
*                                                                         *
*  $00306B00 through $00306C03       EM Et Jet List stored here           *
*                                    for the VBD to read.                 *
*  $00306D00 through $00306E03       Total Et Jet List stored here        *
*                                    for the VBD to read.                 *
*                                                                         *
*                                                                         *
*         List of VBD DMA sections used to build the data block           *
*                                                                         *
*  Length in Bytes    VME Starting                                        *
*  Decimal    Hex      Address Hex            Contents                    *
*  ---------------    ------------    ---------------------------------   *
*    1064    $428        $300004      Current Framework, Cal Trig Final   *
*                                     Sums, L0 Vertex, and L1.5  data     *
*                                                                         *
*    2560    $A00        $306000      Current Cal Trig EM Et and HD Et    *
*                                                                         *
*    1064    $428        $301004      Previous Framework, Cal Trg Final   *
*                                     Sums, L0 Vertex, and L1.5  data     *
*                                                                         *
*    2560    $A00        $307000      Previous Cal Trig EM Et and HD Et   *
*                                                                         *
*     260    $104        $306B00      EM Jet List                         *
*                                                                         *
*     260    $104        $306D00      Total Et Jet List                   *
*                                                                         *
*    1280    $500        $300830      Mask of Jet Patterns  "Jet Mask"    *
*                                                                         *
*     640    $280        $301E74      TRD Hot Tower Table Information     *
*                                                                         *
*     100     $64        $301FB8      Specific Trigger Programming Infrm  *
*                                                                         *
*     512    $200        $304000      Pulser Programming Data, 3 groups   *
*                                     of 64 longwords each, transported   *
*                                     by but not part of the L1 Trigger   *
*                                     Data Block.                         *
*                                                                         *
*     256    $100        $304400      CAMAC Data about less then 100      *
*                                     longwords.  Transported by but not  *
*                                     part of the L1 Trigger Data Block.  *
***************************************************************************

***************************************************************************
*                                                                         *
*     Initialize all of the MVME-214 Memory to all zeros (32k bytes).     *
*     Initialize the section of the MVME-214 Memory where the VBD         *
*        reads the EM and HD Et to the zero energy FADC responce ($08).   *
*     Initialize all of the SHORT IO 214 Memory to all zeros (2k bytes).  *
*     Initialize the Ironics I/O registers.                               *
*        Slave Ready to HIGH, Data Cable Driver Finished to LOW.          *
*     Initialize the VBD.                                                 *
*        Un-Lock the CSR block load DMA time-out.                         *
*        Load the Crate Type.                                             *
*        Load the Event Number Address.                                   *
*        Load the Crate ID Address.                                       *
*        Load the D Control Register, the format for data reads.          *
*        Load the P Control Reg., the format for parameter reads.         *
*        Load the I/O Address high order bits.                            *
*     Load the VBD withthe  pointer list to the Word Counts.              *
*     Load the Word Counts into their Short IO storage locations.         *
*     Load the VBD with the list of data block Base Addresses.            *
*     Initialize the VBD (continued).                                     *
*        Reset the VBD (make these parameters active).                    *
*        Lock the VBD parameters and load DMA time-out.                   *
*     Build words #2, #3, and #4 of the Crate Header and Display          *
*       the Crate ID, the Version Number and the Rivision Numbers.        *
*     Initialize the VBD Buffer Select Counter to VBD Buffer 0.           *
*     Clear any old COMINT Slave Ready requests by pulsing the            *
*        Data Cable Driver signal line high and then low twice.           *
*     Display an Initialization Complete message.                         *
*                                                                         *
***************************************************************************

*************************************************************************
*  This sections calls all of the include files.                        *
*                                                                       *
*  68020_EQUATES.INC defines macros to be used to call MVME133ABUG ROM. *
*************************************************************************

       INCLUDE  68020_EQUATES.INC        ; Get the MVME133A BUG ROM Calls.

       INCLUDE  VBD_Version_Number.SRC   ; Get the Version Number data.

       INCLUDE  VBD_Revision_Number.SRC  ; Get the Revision Number data.


*************************************************************************
*       This section defines program-specific macros:                   *
*                                                                       *
*            WRIO:  Write bit(s) to the IRONICS I/O card                *
*            SOFTWAIT:  Software delay timer for short waits            *
*                                                                       *
*************************************************************************

WRIO    MACRO                                 ; write byte to I/O port.
        NOT.B   \1                            ; complement input.
        MOVE.B  \1,\2                         ; and send to port.
        ENDM

SOFTWAIT   MACRO                              ; Software timer loop.
           LOCAL    WAITMORE                  ; Define a local symbol.
           MOVE.L   \1,D4                     ; Load delay time into D4.
WAITMORE   SUBI.L   #1,D4                     ; Decrement loop counter.
           BNE      WAITMORE                  ; Test for end of delay.
           ENDM                               ; Called with an argument
                  ; of $1000 and with cashe off causes a delay of about 4
                  ; mill seconds, with cashe on the delay is 2.4 mill sec.


*************************************************************************
*                                                                       *
*  Initialize all of the MVME-214  VMX-VME Memory to be all zeros.      *
*                                                                       *
*************************************************************************

Begin_Initialize_Hard_Soft   NOP           ; Initialize Hard Soft Entry Point

         MOVEA.L   #TrgBuffer,A0

         FOR.L   D7 = #TrgBuffer TO #TrgBuffer+$7FFC BY #4   DO.S
            CLR.L   (A0)+
         ENDF                     ; Clear the MVME-214 VMX-VME Memory Module.

*************************************************************************
*                                                                       *
*  Initialize the sections of the MVME-214  VMX-VME Memory  where the   *
*  the VBD reads the current and previous CTFE EM and HD Et data to     *
*  indicate all zero energy readings.                                   *
*                                                                       *
*************************************************************************

         MOVEA.L   #BADEMP,A0                  ; $08  is the zero energy
         MOVEA.L   #BADEMP+$1000,A1            ; responce form a CTFE ADC.
                                               ; Load $08 into all locations
         FOR.L   D7 = #1 TO #640   DO.S        ; where the VBD reads CTFE
            MOVE.L  #$08080808,(A0)+           ; EM and HD energy data;
            MOVE.L  #$08080808,(A1)+           ; Current and Previous.
         ENDF

*************************************************************************
*                                                                       *
*  Initialize all of the SHORT-214  Short I/O Memory to be all zeros.   *
*                                                                       *
*************************************************************************

    MOVEA.L   #IOMemBase+$FFFF0000,A0

    FOR.L  D7 = #IOMemBase+$FFFF0000 TO #IOMemBase+$FFFF07FE BY #2   DO.S
       CLR.W   (A0)+
    ENDF                                 ; Clear the SHORT-214 Memory Module.

*************************************************************************
*                                                                       *
*  Initialize the IRONICS card Slave Ready HI and DCDr Finished LOW.    *
*                                                                       *
*************************************************************************

        MOVE.B  #Bit1High,D0                  ; initialize Slave Ready.
        WRIO    D0,SlvRdy                     ; to 01    HI.

        MOVE.B  #AllBitsLow,D0                ; initialize DCDr Finished.
        WRIO    D0,DCDrFin                    ; to 00   LOW.

*************************************************************************
*                                                                       *
*  Initialize all of the Trouble Warning Bits to indicate no trouble    *
*  and send them out their Ironics Port.                                *
*************************************************************************

        CLR.L   TWBData                    ; Initialize the Trouble Warning
        MOVE.B  TWBData,D0                 ; Bits to all indicate no trouble
        WRIO    D0,TWBPortAdrs             ; and send them out the port.

*************************************************************************
*                                                                       *
*  Initialize the VBD Control Registers.                                *
*                                                                       *
*************************************************************************

        MOVE.W  VBDDMATO,VBDCSR0          ; Load the VBD DMA time-out value.
        MOVE.W  CrateType,CrateTypeReg    ; Load the VBD Crate Type Register.
        MOVE.W  #EvtNmbAdr,EvtNmbAdrReg   ; Load pointer to the Event Number.
        MOVE.W  CrateIDAdrs,CrtIDAdrReg   ; Load the pointer to the Crate ID.
        MOVE.W  DCtrlData,DControlReg     ; Load data read format ctrl reg.
        MOVE.W  PCtrlData,PControlReg     ; Load param read format ctrl reg.
        MOVE.W  IOUPAdrs,IOUPAdrsReg      ; Load upper adrs bits for IO reads.

*************************************************************************
*                                                                       *
*  Load the VBD with the list of the addresses of Word Count storage    *
*  locations in the Short IO Memory module  (i.e. the Word Counter      *
*  Pointer List).  A null terminates the list.                          *
*                                                                       *
*************************************************************************

        MOVE.L  #WCPntList,A3         ; Load address of the start of the.
                                      ; VBD Word CNT Pointer list into A3.

        MOVE.W  #WCStore1,(A3)+     ; Load the pointer to the Header WC.
        MOVE.W  #WCStore2,(A3)+     ; Load pointer to Current Framework WC.
        MOVE.W  #WCStore3,(A3)+     ; Load pointer to Current Cal Trig WC.
        MOVE.W  #WCStore4,(A3)+     ; Load pointer to Previous Framework WC.
        MOVE.W  #WCStore5,(A3)+     ; Load pointer to Previous Cal Trig WC.
        MOVE.W  #WCStore6,(A3)+     ; Load pointer to EM Jet List Word Cnt.
        MOVE.W  #WCStore7,(A3)+     ; Load pointer to Total Et Jet List WC.
        MOVE.W  #WCStore8,(A3)+     ; Load pointer to CHTCR Jet Masks WC.
        MOVE.W  #WCStore9,(A3)+     ; Load pointer to TRD Hot Tower Data WC.
        MOVE.W  #WCStore10,(A3)+    ; Load pointer to Spec Trig Prog Data WC.
        MOVE.W  #WCStore11,(A3)+    ; Load pointer to Pulser Progrming Data WC.
        MOVE.W  #WCStore12,(A3)+    ; Load pointer to CAMAC Data Word Count.

        MOVE.W  #0000,(A3)+           ; Load a null to terminate
                                      ;     the WC list.
        MOVE.W  #0000,(A3)+           ; Load a null to terminate
                                      ;     the WC list.

*************************************************************************
*                                                                       *
*  Load the Word Counts into their storage locations in the Short IO    *
*  Address space Memory module  i.e. the Short 214.   The VBD will      *
*  read them from here during the DMA cycles.                           *
*                                                                       *
*************************************************************************

   MOVEA.L  #$FFFF0000+WCStore1,A3  ; Short IO Adrs for WC storage location 1.
   MOVE.W   WCHeader,(A3)           ; Store the Header Word Count in it.

   MOVEA.L  #$FFFF0000+WCStore2,A3  ; Short IO Adrs for WC storage location 2.
   MOVE.W   WCCurFrWk,(A3)          ; Store the Current FrmWrk Word Cnt in it.

   MOVEA.L  #$FFFF0000+WCStore3,A3  ; Short IO Adrs for WC storage location 3.
   MOVE.W   WCCurCalT,(A3)          ; Store the Current Cal Trg Word Cnt in it.

   MOVEA.L  #$FFFF0000+WCStore4,A3  ; Short IO Adrs for WC storage location 4.
   MOVE.W   WCPrvFrWk,(A3)          ; Store the Prev FrameWork Word Count in it.

   MOVEA.L  #$FFFF0000+WCStore5,A3  ; Short IO Adrs for WC storage location 5.
   MOVE.W   WCPrvCalT,(A3)          ; Store the Prev Cal Trg Word Count in it.

   MOVEA.L  #$FFFF0000+WCStore6,A3  ; Short IO Adrs for WC storage location 6.
   MOVE.W   WCEMJetL,(A3)           ; Store the EM Jet List Word Count in it.

   MOVEA.L  #$FFFF0000+WCStore7,A3  ; Short IO Adrs for WC storage location 7.
   MOVE.W   WCTEtJetL,(A3)          ; Store the Tot Et Jet List Word Cnt in it.

   MOVEA.L  #$FFFF0000+WCStore8,A3  ; Short IO Adrs for WC storage location 8.
   MOVE.W   WCJetMask,(A3)          ; Store the Jet Mask Word Count in it.

   MOVEA.L  #$FFFF0000+WCStore9,A3  ; Short IO Adrs for WC storage location 9.
   MOVE.W   WCTRDHotT,(A3)          ; Store the Hot Tower Table Word Cnt in it.

   MOVEA.L  #$FFFF0000+WCStore10,A3  ;Short IO Adrs for WC storage location 10.
   MOVE.W   WCSpTrPrg,(A3)           ;Store Spec Trg Programing Word Cnt in it.

   MOVEA.L  #$FFFF0000+WCStore11,A3  ;Short IO Adrs for WC storage location 11.
   MOVE.W   WCPulser,(A3)            ;Store the Pulser Data Word Count in it.

   MOVEA.L  #$FFFF0000+WCStore12,A3  ;Short IO Adrs for WC storage location 12.
   MOVE.W   WCCAMAC,(A3)             ;Store the CAMAC Data Word Count in it.


*************************************************************************
*                                                                       *
*  Load the VBD with the list of the data block Base Addresses.         *
*  These are the Base Addresses where the VBD will start to read        *
*  during the DMA cycles.                                               *
*                                                                       *
*************************************************************************

        MOVEA.L  #DataPntList,A3        ; Load address of the start of the
                                        ;    VBD Data Pointer list into A3.

        MOVE.L  BAHeader,(A3)+          ; Load Base Adrs of Crate Header.

        MOVE.L  BACurFrWk,(A3)+         ; Load Base Adrs of Current Framework.
        MOVE.L  BACurCalT,(A3)+         ; Load Base Adrs of Current Cal Trig.
        MOVE.L  BAPrvFrWk,(A3)+         ; Load Base Adrs of Prev Trg Framewrk.
        MOVE.L  BAPrvCalT,(A3)+         ; Load Base Adrs of Prev Calor Trig.

        MOVE.L  BAEMJetL,(A3)+          ; Load Base Adrs of the EM Jet List.
        MOVE.L  BATEtJetL,(A3)+         ; Load Base Adrs of Total Et Jet List.

        MOVE.L  BAJetMask,(A3)+         ; Load Base Adrs of the Jet Mask.
        MOVE.L  BATRDHotT,(A3)+         ; Load Base Adrs of TRD Hot Tower Tbl.
        MOVE.L  BASpTrPrg,(A3)+         ; Load Base Adrs of Spec Trg Progming.

        MOVE.L  BAPulser,(A3)+          ; Load Base Adrs of Pulser data.
        MOVE.L  BACAMAC,(A3)+           ; Load Base Adrs of CAMAC data.

*************************************************************************
*                                                                       *
*  Lock the VBD Control Memory.                                         *
*                                                                       *
*************************************************************************

        MOVE.W  VBDReset,VBDCSR0          ; Reset the VBD and its err FIFO.

        SOFTWAIT  #$1000                  ; Wait a few mill seconds.

        MOVE.W  VBDToLock,VBDCSR0         ; Load the VBD DMA time-out value
                                          ; and lock the VBD Control Memory.

*****************************************************************************
*                                                                           *
*  Build words #2, #3 and #4 of the Crate Header.                           *
*  These Crate Header words are event to event static.   Words #1           *
*  and #5 are built for each event during the transfer to the VBD.          *
*                                                                           *
*    Crate Header Word 1   Sync Word   2 MSByts Evt Num  2 LSByts of F's    *
*    Crate Header Word 2   Controller Word  MSByte is the low byte Crate ID *
*    Crate Header Word 3   Version Number  4-JAN-1990 Document definition   *
*    Crate Header Word 4   Revision Number   defined in D0 Note #967        *
*    Crate Header Word 5   Specific Triggers Fired list    32 bits          *
*                                                                           *
*  Display these words on the 68k console as they are being built. This     *
*  display is part of the initialization message.                           *
*                                                                           *
*  Version Number information for making Crate Header Word #3 is obtained   *
*  from the VBD_VERSION_NUMBER.SRC include file which is called above.      *
*                                                                           *
*  Revision Number information for making Crate Header Word #4 is obtained  *
*  from the VBD_REVISION_NUMBER.SRC include file which is called above.     *
*                                                                           *
*****************************************************************************

        CLR.L   D0                       ; Clear D0 it will receive Crate ID.
        MOVE.L  #DataStack,A5            ; Data Stack for console display.

        MOVE.L  #$FFFF0000,A3            ; Make the 133A version of the Short
        MOVE.W  CrateIDAdrs,A3           ; IO Address for the Crate ID card.
        MOVE.W  (A3),D0                  ; Load the Crate ID into Data Reg 0.

        MOVE.L  D0,(A5)+                 ; Store Crate ID as read from Shea's
                                         ; brd on the data stack for display.

        ANDI.L  #$000000FF,D0            ; Mask off all but Low byte of Crt ID
        SWAP    D0                       ; Move the low byte of the Crate ID
        LSL.L   #$8,D0                   ; into the top byte of data reg D0.
        MOVE.L  D0,CrtHDWord2            ; Store the Controller word as the
                                         ;   second word of the Crate Header.

        MOVE.L  D0,(A5)+                 ; Store the Controller word on the
                                         ;   data stack for display.
        PEA.L   DataStack                ; Push the pointer for the data stack.
        PEA.L   DispCrate                ; Push the Crate ID message format.
        SYSCALL .WRITDLN                 ; Call the system to output message.


        MOVE.L  VersNum,CrtHDWord3       ; Store the Version Number in the
                                         ;   3rd word of the Crate Header.

        MOVE.L  #DataStack,A5            ; Data Stack for console display.
        MOVE.L  VersNum,(A5)+            ; Store the Version Number on the
                                         ;   data stack for display.
        PEA.L   DataStack                ; Push the pointer for the data stack.
        PEA.L   DisVerNum                ; Push Version Number message format.
        SYSCALL .WRITDLN                 ; Call the system to output message.


        CLR.L   D0                       ; Clear Data Register D0.
        MOVE.B  VMECPURevNum,D0          ; Load the VME CPU Revision Number.
        LSL.L   #$8,D0                   ; SHIFT it to the left 8 places
        MOVE.B  COMINTPROMRN,D0          ; Load the COMINT PROM Revision Num.
        LSL.L   #$8,D0                   ; SHIFT it to the left 8 places
        MOVE.B  LookUpRevNum,D0          ; Load the Look Up System Rev. Num.
        LSL.L   #$8,D0                   ; SHIFT it to the left 8 places
        MOVE.B  HardWRRevNum,D0          ; Load the Trigger Hardware Rev. Num.

        MOVE.L  D0,CrtHDWord4            ; Store the Revision Number in the
                                         ;   4th word of the Crate Header.

        MOVE.L  #DataStack,A5            ; Data Stack for console display.
        MOVE.L  D0,(A5)+                 ; Store the Crate Header 4th word
                                         ;   (Rev. Num.) on display data stack.
        PEA.L   DataStack                ; Push the pointer for the data stack.
        PEA.L   DisRevNo1                ; Push Revision Number message 1 form.
        SYSCALL .WRITDLN                 ; Call the system to output message.

        MOVE.L  #DataStack,A5            ; Data Stack for console display.
        CLR.L   D0                       ; Clear data register 0.
        MOVE.B  VMECPURevNum,D0          ; Load VME CPU Program Revision Num.
        MOVE.L  D0,(A5)+                 ; Store the VME CPU Program Revision
                                         ;   Number on the display data stack.
        CLR.L   D0                       ; Clear data register 0.
        MOVE.B  COMINTPROMRN,D0          ; Load COMINT PROM Revision Num.
        MOVE.L  D0,(A5)+                 ; Store the COMINT PROM Revision
                                         ;   Number on the display data stack.
        PEA.L   DataStack                ; Push the pointer for the data stack.
        PEA.L   DisRevNo2                ; Push Revision Number message 2 form.
        SYSCALL .WRITDLN                 ; Call the system to output message.

        MOVE.L  #DataStack,A5            ; Data Stack for console display.
        CLR.L   D0                       ; Clear data register 0.
        MOVE.B  LookUpRevNum,D0          ; Load Look Up System Revision Num.
        MOVE.L  D0,(A5)+                 ; Store the Look Up System Revision
                                         ;   Number on the display data stack.
        CLR.L   D0                       ; Clear data register 0.
        MOVE.B  HardWRRevNum,D0          ; Load Trigger Hardware Revision Num.
        MOVE.L  D0,(A5)+                 ; Store the Trigger Hardware Revision
                                         ;   Number on the display data stack.
        PEA.L   DataStack                ; Push the pointer for the data stack.
        PEA.L   DisRevNo3                ; Push Revision Number message 3 form.
        SYSCALL .WRITDLN                 ; Call the system to output message.

*************************************************************************
*                                                                       *
*  Set the Buffer Select to pick buffer 0.                              *
*                                                                       *
*************************************************************************

        CLR.L   BufSelect     ; Set Buffer Select for VBD buffer 0.

*************************************************************************
*                                                                       *
*  Clear any old COMINT Slave Ready requests by pulsing the Data Cable  *
*  Driver Finished line high and low and high and low.                  *
*                                                                       *
*************************************************************************

        MOVE.B  #Bit1High,D0                  ; Send a Data Cable Driver
        WRIO    D0,DCDrFin                    ;   Finished signal to COMINT.

        SOFTWAIT  #$1000                      ; Wait about 5 mill seconds.

        MOVE.B  #AllBitsLow,D0                ; Drop the Data Cable Driver
        WRIO    D0,DCDrFin                    ;   Finished signal.

        SOFTWAIT  #$1000                      ; Wait about 5 mill seconds.

        MOVE.B  #Bit1High,D0                  ; Send a Data Cable Driver
        WRIO    D0,DCDrFin                    ;   Finished signal to COMINT.

        SOFTWAIT  #$1000                      ; Wait about 5 mill seconds.

        MOVE.B  #AllBitsLow,D0                ; Drop the Data Cable Driver
        WRIO    D0,DCDrFin                    ;   Finished signal.

*************************************************************************
*                                                                       *
*  Send the Initialization Complete Message to the 68k terminal.        *
*                                                                       *
*************************************************************************

        PEA.L    InitCmpt1                 ; push message address on stack.
        SYSCALL  .WRITELN                  ; and send it out.
        PEA.L    InitCmpt2                 ; push message address on stack.
        SYSCALL  .WRITELN                  ; and send it out.

        RTS


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

              ALIGN   4                ; Align to longword address.

DataStack     DCB.L   8,$00000000      ; data stack for Write Line call

DispCrate  DC.B  44,'Crate ID = |10,8|   Controller Word = |10,8|'
DisVerNum  DC.B  56,'Version Number of the Trigger Data Block Format = |10,8|'
DisRevNo1  DC.B  53,'Revision Number in the Crate Header 4th word = |10,8|'
DisRevNo2  DC.B  57,'VME CPU Program Rev = |10,8Z|  COMINT PROMs Rev = |10,8Z|'
DisRevNo3  DC.B  57,'Look Up Sys Rev = |10,8Z|  Trigger Hardware Rev = |10,8Z|'

InitCmpt1     DC.B    30,'Finished the initialization of'
InitCmpt2     DC.B    36,'the VBD, COMINT, and IRONICS modules'


*************************************************************************
*                                                                       *
*  Constants Section for Initialize Hardware and Software               *
*                                                                       *
*************************************************************************

      XDEF   Begin_Initialize_Hard_Soft              ; Symbol exported to
                                                     ; other modules.

      XREF   TrgBuffer,BADEMP,IOMemBase,Bit1High     ; Symbols used in this
      XREF   SlvRdy,AllBitsLow,DCDrFin               ; module but defined in
                                                     ; another program module
      XREF   VBDDMATO,VBDCSR0                        ; Main_symbols.Include
      XREF   VBDReset,VBDToLock

      XREF   CrateType,CrateTypeReg
      XREF   EvtNmbAdr,EvtNmbAdrReg
      XREF   CrateIDAdrs,CrtIDAdrReg,DCtrlData,DControlReg
      XREF   PCtrlData,PControlReg,IOUPAdrs,IOUPAdrsReg

      XREF   WCPntList,WCStore1,WCStore2,WCStore3
      XREF   WCStore4,WCStore5,WCStore6,WCStore7
      XREF   WCStore8,WCStore9,WCStore10,WCStore11,WCStore12

      XREF   WCHeader,WCCurFrWk,WCCurCalT,WCPrvFrWk
      XREF   WCPrvCalT,WCEMJetL,WCTEtJetL,WCJetMask
      XREF   WCTRDHotT,WCSpTrPrg,WCPulser,WCCAMAC

      XREF   BAHeader,BACurFrWk,BACurCalT,BAPrvFrWk
      XREF   BAPrvCalT,BAEMJetL,BATEtJetL,BAJetMask
      XREF   BATRDHotT,BASpTrPrg,BAPulser,BACAMAC

      XREF   DataPntList,CrtHDWord2,CrtHDWord3,CrtHDWord4
      XREF   BufSelect,TWBData,TWBPortAdrs


      END

