OL_DSP_Control IDNT ; title Rev 16-MAY-1995 SECTION NC_DSP_Control,4,C ; Declare a noncommon code ; section. Align to Longwords. * FOR 133 VERSION UNCOMMENT THE FOLLOWING LINE INCLUDE 133Bug_Equates.Include ; Get the 133Bug "Sytem Calls". * FOR 135 VERSION UNCOMMENT THE FOLLOWING LINE * INCLUDE 135Bug_Equates.Include ; for 135Bug ************************************************************************* * 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 * FOR 135 VERSION UNCOMMENT THE FOLLOWING 3 LINES * 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_5_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 MOVE.L #Normal_Wakeup_Word,D3 JMP Setup ENDI IF.B D0 #'2' THEN.S MOVE.L #No_Transfer_Word,D1 MOVE.L #Normal_Wakeup_Word,D2 MOVE.L #Normal_Wakeup_Word,D3 JMP Setup ENDI IF.B D0 #'3' THEN.S MOVE.L #Perform_Transfer_Word,D1 MOVE.L #MFP_Wakeup_Word,D2 MOVE.L #MFP_Wakeup_Word,D3 JMP Setup ENDI IF.B D0 #'4' THEN.S MOVE.L #No_Transfer_Word,D1 MOVE.L #MFP_Wakeup_Word,D2 MOVE.L #MFP_Wakeup_Word,D3 JMP Setup ENDI IF.B D0 #'5' THEN.S MOVE.L #Perform_Transfer_Word,D1 MOVE.L #MFP_Wakeup_Word,D2 MOVE.L #Normal_Wakeup_Word,D3 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_C_Stat_Base_Address,A1 ; A1 = pointer to WUW for DSP C MOVE.L #LDSP_C1_to_68K_Stat_Base_Address,A3 MOVE.L #LDSP_C2_to_68K_Stat_Base_Address,A4 MOVE.L #LDSP_C3_to_68K_Stat_Base_Address,A5 MOVE.L #LDSP_C4_to_68K_Stat_Base_Address,A6 ; A3 = pointer to LDSP_C1-to-68K ; Status Base Address ; A4 = pointer to LDSP_C2-to-68K ; Status Base Address ; A5 = pointer to LDSP_C3-to-68K ; Status Base Address ; A6 = pointer to LDSP_C4-to-68K ; Status Base Address Loop Set_WUW_Invalid MOVE.L #Wakeup_Word_Invalid,(A1) ; Set Local WUW Invalid for ; Hydra C (DSP C1, C2, C3, C4) Wait_for_DSP_Ready_and_Waiting REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied UNTIL.W (A3) #Local_Looking_for_Valid_W_U_W AND.W (A4) #Local_Looking_for_Valid_W_U_W REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied UNTIL.W (A5) #Local_Looking_for_Valid_W_U_W AND.W (A6) #Local_Looking_for_Valid_W_U_W Set_WUW_Valid MOVE.L D2,(A1) ; Set Wakeup Word Valid (indicating ; Normal or MFP L1.5 CT Cycle) to ; Hydra C (DSP C1, C2, C3, C4) MOVE.L D2,D5 ; Pick wakeup word for next cycle. MOVE.L D3,D2 MOVE.L D5,D3 Wait_for_Global_DSP_Answer * REPEAT * * NOP ; Dummy Instruction, we are waiting * ; for the structured control condition * ; to be satisfied * * UNTIL.W (A4) #Global_Evaluated_all_Terms Set_TW_Valid * MOVE.L D1,(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 UNTIL.W (A3) #Local_Cleaned_up_Wait_for_Synch AND.W (A4) #Local_Cleaned_up_Wait_for_Synch REPEAT NOP ; Dummy Instruction, we are waiting ; for the structured control conditions ; to be satisfied UNTIL.W (A5) #Local_Cleaned_up_Wait_for_Synch AND.W (A6) #Local_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 $00B07c80 ; Base Address of ; the "Status to LDSP_A3_to_68K_Stat_Base_Address EQU $00B07ca0 ; 68K Services" block ; for each of the LDSP_A4_to_68K_Stat_Base_Address EQU $00B07cc0 ; Local DSP and ; the Global DSP LDSP_A1_to_68K_Stat_Base_Address EQU $00B07ce0 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 $00B07d60 LDSP_C4_to_68K_Stat_Base_Address EQU $00B07d80 LDSP_C1_to_68K_Stat_Base_Address EQU $00B07da0 LDSP_C2_to_68K_Stat_Base_Address EQU $00B07dc0 GDSP_B2_to_68K_Stat_Base_Address EQU $00B07de0 SEK_to_DSP_A_Stat_Base_Address EQU $00B07e00 ; 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 $00B07e00 ; 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 $801f ; 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 $0008 ; 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 $801f ; 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_5_Loc DC.B 50,' 5: Transfer on alternating normal/MFP ' Hello_Q_Loc DC.B 50,' Choose an option (1 .. 5): ' 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