******************************************************************************
*                                                                            *
*   File  L_DSP_C2.A40                                  Rev.   16-MAY-1995   *
*                                                                            *
*  "Meaningful" Register Usage                                               *
*  ---------------------------                                               *
*  AR4: Base of Peripheral Bus                              Input            *
*  DP:  Base of Global SRAM                                 Input            *
*                                                                            *
*  "Destroyable" Register Usage                                              *
*  ----------------------------                                              *
*  R11                                                                       *
*                                                                            *
*  Module Description                                                        *
*  ==================                                                        *
*                                                                            *
*  This module performs the Node Initialization for Local DSP Node >> C2 <<. *
*  This module "hard-wires" the Local DSP Node ID to C2 (i.e. the node that  *
*  services eta = +19..+20).  There must be a different Local DSP Node       *
*  Initialization module for each Local DSP Node.                            *
*                                                                            *
*  Recall the assignment of Eta Coordinates for this Local DSP Node          *
*                                                                            *
*  Relative        Actual          Is this Node        Relative     Actual   *
*  Eta             Eta             responsible for     Rack         Rack     *
*  Coordinate      Coordinate      this Eta Coord?     Number       Number   *
*  ----------      ----------      ---------------     ------       ------   *
*     n + 0            +17             NO                 1          M111    *
*     n + 1            +18             NO                 1          M111    *
*     n + 2            +19             YES                1          M111    *
*     n + 3            +20             YES                1          M111    *
*     n + 4         non-existent       YES                2          ----    *
*     n + 5         non-existent       YES                2          ----    *
*     n + 6         non-existent       NO                 2          ----    *
*     n + 7         non-existent       NO                 2          ----    *
*                                                                            *
*  Also recall the assignment of the Comm Ports                              *
*                                                                            *
*                                                                            *
*   Comm Port       Function                                                 *
*   ---------       ---------                                                *
*           0       Local-to-Global Transfer: from DSP #C3 Comm Port #4      *
*           1       Local-to-Global Transfer: to DSP #B2 Comm Port #5        *
*           2       NOT USED, available at front panel                       *
*           3       Local-to-Global Transfer: from DSP #C3 Comm Port #0      *
*           4       Trigger Tower EM Et Data from Rack #2 (eta +17+20)       *
*           5       Trigger Tower Tot Et Data from Rack #2 (eta +17:+20)     *
*                                                                            *
*   NOTE that this LDSP does not receive any Rack #2 Data.  The Rack #2      *
*   data is forced to a fixed energy response of 16 counts for both          *
*   EM Et and Total Et.  The zero energy response of these Trigger Towers    *
*   is also set to 16 counts (i.e. these fake Towers will appear to have     *
*   0 GeV of Et).                                                            *
*                                                                            *
*  Then control is returned to the calling module                            *
*                                                                            *
*  This module also contains a subroutine to setup the Mark and Force Pass   *
*  Data Readout.  This subroutine is called from the L_Scan module whenever  *
*  a Mark-and-Force-Pass event occurs                                        *
*                                                                            *
*  This module also contains a routine which is BRANCHED to from the L_Scan  *
*  module, which is used to wait for the Local-to-Global Transfer from the   *
*  "previous" LDSP (if appropriate)                                          *
******************************************************************************

******************************************************************************
*         Include the Hydra and C40 Specific Constant Definitions            *
******************************************************************************

         .include   "hydra.inc"

******************************************************************************
*         Include the       DSP Program-Specific Constant Definitions        *
******************************************************************************

         .include   "constant.inc"
                                                                           
******************************************************************************
*         Include the MACRO Definitions                                      *
******************************************************************************

         .include   "macros.inc"

******************************************************************************
*         Load Code into the  .text  Section                                 *
******************************************************************************

         .text

Initialize_Node:

