NC_DSP_Control IDNT ; title Rev 23-MAR-1994 SECTION NC_DSP_Control,4,C ; Declare a noncommon code ; section. Align to Longwords. INCLUDE 135Bug_Equates.Include ; Get the 135Bug "Sytem Calls". ************************************************************************* * This section defines program-specific macros: * * * * SOFTWAIT: Software delay timer for short waits * * * ************************************************************************* SoftWait MACRO ; Software timer loop. LOCAL WaitMore ; Define a local symbol. MOVE.L \1,D4 ; Load delay time \1 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. ************************************************************************* * This is the code section * ************************************************************************* Start MOVE.L #1,D0 ; Get the Cashe running MOVEC D0,CACR MOVE.L #$F92C,D0 ; Enable the VSB Interface MOVE.L #$FFFA0000,A1 ; (as the Controller) MOVE.W D0,(A1) PEA.L Hello_0_Loc ; push message address on stack. JSR ChrStrgOut ; and send it out. PEA.L Hello_1_Loc ; push message address on stack. JSR ChrStrgOut ; and send it out. PEA.L Hello_2_Loc ; push message address on stack. JSR ChrStrgOut ; and send it out. PEA.L Hello_3_Loc ; push message address on stack. JSR ChrStrgOut ; and send it out. PEA.L Hello_4_Loc ; push message address on stack. JSR ChrStrgOut ; and send it out. PEA.L Hello_Q_Loc ; push message address on stack. JSR ChrStrgOut ; and send it out. SOFTWAIT #$1000 ; Wait about 3 mill seconds. PEA.L CharSpace ; Push space and carage return message JSR ChrStrgOut ; on the stack and send it out. SUBQ.L #2,SP ; Allocate stack space for result SYSCALL .inchr ; Get a character MOVE.B (SP)+,D0 ; Put the character in D0 PEA.L Char_is_Loc ; push message address on stack JSR ChrStrgOut ; and send it out MOVE.L D0,-(A7) ; Put keypress on stack JSR SendCharP1 ; and send it out PEA.L CharSpace ; Push space and carage return message JSR ChrStrgOut ; on the stack and send it out. IF.B D0 #'1' THEN.S MOVE.L #Perform_Transfer_Word,D1 MOVE.L #Normal_Wakeup_Word,D2 JMP Setup ENDI IF.B D0 #'2' THEN.S MOVE.L #No_Transfer_Word,D1 MOVE.L #Normal_Wakeup_Word,D2 JMP Setup ENDI IF.B D0 #'3' THEN.S MOVE.L #Perform_Transfer_Word,D1 MOVE.L #MFP_Wakeup_Word,D2 JMP Setup ENDI IF.B D0 #'4' THEN.S MOVE.L #No_Transfer_Word,D1 MOVE.L #MFP_Wakeup_Word,D2 JMP Setup ENDI PEA.L BadCharLoc ; push message address on stack. JSR ChrStrgOut ; and send it out. PEA.L CharSpace ; Push space and carage return message JSR ChrStrgOut ; on the stack and send it out. JMP Start ; Go back! Setup MOVE.L #0,D0 ; Set the Loop Counter to 0 MOVE.L #SEK_to_DSP_A_Stat_Base_Address,A1 ; A1 = pointer to WUW for DSP A MOVE.L #SEK_to_DSP_B_Stat_Base_Address,A2 ; A2 = pointer to WUW for DSP B MOVE.L #SEK_to_DSP_C_Stat_Base_Address,A3 ; A3 = pointer to WUW for DSP C MOVE.L #LDSP_A2_to_68K_Stat_Base_Address,A4 MOVE.L #LDSP_B3_to_68K_Stat_Base_Address,A5 MOVE.L #LDSP_C3_to_68K_Stat_Base_Address,A6 ; A4 = pointer to LDSP_A2-to-68K ; Status Base Address ; A5 = pointer to LDSP_B3-to-68K ; Status Base Address ; A6 = pointer to LDSP_C3-to-68K ; Status Base Address MOVE.L #GDSP_B2_to_68K_Stat_Base_Address,A0 ; A0 = pointer to GDSP_B2-to-68K ; Status Base Address Loop Set_TW_Invalid MOVE.L #Transfer_Word_Invalid,8(A2) ; Set Transfer Word Invalid for ; Hydra B Set_WUW_Invalid MOVE.L #Wakeup_Word_Invalid,(A1) ; Set Local WUW Invalid for ; Hydra A MOVE.L #Wakeup_Word_Invalid,(A2) ; Set Local WUW Invalid for ; Hydra B MOVE.L #Wakeup_Word_Invalid,(A3) ; Set Local WUW Invalid for ; Hydra C MOVE.L #Wakeup_Word_Invalid,4(A2) ; Set Global WUW Invalid ; for Hydra B Wait_for_DSP_Ready_and_Waiting REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP A2 and A3 to synch UNTIL.W (A4) #Local_Looking_for_Valid_W_U_W AND.W 32(A4) #Local_Looking_for_Valid_W_U_W REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP A4 and A1 to Synch UNTIL.W 64(A4) #Local_Looking_for_Valid_W_U_W AND.W 96(A4) #Local_Looking_for_Valid_W_U_W REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP C3 and C4 to synch UNTIL.W (A6) #Local_Looking_for_Valid_W_U_W AND.W 32(A6) #Local_Looking_for_Valid_W_U_W REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP C1 and C2 to Synch UNTIL.W 64(A6) #Local_Looking_for_Valid_W_U_W AND.W 96(A6) #Local_Looking_for_Valid_W_U_W REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP B3 and B4 to synch UNTIL.W (A5) #Local_Looking_for_Valid_W_U_W AND.W 32(A5) #Local_Looking_for_Valid_W_U_W REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP B1 and GDSP to Synch UNTIL.W 64(A5) #Local_Looking_for_Valid_W_U_W AND.W (A0) #Global_Looking_for_Valid_W_U_W Set_WUW_Valid MOVE.L D2,(A1) ; Set Local Wakeup Word to DSP A MOVE.L D2,(A2) ; Set Local Wakeup Word to DSP B MOVE.L D2,(A3) ; Set Local Wakeup Word to DSP C MOVE.L D2,4(A2) ; Set Global Wakeup Word to DSP B Wait_for_Global_DSP_Answer REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control condition ; to be satisfied UNTIL.W (A0) #Global_Evaluated_all_Terms Set_TW_Valid MOVE.L D1,8(A2) ; Set Transfer Word Valid (indicating ; that the transfer to 214 should be ; performed, or not as chosen ; earlier) to Hydra B Wait_for_Synch REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP A2 and A3 to synch UNTIL.W (A4) #Local_Cleaned_Up_Wait_for_Synch AND.W 32(A4) #Local_Cleaned_Up_Wait_for_Synch REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP A4 and A1 to Synch UNTIL.W 64(A4) #Local_Cleaned_Up_Wait_for_Synch AND.W 96(A4) #Local_Cleaned_Up_Wait_for_Synch REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP C3 and C4 to synch UNTIL.W (A6) #Local_Cleaned_Up_Wait_for_Synch AND.W 32(A6) #Local_Cleaned_Up_Wait_for_Synch REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP C1 and C2 to Synch UNTIL.W 64(A6) #Local_Cleaned_Up_Wait_for_Synch AND.W 96(A6) #Local_Cleaned_Up_Wait_for_Synch REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP B3 and B4 to synch UNTIL.W (A5) #Local_Cleaned_Up_Wait_for_Synch AND.W 32(A5) #Local_Cleaned_Up_Wait_for_Synch REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied ; Wait for LDSP B1 and GDSP to Synch UNTIL.W 64(A5) #Local_Cleaned_Up_Wait_for_Synch AND.W (A0) #Global_Cleaned_Up_Wait_for_Synch ADDQ.L #1,D0 ; Increment the Loop Counter Go_to_Top_of_Loop JMP Loop ; Go back! ************************************************************************* * Constants defined with EQU directives * ************************************************************************* B3_B4_B1_MFP_Data_Length EQU 810 ; Length of the ; MFP Sections of ; interest LDSP_A2_to_68K_Stat_Base_Address EQU $00A07c80 ; Base Address of ; the "Status to LDSP_A3_to_68K_Stat_Base_Address EQU $00A07ca0 ; 68K Services" block ; for each of the LDSP_A4_to_68K_Stat_Base_Address EQU $00A07cc0 ; Local DSP and ; the Global DSP LDSP_A1_to_68K_Stat_Base_Address EQU $00A07ce0 LDSP_B3_to_68K_Stat_Base_Address EQU $00B07d00 LDSP_B4_to_68K_Stat_Base_Address EQU $00B07d20 LDSP_B1_to_68K_Stat_Base_Address EQU $00B07d40 LDSP_C3_to_68K_Stat_Base_Address EQU $00C07d60 LDSP_C4_to_68K_Stat_Base_Address EQU $00C07d80 LDSP_C1_to_68K_Stat_Base_Address EQU $00C07da0 LDSP_C2_to_68K_Stat_Base_Address EQU $00C07dc0 GDSP_B2_to_68K_Stat_Base_Address EQU $00B07de0 DSP_to_68K_Stat_Block_Size EQU LDSP_B4_to_68K_Stat_Base_Address-LDSP_B3_to_68K_Stat_Base_Address SEK_to_DSP_A_Stat_Base_Address EQU $00A07e00 ; Base address ; of the "Status SEK_to_DSP_B_Stat_Base_Address EQU $00B07e00 ; from the "68K ; Services" block. SEK_to_DSP_C_Stat_Base_Address EQU $00C07e00 ; Each block ; serves ALL ; DSPs on ONE ; Hydra card. Wakeup_Word_Invalid EQU $aa00ff00 ; Transfer and ; Wakeup Words Normal_Wakeup_Word EQU $55000007 ; generated by ; this program MFP_Wakeup_Word EQU $55070107 Transfer_Word_Invalid EQU $aa0000ff Perform_Transfer_Word EQU $55000001 No_Transfer_Word EQU $55000000 Local_Looking_for_Valid_W_U_W EQU $0001 ; This Local DSP ; is Ready for the ; the next (or first) ; loop and is looking ; for a valid ; Wake Up Word Local_Received_Valid_W_U_W EQU $0003 ; This Local DSP ; has received a ; Valid Wake Up Word Local_Received_all_ERPB_Data EQU $0007 ; This Local DSP ; has received all ; of its ERPB Data Local_Started_Loc_Glob_Xfr EQU $000f ; This Local DSP ; has started its ; part(s) of the Local ; to Global Xfr Local_Finished_Loc_Glob_Xfr EQU $001f ; This Local DSP ; has finished its ; part(s) of the Local ; to Global Transfer ; (including Mark and ; Force Pass Data ; if applicable) Local_Cleaned_Up_Wait_for_Synch EQU $101f ; This Local DSP ; has cleaned up ; from this Cycle ; and is waiting ; for all DSPs to ; re-synchronize. ; The EC will announce ; this re-synching ; by setting the ; Wake Up Word ; invalid Global_Looking_for_Valid_W_U_W EQU $0001 ; The Global DSP ; is Ready for the ; the next (or first) ; loop and is looking ; for a valid ; Wake Up Word Global_Received_Valid_W_U_W EQU $0003 ; The Global DSP ; has received a ; Valid Wake Up Word Global_Received_all_Local_Data EQU $0007 ; The Global DSP ; has received all ; of its Data from ; all Local DSPS. ; This includes the ; Mark and Force ; Pass Data if ; applicable Global_Evaluated_all_Terms EQU $000f ; The Global DSP ; has evaluated all ; Terms and is now ; providing the ; Term Answer Word ; to the EC Global_Finished_Xfr_to_214 EQU $001f ; The Global DSP ; has finished the ; transfer of the ; DSP-sourced Data ; in the Data Block ; to the MVME214. ; This includes ; Mark and Force ; Pass Data if ; applicable Global_Skipped_Xfr_to_214 EQU $002f ; The Global DSP ; has skipped ; the transfer to ; the 214 Global_Cleaned_Up_Wait_for_Synch EQU $101f ; The Global DSP ; has cleaned up ; from this Cycle ; and is waiting ; for all DSPs to ; re-synchronize. ; The EC will announce ; this re-synching ; by setting the ; Wake Up Word ; invalid ************************************************************************* * Data defined with DC directives * ************************************************************************* Hello_0_Loc DC.B 50,' Hello from the Baby DSP Control Program ' Hello_1_Loc DC.B 50,' 1: Transfer will be performed on Normal ' Hello_2_Loc DC.B 50,' 2: NO Transfer will be performed on Normal ' Hello_3_Loc DC.B 50,' 3: Transfer will be performed on MFP ' Hello_4_Loc DC.B 50,' 4: NO Transfer will be performed on MFP ' Hello_Q_Loc DC.B 50,' Choose an option (1 .. 4): ' Char_is_Loc DC.B 50,' You have pressed the following key: ' BadCharLoc DC.B 50,' ILLEGAL KEY, TRY AGAIN PLEASE ' Goodbye_Loc DC.B 50,' Goodbye from the Baby DSP Control Program ' Cyc_Msg_Loc DC.B 4,'1 ' CharSpace DC.B 4,' ' Low4Long DC.L $0000000F ; Low order 4 bits set, Mask for Sync. Data_Block_Storage_Loc DS.L B3_B4_B1_MFP_Data_Length ; Storage space ; for Data Block ************************************************************************* * Cross-References * ************************************************************************* XREF ChrStrgOut,ChrWrtOut,BinASCII,SendCharP1 XDEF Low4Long XDEF B3_B4_B1_MFP_Data_Length XDEF Data_Block_Storage_Loc ************************************************************************* * End of this module * ************************************************************************* END