📄 ncr710init.n
字号:
;/* if none that's a new command to start */jump PASS((UINT)startNewCmd) if 0;/* clear sigp and go to reselected code */move CTEST2 & B_SIGP to SFBRwait RESELECT PASS((UINT)selectAddr)jump PASS((UINT)reselect)PROC startNewCmd:;/* test and clear the sigp bit */move CTEST2 & B_SIGP to SFBR;/* that's a new command interrupt cpu */jump REL(intCpuNewCmd) if not 0;/* that's an big error go to wait entry point */int PASS(BAD_NEW_CMD)jump PASS((UINT)waitSelect)intCpuNewCmd:int PASS(NEW_COMMAND_PROCESS)PROC reselSelect:int PASS(RECONNECT_IN_SELECT);/******************************************************************************;* First entry point of the script select ;* with ATN.;*;*/PROC selWithAtn:; /* Turn on time out before a select */;to be comment when you want debuging scriptmove CTEST7 & ~B_TIMEO to CTEST7 ;to be uncomment when you want debuging script;move CTEST7 | B_TIMEO to CTEST7 ;/* stamps current requested phase */move PHASE_NOPHASE to SCRATCH0 ;/* Select device */select ATN from DEVICEID ,PASS((UINT)checkNewCmd);select ATN from DEVICEID ,PASS((UINT)reselSelect); /* If status accept it */jump PASS((UINT)endTransact),when STATUS; /* only this phase must occur after a select with ATN */jump PASS ((UINT) msgOut1) when MSG_OUTint PASS(MSGOUT_EXPECT),if not MSG_OUT;/******************************************************************************;* Entry for select without attention asserted ;* be used.;* selWithoutATN ;*/PROC selWithoutAtn:; /* Turn on time out before a select */;to be commented when you want debuging scriptmove CTEST7 & ~B_TIMEO to CTEST7 ;to be uncommented when you want debuging script;move CTEST7 | B_TIMEO to CTEST7 ;/* Log requested phase */move PHASE_NOPHASE to SCRATCH0;/* select device */select from DEVICEID ,PASS((UINT)checkNewCmd)jump PASS ((UINT) contTransact) ;/******************************************************************************;* Main proc to handle a complete scsi ;* transaction ;*/ PROC contTransact:; /* if status phase just after select */jump PASS((UINT)endTransact),when STATUS; /* check and jump to a normal phase after a select */jump PASS((UINT)msgOut1),when MSG_OUTjump PASS((UINT)endTransact),when STATUSjump PASS((UINT)msg1),when MSG_INint PASS(BAD_PH_BEFORE_CMD),if not CMD; /* Turn off time out after a select, some commands take a long time */move CTEST7 | B_TIMEO to CTEST7 move PHASE_COMMAND to SCRATCH0move from PASS(CMDCOUNT) ,when CMD; /* Jump to a normal phase after a command */jump PASS((UINT)msg2),when MSG_INjump PASS((UINT)endTransact),if STATUSjump PASS((UINT)inputData),if DATA_INjump PASS((UINT)outputData),if DATA_OUTint PASS(BAD_PH_AFTER_CMD);/******************************************************************************; * Process the end of a scsi transaction.; * ; */ PROC endTransact:move CTEST7 & ~B_TIMEO to CTEST7move PHASE_STATUS to SCRATCH0;/* status first */move from PASS(STATUSCOUNT),when STATUSint PASS(MSGIN_EXPECT_AFTER_ST), when not MSG_INmove PHASE_MSGIN to SCRATCH0;/* command complete follow */move from PASS(MSGINCOUNT), when MSG_INint PASS(BAD_MSG_INSTEAD_CMDCOMP), if not M_CMD_COMP clear ACK; /* Turn on time out */move CTEST7 & ~B_TIMEO to CTEST7 ;/* get off bus ,wait free phase */wait DISCONNECTint PASS(GOOD_END);/* Process a message out and go to the target requested phase */PROC msgOut1:move PHASE_MSGOUT to SCRATCH0 move from PASS(MSGOUTCOUNT) ,when MSG_OUTjump PASS((UINT)contTransact),when COMMANDjump PASS((UINT)contTransact) if STATUS jump PASS((UINT)inputData) if DATA_IN jump PASS((UINT)outputData) if DATA_OUT jump PASS((UINT)msg1) if MSG_IN int PASS(PH_UNKNOWN);/* same as msgout1 but use after data phase */PROC msgOut3:move PHASE_MSGOUT to SCRATCH0move from PASS(MSGOUTCOUNT) ,when MSG_OUTjump PASS((UINT)contTransact),when COMMANDjump PASS((UINT)contTransact) if STATUSjump PASS((UINT)inputData) if DATA_INjump PASS((UINT)outputData) if DATA_OUTjump PASS((UINT)msg3) if MSG_INint PASS(PH_UNKNOWN);/* process a data out phase */PROC outputData:move PHASE_DATAOUT to SCRATCH0move from PASS(DATACOUNT),when DATA_OUT;/* handle the end of a transaction after a data phase */PROC checkOut:jump PASS((UINT)endTransact),when STATUSjump PASS((UINT)msg3),when MSG_INjump PASS((UINT) asortPh);;/* process a data in phase */PROC inputData:move PHASE_DATAIN to SCRATCH0;move CTEST7 & ~B_TIMEO to CTEST7move from PASS(DATACOUNT),when DATA_INjump PASS((UINT)checkOut) ;/* proc to receive a message from target before command phase */PROC msg1:move PHASE_MSGIN to SCRATCH0move from PASS(MSGINCOUNT),when MSG_IN;/* check for extended msg */jump REL(extMsg1),if M_EXT_MSG ;/* int cpu to save data pointer */int PASS(SAVDATP_BEFORE_CMD), if M_SAV_DAT_P ;/* int cpu to restore pointer */int PASS(RESTORE_POINTER), if M_REST_P;/* jump to disconnect process if disconnect msg */jump REL(disc1), if M_DISC;/* int cpu for a reject msg received ,the cpu have to find out ; which message have been rejected */int PASS(REJECT_MSG1), if M_MSG_REJECTint PASS(BAD_MSGIN_BEFORE_CMD);/* sub-proc entry point for an extended msg in */extMsg1:; /* accept first byte message */ clear ACK;/* get the remain of the extended msg */move from PASS(EXTMSGINCOUNT),when MSG_IN;/* int cpu to process this extended message */int PASS(EXTMSG_BEFORE_CMD)disc1:;/* accept message byte */clear ACK;/* wait for a legal disconnect from the target */wait DISCONNECT;/* int cpu to process disconnect on this device */int PASS(DISC_BEFORE_CMD);/* SAME AS MSG1 but after cmd phase */PROC msg2:move PHASE_MSGIN to SCRATCH0move from PASS(MSGINCOUNT) ,when MSG_INjump REL(extMsg2),if M_EXT_MSGint PASS(SAVDATP_AFTER_CMD),if M_SAV_DAT_Pint PASS(RESTORE_POINTER),if M_REST_Pjump REL(disc2),if M_DISCint PASS(BAD_MSG_AFTER_CMD)extMsg2:clear ACKmove from PASS(EXTMSGINCOUNT),when MSG_INint PASS(EXTMSG_AFTER_CMD)disc2:clear ACKwait DISCONNECTint PASS(DISC_AFTER_CMD);/* SAME AS MSG1 but after data phase */PROC msg3:move PHASE_MSGIN to SCRATCH0move from PASS(MSGINCOUNT) ,when MSG_INjump REL(extMsg3),if M_EXT_MSGint PASS(SAVDATP_AFTER_DATA),if M_SAV_DAT_Pint PASS(RESTORE_POINTER),if M_REST_Pjump REL(disc3),if M_DISCint PASS(BAD_MSG_AFTER_DATA) extMsg3:clear ACKmove from PASS(EXTMSGINCOUNT),when MSG_INint PASS(EXTMSG_AFTER_DATA) disc3:clear ACKwait DISCONNECTint PASS(DISC_AFTER_DATA);/* int cpu to signal an initator selection as a target */PROC selectAddr:int PASS(SELECT_AS_TARGET);/* restart entry point to accept a message before/after cmd phase */PROC ackMsg1:; /* Accept any msg ,usual restart entry point after an extended msg in */clear ACKjump PASS((UINT)msg1),when MSG_INjump PASS ((UINT) asortPh);/* restart entry point to accept a message after/during data phase */PROC ackMsg3:; /* Accept any msg ,usual restart entry point after an msg in after data in/out */clear ACKjump PASS((UINT)msg3),when MSG_INjump PASS ((UINT) checkPhData);/* usual restart entry after a phase mismatch during data tranfert or; * a save data pointer after a data phase */PROC checkPhData:jump PASS((UINT)inputData),when DATA_INjump PASS((UINT)outputData),if DATA_OUTjump PASS((UINT)msgOut3),if MSG_OUTjump PASS((UINT)endTransact),if STATUSjump PASS((UINT) contTransact),if CMDjump PASS((UINT)msg3),if MSG_INjump PASS((UINT)reserOutPh),if RES4jump PASS((UINT)reserInPh),if RES5int PASS(PH_UNKNOWN); /* renegotiate for a message out ,restart point if any; message out to send */PROC ackAtnMsg:set ATNclear ACKmove PHASE_MSGOUT to SCRATCH0move from PASS(MSGOUTCOUNT) ,when MSG_OUTjump PASS((UINT) asortPh) when not MSG_OUTint PASS(PH_UNKNOWN)PROC asortPh:; /* restart to try to fisnish properly the transaction */clear ATNjump PASS((UINT)inputData),when DATA_INjump PASS((UINT)outputData),if DATA_OUTjump PASS((UINT)msgOut1),if MSG_OUTjump PASS((UINT)endTransact),if STATUSjump PASS((UINT) contTransact),if CMDjump PASS((UINT)msg1),if MSG_INjump PASS((UINT)reserOutPh),if RES4jump PASS((UINT)reserInPh),if RES5int PASS(PH_UNKNOWN);/* reserved phase detected on scsi */PROC reserOutPh:move PHASE_UNDEF1 to SCRATCH0int PASS(RES_OUT_DETECTED);/* reserved phase detected on scsi */PROC reserInPh:move PHASE_UNDEF2 to SCRATCH0int PASS(RES_IN_DETECTED);/******************************************************************************;* Entry point use when you decide to send a clear ;* or an abort message to the target ;* This is necessary because some target accept ;* only a pair of sync Message.You can't negotiate ;* again if the scsi controller can't fit the sync;* target values returned.;* Like the agreement is implicit the only way to ;* clear the sync value in the target is to send a ;* reset bus device message;;*/PROC endAbort:set ATNclear ACKmove PHASE_MSGOUT to SCRATCH0move from PASS(MSGOUTCOUNT) ,when MSG_OUTwait DISCONNECTint PASS(ABORT_CLEAR_END);/* End of Script */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -