Figure9.7 scripts sequence to move data, Scripts sequence to move data – Avago Technologies LSI53C1010 User Manual
Page 212

9-14
SCRIPTS Programming Topics
Figure 9.7
SCRIPTS Sequence to Move Data
Move_Data:
JUMP REL(RW_Offset_patch_di), WHEN DATA_IN
;During a write command, some devices disconnect after all the
;data has been sent and reselect with Status and msg_in. The
;following instructions prevents phase mismatch when this
;happens.
JUMP REL(RW_Handle_Phase) WHEN NOT DATA_OUT
; *** Script move data out ENTRY
RW_Offset_patch_do:
;Relative offset will be changed so that we jump
;into the proper place in the scatter gather list
JUMP REL(Data_Out_xfer); Data_Out_xfer:
CHMOV FROM data_buf1, WHEN DATA_OUT CHMOV FROM data_buf2, WHEN DATA_OUT
; 16 moves to support Scatter Gather
CHMOV FROM data_buf3, WHEN DATA_OUT
CHMOV FROM data_buf4, WHEN DATA_OUT
CHMOV FROM data_buf5, WHEN DATA_OUT
CHMOV FROM data_buf6, WHEN DATA_OUT
CHMOV FROM data_buf7, WHEN DATA_OUT
CHMOV FROM data_buf8, WHEN DATA_OUT
CHMOV FROM data_buf9, WHEN DATA_OUT
CHMOV FROM data_buf10, WHEN DATA_OUT
CHMOV FROM data_buf11, WHEN DATA_OUT
CHMOV FROM data_buf12, WHEN DATA_OUT
CHMOV FROM data_buf13, WHEN DATA_OUT
CHMOV FROM data_buf14, WHEN DATA_OUT
CHMOV FROM data_buf15, WHEN DATA_OUT
CHMOV FROM data_buf16, WHEN DATA_OUT
; Check to see if we need more SG list entries
;In older LSI53C8XX chips, SBR = DWT
MOVE SBR & RW_NEED_MORE_SG_ENTRIES to SFBR
INT RW_Need_More_SG, if not 0
; If we are here then all the data was transferred
; so we set a flag to indicate that
MOVE SBR | RW_ALL_DATA_TRANSFERRED to DWT
JUMP REL(RW_Handle_Phase)
; *** Script move data ENTRY
RW_Offset_patch_di:
;Relative offset will be changed so that we jump into the
;proper place in the scatter gather list
JUMP REL(Data_In_xfer); Data_In_xfer:
CHMOV FROM rw_data_buf1, WHEN DATA_IN CHMOV FROM rw_data_buf2, WHEN DATA_IN
; 16 moves to support Scatter Gather
CHMOV FROM rw_data_buf3, WHEN DATA_IN
CHMOV FROM rw_data_buf4, WHEN DATA_IN
CHMOV FROM rw_data_buf5, WHEN DATA_IN
CHMOV FROM rw_data_buf6, WHEN DATA_IN
CHMOV FROM rw_data_buf7, WHEN DATA_IN
CHMOV FROM rw_data_buf8, WHEN DATA_IN
CHMOV FROM rw_data_buf9, WHEN DATA_IN