******************************************************************************
*   This code is specific to Local DSP Node C2.  All "Node-Specific"         *
*   definitions are handled here.  No other code module is allowed to        *
*   reference node-specific labels.  This is handled by using this module    *
*   to copy all node-specific values and pointers into "generic" memory      *
*   locations                                                                *
*                                                                            *
*   Recall the Node-Specific information:                                    *
*                                                                            *
*       (1) The base of the LDSP List of Identified Objects                  *
*       (2) The actual eta coordinates serviced by this node                 *
*       (3) The EM Et and Total Et Zero Responses for the Trigger Towers     *
*           serviced by this Local DSP Node                                  *
*       (4) The Comm Ports corresponding to Rack #1 EM, Rack #1 Total,       *
*           Rack #2 EM, and Rack #2 Total Inputs                             *
*       (5) The Comm Port(s) used for transmitting data to the Global DSP    *
*           (recall that this is fairly complex due to the "staged" nature   *
*           of the Local-to-Global transfer.                                 *
*                                                                            *
*   Note that (1)-(3) are defined simply using assembler .word directives    *
*   while (4)-(5) require code to execute on the C40                         *
*                                                                            *
******************************************************************************

******************************************************************************
*   Program the Comm Ports and DMA Channels which correspond to              *
*                                                                            *
*           >>>>>  Rack #1 EM Et Trigger Tower Data     <<<<<                *
*           >>>>>  Rack #1 Total Et Trigger Tower Data  <<<<<                *
*           >>>>>  Local-to-Global Transfer to "next"   <<<<<                *
*           >>>>>  Local-to-Global Transfer from "prev" DSP #C1 <<<<<        *
*           >>>>>  Local-to-Global Transfer from "prev" DSP #C3 <<<<<        *
*                                                                            *
*   Programming each DMA Channel is done with the SETUP_DMA macro            *
*   Programming each Local-to-Global-to-Next Comm Port is done with the      *
*       SETUP_LG_NEXT_PORT macro                                             *
*   Programming each Local-to-Global-from-Previous Comm Port is done with    *
*       the SETUP_LG_PREV_PORT macro                                         *
******************************************************************************
                                                                              
******************************************************************************
*   Program the Comm Port and DMA Channel corresponding to                   *
*                                                                            *
*           >>>>>  Rack #1 EM Et Trigger Tower Data     <<<<<                *
*                                                                            *
*   Recall that this is DSP C2                                               *
*                                                                            *
*   The EM Et TT Data for Rack #1 arrives on        Comm Port 4              *
*                                                                            *
*   The transfer should be Read Synchronized with ICRDY4                     *
*                                                                            *
*   The Rack_1_EM_DMA_Finished_ISR should be called by DMAINT4               *
*                                                                            *
******************************************************************************

        SETUP_DMA   4, @Rack_1_EM_DMA_Link_Pointer_Loc, @ICRDY4_Read_Synch_Loc, @Rack_1_EM_DMA_Finished_ISR_Loc

        SETUP_CRC_PORT  4

******************************************************************************
*   Program the Comm Port and DMA Channel corresponding to                   *
*                                                                            *
*           >>>>>  Rack #1 Total Et Trigger Tower Data  <<<<<                *
*                                                                            *
*   Recall that this is DSP C2                                               *
*                                                                            *
*   The Total Et TT Data for Rack #1 arrives on     Comm Port 5              *
*                                                                            *
*   The transfer should be Read Synchronized with ICRDY5                     *
*                                                                            *
*   The Rack_1_Tot_DMA_Finished_ISR should be called by DMAINT5              *
*                                                                            *
******************************************************************************

        SETUP_DMA   5, @Rack_1_Tot_DMA_Link_Pointer_Loc, @ICRDY5_Read_Synch_Loc, @Rack_1_Tot_DMA_Finished_ISR_Loc  

        SETUP_CRC_PORT  5

******************************************************************************
*   Program the Comm Port and DMA Channel corresponding to                   *
*                                                                            *
*           >>>>>  LDSP C2 Local-to-Global Transfer  to "next" DSP  <<<<<    *
*                                                                            *
*   Recall that this is DSP C2                                               *
*                                                                            *
*   The connection to the "next" DSP is on          Comm Port 1              *
*                                                                            *
*   The transfer should be Write Synchronized with OCRDY1                    *
*                                                                            *
*   The LG_Xfr_to_Next_Complete_ISR  hould be called by DMAINT1              *
*                                                                            *
******************************************************************************

        SETUP_DMA   1, @LG_Object_DMA_Link_Pointer_Loc, @OCRDY1_Write_Synch_Loc, @LG_Xfr_to_Next_Complete_ISR_Loc

        SETUP_LG_NEXT_PORT  1

******************************************************************************
*   Program the Comm Port and DMA Channel corresponding to                   *
*                                                                            *
*           >>>>>  LDSP C2 Local-to-Global Transfer from "prev" DSP #1 <<<<< *
*                                                                            *
*   Recall that this is DSP C2                                               *
*                                                                            *
*   The connection from the "prev" DSP #1 is on     Comm Port 3              *
*                                                                            *
*   The transfer should be Read  Synchronized with ICRDY3                    *
*                                                                            *
*   The LG_Xfr_fr_Pr_1_Complete_ISR  hould be called by DMAINT3              *
*                                                                            *
******************************************************************************

        SETUP_DMA   3, @LG_P1_Object_Link_Pointer_Loc, @ICRDY3_Read_Synch_Loc, @LG_Xfr_fr_Pr_1_Complete_ISR_Loc

        SETUP_LG_PREV_PORT  3

******************************************************************************
*   Program the Comm Port and DMA Channel corresponding to                   *
*                                                                            *
*           >>>>>  LDSP C2 Local-to-Global Transfer from "prev" DSP #3 <<<<< *
*                                                                            *
*   Recall that this is DSP C2                                               *
*                                                                            *
*   The connection from the "prev" DSP #3 is on     Comm Port 0              *
*                                                                            *
*   The transfer should be Read  Synchronized with ICRDY0                    *
*                                                                            *
*   The LG_Xfr_fr_Pr_3_Complete_ISR  hould be called by DMAINT0              *
*                                                                            *
******************************************************************************

        SETUP_DMA   0, @LG_P3_Object_Link_Pointer_Loc, @ICRDY0_Read_Synch_Loc, @LG_Xfr_fr_Pr_3_Complete_ISR_Loc

        SETUP_LG_PREV_PORT  0

******************************************************************************
*   Now insert a lot of NOPs to allow the last DMA Dummy List to transfer    *
*   and allow the DMA Channel to autoinitialize with the Real List           *
******************************************************************************

        NOP                                         ; These are not
        NOP                                         ; absolutely necessary
        NOP                                         ; but I want the DMA
        NOP                                         ; Channels to be
        NOP                                         ; fully initialized
        NOP                                         ; BEFORE control is 
        NOP                                         ; transferred to the
        NOP                                         ; next module. 
        NOP                                       
        NOP                                       
        NOP                                        
        NOP
        NOP                                       

        RETS                                            ; Return to the 
                                                        ; calling module
               
******************************************************************************
*   This section of code is used to set up the Mark and Force Pass Data      *
*   Readout.  It is called by the L_Scan module whenever a Mark and Force    *
*   Pass event flows through the Cal Trig (recall that this information is   *
*   derived from the "DSP Wakeup Word" which comes from the 68K).            *
*                                                                            *
*   Recall that this is LDSP C2                                              *
*                                                                            *
*   The connection to the "next" DSP is on          Comm Port 1              *
*                                                                            *
*   The connection from the "previous" DSP #1 is on Comm Port 3              *
*                                                                            *
*   The connection from the "previous" DSP #3 is on Comm Port 0              *
*                                                                            *
*       [Note that this LDSP receives data "previous" DSP data via           *
*        two different Comm Ports]                                           *
*                                                                            *
*   I use the SETUP_MFP_TO_NEXT_DMA  macro to set up the DMA Channel         *
*                                                                            * 
*   I use the SETUP_MFP_FROM_DOUBLE_PREV_DMA macro to set up the DMA Channel *
*   for the "previous" data                                                  *
*                                                                            *
******************************************************************************

Setup_Mark_and_Force_Pass_DMA:                                                
                                                                              
Setup_MFP_to_Next_DSP:                  

        SETUP_MFP_TO_NEXT_DMA               1   

Setup_MFP_from_Prev_DSP:

        SETUP_MFP_FROM_DOUBLE_PREV_DMA      3, 0

                                                            
        RETS                                            ; return to the
                                                        ; calling module
    
******************************************************************************
*   This is the module which is called to wait for the arrival of the        *
*   data from the "previous" LDSP(s) in the Local-to-Global Transfer         *
*   Chain.  The arrival of the data is indicated by an interrupt.            *
*                                                                            *
*   Recall that not all LDSPs have a "previous" LDSP in the Local-to-Global  *
*   Tranfer Chain.  If there is no "previous" LDSP, then there is            *
*                                                                            *
*   If this LDSP does have a "previous" LDSP, then this module is            *
*           a loop which examines the status of the transfer from the        *
*           "previous" DSP, followed by a BRANCH back to the                 *
*           Previous_Count_Transfer_Finished entry point of L_Scan           *
*                                                                            *
*   If this LDSP does NOT have a "previous" LDSP, then this module is        *
*           a BRANCH back to the Previous_Count_Transfer_Finished entry      *
*           point of L_Scan                                                  *
*                                                                            *
*   This is LDSP C2 which     has       "previous" LDSP data                 *
*                                                                            *
*   I use the WAIT_FOR_PREV_DMA macro to wait for the "previous" LDSP data   *
*   to arrive                                                                *
******************************************************************************
Wait_for_Previous_DSP_Counts:                           ; Need to wait for   
                                                        ; previous LDSP data
                                        
        WAIT_FOR_PREV_DMA           
                                                    ; the next instruction
                                                    ; does not execute 
                                                    ; until the transfer
                                                    ; from the previous
                                                    ; DSP is complete
                           
         LDA    @LG_Pr_1_DMA_Control_Reg_Handle, AR7    ; Use R11, AR7 to load
                                                        ; "Force Start" DMA
         LDI    @DMA_Force_Start_Loc, R10               ; Channel Control Word
                                                        ; into the DMA Control
         OR3    *AR7, R10, R11                          ; Registers for the
                                                        ; DMA Channels running
         STI    R11, *AR7                               ; the Local to Global
                                                        ; Transfers.  This
        BRD     Previous_Count_Transfer_Finished        ; starts the Local
                                                        ; to Global Object
         LDA    @LG_Pr_3_DMA_Control_Reg_Handle, AR7    ; Transfer from
                                                        ; the Previous DSPs.
         OR3    *AR7, R10, R11                           
                                                       
         STI    R11, *AR7
                                                        ; Return to the
                                                        ; L_Scan module to
                                                        ; start the Transfer
                                                        ; to the next DSP
           
******************************************************************************
*   This is the module which is called to wait for the arrival of the Object *
*   data from the "previous" LDSP(s) in the Local-to-Global Transfer         *
*   Chain.  The arrival of the data is indicated by an interrupt.            *
*                                                                            *
*   Recall that not all LDSPs have a "previous" LDSP in the Local-to-Global  *
*   Tranfer Chain.  If there is no "previous" LDSP, then there is            *
*                                                                            *
*   If this LDSP does have a "previous" LDSP, then this module is            *
*           a loop which examines the status of the transfer from the        *
*           "previous" DSP, followed by a BRANCH back to the                 *
*           Previous_Obj_Transfer_Finished entry point of L_Scan             *
*                                                                            *
*   If this LDSP does NOT have a "previous" LDSP, then this module is        *
*           a BRANCH back to the Previous_Obj_Transfer_Finished entry        *
*           point of L_Scan                                                  *
*                                                                            *
*   This is LDSP C2 which has two previous LDSP's                            *
******************************************************************************

Wait_for_Previous_DSP_Objects:                          ; Need to wait
                                                        ; for previous LDSP
                                                        ; data

        WAIT_FOR_PREV_DMA           
                                                    ; the next instruction
                                                    ; does not execute 
                                                    ; until the transfer
                                                    ; from the previous
                                                    ; DSP is complete

        BR      Previous_Obj_Transfer_Finished          ; Return to the
                                                        ; L_Scan module to
                                                        ; start the Transfer
                                                        ; to the next DSP



******************************************************************************
*  This is the Bulkhead.  This code should never be executed                 *
******************************************************************************

End_Of_L_DSP_C2:                        ; These instructions should never be
                                        ; executed in the "normal" operation
         BR     End_Of_L_DSP_C2         ; of the program.  If the program
                                        ; counter becomes corrupted or
         BR     End_Of_L_DSP_C2         ; if we have a bug in the program
                                        ; we MAY try to execute these
         BR     End_Of_L_DSP_C2         ; instructions.  If we get to these
                                        ; instructions the program will appear
         BR     End_Of_L_DSP_C2         ; to halt.  We could also use a
                                        ; TRAP instruction here, and jump to
                                        ; a service routine.

*****************************************************************************
*       Constants defined using the assembler .set directive                *
*       These constants differ across Node Initialization Modules           *
*****************************************************************************
                                  
Local_Mem_Ctrl_Reg_Value        .set    1DCC4000h       ; Value to use for
                                                        ; Local Memory
                                                        ; Interface Control
                                                        ; Register

Rack_1_EM_ComPort_Input .set Base_of_Peripheral_Bus + Disp_to_ComPort_4_Input
                                                        ; Port Input Register
                                                        ; for Rack 2 EM Et
                                                        ; Trigger Tower Data

Rack_1_Tot_ComPort_Input .set Base_of_Peripheral_Bus + Disp_to_ComPort_5_Input
                                                        ; Comm Port Input
                                                        ; Register for Rack 2
                                                        ; Total Et Trigger Tower
                                                        ; Data.

Rack_2_EM_ComPort_Input .set        0                   ; There is no Rack
                                                        ; 2.  This symbol is
                                                        ; left in so that the
                                                        ; DMA List defined in
                                                        ; l_dmacmn.inc does
                                                        ; not generate assembly
                                                        ; errors.  The DMA
                                                        ; List from Rack 1 is
                                                        ; not used in the code.

Rack_2_Tot_ComPort_Input .set       0                   ; There is no Rack
                                                        ; 2.  This symbol is
                                                        ; left in so that the
                                                        ; DMA List defined in
                                                        ; l_dmacmn.inc does
                                                        ; not generate assembly
                                                        ; errors.  The DMA
                                                        ; List from Rack 1 is
                                                        ; not used in the code.

LG_to_Next_ComPort_Output .set Base_of_Peripheral_Bus + Disp_to_ComPort_1_Output
                                                        ; Comm Port Output
                                                        ; Register for Local
                                                        ; to Global to Next
                                                        ; DSP 
                                                        ; Transfer

LG_to_Next_DMA_Control  .set  Base_of_Peripheral_Bus + Disp_to_DMA_1_Control
                                                        ; DMA Control 
                                                        ; Register for Local
                                                        ; to Global to Next
                                                        ; DSP
                                                        ; Transfer  

LG_from_Pr_1_ComPort_Input .set Base_of_Peripheral_Bus + Disp_to_ComPort_3_Input
                                                        ; Comm Port Output
                                                        ; Register for Local
                                                        ; to Global from
                                                        ; the Previous DSP 
                                                        ; Transfer

LG_from_Pr_1_DMA_Control .set  Base_of_Peripheral_Bus + Disp_to_DMA_3_Control
                                                        ; DMA Control 
                                                        ; Register for Local
                                                        ; to Global from    
                                                        ; the Previous DSP
                                                        ; Transfer  

LG_from_Pr_3_ComPort_Input .set Base_of_Peripheral_Bus + Disp_to_ComPort_0_Input
                                                        ; Comm Port Output
                                                        ; Register for Local
                                                        ; to Global from
                                                        ; the Previous DSP 
                                                        ; Transfer

LG_from_Pr_3_DMA_Control .set  Base_of_Peripheral_Bus + Disp_to_DMA_0_Control
                                                        ; DMA Control 
                                                        ; Register for Local
                                                        ; to Global from    
                                                        ; the Previous DSP
                                                        ; Transfer  

*   NOTE these assignments are correct.  The symbol names are not
*   optimal but this assignment is correct.  

    .asg    "LDSP_C3_ObjectList_Loc", This_LDSP_ObjectList_Loc

    .asg    "LDSP_C3_Obj_Count_Data_Loc", This_LDSP_CountList_Loc

                                                        ; Assign the strings
                                                        ; in the left column
                                                        ; to the symbols
                                                        ; in the right
                                                        ; column.  Can't
                                                        ; just use .set
                                                        ; because the 
                                                        ; strings in the
                                                        ; left column are
                                                        ; the names of
                                                        ; symbols that 
                                                        ; are not well-
                                                        ; defined.

Num_Prev_DSPs            .set   3                       ; How many Previous
                                                        ; DSP's are there?

Num_DSPs_Serviced        .set   Num_Prev_DSPs + 1       ; How many DSP's
                                                        ; data are sent to
                                                        ; Global DSP? 


*****************************************************************************
*       Define constants and working variables in the Data Section          *
*       These constants and working variables are the same for all          *
*       Node Initialization Modules                                         *
*****************************************************************************

            .data

Local_Mem_Ctrl_Reg_Value_Loc:                           ; Memory location
                                                        ; to store the
            .word        Local_Mem_Ctrl_Reg_Value       ; value of the Local
                                                        ; MICR         

LG_Next_DMA_Control_Reg_Handle:                         ; Memory location
                                                        ; which holds the 
            .word       LG_to_Next_DMA_Control          ; address of the
                                                        ; Local-to-Global
                                                        ; DMA Channel
                                                        ; Control Register

******************************************************************************
*       Include the "common for all Nodes" parts of the DMA Lists            *
*   These are defined in an include file                                     *
******************************************************************************

        .include "l_dmacmn.inc"

****************************************************************************
*      Define constants and working variables in the Data Section          *
*      These constants and working variables differ across                 *
*      Node Initialization Modules                                         *
****************************************************************************

    .data


MFP_DC_DMA_List_Loc:                                    ; The following 7
                                                        ; memory locations
                                                        ; define the
                                                        ; Derived Constant
                                                        ; data subsection
                                                        ; of the DMA List for
                                                        ; the Mark and Force
                                                        ; Pass section of
                                                        ; the Data Block

MFP_DC_DMA_Control_Loc:                                 ; Memory location
                                                        ; which holds the
        .word    DMA_Cont_Word_for_MFP_Next             ; Control Register

MFP_DC_DMA_Source_Loc:                                  ; Memory location
                                                        ; which holds the
        .word    MFP_Derived_Const_Data_Loc             ; Source Address
                                                        ; Register

MFP_DC_DMA_Source_Index_Loc:                            ; Memory location
                                                        ; which holds the
        .word    1                                      ; Source Address Index
                                                        ; Register

MFP_DC_DMA_Counter_Loc:                                 ; Memory location
                                                        ; which holds the
        .word    MFP_Derived_Const_Length               ; Transfer Counter
                                                        ; Register

MFP_DC_DMA_Destination_Loc:                             ; Memory location
                                                        ; which holds the
        .word    LG_to_Next_ComPort_Output              ; Destination Address
                                                        ; Register

MFP_DC_DMA_Dest_Index_Loc:                              ; Memory location
                                                        ; which holds the
        .word    0                                      ; Destination Address
                                                        ; Index Register

MFP_DC_DMA_Link_Pointer_Loc:                            ; Memory location
                                                        ; which holds the
        .word    MFP_Prv_to_Nxt_DMA_List_Loc            ; Link Pointer
                                                        ; Register
 
    
MFP_Prv_to_Next_DMA_List_Handle                         ; Memory locatio
                                                        ; to store the
        .word   MFP_Prv_to_Nxt_DMA_List_Loc             ; base address of
                                                        ; the DMA List for
                                                        ; for the transfer of
                                                        ; all Previous DSP  
                                                        ; Mark and Force Pass
                                                        ; Data to the Next   
                                                        ; DSP


MFP_Prv_to_Nxt_DMA_List_Loc:                            ; The following 7
                                                        ; memory locations
                                                        ; define the
                                                        ; "MFP Data from the
                                                        ; Previous DSP to
                                                        ; the Next DSP"
                                                        ; data subsection
                                                        ; of the DMA List for
                                                        ; the Mark and Force
                                                        ; Pass section of
                                                        ; the Data Block

MFP_PN_DMA_Control_Loc:                                 ; Memory location
                                                        ; which holds the
        .word    DMA_Cont_Word_for_MFP_Next_End         ; Control Register

MFP_PN_DMA_Source_Loc:                                  ; Memory location
                                                        ; which holds the
        .word    LDSP_C3_Mark_Pass_Data_Loc             ; Source Address
                                                        ; Register

MFP_PN_DMA_Source_Index_Loc:                            ; Memory location
                                                        ; which holds the
        .word    1                                      ; Source Address Index
                                                        ; Register

MFP_PN_DMA_Counter_Loc:                                 ; Memory location
                                                        ; which holds the
        .word    3 * LDSP_MFP_Section_Length            ; Transfer Counter
                                                        ; Register

MFP_PN_DMA_Destination_Loc:                             ; Memory location
                                                        ; which holds the
        .word    LG_to_Next_ComPort_Output              ; Destination Address
                                                        ; Register

MFP_PN_DMA_Dest_Index_Loc:                              ; Memory location
                                                        ; which holds the
        .word    0                                      ; Destination Address
                                                        ; Index Register

MFP_PN_DMA_Link_Pointer_Loc:                            ; Memory location
                                                        ; which holds the
        .word    LG_Next_DMA_List_Loc                   ; Link Pointer
                                                        ; Register

                 
******************************************************************************

LG_Pr_1_DMA_List_Loc:                                   ; The following 
                                                        ; memory locations
                                                        ; define the DMA List
                                                        ; for the Local to    
                                                        ; Global from the 
                                                        ; "Previous" DSP #1
                                                        ; DMA Transfer.  This
                                                        ; is broken into 2 
                                                        ; parts, the "Counts"
                                                        ; part and the
                                                        ; "Objects" part.     

******************************************************************************
                                                                              
LG_P1_Count_DMA_List_Loc:                               ; This is the
                                                        ; Counts part


LG_P1_Count_Control_Loc:                                ; Memory location
                                                        ; which holds the
        .word    DMA_Start_Word_for_LG_P_Counts         ; Control Register

LG_P1_Count_Source_Loc:                                 ; Memory location
                                                        ; which holds the
        .word    LG_from_Pr_1_ComPort_Input             ; Source Address
                                                        ; Register

LG_P1_Count_Source_Index_Loc:                           ; Memory location
                                                        ; which holds the
        .word    0                                      ; Source Address Index
                                                        ; Register

LG_P1_Count_Counter_Loc:                                ; Memory location
                                                        ; which holds the
        .word    LDSP_CountList_Length                  ; Transfer Counter
                                                        ; Register

LG_P1_Count_Destination_Loc:                            ; Memory location
                                                        ; which holds the
        .word    LDSP_C1_Obj_Count_Data_Loc             ; Destination Address
                                                        ; Register

LG_P1_Count_Dest_Index_Loc:                             ; Memory location
                                                        ; which holds the
        .word    1                                      ; Destination Address
                                                        ; Index Register
                                                      
LG_P1_Count_Link_Pointer_Loc:                           ; Memory location
                                                        ; which holds the
        .word    LG_P1_Object_DMA_List_Loc              ; Link Pointer
                                                        ; Register         

******************************************************************************

LG_P1_Object_DMA_List_Loc:                              ; This is the
                                                        ; Objects part


LG_P1_Object_Control_Loc:                               ; Memory location
                                                        ; which holds the
        .word    DMA_Start_Word_for_LG_P_Objects        ; Control Register

LG_P1_Object_Source_Loc:                                ; Memory location
                                                        ; which holds the
        .word    LG_from_Pr_1_ComPort_Input             ; Source Address
                                                        ; Register

LG_P1_Object_Source_Index_Loc:                          ; Memory location
                                                        ; which holds the
        .word    0                                      ; Source Address Index
                                                        ; Register

LG_P1_Object_Counter_Loc:                               ; Memory location
                                                        ; which holds the
        .word    LDSP_ObjectList_Length                 ; Transfer Counter
                                                        ; Register

LG_P1_Object_Destination_Loc:                           ; Memory location
                                                        ; which holds the
        .word    LDSP_C1_ObjectList_Loc                 ; Destination Address
                                                        ; Register

LG_P1_Object_Dest_Index_Loc:                            ; Memory location
                                                        ; which holds the
        .word    1                                      ; Destination Address
                                                        ; Index Register
                                                      
LG_P1_Object_Link_Pointer_Loc:                          ; Memory location
                                                        ; which holds the
        .word    LG_Pr_1_DMA_List_Loc                   ; Link Pointer
                                                        ; Register         

******************************************************************************

LG_MFP_Pr_1_DMA_List_Handle:                            ; Memory locatio
                                                        ; to store the
        .word   LG_MFP_Pr_1_DMA_List_Loc                ; base address of
                                                        ; the DMA List for
                                                        ; for the Mark and 
                                                        ; Force Pass section
                                                        ; of the "Previous"
                                                        ; DSP #1's Data Block

******************************************************************************

LG_MFP_Pr_1_DMA_List_Loc:                               ; The following 
                                                        ; memory locations
                                                        ; define the DMA List
                                                        ; from the "previous"
                                                        ; DSP #1's 
                                                        ; Mark and Force Pass 
                                                        ; section of the Data
                                                        ; Block.
                                                        ; The Mark and Force
                                                        ; Pass section is
                                                        ; composed of Trigger
                                                        ; Tower data, Ref Set
                                                        ; Data, and Tool-
                                                        ; Dependent data.
                                                        ; The Object List
                                                        ; is redefined
                                                        ; here because its
                                                        ; control is
                                                        ; different from
                                                        ; the "normal"
                                                        ; Object List.        

******************************************************************************
                                 
LG_MFP_P1_OL_DMA_List_Loc:                              ; This is the Object
                                                        ; List from the 
                                                        ; Previous "1" DSP
                                                        ; for MFP events

LG_MFP_P1_OL_DMA_Control_Loc:                           ; Memory location
                                                        ; which holds the
        .word    DMA_Start_Word_for_MFP_P_Objects       ; Control Register

LG_MFP_P1_OL_DMA_Source_Loc:                            ; Memory location
                                                        ; which holds the
        .word    LG_from_Pr_1_ComPort_Input             ; Source Address
                                                        ; Register

LG_MFP_P1_OL_DMA_Src_Index_Loc:                         ; Memory location
                                                        ; which holds the
        .word    0                                      ; Source Address Index
                                                        ; Register

LG_MFP_P1_OL_DMA_Counter_Loc:                           ; Memory location
                                                        ; which holds the
        .word    LDSP_ObjectList_Length                 ; Transfer Counter
                                                        ; Register

LG_MFP_P1_OL_DMA_Destination_Loc:                       ; Memory location
                                                        ; which holds the
        .word    LDSP_C1_ObjectList_Loc                 ; Destination Address
                                                        ; Register

LG_MFP_P1_OL_DMA_Dest_Index_Loc:                        ; Memory location
                                                        ; which holds the
        .word    1                                      ; Destination Address
                                                        ; Index Register

LG_MFP_P1_OL_DMA_Link_Pntr_Loc:                         ; Memory location
                                                        ; which holds the
        .word    LG_MFP_Pr_1_Data_DMA_List_Loc          ; Link Pointer
                                                        ; Register

******************************************************************************

LG_MFP_Pr_1_Data_DMA_List_Loc:                          ; This is the MFP
                                                        ; data from the
                                                        ; Previous "1" DSP.

LG_MFP_Pr_1_DMA_Control_Loc:                            ; Memory location
                                                        ; which holds the
        .word    DMA_Start_Word_for_MFP_P_Data          ; Control Register

LG_MFP_Pr_1_DMA_Source_Loc:                             ; Memory location
                                                        ; which holds the
        .word    LG_from_Pr_1_ComPort_Input             ; Source Address
                                                        ; Register

LG_MFP_Pr_1_DMA_Source_Index_Loc:                       ; Memory location
                                                        ; which holds the
        .word    0                                      ; Source Address Index
                                                        ; Register

LG_MFP_Pr_1_DMA_Counter_Loc:                            ; Memory location
                                                        ; which holds the
        .word    LDSP_MFP_Section_Length                ; Transfer Counter
                                                        ; Register

LG_MFP_Pr_1_DMA_Destination_Loc:                        ; Memory location
                                                        ; which holds the
        .word    LDSP_C1_Mark_Pass_Data_Loc             ; Destination Address
                                                        ; Register

LG_MFP_Pr_1_DMA_Dest_Index_Loc:                         ; Memory location
                                                        ; which holds the
        .word    1                                      ; Destination Address
                                                        ; Index Register

LG_MFP_Pr_1_DMA_Link_Pointer_Loc:                       ; Memory location
                                                        ; which holds the
        .word    LG_Pr_1_DMA_List_Loc                   ; Link Pointer
                                                        ; Register

******************************************************************************
******************************************************************************

LG_Pr_3_DMA_List_Loc:                                   ; The following 
                                                        ; memory locations
                                                        ; define the DMA List
                                                        ; for the Local to    
                                                        ; Global from the 
                                                        ; "Previous" DSP #3
                                                        ; DMA Transfer.  This
                                                        ; is broken into 2 
                                                        ; parts, the "Counts"
                                                        ; part and the
                                                        ; "Objects" part.     

******************************************************************************
                                                                              
LG_P3_Count_DMA_List_Loc:                               ; This is the
                                                        ; Counts part


LG_P3_Count_Control_Loc:                                ; Memory location
                                                        ; which holds the
        .word    DMA_Start_Word_for_LG_P_Counts         ; Control Register

LG_P3_Count_Source_Loc:                                 ; Memory location
                                                        ; which holds the
        .word    LG_from_Pr_3_ComPort_Input             ; Source Address
                                                        ; Register

LG_P3_Count_Source_Index_Loc:                           ; Memory location
                                                        ; which holds the
        .word    0                                      ; Source Address Index
                                                        ; Register

LG_P3_Count_Counter_Loc:                                ; Memory location
                                                        ; which holds the
        .word    2 * LDSP_CountList_Length              ; Transfer Counter
                                                        ; Register

LG_P3_Count_Destination_Loc:                            ; Memory location
                                                        ; which holds the
        .word    LDSP_C3_Obj_Count_Data_Loc             ; Destination Address
                                                        ; Register

LG_P3_Count_Dest_Index_Loc:                             ; Memory location
                                                        ; which holds the
        .word    1                                      ; Destination Address
                                                        ; Index Register
                                                      
LG_P3_Count_Link_Pointer_Loc:                           ; Memory location
                                                        ; which holds the
        .word    LG_P3_Object_DMA_List_Loc              ; Link Pointer
                                                        ; Register         

******************************************************************************

LG_P3_Object_DMA_List_Loc:                              ; This is the
                                                        ; Objects part


LG_P3_Object_Control_Loc:                               ; Memory location
                                                        ; which holds the
        .word    DMA_Start_Word_for_LG_P_Objects        ; Control Register

LG_P3_Object_Source_Loc:                                ; Memory location
                                                        ; which holds the
        .word    LG_from_Pr_3_ComPort_Input             ; Source Address
                                                        ; Register

LG_P3_Object_Source_Index_Loc:                          ; Memory location
                                                        ; which holds the
        .word    0                                      ; Source Address Index
                                                        ; Register

LG_P3_Object_Counter_Loc:                               ; Memory location
                                                        ; which holds the
        .word    2 * LDSP_ObjectList_Length             ; Transfer Counter
                                                        ; Register

LG_P3_Object_Destination_Loc:                           ; Memory location
                                                        ; which holds the
        .word    LDSP_C3_ObjectList_Loc                 ; Destination Address
                                                        ; Register

LG_P3_Object_Dest_Index_Loc:                            ; Memory location
                                                        ; which holds the
        .word    1                                      ; Destination Address
                                                        ; Index Register
                                                      
LG_P3_Object_Link_Pointer_Loc:                          ; Memory location
                                                        ; which holds the
        .word    LG_Pr_3_DMA_List_Loc                   ; Link Pointer
                                                        ; Register         

******************************************************************************

LG_MFP_Pr_3_DMA_List_Handle:                            ; Memory locatio
                                                        ; to store the
        .word   LG_MFP_Pr_3_DMA_List_Loc                ; base address of
                                                        ; the DMA List for
                                                        ; for the Mark and 
                                                        ; Force Pass section
                                                        ; of the "Previous"
                                                        ; DSP #3's Data Block

******************************************************************************

LG_MFP_Pr_3_DMA_List_Loc:                               ; The following 
                                                        ; memory locations
                                                        ; define the DMA List
                                                        ; from the "previous"
                                                        ; DSP #3's 
                                                        ; Mark and Force Pass 
                                                        ; section of the Data
                                                        ; Block.
                                                        ; The Mark and Force
                                                        ; Pass section is
                                                        ; composed of Trigger
                                                        ; Tower data, Ref Set
                                                        ; Data, and Tool-
                                                        ; Dependent data.
                                                        ; The Object List
                                                        ; is redefined
                                                        ; here because its
                                                        ; control is
                                                        ; different from
                                                        ; the "normal"
                                                        ; Object List.        

******************************************************************************
                                 
LG_MFP_P3_OL_DMA_List_Loc:                              ; This is the Object
                                                        ; List from the 
                                                        ; Previous "3" DSP
                                                        ; for MFP events

LG_MFP_P3_OL_DMA_Control_Loc:                           ; Memory location
                                                        ; which holds the
        .word    DMA_Start_Word_for_MFP_P_Objects       ; Control Register

LG_MFP_P3_OL_DMA_Source_Loc:                            ; Memory location
                                                        ; which holds the
        .word    LG_from_Pr_3_ComPort_Input             ; Source Address
                                                        ; Register

LG_MFP_P3_OL_DMA_Src_Index_Loc:                         ; Memory location
                                                        ; which holds the
        .word    0                                      ; Source Address Index
                                                        ; Register

LG_MFP_P3_OL_DMA_Counter_Loc:                           ; Memory location
                                                        ; which holds the
        .word    2 * LDSP_ObjectList_Length             ; Transfer Counter
                                                        ; Register

LG_MFP_P3_OL_DMA_Destination_Loc:                       ; Memory location
                                                        ; which holds the
        .word    LDSP_C3_ObjectList_Loc                 ; Destination Address
                                                        ; Register

LG_MFP_P3_OL_DMA_Dest_Index_Loc:                        ; Memory location
                                                        ; which holds the
        .word    1                                      ; Destination Address
                                                        ; Index Register

LG_MFP_P3_OL_DMA_Link_Pntr_Loc:                         ; Memory location
                                                        ; which holds the
        .word    LG_MFP_Pr_3_Data_DMA_List_Loc          ; Link Pointer
                                                        ; Register

******************************************************************************

LG_MFP_Pr_3_Data_DMA_List_Loc:                          ; This is the MFP
                                                        ; data from the
                                                        ; Previous "3" DSP.

LG_MFP_Pr_3_DMA_Control_Loc:                            ; Memory location
                                                        ; which holds the
        .word    DMA_Start_Word_for_MFP_P_Data          ; Control Register

LG_MFP_Pr_3_DMA_Source_Loc:                             ; Memory location
                                                        ; which holds the
        .word    LG_from_Pr_3_ComPort_Input             ; Source Address
                                                        ; Register

LG_MFP_Pr_3_DMA_Source_Index_Loc:                       ; Memory location
                                                        ; which holds the
        .word    0                                      ; Source Address Index
                                                        ; Register

LG_MFP_Pr_3_DMA_Counter_Loc:                            ; Memory location
                                                        ; which holds the
        .word    2 * LDSP_MFP_Section_Length            ; Transfer Counter
                                                        ; Register

LG_MFP_Pr_3_DMA_Destination_Loc:                        ; Memory location
                                                        ; which holds the
        .word    LDSP_C3_Mark_Pass_Data_Loc             ; Destination Address
                                                        ; Register

LG_MFP_Pr_3_DMA_Dest_Index_Loc:                         ; Memory location
                                                        ; which holds the
        .word    1                                      ; Destination Address
                                                        ; Index Register

LG_MFP_Pr_3_DMA_Link_Pointer_Loc:                       ; Memory location
                                                        ; which holds the
        .word    LG_Pr_3_DMA_List_Loc                   ; Link Pointer
                                                        ; Register

******************************************************************************
******************************************************************************

This_LDSP_Node_ID_Loc:  .word     Local_DSP_C2          ; Memory location
                                                        ; to store the Node
                                                        ; ID of this Local
                                                        ; DSP

This_LDSP_Ref_Set_Block_Handle:                         ; Memory location  
                                                        ; to store the 
             .word     LDSP_C2_Ref_Set_Block_Loc        ; base address of
                                                        ; this LDSP's 
                                                        ; Ref Set Data in
                                                        ; Dual Port Memory
                                                        ; (for loading
                                                        ; from TCC)

This_LDSP_to_TCC_Status_Handle:                         ; Memory location
                                                        ; to store the
             .word  LDSP_C2_to_TCC_Stat_Base_Address    ; Base Address of
                                                        ; the "LDSP-to-TCC"
                                                        ; Status Block in
                                                        ; Dual Port Memory
                                                        ; for this LDSP

This_LDSP_to_68K_Status_Handle:                         ; Memory location
                                                        ; to store the
             .word  LDSP_C2_to_68K_Stat_Base_Address    ; Base Address of
                                                        ; the "LDSP-to-68K"
                                                        ; Status Block in
                                                        ; Dual Port Memory
                                                        ; for this LDSP

Eta_Nplus2_Coord_Loc:   .word     Eta_Pos_19            ; Memory location
                                                        ; to store the actual
                                                        ; eta coordinate
                                                        ; corresponding to
                                                        ; this Node's eta
                                                        ; "n + 2"

Eta_Nplus3_Coord_Loc:   .word     Eta_Pos_20            ; Memory location
                                                        ; to store the actual
                                                        ; eta coordinate
                                                        ; corresponding to
                                                        ; this Node's eta
                                                        ; "n + 3"

Eta_Nplus4_Coord_Loc:   .word     Eta_Nonexistent       ; Memory location
                                                        ; to store the actual
                                                        ; eta coordinate
                                                        ; corresponding to
                                                        ; this Node's eta
                                                        ; "n + 4"

Eta_Nplus5_Coord_Loc:   .word     Eta_Nonexistent       ; Memory location
                                                        ; to store the actual
                                                        ; eta coordinate
                                                        ; corresponding to
                                                        ; this Node's eta
                                                        ; "n + 5"

Eta_Nplus0_EM_Et_Zeresp_Loc:                            ; Memory location to
                                                        ; store the EM Et
         .word   Eta_17_EM_Et_Zero_Response             ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 0"

Eta_Nplus1_EM_Et_Zeresp_Loc:                            ; Memory location to
                                                        ; store the EM Et
         .word   Eta_18_EM_Et_Zero_Response             ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 1"

Eta_Nplus2_EM_Et_Zeresp_Loc:                            ; Memory location to
                                                        ; store the EM Et
         .word   Eta_19_EM_Et_Zero_Response             ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 2"

Eta_Nplus3_EM_Et_Zeresp_Loc:                            ; Memory location to
                                                        ; store the EM Et
         .word   Eta_20_EM_Et_Zero_Response             ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 3"

Eta_Nplus4_EM_Et_Zeresp_Loc:                            ; Memory location to
                                                        ; store the EM Et
         .word   Eta_Fake_EM_Et_Zero_Response           ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 4"

Eta_Nplus5_EM_Et_Zeresp_Loc:                            ; Memory location to
                                                        ; store the EM Et
         .word   Eta_Fake_EM_Et_Zero_Response           ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 5"

Eta_Nplus6_EM_Et_Zeresp_Loc:                            ; Memory location to
                                                        ; store the EM Et
         .word   Eta_Fake_EM_Et_Zero_Response           ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 6"

Eta_Nplus7_EM_Et_Zeresp_Loc:                            ; Memory location to
                                                        ; store the EM Et
         .word   Eta_Fake_EM_Et_Zero_Response           ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 7"

Eta_Nplus0_Tot_Et_Zeresp_Loc:                           ; Memory location to
                                                        ; store the EM Et
         .word   Eta_17_Tot_Et_Zero_Response            ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 0"

Eta_Nplus1_Tot_Et_Zeresp_Loc:                           ; Memory location to
                                                        ; store the EM Et
         .word   Eta_18_Tot_Et_Zero_Response            ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 1"

Eta_Nplus2_Tot_Et_Zeresp_Loc:                           ; Memory location to
                                                        ; store the EM Et
         .word   Eta_19_Tot_Et_Zero_Response            ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 2"

Eta_Nplus3_Tot_Et_Zeresp_Loc:                           ; Memory location to
                                                        ; store the EM Et
         .word   Eta_20_Tot_Et_Zero_Response            ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 3"

Eta_Nplus4_Tot_Et_Zeresp_Loc:                           ; Memory location to
                                                        ; store the EM Et
         .word   Eta_Fake_Tot_Et_Zero_Response          ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 4"

Eta_Nplus5_Tot_Et_Zeresp_Loc:                           ; Memory location to
                                                        ; store the EM Et
         .word   Eta_Fake_Tot_Et_Zero_Response          ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 5"

Eta_Nplus6_Tot_Et_Zeresp_Loc:                           ; Memory location to
                                                        ; store the EM Et
         .word   Eta_Fake_Tot_Et_Zero_Response          ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 6"

Eta_Nplus7_Tot_Et_Zeresp_Loc:                           ; Memory location to
                                                        ; store the EM Et
         .word   Eta_Fake_Tot_Et_Zero_Response          ; Zero Response of 
                                                        ; this Node's eta
                                                        ; "n + 7"

This_LDSP_ObjectList_Handle:                            ; Memory location to
                                                        ; store the base Adrs
         .word   LDSP_C2_ObjectList_Loc                 ; of the List of ID'd
                                                        ; Objects for this
                                                        ; Local DSP Node

This_LDSP_CountList_Handle:                             ; Memory location to
                                                        ; store the base Adrs
        .word    LDSP_C2_Obj_Count_Data_Loc             ; of the Object 
                                                        ; Counts (for 
                                                        ; transfer to GDSP)
                                                        ; for this LDSP
                                                        ; Node
                                             
Mask_of_TT_Data_Blocks_Loc:                             ; Memory location
                                                        ; to store the Mask
         .word   Rack_1_EM_Tot_TT_Data                  ; of Trigger Tower
                                                        ; Data Blocks.  

LG_Pr_1_DMA_Control_Reg_Handle:                       ; Memory location
                                                        ; to store the address
         .word   LG_from_Pr_1_DMA_Control               ; of the Control
                                                        ; Register for the
                                                        ; DMA Channel 
                                                        ; corresponding to
                                                        ; the Previous "1"
                                                        ; LDSP.          

LG_Pr_3_DMA_Control_Reg_Handle:                       ; Memory location
                                                        ; to store the address
         .word   LG_from_Pr_3_DMA_Control               ; of the Control
                                                        ; Register for the
                                                        ; DMA Channel 
                                                        ; corresponding to
                                                        ; the Previous "3"
                                                        ; LDSP.


******************************************************************************
*  Cross-References                                                          *
******************************************************************************

******************************************************************************
*   Include the Local Definitions and References                             *
******************************************************************************

    .include    "l_refdef.inc"
                
******************************************************************************
*       End of this module                                                   *
******************************************************************************

         .end
                                                    
