IMD 1.17: 11/11/2014 10:46:15 82VKXSVRDOS B* VERSADOS/RMS68K SRC/OBJ 4.4 (NOT BOOTABLE) SN=49367 4 OF 30  SR04q82VKXSVRDOS 0420¥m-)žF3 Hç€pab$¼B€0*å€\€2€ Kp,, (-"¸´pg \GSfô0<ýNuB4pNuHçþ/>,, F3 (-"¸´pg \GSfô0<ý`B† ôp.LßNuHçþ/>,, "-"²´pg \GF3 Sfô0<ý`BBBA tp4pÂBƒ.LßNurB‚½ñf 01a3¼ÿÿ\R‚ ‚F3 fâB€`þ m"NuHçþBƒrB‚B€0+6+g½ñfƒJCfa`R‚\F3 ‚fà0<ò`B€Lß`²/ $m"$_Nu/ $m"±$_Nu/ $m"0+@ÿgF3 Ê$_NuHçþBƒrB‚B€0+6g½ñf¤ƒJCfa¸`R‚\ ‚fà`ŒLßF3 B€`DHçþB…BƒrB‚B€0+6@ÿg½ñfÿbƒJCfa€`\R‚`ä7E`ÿPF3 0<ô``ø6€NuŸü /KB†BƒB‚B€0+J@gpB…:3`/E. ߯.aÌÎüF3 XG½ñpf2&3`g4\FAúTB-)$/Hçÿþ"Cp"N@`` aþèLßÿS@`¨B€0<öF3 `B€0<ø`LßÿB€0<ñ`&oB€ßü `ÿdHçÿþ*A…ÿ($< F3 aB aþœÈüD XD$y(,mPB‡* ,-&* ¼ƒg Ôü4Sk`î02@a$LßF3 ÿNsQB¯RoJEgçïSE`ô:/PNu02@ff(-"a ` NpN@F3 NuHçÿþ NpN@``LßÿNu`øfJ…g i6pN@`` J…gJ0PfT—T—NuHçF3 þŸü $y(B‡* -&* °ƒg Ôü4Sk`î/J$< /BB„pÞü 3 Lßþ|ÿþNu4é(;1FTACO ASREL' M615LIB SA$S(…ACO subroutines`2IACOPEN IACOOFF RIACOCLS .IACOPLS nIACOSTA `IACOOUT @)¾F3 Hç€pa‚$¼B€0*å€\€2€ Kp:ÄüX‚Jq jBR‡63/C&/a^ @ýg03ƒ #Ž XAS@nÄF3 a| @ýgB€`40<ö`.0<÷`(0<ý`"0<þJGg6<ÿÿB43ÄüX‚3ƒ XASGnìF3 PLß`øHçþ/>,, (-"¸´pg \GSfô0<ý`B† ôp.LßNuHçF3 þ/>,, "-"²´pg \GSfô0<ý`BBBA tp4pÂBƒ.LßNu>,F3 , (-"¸´pg \GSfô0<ýNuB4pNurB‚½ñf 01a3¼ÿÿ\R‚ ‚F3 fâB€`: m"NuHçþBƒrB‚B€0+6+g½ñfƒJCfa`R‚\ ‚F3 fà0<ò`B€Lß`î/ $m"$_NuHçþBƒrB‚B€0+6g½ñfȃJCF3 fa`R‚\ ‚fà`°LßB€`¤/ $m"±$_NuHçþB…BƒrB‚B€0+6@F3 ÿg½ñfÿxƒJCfa`\R‚`ä7E`ÿf/ $m"0+@ÿgÊ$_Nu0,, (-"¸´pgG Sfò0<ý`(B† oQF3 f ´p` ôp` g ôp.LßNu ´pa`îýþÿþ ï÷ÿ÷F3 HçÿþB€Jk4g gpgP@B2;Æ €x騃ÿá‹‚ƒ‚€F3 aLßÿNuB€âÞ;ªPÃ4pà‰ƒ4pà‰ƒ4pÿ≀ƒ4pNuHçþ/>,, F3 "-"²´pgG Sfò0<ý`Ð@Æ|BBBA tpÐFD¨ÈBFB4pF3 ÂB€4p€èƒFDÉBBBAè(FD¨ (ÈBFB4pÂB(€4F3 p@è ƒ(FDÉ(J(J(JJ((ä€4p@( ä€4p F3 @ ( ä€4p @ (ä€4p @B€FÆ.LßNu>,, (-"¸´pF3 gG Sfò0<ýNuB´pB´pNurB‚½ñf01a3¼ÿÿ\R‚ ‚fàB€F3 `À m" lV¨èf ff<`< nF3 ¨ Nu n¨`ò n¨`æ¨ `à Q€¨ ¨è ¨NuHçF3 þBƒrB‚B€0+6+g½ñf"81gƒJCfa&`R‚\ ‚fÔ0,f2`2)aü0aüTNuÿÿHçþrB‚B€0+ @ÿn®g0½ñF3 fþ:81fþ4fþ,Ä3„HçÿþaLßÿR‚\ ‚fÀ`ÿrCúF3 aÿ~Nuþ÷Ÿü /KB†BƒB‚B€0+J@gŠB…:3`/E. ߯.a¦ÎüF3 XG½ñpfB61pg@&+gBAúdB-)$/"CHçÿþp"N@``.LßÿHçÿþ F3 aý’LßÿS@`–B€<ö`"B€<ù`B€<ø`LßÿB€8ñ`&oB€ßü `DF3 Hçÿþ*A…ÿa aý˜LßÿNsQB¯RoJEg çïSE`ò:/PF3 Nu6€Nup N@fJ…g i6pN@`` J…gJ0PfT—T—NupN@`NqT—NuHçþF3 ŸüB¯ $y(B‡* -&* °ƒg ÔøSk”`ì/J$< aÆ/BB„F3  gtR¯ ÈüD XD$y(,r@02@@gJ. Þ$Aú8B-)àHÀüF3 "|2@NVÿ¸H×ÿp"N@``L×ÿ(nBÿaþL×ÿN^` $/a" / ÞüF3 LßþJ€g |`|ÿþNu02@f(-"aVNu` NpN@Nu m"F3 ( g ( f„RB( g( fpRB(g(fdRB(gF3 (fRRB(g(fFRB(g(f4RB( g( f&RBF3 ( g( fRBNuJ(NuJ(NuJNuJ(NuHçÿþ$< BƒB„B†F3 ÈüDAÿ*A"m"$y(B‡ -* ** °…g ÔøSFgJ`î,r@2@gF3 )gHçÿþaþÊLßÿ`)fHçÿþaþ²Lßÿ‚ÿ(JBaûúLßÿNs3 Hçÿþ NpN@``LßÿNu`ø4éé;1FTRIO ASREL' RIOLIB SA2W(…RIO subroutines~2IRIOPEN IRIOOFF RIRIOCLS .IRIOPLS ŠIRIOENB nIRIODSB |IRIOSTA `IRIOOUT @)ÜF3 Hç€pa $¼B€0*å€\€2€ Kp*‚ontheVME600.‚YoumustusetheSAMEchannelonbothboards.*ŠPAGE ,*£ASCVAL,BHLCVT,andCVT2arecommonlyused**£functionswhicharemodulesinalibrary(*£filecalledUTILIB.RO.‚Acalltothese'*£functionsareincludedinthissource)*£program,whichisprovidedwithanXREF&*£declaration.‚Thisalsorequiresthat'*£UTILIB.RObeavailabletothelinkage$*£editorduringthelinkingprocess.%*£SeeTEST605.LFforlinkchainfile. -ŠXREFƒASCVALConvertsASCIItoabinaryvalue$*£ThisroutinewillconvertanASCII,*£characterstringrepresentingadecimalor,*£hexidecimalvaluetotheequivalentbinary,*£value.‚Ifadollarsign($)isencountered&*£hexidecimalconversionisperformed;,*£otherwisedecimalconversionisperformed.+*£Anemptycharacterstringfieldpassedto–BŸ:§J¯>·I¿AÇBÏI×Mß,*£thisfunctioninA0producesazerobinary'*£value.‚Conversionterminateswhenthe)*£firstinvalidcharacterisencountered.'*£ENTRY:‚A0-StartingaddressofASCII*°characterstringtoconvert#*£EXIT:‚D1-Characterthatcaused *°termination%*«D2-Classcodeofterminatingchar"*«D3-Binaryresultofconversion*«A0-Addressofthecharacter *°followingtheterminatingchar 8ŠXREFƒBHLCVTConverts4-bytebinaryvaluetoASCIIdigit)*£Thisroutinewillconvertalongbinary-*£wordvaluetoahexadecimalvalueexpressed)*£asan8characterASCIIstring.‚Leading*£zerosaresuppressed.,*£ENTRY:‚D0.L-Binaryvaluetobeconverted(*£EXIT:‚D2.L-Fourhighorderbytesof*²convertedvalue *«D3.L-Fourloworderbytesof*²convertedvalue 6ŠXREFƒCVT2ConvertstwoASCIIdecimaldigitstobinary-*£ThisroutinewillconverttwoASCIIdecimal(*£digitstotheequivalentbinaryvalue.+*£Anemptycharacterstringfieldpassedto,*£thisfunctioninA0producesazerobinary**£value.‚Conversionterminateswhenanon-*£decimaldigitisencountered)*£ENTRY:‚A0-Addressofmostsignificant*°ASCIIdecimaldigit)*£EXIT:‚D0-Binaryresultofconversion!*«A0-Addressoftheterminating *°character ŠPAGE:BUFSIZEƒEQU„$100Thislabeldefinesthevalueforthesize*£oftheconversiontableS. ŠMOVE.LA0,IOSOUT+16-PBA(A4)SettheendingaddressofmessageŠLEA„IOSOUT(PC),A0ŠTRAPƒ#2ŠENDM ŠPAGE 2ŠOPT„PCSWeuseaPCSoptionsotheassemblerwill%*£forcePCrelativeaddressingwithin(*£SECTION.‚ForcesPCrelativeaddressing-*£(wheneversuchanaddressingmodeislegal))*£inaninstructionwhichoccurswithina'*£relocatableSECTIONandreferencesan,*£operandinarelocatableSECTION(neednot**£bethesameSECTIONastheinstruction).,*£Failuretoresolvesucnareferenceintoa-*£16-bitdisplacementfromthePCwillresult)*£inanerror.‚Thisoptionmaybeusedto+*£forcepositionindependentcode;however,(*£thisoptiondoesnotforcePCrelative,*£addressingofabsoluteoperandsorunknown*£forwardreferences. ŠPAGE N*******************************************************************************Ì**™DATAƒSECTIONœ**Ì*N****************************************************************************** ŠSECTIONDATA =D_ABUF„DS.BƒBUFSIZEŒThisisthebufferareathatwillcontain**£thedelayandtheconversionvaluetobe *£converted. =A_DBUF„DS.BƒBUFSIZEŒThisisthebufferareathatwillcontain(*£theconvertedanalogtodigitalvalue. $PBA‡EQU„*’ProgramBaseAddress(PBA)%*£Thislabelisusedtodesignatethe+*£beginningoftheprogram.‚Thisisusedto'*£makereferencestootherpartsofthe*£program,relocatable. :BUFOFSTƒDC.LƒPBA-D_ABUF‰ThisistheoffsetfromPBAtothe'*£conversiontablesothattherelative**£addresscanbefoundtomaketheprogram*£relocatable. 9ŠDS.WƒSTACKLEN‹ThisisthestackareafortheVME605test2STACK…EQU„*’program.‚Registersandotherimportant,*£informationwillbestoredonthestackas)*£theprogramisexecuted.‚Thestackarea'*£isdynamicandwillchangeduringthe *£executionofthetestprogram. 9BUFADR_DAƒDS.Lƒ1Thisisthestorageareafortheaddress-*£oftheconversiontablefortheD/Adriver. 9BUFADR_ADƒDS.Lƒ1Thisisthestorageareafortheaddress-*£oftheconversiontablefortheA/Ddriver. =INPUTBUF‚DS.WƒSTRNGLEN‹Thisis thestorageareafortheinput*£stringsthatareentered. 9STATUS„DS.Lƒ1’Thiswillbethestorageareforthestatus,*£codethatisreturnedfromCMR.‚Thisvalue-*£willbedisplayedtoshowtheuserwhatthe*£errorcodewas. 6NUMBER„DS.Lƒ2’SaveareafortheASCIIvalueofSTATUS. 8INPUT_VALUE‚DS.W‚1Entereddigitalvaluetobeconverted**£toanalog(D/A)isstoredhereinbinary**£formforlatercomparisonwiththevalue*£readofftheA/D.ŠPAGE N*******************************************************************************Ì*!*–PARAMETERƒBLOCKS—**Ì*N****************************************************************************** ŠNEXTWB”ForceevenboundaryIOSOUTŠDC.Bƒ0’Requestcode"ŠDC.BƒWRITEŽFunctionspecificationŠDC.Wƒ8’OptionsŠDC.Bƒ0’StatusŠDC.BƒCRTLogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress   ŠNEXTWB”ForceevenboundaryIOSINŠDC.Bƒ0’Requestcode!ŠDC.BƒREADFunctionspecificationŠDC.Wƒ0’OptionsŠDC.Bƒ0’Status"ŠDC.BƒKEYBOARD‹LogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress*#*‚CMRInitiateI/Oparameterblock:CMRBLK„DC.Bƒ7’InitiateI/OŠDC.BƒUNUSEDUnusedŠDC.WƒUNUSEDUnused/ŠDC.Lƒ'DAC1'Channelname(Dynamicallychanged)ŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnused$ŠDC.Lƒ0’AddressofI/Ocontrolblock#ŠDC.Lƒ0’LengthofI/OcontrolblockŠPAGE*2*‚OPENcommandparameterblockfortheD/Adriver:*OPEN_DAƒDC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒOPENOpencommandcodeŠDC.Wƒ1’#ofchannelstoopen-ŠDC.Wƒ0’Channeltoopen(Dynamicallychanged)4OLEN_DAƒEQU„*-OPEN_DAŠLengthofOPENparameterblock*5*‚CONVERTcommandparameterblockfortheD/Adriver:*CONV_DAƒDC.Wƒ0’Returnedstatusfromdriver"ŠDC.WƒCONVERTŒConvertcommandcode ŠDC.Wƒ1’#ofchannelstoconvert0ŠDC.Wƒ0’Channeltoconvert(Dynamicallychanged)ŠDC.Wƒ1’#ofconversions%ŠDC.Lƒ0’BufferaddressofconversionsŠDC.Wƒ01‘Wakeupwhendone7CLEN_DAƒEQU„*-CONV_DAŠLengthofCONVERTparameterblock*2*‚OPENcommandparameterblockfortheA/Ddriver:*OPEN_ADƒDC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒOPENOpencommandcode-ŠDC.Wƒ0’Channeltoopen(Dynamicallychanged)4OLEN_ADƒEQU„*-OPEN_ADŠLengthofOPENparameterblock*5*‚CONVERTcommandparameterblockfortheA/Ddriver:*CONV_ADƒDC.Wƒ0’Returnedstatusfromdriver"ŠDC.WƒCONVERTŒConvertcommandcode ŠDC.Wƒ1’#ofchannelstoconvert )ŠDC.Wƒ0’CommandID(returnwhencomplete)0ŠDC.Wƒ0’Channeltoconvert(Dynamicallychanged) ŠDC.Wƒ00‘Channelcompletioncode%ŠDC.Lƒ0’BufferaddressofconversionsŠDC.Wƒ2’BuffersizeinbytesŠDC.Wƒ0’Controlfield7CLEN_ADƒEQU„*-CONV_ADŠLengthofCONVERTparameterblock*@*‚CLOSEcommandparameterblockfortheA/DandtheD/Adrivers:)CLSBLK„DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒCLOSEŽClosecommandcodeCLOSLENƒEQU„*-CLSBLK ŠNEXTWB ŠPAGE N*******************************************************************************Ì**œMESSAGES¡**Ì*N****************************************************************************** ŠSECTIONMESSAGES CHEAD†DC.BƒCR,LF,LF,'MVME600&MVME605DriverTestProgram',CR,LF,LF HEADE…EQU„*-1ŠNEXTWB1MESS1…DC.Bƒ'…Numberofthechanneltoconvert‚>'MESS1E„EQU„*-1ŠNEXTWB4MESS5…DC.Bƒ'‚Valuetobeconverted($000-$FFF)‚>'MESS5E„EQU„*-1ŠNEXTWBMESS8…DC.Bƒ'Enteredvalue='MESS8E„EQU„*-1ŠNEXTWB#MESS9…DC.Bƒ'=Resultvalue.',CR,LFMESS9E„EQU„*-1ŠNEXTWB6MESS10„DC.BƒCR,LF,'<<>>',CR,LFMESS10EƒEQU„*-1ŠNEXTWB2MESS11„DC.BƒCR,LF,'<<<ƒConversionsdoneƒ>>>',CR,LFMESS11EƒEQU„*-1ŠNEXTWB3BADOPN_DADC.BƒCR,LF,'***OPENABORTEDD/A***--'BOPEN_DA‚EQU„*-1ŠNEXTWB9BADCNV_D ADC.BƒCR,LF,'***CONVERSIONABORTEDD/A***--'BCNV_DAƒEQU„*-1ŠNEXTWB4BADCLS_DADC.BƒCR,LF,'***CLOSEABORTEDD/A***--'BCLS_DAƒEQU„*-1ŠNEXTWB3BADOPN_ADDC.BƒCR,LF,'***OPENABORTEDA/D***--'BOPEN_AD‚EQU„*-1ŠNEXTWB9BADCNV_ADDC.BƒCR,LF,'***CONVERSIONABORTEDA/D***--'BCNV_ADƒEQU„*-1ŠNEXTWB4BADCLS_ADDC.BƒCR,LF,'***CLOSEABORTEDA/D***--'BCLS_ADƒEQU„*-1ŠNEXTWB+STATUSMƒDC.Bƒ'ErrorcodereturnedinD0='STATUSME‚EQU„*-1ŠNEXTWBCRLF†DC.BƒCR,LF CRLFE…EQU„*-1ŠNEXTWBSPACE…DC.Bƒ'„'SPACE_ENDEQU„*-1ŠNEXTWBŠPAGEN*******************************************************************************Ì**–PROGRAMƒSECTION™**Ì*N****************************************************************************** ŠSECTIONCODE PROGSTRTŠLEA„STACK(PC),A7.ŠLEA„PBA(PC),A4‰GetProgramBaseAddress(PBA)?ŠMOVE.LBUFOFST(PC),D0…D0=offsettofindtheconversiontableŠNEG.L‚D0–fromPBA3ŠLEA„(A4,D0.L),A0‡AddressforD/AconversionbufferFŠMOVE.LA0,BUFADR_DA-PBA(A4)Savetheaddressoftheconversionbuffer@ŠMOVE.LA0,CONV_DA+$A-PBA(A4)thephysicaladdressofthebuffer3ŠADD.L‚#BUFSIZE,A0ˆAddressforA/DconversionbuferFŠMOVE.LA0,BUFADR_AD-PBA(A4)Savetheaddressoftheconversionbuffer@ŠMOVE.LA0,CONV_AD+$C-PBA(A4)thephysicaladdressofthebuffer &ŠOUTPUTHEAD,HEADE‰Displaytheheading N*-----------------------------------------------------------------------------***‰Getthenumberofthechanneltoconvert*N*-----------------------------------------------------------------------------GETCHAN.ŠOUTPUTMESS1,MESS1E‡ChannelnumbertoconvertŠINPUT‚INPUTBUF,INPUTBUF+8ŠLEA„INPUTBUF(PC),A0)ŠBSR„CVT2ConvertASCIIdecimaltobinary'ŠIF.LD0#0OR.LD0#3THEN.S ŒBRAGETCHANŠENDI@ŠMOVE.WD0,OPEN_DA+6-PBA(A4)ChannelnumberforD/AOPEN„commandCŠMOVE.WD0,CONV_DA+6-PBA(A4)ChannelnumberforD/ACONVERTcommand@ŠMOVE.WD0,OPEN_AD+4-PBA(A4)ChannelnumberforA/DOPEN„commandCŠMOVE.WD0,CONV_AD+8-PBA(A4)ChannelnumberforA/DCONVERTcommand **‰C=Constantlevelwaveform*)ŒBSR„GETVAL‹ReturnsD3=ValuetoconvertŒMOVE.W#1,CONV_DA+8-PBA(A4)@ŒMOVE.LBUFADR_DA(PC),A0‚GettheaddressoftheconversiontableŒMOVE.W#0,D1ŒZerodelay%ŒMOVE.WD1,(A0)+‰D1=Delayvalue=0&ŒMOVE.WD3,(A0)+‰D3=ValuetoconvertBŒMOVE.WD3,INPUT_VALUE-PBA(A4)‚Savetheuserentereddigitalvalue%*¢forlatercomparisonwithA/DvalueŒPAGEN*-----------------------------------------------------------------------------**‰Starttheconversionshere*N*-----------------------------------------------------------------------------**ƒOPENTHED/ACHANNEL*ŠLEA„CMRBLK(PC),A0ŠLEA„OPEN_DA(PC),A1ŠMOVE.L#'DAC1',$4(A0)ŠMOVE.LA1,$14(A0)ŠMOVE.W#OLEN_DA,$18(A0)7ŠMOVE.L#CMR,D0ŒHereweperformanexecutiverequesttoŠTRAPƒ#1‘invokeCMR.1ŠIFTHEN.SŒCMRreturnsastatuscodeinD0.BŒMOVE.LD0,STATUS-PBA(A4)/ŒOUTPUTBADOPN_DA,BOPEN_DA‚***OPENABORTED***ŒBRA.L‚SHOW_D0ŠENDI**ƒOPENTHEA/DCHANNEL*ŠLEA„CMRBLK(PC),A0ŠLEA„OPEN_AD(PC),A1ŠMOVE.L#'AD01',$4(A0)ŠMOVE.LA1,$14(A0)ŠMOVE.W#OLEN_AD,$18(A0)7ŠMOVE.L#CMR,D0ŒHereweperformanexecutiverequesttoŠTRAPƒ#1‘invokeCMR.1ŠIFTHEN.SŒCMRreturnsastatuscodeinD0.BŒMOVE.LD0,STATUS-PBA(A4)/ŒOUTPUTBADOPN_AD,BOPEN_AD‚***OPENABORTED***ŒBRA.L‚SHOW_D0ŠENDI**ƒDOCONVERSIONS*3ŠOUTPUTMESS10,MESS10E…<<<ƒStartingconversionsƒ>>> ŒLEA„CMRBLK(PC),A0ŒLEA„CONV_DA(PC),A1ŒMOVE.L#'DAC1',$4(A0)ŒMOVE.LA1,$14(A0)ŒMOVE.W#CLEN_DA,$18(A0)5ŒMOVE.L#CMR,D0ŠTellthedrivertodotheconversionsŒTRAPƒ#1*(*ƒDoawaituntilthedriverwakesusup*ŒMOVE.L#19,D0ŒTRAPƒ#1 ŒMOVE.WCONV_DA(PC),D01ŒIFTHEN.SŒCMRreturnsastatuscodeinD0.BŽMOVE.LD0,STATUS-PBA(A4)4ŽOUTPUTBADCNV_DA,BCNV_DAƒ***CONVERSIONABORTED***ŽBRA.L‚SHOW_D0ŒENDI  ŒLEA„CMRBLK(PC),A0ŒLEA„CONV_AD(PC),A1ŒMOVE.L#'AD01',$4(A0) ŒMOVE.LA1,$14(A0)ŒMOVE.W#CLEN_AD,$18(A0)5ŒMOVE.L#CMR,D0ŠTellthedrivertodotheconversionsŒTRAPƒ#1*A*‚THEA/DDRIVERWILLONLYRETURNWHENCHANNELHASBEENCONVERTED*ŒMOVE.WCONV_AD(PC),D01ŒIFTHEN.SŒCMRreturnsastatuscodeinD0.BŽMOVE.LD0,STATUS-PBA(A4)4ŽOUTPUTBADCNV_AD,BCNV_ADƒ***CONVERSIONABORTED***ŽBRA.L‚SHOW_D0ŒENDI 'ŒOUTPUTMESS8,MESS8E‡'ENTEREDVALUE=' ŒCLR.L‚D04ŒMOVE.WINPUT_VALUE-PBA(A4),D0‚GettheenteredvalueŒBSR„BHLCVTŽConverttoASCIIŒMOVE.LD2,NUMBER-PBA(A4)ŒMOVE.LD3,NUMBER+4-PBA(A4)0ŒOUTPUTNUMBER,NUMBER+7…Outputtheenteredvalue0ŒOUTPUTSPACE,SPACE_END…'„'(outputsomespaces) 7ŒMOVE.LBUFADR_AD(PC),A0„PointtoresultbufferforA/D ŒCLR.L‚D0ŒMOVE.W(A0),D0Gettheresult"ŒAND.W‚#$0FFF,D0‹Resultis12bitsŒBSR„BHLCVTŽConverttoASCIIŒMOVE.LD2,NUMBER-PBA(A4)ŒMOVE.LD3,NUMBER+4-PBA(A4)/ŒOUTPUTNUMBER,NUMBER+7…Outputtheresultvalue'ŒOUTPUTMESS9,MESS9Eˆ'=resultvalue.' ŒBRA.S‚EXIT :SHOW_D0ƒMOVE.LSTATUS(PC),D0†Getthestatusvaluereturned'SHOW1_D0‚BSR„BHLCVTConvertittoASCII9ŠMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŠMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytesŠOUTPUTSTATUSM,STATUSMEŠOUTPUTNUMBER,NUMBER+7ŠOUTPUTCRLF,CRLFE ŠBRA.S‚EXIT  CHECKQ3ŠCMP.B‚#'Q',INPUTBUF-PBA(A4)DotheywanttoQuit? ŠBEQ.S‚EXIT3ŠCMP.B‚#'.',INPUTBUF-PBA(A4)DotheywanttoQuit? ŠBEQ.S‚EXITŠRTS  EXIT**‚CLOSETHECHANNELS:*ŠLEA„CMRBLK(PC),A0ŠLEA„CLSBLK(PC),A1ŠMOVE.L#'DAC1',$4(A0)ŠMOVE.LA1,$14(A0)ŠMOVE.W#CLOSLEN,$18(A0)1ŠMOVE.L#CMR,D0ŒTellCMRtoclosetheD/AchannelŠTRAPƒ#1ŠIFTHEN.SŒMOVE.LD0,STATUS-PBA(A4)/ŒOUTPUTBADCLS_DA,BCLS_DAƒ***CLOSEABORTED***ŠENDI ŠLEA„CMRBLK(PC),A0ŠLEA„CLSBLK(PC),A1ŠMOVE.L#'AD01',$4(A0)ŠMOVE.LA1,$14(A0)ŠMOVE.W#CLOSLEN,$18(A0)1ŠMOVE.L#CMR,D0ŒTellCMRtoclosetheD/AchannelŠTRAPƒ#1ŠIFTHEN.SŒMOVE.LD0,STATUS-PBA(A4)/ŒOUTPUTBADCLS_AD,BCLS_ADƒ***CLOSEABORTED***ŠENDI /ŠOUTPUTMESS11,MESS11E…<<<ƒConversionsdoneƒ>>> "ŠMOVE.L#15,D0TerminatethistaskŠTRAPƒ#1 *=*‚Routinetogetthedigitalvaluetobeconvertedtoanalog:*GETVAL8ŠOUTPUTMESS5,MESS5E‡Valuetobeconverted($000-$FFF)ŠINPUT‚INPUTBUF,INPUTBUF+8ŠLEA„INPUTBUF(PC),A0!ŠBSR„ASCVAL‹D3=ValuetoconvertŠRTS ŠEND„PROGSTRTéééééTEST˜ÿÿÿÿÿ€SEG0 ÿÿÿÿ ÿÿ DAC1 MVME600 & MVME605 Driver Test Program  Number of the channel to convert > Value to be converted ($000 - $FFF) > Entered value = = Result value. <<< Starting conversions >>> <<< Conversions done >>> *** OPEN ABORTED D/A *** -- *** CONVERSION ABORTED D/A *** -- *** CLOSE ABORTED D/A *** -- *** OPEN ABORTED A/D *** -- *** CONVERSION ABORTED A/D *** -- *** CLOSE ABORTED A/D *** -- Error code returned in D0 = Oúý2Iúüb :ü^D€Aô)HÌ)H¬Ñü)HÐ)HÄAúþ)HRAúþ0)HVAúýtNBAúþ$)HRAúþD)HVAúý^NBAúüæ)HnAúüæ)HrAúýdNBaNAúüÌa„ €m €o`¶9@ 9@¨9@¶9@ÀaÀ9|ª zü2<0Á0Ã9CDAúý2CúýJ!|DAC1!I1|p;*Thisquestionaskswhichchannelyouwouldliketodothe>*conversionson.‚Theanswermustbe(0-63),decimal,orthe/*testprogramwillaskforadifferentanswer.*'*‰B.‚(C)onstantlevel‚(S)awtoothwave„>?*Thisquestionasksforthetypeofwaveformyouwouldliketo>*testfor.‚Ananswerof"C"willthenaskyouquestion#Cand?*thenquestion#D.‚Ananswerof"S"willthenaskyouquestion8*#Candthenquestion#E.‚Ananswerof"O"willaskyou?*question#Candthenquestion#Duntilyouanswerquestion#C>*withan$FFFFtoexit.‚The"O"optionisusedtocreateyour6*ownwaveform.‚Thiswillenabletheusertocreat‚the<*conversiontablewithhisowndelaysandconversionvalues* *‰C.‚DelaybetweenconversionsŒ>;*Thisquestionasksforthedelayoftheconversionvalue.?*Thisvaluecanbefrom$0to$FFFFwith$0beingnodelayand<*$FFFFbeingthelongestdelay.‚Eachdelayisapproximately*1(one)millisecondofdelay.***‰D.‚Valuetobeconverted($000-$FFF)‚> 6A:";*L2C:TBFJDREZ^=*Thisquestionasksforthevaluetobeconverted.‚Thevalue<*canbefrom$000to$FFFwith$000beingthemostnegative;*valueand$FFFbeingthemostpositivevalue.‚Question#F*followsthisquestion.*"*ValueŠ5voltscaleŠ10voltscale* equivalentequivalent4*--------------------------------------------------*$FFFŒ+5.0volts+10.0volts*$C00Œ+2.5“+5.0*$8000.0”0.0*$400Œ-2.5“-5.0*$000Œ-5.0“-10.0*%*‰E.‚Incrementforconversionvalue‡>>*Thisquestionasksfortheincrementvaluethatwillbeused;*tocalculatethesawtoothwaveformwith.‚Thisishowmuch@*thesawtoothwaveformwillbeincrementedforeachconversion.<*Thisvaluecanbefrom$000to$FFF.‚Anythingoutsidethis>*rangewillnotbeacceptedandthetestprogramwillaskfor*adifferentanswer.*(*‰F.‚Numberoftimestodoconversions„>?*Thisquestionasksfortheamountoftimestorunthroughthe*conversiontable. ŠPAGE *‚Examples:*B*‰Thefollowingexampleshouldmakeaconstantlevelat+5.0volts:*‰iftheinputvoltageontheVME605boardis+10.0volts.**‰MVME605DriverTestProgram**&*ŒNumberofthechanneltoconvert‚>0&*‹(C)onstantlevel‚(S)awtoothwave‚>C*“Delaybetweenconversions‚>1,*‰Valuetobeconverted($000-$FFF)‚>$C00'*‹Numberoftimestodoconversions‚>1    E*‰Thefollowingexamplewillcreateasawtoothwavethatwillbefrom-*‰theminimumvoltagetothemaximumvoltage.**‰MVME605DriverTestProgra  m**&*ŒNumberofthechanneltoconvert‚>0&*‹(C)onstantlevel‚(S)awtoothwave‚>S*“Delaybetweenconversions‚>0'*ŽIncrementforconversionvalue‚>$100(*‹Numberoftimestodoconversions‚>50  ŠPAGE,*£ASCVAL,BHLCVT,andCVT2arecommonlyused**£functionswhicharemodulesinalibrary(*£filecalledUTILIB.RO.‚Acalltothese'*£functionsareincludedinthissource)*£program,whichisprovidedwithanXREF&*£declaration.‚Thisalsorequiresthat'*£UTILIB.RObeavailabletothelinkage$*£editorduringthelinkingprocess.%*£SeeTEST605.LFforlinkchainfile. -ŠXREFƒASCVALConvertsASCIItoabinaryvalue$*£ThisroutinewillconvertanASCII,*£characterstringrepresentingadecimalor,*£hexidecimalvaluetotheequivalentbinary,*£value.‚Ifadollarsign($)isencountered&*£hexidecimalconversionisperformed;,*£otherwisedecimalconversionisperformed.+*£Anemptycharacterstringfieldpassedto,*£thisfunctioninA0producesazerobinary'*£value.‚Conversionterminateswhenthe)*£firstinvalidcharacterisencountered.'*£ENTRY:‚A0-StartingaddressofASCII*°characterstringtoconvert#*£EXIT:‚D1-Characterthatcaused *°termination%*«D2-Classcodeofterminatingchar"*«D3-Binaryresultofconversion*«A0-Addressofthecharacter *°followingtheterminatingchar 8ŠXREFƒBHLCVTConverts4-bytebinaryvaluetoASCIIdigit)*£Thisroutinewillconvertalongbinary-*£wordvaluetoahexadecimalvalueexpressed)*£asan8characterASCIIstring.‚Leading*£zerosaresuppressed.,*£ENTRY:‚D0.L-Binaryvaluetobeconverted(*£EXIT:‚D2.L-Fourhighorderbytesof*²convertedvalue *«D3.L-Fourloworderbytesof*²convertedvalue   6ŠXREFƒCVT2ConvertstwoASCIIdecimaldigitstobinary-*£ThisroutinewillconverttwoASCIIdecimal(*£digitstotheequivalentbinaryvalue.+*£Anemptycharacterstringfieldpassedto,*£thisfunctioninA0producesazerobinary**£value.‚Conversionterminateswhenanon-*£decimaldigitisencountered)*£ENTRY:‚A0-Addressofmostsignificant*°ASCIIdecimaldigit)*£EXIT:‚D0-Binaryresultofconversion!*«A0-Addressoftheterminating *°characterŠPAGE ;BUFSIZEƒEQU„$8000ŽThislabeldefinesthevalueforthesize$*£ofthedelayandconversiontable. 6CLOSE…EQU„2’Thislabeldefinesthecodevaluethatthe+*£D/Adriverrecognizesasthecommandcode*£foraCLOSEcommand. @CLSIZE„EQU„BUFSIZE/4ŠThislabeldefinesthevalueforperforming,*£alooptofilltheconversiontablewitha)*£certaindelayandconversionvalue.‚The-*£sizeisBUFSIZE/4becausethereare2words,*£perentry,1wordfordelayand1wordfor-*£theconversionvalue,andthereare2bytes *£perword. 4CMR‡EQU„60‘Thislabeldefinesthecodevaluethatwe,*£mustusetotelltheoperatingsystemthat+*£wewanttoinvokeCMR,theRMS68KChannel*£ManagementRoutine. /CODE†EQU„8’Thislabeldefinesthenumberofthe%*£programsectionthatcontainscode.-*£Section8isarelativelyarbitrarysection(*£butitisthesectionwherethesystem(*£expects(bydefault)toseecodefora*£program,(readonly). 8CONVERTƒEQU„3’Thislabeldefinesthecodevaluethatthe+*£D/Adriverrecognizesasthecommandcode*£foraCONVERTcommand. 5CRˆEQU„$0DThislabeldefinesthecodeforacarriage*£return 1CRT‡EQU„6’ThislabeldefinesthevaluefortheLU*£numberfortheCRT. 4DATA†EQU„0’Thislabeldefinesthenumberofthedata**£sectionthatcontainsdata.‚Section0is+*£arelativelyarbitrarysection,butitis-*£thesectionwherethesystemexpectstosee"*£codefordata(read/writearea). 6KEYBOARD‚EQU„5’ThislabeldefinesthevaluefortheLU*£numberforthekeyboard. 6LFˆEQU„$0AThislabeldefinesthecodeforalinefeed 3MESSAGES‚EQU„1’Thislabeldefinesthenumberofthe,*£messagessectionthatwillcontainallthe%*£messages.‚Section1isar  elatively*£arbitrarysection. 5OPEN†EQU„1’Thislabeldefinesthecodevaluethatthe+*£D/Adriverrecognizesasthecommandcode*£foranOPENcommand. 3READ†EQU„1’Thislabeldefinesthecodevalueofthe&*£IOSrequestcodeforaREADcommand. ŠMOVE.LA0,IOSOUT+16-PBA(A4)SettheendingaddressofmessageŠLEA„IOSOUT(PC),A0ŠTRAPƒ#2ŠENDM ŠPAGE 2ŠOPT„PCSWeuseaPCSoptionsotheassemblerwill%*£forcePCrelativeaddressingwithin(*£SECTION.‚ForcesPCrelativeaddressing-*£(wheneversuchanaddressingmodeislegal))*£inaninstructionwhichoccurswithina'*£relocatableSECTIONandreferencesan,*£operandinarelocatableSECTION(neednot**£bethesameSECTIONastheinstruction).,*£Failuretoresolvesucnareferenceintoa-*£16-bitdisplacementfromthePCwillresult)*£inanerror.‚Thisoptionmaybeusedto+*£forcepositionindependentcode;however,(*£thisoptiondoesnotforcePCrelative,*£addressingofabsoluteoperandsorunknown*£forwardreferences. ŠPAGE N*******************************************************************************Ì**™DATAƒSECTIONœ**Ì*N****************************************************************************** ŠSECTIONDATA =D_ABUF„DS.BƒBUFSIZEŒThisisthebufferareathatwillcontain**£thedelayandtheconversionvaluetobe *£converted. $PBA‡EQU„*’ProgramBaseAddress(PBA)%*£Thislabelisusedtodesignatethe+*£beginningoftheprogram.‚Thisisusedto'*£makereferencestootherpartsofthe*£program,relocatable. 9ŠDS.WƒSTACKLEN‹ThisisthestackareafortheVME605test2STACK…EQU„*’program.‚Registersandotherimportant,*£informationwillbestoredonthestackas)*£theprogramisexecuted.‚Thestackarea'*£isdynamicandwillchangeduringthe *£executionofthetestprogram. 8BUFFADDR‚DS.Lƒ1’Thisisthestorageareafortheaddress,*£oftheconversiontable.‚Thisaddresswill-*£befiguredatexecutiontimesotheprogram*£willberelocatable. =INPUTBUF‚DS.WƒSTRNGLEN‹Thisisthestorageareafortheinput*£stringsthatareentered. 6DELAYVAL‚DS.Wƒ1’Thisisthestorageareaforthedelay(*£thatisenteredforthedelayforeach *£conversion. :BUFOFSTƒDC.LƒPBA-D_ABUF‰ThisistheoffsetfromPBAtothe'*£conversiontablesothattherelative**£addresscanbefoundtomaketheprogram*£relocatable. 9STATUS„DS.Lƒ1’Thiswillbethestorageareforthestatus,*£codethatisreturnedfromCMR.‚Thisvalue-*£willbedisplayedtoshowtheuserwhatthe*£errorcodewas.  NUMBER„DS.Lƒ2 1NUMT†DS.Lƒ1’Thisisthestorageforthenumberof&*£conversionstoperform.‚Thiswillbe,*£changeddynamicallyafterthequestionhas*£beenanswered. 5INC‡DS.Wƒ1’Thisisthestorageareafortheincrement**£thatwillbeuse  dtofigurethesawtooth *£waveform. ŠPAGE N*******************************************************************************Ì*!*–PARAMETERƒBLOCKS—**Ì*N****************************************************************************** ŠNEXTWB”ForceevenboundaryIOSOUTŠDC.Bƒ0’Requestcode"ŠDC.BƒWRITEŽFunctionspecificationŠDC.Wƒ8’OptionsŠDC.Bƒ0’StatusŠDC.BƒCRTLogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress   ŠNEXTWB”ForceevenboundaryIOSINŠDC.Bƒ0’Requestcode!ŠDC.BƒREADFunctionspecificationŠDC.Wƒ0’OptionsŠDC.Bƒ0’Status"ŠDC.BƒKEYBOARD‹LogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress  CMRBLK„DC.Bƒ7’InitiateI/OŠDC.BƒUNUSEDUnusedŠDC.WƒUNUSEDUnusedŠDC.Lƒ'DAC1'ChannelnameŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnused$ŠDC.Lƒ0’AddressofI/Ocontrolblock#ŠDC.Lƒ0’LengthofI/Ocontrolblock   *OPENBLKƒDC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒOPENOpencommandcodeŠDC.Wƒ1’#ofchannelstoopen-ŠDC.Wƒ0’Channeltoopen(Dynamicallychanged)4OPENLENƒEQU„*-OPENBLKŠLengthofOPENparameterblock   *CONVBLKƒDC.Wƒ0’Returnedstatusfromdriver"ŠDC.WƒCONVERTŒConvertcommandcode ŠDC.Wƒ1’#ofchannelstoconvert0ŠDC.Wƒ0’Channeltoconvert(Dynamicallychanged).ŠDC.Wƒ0’#ofconversions(Dynamicallychanged)%ŠDC.Lƒ0’BufferaddressofconversionsŠDC.Wƒ01‘Wakeupwhendone7CONVLENƒEQU„*-CONVBLKŠLengthofCONVERTparameterblock   )CLSBLK„DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒCLOSEŽClosecommandcodeCLOSLENƒEQU„*-CLSBLK ŠNEXTWB ŠPAGE N*******************************************************************************Ì**œMESSAGES¡**Ì*N****************************************************************************** ŠSECTIONMESSAGES 9HEAD†DC.BƒCR,LF,LF,'MVME605DriverTestProgram',CR,LF,LF HEADE…EQU„*-1ŠNEXTWB1MESS1…DC.Bƒ'…Numberofthechanneltoconvert‚>'MESS1E„EQU„*-1ŠNEXTWB*MESS3…DC.Bƒ'ŒDelaybetweenconversions‚>'MESS3E„EQU„*-1ŠNEXTWB1MESS4…DC.Bƒ'„(C)onstantlevel‚(S)awtoothwave‚>'MESS4E„EQU„*-1ŠNEXTWB4MESS5…DC.Bƒ'‚Valuetobeconverted($000-$FFF)‚>'MESS5E„EQU„*-1ŠNEXTWB2MESS6…DC.Bƒ'„Numberoftimestodoconversions‚>'MESS6E„EQU„*-1ŠNEXTWB/MESS7…DC.Bƒ'‡Incrementforconversionvalue‚>'MESS7E„EQU„*-1ŠNEXTWB0MESS10„DC.BƒCR,LF,'<<>>'MESS10EƒEQU„*-1ŠNEXTWB2MESS11„DC.BƒCR,LF,'<<<ƒConversionsdoneƒ>>>',CR,LFMESS11EƒEQU„*-1ŠNEXTWB,BADOPN„DC.BƒCR,LF,'***OPENABORTED***--'BADOPNEƒEQU„*-1ŠNEXTWB2BADCNV„DC.BƒCR,LF,'***CONVERSIONABORTED***--'BADCNVEƒEQU„*-1ŠNEXTWB-BADCLS„DC.BƒCR,LF,'***CLOSEABORTED***--'BADCLSEƒEQU„*-1ŠNEXTWB+STATUSMƒDC.Bƒ'ErrorcodereturnedinD0='STATUSME‚EQU„*-1ŠNEXTWBCRLF†DC.BƒCR,LF CRLFE…EQU„*-1 ŠNEXTWB ŠPAGE N*******************************************************************************Ì**–PROGRAMƒSECTION™**Ì*N****************************************************************************** ŠSECTIONCODE PROGSTRTŠLEA„STACK(PC),A7.ŠLEA„PBA(PC),A4‰GetProgramBaseAddress(PBA)?ŠMOVE.LBUFOFST(PC),D0…D0=offsettofindtheconversiontableŠNEG.L‚D0–fromPBA7ŠLEA„(A4,D0.L),A0‡AddthenegativeoffsettoPBAtogetEŠMOVE.LA0,BUFFADDR-PBA(A4)Savetheaddressoftheconversionbuffer@ŠMOVE.LA0,CONVBLK+$A-PBA(A4)thephysicaladdressofthebuffer &ŠOUTPUTHEAD,HEADE‰Displaytheheading N*-----------------------------------------------------------------------------***‰Getthenumberofthechanneltoconvert*N*-----------------------------------------------------------------------------GETCHAN.ŠOUTPUTMESS1,MESS1E‡Channelnumbertoconvert  ŠINPUT‚INPUTBUF,INPUTBUF+8ŠLEA„INPUTBUF(PC),A0)ŠBSR„CVT2ConvertASCIIdecimaltobinary(ŠIF.LD0#0OR.LD0#63THEN.S ŒBRAGETCHANŠENDI?ŠMOVE.WD0,OPENBLK+6-PBA(A4)SavethechannelnumberinOPENBLK?ŠMOVE.WD0,CONVBLK+6-PBA(A4)SavethechannelnumberinCONVBLK N*-----------------------------------------------------------------------------*.*‰Get(C)onstantlevel‚or(S)awtoothwaveform*N*-----------------------------------------------------------------------------GETCLST<ŠOUTPUTMESS4,MESS4E‡(C)onstantlevelor(S)awtoothwaveform+ŠINPUT‚INPUTBUF,INPUTBUF+8GettheirchoiceŠMOVE.BINPUTBUF(PC),D0**£C=Constantlevel*£O=createyourOwnwaveform*£S=Sawtoothwaveform* **‰O=Ownwaveform*CŠIF.BD0#'O'THEN.S‚SeeiftheywanttodothereownwaveformŒMOVE.LBUFFADDR(PC),A2 ŒMOVE.LA2,A1%OWNVAL†BSR„GETDELAY‰Getadelayvalue<ŒIF.LD3#$FFFFTHEN.SD3=$FFFFmeansexit"O"option-ŽMOVE.WD3,(A1)+‰Storethedelayinthetable/ŽBSR„GETVAL‹Gogetthevaluefortheconversion ŽMOVE.WD3,(A1)+‰Savethatvalue ŽBRA„OWNVALŒENDI6ŒSUB.L‚A2,A1ŠFindthedifferencebetweenthebeg&end ŒMOVE.LA1,D01ŒDIVU.W‚#4,D0‰Divideby4because4bytes/commandŒMOVE.WD0,CONVBLK+8-PBA(A4)0ŒBRA„GETNUMTˆGogetthenumberoftimestodoitŠENDI **‰C=Constantlevelwaveform*ŠIF.BD0#'C'THEN.S7ŒBSR„GETDELAY‹Gogetthedelayvalueforeachconversio0ŒMOVE.WD3,DELAYVAL-PBA(A4)Savethedelayvalue)ŒBSR„GETVAL‹ReturnsD3=ValuetoconvertŒMOVE.W#1,CONVBLK+8-PBA(A4)?ŒMOVE.LBUFFADDR(PC),A0‚GettheaddressoftheconversiontableCŒMOVE.WDELAYVAL(PC),D1‚Getthedelayvaluetoputintobuffertabl!ŒMOVE.WD1,(A0)+‰D1=Delayvalue&ŒMOVE.WD3,(A0)+‰D3=Valuetoconvert0ŒBRA„GETNUMTˆGogetthenumberoftimestodoitŠENDI **‰S=Sawtoothwaveform*ŠIF.BD0#'S'THEN.L7ŒBSR„GETDELAY‹Gogetthedelayvalueforeachconversio0ŒMOVE.WD3,DELAYVAL-PBA(A4)SavethedelayvalueGETINCŒREPEAT3ŽOUTPUTMESS7,MESS7EƒIncrementforconversionvalueŽINPUT‚INPUTBUF,INPUTBUF+8ŽLEA„INPUTBUF(PC),A0 ŽBSR„ASCVALŒUNTIL.LD1#0+ŒIF.LD3#1OR.LD3#$0FFFTHEN.S ŽBRA„GETINCŒENDI8ŒMOVE.WD3,INC-PBA(A4)ƒSavethenumberoftimestodoitCŒMOVE.WDELAYVAL(PC),D0‚Getthedelayvaluetoputintobuffertabl-ŒCLR.L‚D1Startwithamaximumnegativevalue;ŒMOVE.LBUFFADDR(PC),A0‚Gettheaddressofthebuffertable ŒMOVE.LA0,A1ŒMOVE.WINC(PC),D2 ŒREPEAT/ŽMOVE.WD0,(A1)+‡Movethedelayintothebuffer<ŽMOVE.WD1,(A1)+‡Movethedatatobeconvertedintothebuff ŽADD.W‚D2,D1ŒUNTIL.WD1#$0FFF ŒIF.WD1#$0FFFTHEN.S ŽSUB.W‚D2,D1ŒENDI ŒREPEAT/ŽMOVE.WD0,(A1)+‡Movethedelayintothebuffer<ŽMOVE.WD1,(A1)+‡Movethedatatobeconvertedintothebuff ŽSUB.W‚D2,D1ŒUNTIL.WD1#0 6ŒSUB.L‚A0,A1ŒFindthedifferencebetweenthebeg&end ŒMOVE.LA1,D01ŒDIVU.W‚#4,D0‹Divideby4because4bytes/commandŒMOVE.WD0,CONVBLK+8-PBA(A4)2ŒBRA.S‚GETNUMTˆGogetthenumberoftimestodoitŠENDI ŠBRA„GETCLSTN*-----------------------------------------------------------------------------*.*‰Getthenumberoftimetodotheconversions*N*-----------------------------------------------------------------------------GETNUMTŠREPEAT6ŒOUTPUTMESS6,MESS6E‡NumberoftimestodoconversionsŒINPUT‚INPUTBUF,INPUTBUF+8ŒLEA„INPUTBUF(PC),A0 ŒBSR„ASCVALŠUNTILD1#0+ŠIF.LD3#1OR.LD3#$FFFFTHEN.S ŒBRA„GETNUMTŠENDI8ŠMOVE.LD3,NUMT-PBA(A4)„Savethenumberoftimetodoit N*-----------------------------------------------------------------------------**‰Starttheconversionshere*N*-----------------------------------------------------------------------------**ƒOPENTHED/ACHANNEL*ŠLEA„CMRBLK(PC),A0ŠLEA„OPENBLK(PC),A1ŠMOVE.LA1,$14(A0)ŠMOVE.W#OPENLEN,$18(A0)7ŠMOVE.L#CMR,D0ŒHereweperformanexecutiverequestto.ŠTRAPƒ#1‘invokeCMR.‚ThevalueinD0tel  lsthe)*£operatingsystemthatwewanttoinvoke**£CMR,andthevalueinA0tellsCMRwhere&*£tofinditsparameterblock.‚TheCMR+*£parameterblockcontainsapointertothe(*£I/Ocommandblock,andtheI/Ocommand"*£blockspwcifiesanOPENcommand. 9ŠBNE.S‚BADOPENŒCMRreturnsastatuscodeinD0.B,andCMR+*£returnstheCC.Zbittoreflectthevalue'*£ofthestatuscodeinD0.B.‚Anonzero+*£statuscodeindicatesthatthedriverhas*£rejectedtheOPENcommand.**ƒDOCONVERSIONS*3ŠOUTPUTMESS10,MESS10E…<<<ƒStartingconversionsƒ>>>:ŠMOVE.LNUMT(PC),D7ˆD7=NumberoftimestodoconversionsŠFOR.LD6=#1TOD7DO.SŒLEA„CMRBLK(PC),A0ŒLEA„CONVBLK(PC),A1ŒMOVE.LA1,$14(A0)ŒMOVE.W#CONVLEN,$18(A0)5ŒMOVE.L#CMR,D0ŠTellthedrivertodotheconversionsŒTRAPƒ#1*'*ƒDoawaituntilthedrivewakesusup*ŒMOVE.L#19,D0ŒTRAPƒ#1 ŒMOVE.WCONVBLK(PC),D0ŒBNE.S‚BADCONVŠENDF**‚CLOSETHECHANNEL*ŠLEA„CMRBLK(PC),A0ŠLEA„CLSBLK(PC),A1ŠMOVE.LA1,$14(A0)ŠMOVE.W#CLOSLEN,$18(A0)1ŠMOVE.L#CMR,D0ŒTellCMRtoclosetheD/AchannelŠTRAPƒ#1ŠBNE.S‚BADCLOSE/ŠOUTPUTMESS11,MESS11E…<<<ƒConversionsdoneƒ>>> ŠBRA„EXIT BADOPENŠMOVE.LD0,STATUS-PBA(A4)+ŠOUTPUTBADOPN,BADOPNE…***OPENABORTED***ŠBRA.S‚SHOW_D0 BADCONVŠMOVE.LD0,STATUS-PBA(A4)1ŠOUTPUTBADCNV,BADCNVE…***CONVERSIONABORTED***ŠBRA.S‚SHOW_D0 BADCLOSEŠMOVE.LD0,STATUS-PBA(A4),ŠOUTPUTBADCLS,BADCLSE…***CLOSEABORTED*** :SHOW_D0ƒMOVE.LSTATUS(PC),D0†GetthestatusvaluereturnedŠBSR„BHLCVTConvertittoASCII9ŠMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŠMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytesŠOUTPUTSTATUSM,STATUSMEŠOUTPUTNUMBER,NUMBER+7ŠOUTPUTCRLF,CRLFE ŠBRA.S‚EXIT  CHECKQ3ŠCMP.B‚#'Q',INPUTBUF-PBA(A4)DotheywanttoQuit? ŠBEQ.S‚EXIT3ŠCMP.B‚#'.',INPUTBUF-PBA(A4)DotheywanttoQuit? ŠBEQ.S‚EXITŠRTS  EXIT"ŠMOVE.L#15,D0TerminatethistaskŠTRAPƒ#1 GETDELAY.ŠOUTPUTMESS3,MESS3E‡DelaybetweenconversionsŠINPUT‚INPUTBUF,INPUTBUF+8 ŠBSR„CHECKQŠLEA„INPUTBUF(PC),A0 ŠBSR„ASCVAL ŠTST.L‚D1 ŠBEQ„GETDELAY+ŠIF.LD3#0OR.LD3#$FFFFTHEN.S ŒBRA„GETDELAYŠENDI ŠRTS   GETVAL8ŠOUTPUTMESS5,MESS5E‡Valuetobeconverted($000-$FFF)ŠINPUT‚INPUTBUF,INPUTBUF+8 ŠBSR„CHECKQŠLEA„INPUTBUF(PC),A0!ŠBSR„ASCVAL‹D3=ValuetoconvertŠRTS   ŠEND„PROGSTRTTESTƒˆÿÿÿÿÿ€SEG0‰ÿÿÿÿˆÿÿ             €DAC1 MVME605 Driver Test Program Number of the channel to convert  > Delay between conversions > (C)onstant level (S)awtooth wave > Value to be converted ($000 - $FFF) > Number of times to do conversions > Increment for conversion value > <<< Starting conversions >>> <<< Conversions done >>> *** OPEN ABORTED *** -- *** CONVERSION ABORTED *** -- *** CLOSE ABORTED *** -- Error code returned in D0 = Oúý>Iúür :ý D€Aô)HÈ)H®Aúþ)HTAúþ,)HXAúý”NBAúþ )HTAúþ@)HXAúý~NBAúüü)HpAúüü)HtAúý„NBaâAúüâaâ €m €?o`¶9@¢9@ªAúþ")HTAúþB)HXAúý,NBAúüª)HpAúüª)HtAúý2NBa:ü Of,$zü‚"Ja’ ƒÿÿg 2ÃaÔ2Ã`ê“Ê €ü9@¬`Ò Cf"af9C0a®9|¬ zü>2:ü¢0Á0Ã`ª Sfža<9C0Aúþ)HTAúþ")HXAúüŽNBAúü )HpAúü )HtAúü”NBaòAúûòa– gÀ ƒm ƒÿo`®9CF0: ü0B zûÂ"H4:ü:2À2ÁÒB Aÿoô Aÿo’B2À2Á’B Alô“È €ü9@¬``þÌAúý@)HTAúý`)HXAúûöNBAúût)HpAúût)HtAúûüNBaZAúûZaþ Ag ƒm ƒÿÿo`°)CBAúûêCúü!I1|pAúüä)HTAúü÷)HXAúú²NBAúúž)HTAúú)HXAúúœNBAúüÔ)HTAúüÍ)HXAúú†NB` ,QÌg ,.ÌgNupNAAúû$)HTAúûD)HXAúúXNBAúùÖ)HpAúùÖ)HtAúú^NBa¼aºAúù¼a`JgÄ ƒm ƒÿÿo`²NuAúû()HTAúûH)HXAúúNBAúù†)HpAúù†)HtAúúNBaÿlaÿhAúùha NuRˆ  gøHçIúîB„BƒÁa='0')and(num_str[i]<='9'))or7‘((num_str[i]>='A')and(num_str[i]<='F'))ƒ)doŒbeginifnum_str[i]>='A'9’thennum:=num*16+ord(num_str[i])-ord('A')+105’elsenu m:=num*16+ord(num_str[i])-ord('0'); i:=i+1Œend;‰ifi<=length(num_str)thenŒbeginerror:=TRUE;+write('Invalidhexnumber-reenter>');p$force(output)Œend†endƒuntilerror=FALSE;ƒhex_in:=num end;{$E} procedure hex_out ( num : word); varƒnum_str:string[4];ƒi,j…:integer; begin ƒnum_str:='„';ƒfori:=4downto1do†begin‰j:=nummod16;‰num:=numdiv16; ‰ifj>=10k h,Œthennum_str[i]:=chr(j-10+ord('A'))'Œelsenum_str[i]:=chr(j+ord('0'))†end;ƒwriteln(num_str)end;{$E}procedure enter_command; varƒstatus„:word; ƒi‰:integer; beginƒwithinit_blk.cmd_adr^do„begin†casecmd_char[1]of‰'W':code:=WAIT;‰'O':code:=OPEN;‰'C':code:=CLOSE;‰'E':code:=ENABLE;‰'D':code:=DISABLE;‰'S':code:=STAT†end;†ifcode<>WAITthenˆbegin%Šwrite('Enterchannelmnemonic>');Šp$force(output);Šreadln(init_blk.mnemonic);Šifcode<>OPEN then”{AllcommandsexceptOPEN}begin*“write('Enterchannelsmaskinhex.>');“p$force(output);“chan_mask:=hex_inendelse”{OPENcommand}begin /“write('Enternumberofchannelstoopen>');“p$force(output);“readln(chan_cnt); “fori:=0tochan_cnt-1do–begin#™write('Enterchannelnumber>');™p$force(output);™readln(cdb[i].chan_no);2™write('Enterchannelconfigurationinhex.>');™p$force(output);™cdb[i].config:=hex_in–end Œend‚{else} ˆend;{if},†status:=send_command(init_blk,task_ID);†ifcode<>WAITˆthen‰begin‹ifcode=STATŽthenbegin’write('ChannelStatus=');’p$force(output);’hex_out(chan_mask)end;‹write('CommandStatusis');‹p$force(output);‹hex_out(status)‰end „end‚{with}end;{$E} begin‚{main} ƒwithinit_blkdo†begin ‰code:=7;‰sub_code:=0;‰new(cmd_adr)†end; +ƒwrite('Enternumberoftasks(1-26)>');ƒp$force(output);ƒreadln(task_cnt); ƒtask_ID:='INPx'; ƒclone_tasks(task_cnt); ƒwhiletruedo†fori:=1totask_cntdo‡repeat‰begin(Œtask_id[4]:=chr(ord('A')+i-1);$Œwriteln('**Task',task_ID,'**');EŠwrite('Command(O-pen,C-lose,E-nable,D-isable,S-tatus,W-ait)>');Œp$force(output);Œreadln(cmd_char); Œif(length(cmd_char)<>0)and+(cmd_char[1]in['W','O','C','E','D','S'])then‚enter_command‰end‡untillength(cmd_char)=0end. =/*=/*†M610DRV.INTSTASM.AF=/*5=/* Chain file to assemble portion of the MVME610/620=/* driver test program.=/*:=/* If no output argument is specified for the listing the2=/* chain file will default to M610DRV.INTSTASM.LS=/*=/IFC \1ƒ=ARGM610DRV.INTSTASM.LS=/ENDIF=/*4=ASM M610DRV.INTSTASM.SA,M610DRV.INTSTASM.RO,\1;Z=80=/*{ Included files are:=/*ƒ9995.&.TR1.EQ=/*ƒ9995.&.TR1RTCD.EQ=/*ƒ9995.&.EXE.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.M610CMD.EQ=/*}=/*=ENDééé ééé*‰INCLUDE9995.&.TR1.EQŠINCLUDE9995.&.TR1.EQ*‰INCLUDE9995.&.TR1RTCD.EQŠINCLUDE9995.&.TR1RTCD.EQ*‰INCLUDE9995.&.EXE.EQŠINCLUDE9995.&.EXE.EQ*‰INCLUDE9995.&.LV5.EQŠINCLUDE9995.&.LV5.EQ*‰INCLUDE9995.&.M610CMD.EQŠINCLUDE9995.&.M610CMD.EQŠPAGE*H* VME 610/620 Driver Assembly language test routines. These routines are;* called from a Pascal test task that performs terminal I/OŠSPC„2 ŠSECTION9ŠXDEFƒCLONE_TA I*‚CreatethespecifiednumberoftesttasksthatsharethecodeandstackL* segments of the PASCAL program that is calling this routine. Then allocate.* an ASQ for each task and start them running. ,CLONE_TA‚MOVE.L(A7)+,A4‹SavereturnaddressŠSPC„2$ŠMOVE.L(A7)+,D7‹Savetaskcount-1 ŠSUB.L‚#1,D7ŠSPC„2:ŠLEA.L‚-100(A7),A7ˆAllocateparameterblockspaceonstackŠSPC„27ŠMOVE.LA7,A0ŽStoreCRTCBparameterblockaddressinA0ŠSPC„2'*‚InitializeCreateTCBparameterblock @ŠMOVE.L#'INPA',CRTTSK(A0)ƒNametasksalphabeticallywithinsameŠCLR.L‚CRTSES(A0)‰sessionŠSPC„23ŠMOVE.W#CTOPMP,CRTOPT(A0)PropogatemonitoroptionŠSPC„21ŠMOVE.B#$7F,CRTIPR(A0)„Runtaskatmax.priorityŠMOVE.B#$7F,CRTLPR(A0)ŠSPC„2-ŠMOVE.W#$2000,CRTATT(A0)‚TaskdumpattributeŠSPC„2.ŠLEA.L‚TASKENT(PC),A1…TaskentrypointaddressŠMOVE.LA1,CRTENT(A0)ŠSPC„2ŠMOVE.W#0,CRTUID(A0)†User0ŠSPC„2* Create TCB's %ŠMOVE.WD7,D1ŽInitializeloopcounterŠSPC„2)TCBLOOPƒMOVE.L#CRTCB,D0ŠIssueCRTCBcallŠTRAPƒ#1 ŠBEQ.S‚TCBOK ŠBSR„ERRORŠSPC„2ETCBOK…ADD.B‚#1,CRTTSK+3(A0)„Updatetasknameandloopuntilalltasks#ŠDBRAƒD1,TCBLOOP‰havebeencreated.ŠSPC„25* Initialize Share Segment directive parameter block. #ŠMOVE.L#'INPA',SEGTCB(A0)ƒTaskname<ŠMOVE.W#SGOPPA,SEGOPT(A0)ƒLogical=physicaladdressoptionŠSPC„23ŠMOVE.W#SGATSS,SEGATT(A0)ƒSessionsharablesegmentŠSPC„2,* Share code and data segments to each task. %ŠMOVE.LD7,D1ŽInitializeloopcounter ŠMOVE.LA7,A1ŠSPC„2H%I-95B=B=SEGLOOPƒMOVE.L#SHRSEG,D0‰SharethecodesegmenttoeachtaskŠMOVE.L#'CODE',SEGNAM(A1) ŠMOVE.LA1,A0ŠTRAPƒ#1 ŠBEQ.S‚SEG010 ŠBSR„ERRORŠSPC„2DSEG010„MOVE.L#SHRSEG,D0‰SharethePASCALstacksegmenttoeachtaskŠMOVE.L#'SEG2',SEGNAM(A1) ŠMOVE.LA1,A0ŠTRAPƒ#1 ŠBEQ.S‚SEG020 ŠBSR„ERRORŠSPC„2FSEG020„ADD.B‚#1,SEGTCB+3(A1)†LoopuntilbothsegmentshavebeensharedŠDBRAƒD1,SEGLOOP‰toalltasks.ŠSPC„2)* Initialize Allocate ASQ parameter block ŠMOVE.LA1,A0,ŠMOVE.L#'INPA',ASQTSK(A0)„InitialtasknameŠSPC„2AŠMOVE.B#AQSTQE+AQSTRE+8,ASQSTA(A0)ASR/ASQenabled,noregistersŠSPC„23ŠMOVE.B#18,ASQMML(A0)…Max.eventlength=18bytesŠSPC„2.ŠMOVE.L#2048,ASQQLN(A0)ƒASQlength=2KbytesŠSPC„2-ŠLEA.L‚INTASR(PC),A1†Default tointerruptASRŠMOVE.LA1,ASQASR(A0)ŠSPC„2* Allocate ASQs for each task %ŠMOVE.LD7,D1ŽInitializeloopcounterŠSPC„25ASQLOOPƒMOVE.L#GTASQ,D0ƒIssueAllocateASQdirectiveŠTRAPƒ#1 ŠBEQ.S‚ASQ010 ŠBSR„ERRORŠSPC„2EASQ010„ADD.B‚#1,ASQTSK+3(A0)†LoopuntilanASQhasbeenallocatedforŠDBRAƒD1,ASQLOOP‰eachtask.ŠSPC„2'*Initialize Start Task parameter block. :ŠMOVE.L#'INPA',STRTSK(A0)ƒStarttaskswithoutpassingany+ŠMOVE.W#0,STROPT(A0)†initializeregisters.ŠSPC„2* Start all tasks *ŠMOVE.LD7,D1Initializetheloopcounter.ŠSPC„2#STARTLPƒMOVE.L#START,D0ŠStarttaskŠTRAPƒ#1ŠBEQ.S‚STRT010 ŠBSR„ERRORŠSPC„2DSTRT010ƒADD.B‚#1,STRTSK+3(A0)„LoopuntilalltaskshavebeenstartedŠDBRAƒD1,STARTLPŠSPC„2* Task startup completeŠSPC„2-ŠLEA.L‚100(A7),A7‰RestoreentrystackpointerŠSPC„2+ŠJMP„(A4)ReturntocallingPASCALroutine.ŠSPC„2ŠPAGEŠXDEFƒSEND_COMŠSPC„2K* This routine passes the address of an Initiate I/O parameter block to oneM* of the test tasks in an event that is queued to the task. After sending theM* command event, the routine waits for the test task to set a flag indicatingM* that the command has been issued to the driver and the return status can beH* read from the command parameter block. The routine then returns to theN* calling PASCAL routine with the command status as the function return value. :SEND_COM‚MOVEM.L(A7)+,A1/A2/A4„Pullparametersfromstack*¤A1=Returnaddress*¤A2=TaskIDaddress*¤A4=InitiateI/OPBaddressŠSPC„2>ŠLEA.L‚-100(A7),A7ˆAllocateparameterblockspaceonthestackŠSPC„2-* Initialize the Queue Event parameter block. 6ŠMOVE.LA7,A0ŽSaveparameterblockbaseaddressinA0.ŠSPC„2?ŠMOVE.L(A2),QEVTSK(A0)†CopythetaskIDpassedfromthePASCAL'*£routinetothedestinationtaskname.ŠSPC„2@ŠMOVE.W#QVOPAS,QEVOPT(A0)ƒSetthecommandprocessingASRofthe?ŠLEA.L‚CMDASR(PC),A2†tasttasktobethealternateASRTserviceŠMOVE.LA2,QEVIAD(A0)†address.ŠSPC„2?ŠLEA.L‚QEVIAD+4(A0),A2†Loadtheeventbufferaddress(following=ŠMOVE.LA2,QEVPKT(A0)†theparameterblock)intotheparameter*£block.ŠSPC„22ŠCLR.W‚(A4)+Clearthecommandconpletionflagand(*£updatethepointertotheInitiateI/O*£parameterblockbaseaddress.ŠSPC„2;ŠMOVE.W#$0603,(A2)+‰Eventlength=6bytes,Eventcode=3ŠMOVE.LA4,(A2)+ŠSPC„2@ŠMOVE.W#CMDLEN,XIOPLN(A4)ƒAssumethatthelengthofthecommand'*£blockisstandard(i.e.notanOPEN) ŠSPC„29ŠMOVE.LXIOCPK(A4),A2‡Getthecommandblockbaseaddress.ŠSPC„2BŠCMP.W‚#INOPEN,CMDCOD(A2)‚IfthecommandisnotOPEN,thestandard/ŠBNE.S‚QUECMDlengthalreadyloadediscorrect.ŠSPC„2:ŠMOVE.WCMDNCO(A2),D1ˆCalculatethecorrectlengthforthe:ŠMULUƒ#OPNCDB,D1‰OPENcommandparameterblockandstorein)ŠADD.L‚#CMDCHL,D1‰theInitiateI/Oblock.ŠMOVE.WD1,XIOPLN(A4)ŠSPC„2AQUECMD„MOVE.L#QEVNT,D0‹Queuethecommandeventtothetesttask.ŠTRAPƒ#1ŠBEQ.S‚ACKLOOP ŠBSR„ERRORŠSPC„2;ACKLOOPƒTST.B‚-2(A4)Loopuntilthecommandcompletionflag+ŠBEQ„ACKLOOPŒhasbeensetbythetesttask.ŠSPC„22ŠLEA.L‚100(A7),A7‹Restoretheentrystackpointer.ŠSPC„2=ŠMOVE.WCMDSTA(A2),(A7)†Savethecommandcompletionstatusin(*£thefunctionreturnwordonthestack.ŠSPC„2/ŠJMP„(A1)‘ReturntothecallingPASCALroutine.ŠSPC„2ŠPAGEJ*‚ThisisthetesttaskthatissuescommandstothedriverasspecifiedbyL* the controlling PASCAL task. The test task handles interrupt notificationsN* sent by the driver. The user is notified of the interrupt via LEDs connected:* to an MVME 625 Digital Output module on the I/O channel. 5VME625„EQU„$FE6001ŒVME625moduleI/Ochanneladdress (* Allocate Stack Segment parameter block SEGBLK„DC.Lƒ0’Taskname…(self)ŠDC.Lƒ0’Sessionnumber(self)6ŠDC.WƒSGOPPALogicalAddress=Physicaladdressoption)ŠDC.WƒSGATRWRead/WriteSegmantattributeŠDC.Lƒ'STAK'Segmentname)ŠDC.Lƒ0’Segmentaddress(ReturnedbyRMS)ŠDC.Lƒ$100S egmentlengthŠSPC„2* Test task entry point* Allocate a stack segment >TASKENTƒMOVE.L#GTSEG,D0ŠAllocateastacksegmentof256bytesŠLEA.L‚SEGBLK(PC),A0ŠTRAPƒ#1 ŠBEQ.S‚TSK010 ŠBSR„ERRORŠSPC„2BTSK010„LEA.L‚$F8(A0),A7‰Initializethestackpointertotheendof*£thestacksegment.ŠSPC„2CTSKWTEVT‚MOVE.L#WTEVNT,D0‹Waitforacommandeventoraninterrupt*ŠTRAPƒ#1‘eventtobeprocessedintheASR.ŠBEQ.S‚TSKWTEVT ŠBSR„ERRORŠSPC„2I*‚Controlreachesherewhentheuserhasissuedacommandforthetaskto* enter the wait state. ;TSKWAITƒMOVE.L#WAIT,D0ŒPlacethetaskintoaWAITstateso0ŠTRAPƒ#1‘interruptsmaybeprocessedonchannels*£usingWAKEUP.ŠSPC„23ŠBSETƒ#7,VME625ŒPulseLED7ontheVME625boardto8ŠBCLRƒ#7,VME625ŠindicatethatawakeuphasbeenreceivedŠSPC„26ŠBRA.S‚TSKWAITŽThislooprepeatsuntilacommandevent*£isqueuedtothetesttask.ŠPAGE* Command event ASR 3CMDASR„SUB.L‚#16,A7Allocatestacktoreceiveevent ŠMOVE.LA7,A0ŠSPC„21ŠMOVE.L#RDEVNT,D0ŠReadcommandeventintobufferŠTRAPƒ#1 ŠBEQ.S‚CMD020 ŠBSR.S‚ERRORŠSPC„28CMD020„MOVE.LEVQTXT(A0),A0‡Loadeventtextbaseaddress ŠADD.L‚#16,A7=ŠMOVE.LXIOCPK(A0),A1ˆLoadInputCommandParameterBlockbase *£addressŠSPC„27ŠTST.W‚CMDCOD(A1)ŠIfthecommandcodeiszero,thetest3ŠBEQ.S‚CMDWAITŒtaskistobeputintoaWAITstate.ŠSPC„2* Issue command to the driver. 5ŠMOVE.L#CMR,D0ŒIssuetheInitiateI/OcommandtoCMRŠTRAPƒ#1 ŠBEQ.S‚CMD030ŠSPC„2=ŠMOVE.WD0,CMDSTA(A1)ˆIfanerrorisreturnebyCMR,copythe'*£errorcodeintotheIPBstatusfield.ŠSPC„24* Signal supervisor task that command was completed. FCMD030„MOVE.W#$FFFF,-2(A0)†SetthecommandcompletionflagandreturnŠRTR—fromtheeventŠSPC„2* Put task in WAIT state CCMDWAITƒLEA.L‚TSKWAIT(PC),A1‡Changetheeventreturnaddresstothe'ŠMOVE.LA1,2(A7)‹WAITloopentrypoint.ŠSPC„25ŠMOVE.W#$FFFF,-2(A0)ˆSetthecommandcompletionflagŠSPC„2;ŠMOVE.L#SETASQ,D0‹EnabletheASRandASQsocommandevents4ŠMOVE.L#5,A0ŽmaybeprocessedwhenaWAKEUPoccurs.ŠTRAPƒ#1 ŠBEQ.S‚CMD010 ŠBSR.S‚ERRORŠSPC„20CMD010„RTR˜ReturntotheWAITstateloopuntila+*£commandeventiswaitingandaWAKEUPhas(*£beenissuedtothetaskbythedriver.ŠPAGE* Interrupt Event ASR 3INTASR„SUB.L‚#16,A7Allocatestacktoreceiveevent ŠMOVE.LA7,A0ŠSPC„2)ŠMOVE.L#RDEVNT,D0‰ReadeventintobufferŠTRAPƒ#1 ŠBEQ.S‚INT010 ŠBSR.S‚ERRORŠSPC„2;INT010„MOVE.B3(A0),D0‹LoadtheinterruptingchannalnumberŠSPC„28ŠCMP.L‚#'IN02',4(A0)ˆIfthefirstmoduleisinterrupting1ŠBNE.S‚INT020leavethechannelnumberunchanged.ŠSPC„21ŠADD.B‚#4,D0Ifthesecondmoduleisinterrupting!*£addfourtothechannelnumber.ŠSPC„28INT020„BSETƒD0,VME625ŒPulsetheLEDcorrespondingtothe(ŠBCLRƒD0,VME625Šmodifiedchannelnumber.ŠSPC„2ŠADD.L‚#16,A7RestorestackŠSPC„2ŠRTR™ReturnfromeventŠSPC„2;ERROR…MOVE.L(A7)+,A0Abortthetaskifanunexpectederror9ŠMOVE.L#ABORT,D0Šoccurs.Theaddressofwherertheerror3ŠTRAPƒ#1‘occurredisstoredinA0fortheSCTabort *£message.ŠSPC„2ŠEND=/*=/*†M610DRV.TEST610.AF=/*,=/*†TEST610testprogramassemblychainfile=/*6=/*†Thecommandlinewillacceptargumentsasfollows:=/*;=/*‹Argument01…\1=Outputfileassemblylistingordevice=/*=/*H=/*†Thefollowingshowstheassemblychainsequence.‚InthisexampletheH=/*†NULLdevicewaschosenasArgument01,however,theusercouldifhe5=/*†sodesiredhaverequestedanoutputlistingfile.=/*#=/*=CHAINM610DRV.TEST610.AF#NULL=/*-=/*†Defaultargument01isM610DRV.TEST610.LS=/*=/IFC \1ƒ=ARGM610DRV.TEST610.LS=/ENDIF=/*4=ASM M610DRV.TEST610.SA,M610DRV.TEST610.RO,\1;RZ=100=/*{ Included files are:=/*ƒ--none--=/*}=/*=END éééééE=/*=/*†M610DRV.TEST610.LF=/*G=/*†ThischainfilewillgeneratetheTEST610testprogramloadmodule.=/*5=/*†Thecommandlinewillacceptargumentsasfollows=/*7=/*‹Argument01ˆ\1=Outputfilelinklistingordevice=/*D=/*†Thefollowingshowsthelinkchainsequence.‚InthisexampletheF=/*†printerwaschosenasArgument1,however,theusercouldifheso2=/*†desiredhaverequestedanoutputlistingfile.=/*!=/*=CHAINM610DRV.TEST610.LF#PR=/*-=/*†Defaultargument01isM610DRV.TEST610.LL=/*=/IFC \1ƒ=ARGM610DRV.TEST610.LL=/ENDIF=/*"=LINK ,M610DRV.TEST610.LO,\1;HAMIXSEG SEG0:0,1,8,14 $000000ATTRIBUTES D PINPUT M610DRV.TEST610.ROLIB 0.&.UTILIB.ROEND=/*=ENDéééééNN*******************************************************************************Ì**Ì*#*—MVME610orMVME620‚TestProgram•**Ì**Ì*N********************************************************************************6* This program was writt en to test the MVME610 driver.**    *‰ModificationHistoryN*-----------------------------------------------------------------------------*11/01/84‡DUHInitialwriting   *1.‚Introduction*B*‰ThisprogramwaswrittentotesttheMVME610driver.‚ItcanalsoI*‚beusedtotesttheVME620board.‚ThisprogramwillaskforthechannelI*‚numbertouse.‚ItwillthenaskiftheuserwantstoreadthestatusofL*‚thatchannelorenableandwaitforanegativegoingedgeonthatchannel.K*‚Tousethistestprogram,connectasquarewavegeneratortoachannelonD*‚theVME620DCinputmoduleoraswitchconnectedto120VACforthe*‚VME610ACinputmodule.*8*‰Thisprogramassumestheboardsarejumperedasshown:**‚VME610orVME620:%*„J3‚1,2‚3,4‚5,6‡addressoffset$0005*„J2‚2,4‘interruptINT1*ŠPAGE ,*£ASCVAL,BHLCVT,andCVT2arecommonlyused**£functionswhicharemodulesinalibrary(*£filecalledUTILIB.RO.‚Acalltothese'*£functionsareincludedinthissource)*£program,whichisprovidedwithanXREF&*£declaration.‚Thisalsorequiresthat'*£UTILIB.RObeavailabletothelinkage$*£editorduringthelinkingprocess.%*£SeeTEST620.LFforlinkchainfile. -ŠXREFƒASCVALConvertsASCIItoabinaryvalue$*£ThisroutinewillconvertanASCII,*£characterstringrepresentingadecimalor,*£hexidecimalvaluetotheequivalentbinary,*£value.‚Ifadollarsign($)isencountered&*£hexidecimalconversionisperformed;,*£otherwisedecimalconversionisperformed.+*£Anemptycharacterstringfieldpassedto,*£thisfunctioninA0producesazerobinary'*£value.‚Conversionterminateswhenthe)*£firstinvalidcharacterisencountered.'*£ENTRY:‚A0-StartingaddressofASCIIW>`:hDpBxG€FˆFS˜8*°characterstringtoconvert#*£EXIT:‚D1-Characterthatcaused *°termination%*«D2-Classcodeofterminatingchar"*«D3-Binaryresultofconversion*«A0-Addressofthecharacter *°followingtheterminatingchar 8ŠXREFƒBHLCVTConverts4-bytebinaryvaluetoASCIIdigit)*£Thisroutinewillconvertalongbinary-*£wordvaluetoahexadecimalvalueexpressed)*£asan8characterASCIIstring.‚Leading*£zerosaresuppressed.,*£ENTRY:‚D0.L-Binaryvaluetobeconverted(*£EXIT:‚D2.L-Fourhighorderbytesof*²convertedvalue *«D3.L-Fourloworderbytesof*²convertedvalue 6ŠXREFƒCVT2ConvertstwoASCIIdecimaldigitstobinary-*£ThisroutinewillconverttwoASCIIdecimal(*£digitstotheequivalentbinaryvalue.+*£Anemptycharacterstringfieldpassedto,*£thisfunctioninA0producesazerobinary**£value.‚Conversionterminateswhenanon-*£decimaldigitisencountered)*£ENTRY:‚A0-Addressofmostsignificant*°ASCIIdecimaldigit)*£EXIT:‚D0-Binaryresultofconversion!*«A0-Addressoftheterminating *°character ŠPAGEŠMOVE.LA0,IOSOUT+16-PBA(A4)SettheendingaddressofmessageŠLEA„IOSOUT(PC),A0ŠTRAPƒ#2ŠENDM ŠPAGE 2ŠOPT„PCSWeuseaPCSoptionsotheassemblerwill%*£forcePCrelativeaddressingwithin(*£SECTION.‚ForcesPCrelativeaddressing-*£(wheneversuchanaddressingmodeislegal))*£inaninstructionwhichoccurswithina'*£relocatableSECTIONandreferencesan,*£operandinarelocatableSECTION(neednot**£bethesameSECTIONastheinstruction).,*£Failuretoresolvesucnareferenceintoa-*£16-bitdisplacementfromthePCwillresult)*£inanerror.‚Thisoptionmaybeusedto+*£forcepositionindependentcode;however,(*£thisoptiondoesnotforcePCrelative,*£addressingofabsoluteoperandsorunknown*£forwardreferences. ŠPAGE N*******************************************************************************Ì**™DATAƒSECTIONœ**Ì*N****************************************************************************** ŠSECTIONDATA $PBA‡EQU„*’ProgramBaseAddress(PBA)%*£Thislabelisusedtodesignatethe+*£beginningoftheprogram.‚Thisisusedto'*£makereferencestootherpartsofthe*£program,relocatable. 9ŠDS.WƒSTACKLEN‹ThisisthestackareafortheVME620test2STACK…EQU„*’program.‚Registersandotherimportant,*£informationwillbestoredonthestackas)*£theprogramisexecuted.‚Thestackarea'*£isdynamicandwillchangeduringthe *£executionofthetestprogram. =INPUTBUF‚DS.WƒSTRNGLEN‹Thisisthestorageareafortheinput*£stringsthatareentered. 9STATUS„DS.Lƒ1’Thiswillbethestorageareforthestatus,*£codethatisreturnedfromCMR.‚Thisvalue-*£willbedisplayedtoshowtheuserwhatthe *£errorcodewas. 6NUMBER„DS.Lƒ2’SaveareafortheASCIIvalueofSTATUS.ŠPAGE N*******************************************************************************Ì*!*–PARAMETERƒBLOCKS—**Ì*N****************************************************************************** ŠNEXTWB”ForceevenboundaryIOSOUTŠDC.Bƒ0’Requestcode"ŠDC.BƒWRITEŽFunctionspecificationŠDC.Wƒ8’OptionsŠDC.Bƒ0’StatusŠDC.BƒCRTLogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress   ŠNEXTWB”ForceevenboundaryIOSINŠDC.Bƒ0’Requestcode!ŠDC.BƒREADFunctionspecificationŠDC.Wƒ0’OptionsŠDC.Bƒ0’Status"ŠDC.BƒKEYBOARD‹LogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress  CMRBLK„DC.Bƒ7’InitiateI/OŠDC.BƒUNUSEDUnusedŠDC.WƒUNUSEDUnusedŠDC.Lƒ'IN01'ChannelnameŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnused$ŠDC.Lƒ0’AddressofI/Ocontrolblock#ŠDC.Lƒ0’LengthofI/OcontrolblockŠPAGE*7*‚OPENcommandparameterblockfortheDCINPUTdriver:+OPEN_DCI‚DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒOPENOpencommandcodeŠDC.Wƒ1’#ofchannelstoopen-ŠDC.Wƒ0’Channeltoopen(Dynamicallychanged)-ŠDC.WƒDEFAULTŒChannelconfiguration(Dynamic)6OLEN_DCI‚EQU„*-OPEN_DCI‰LengthofOPENparameterblock*E*‚READOUTPUTSTATUScommandparameterblockfortheDCINPUTdriver:+READ_DCI‚DC.Wƒ0’Returnedstatusfromdriver*ŠDC.WƒREAD_STATUSˆReadstatuscommandcode.ŠDC.Wƒ0’Bitmaskforchannelstoreadandupon(*£returnholdstheactualchannelstatus=RLEN_DCI‚EQU„*-READ_DCI‰LengthofREADSTATUSparameterblock*D*‚ENABLEINTERRUPTScommandparameterblockfortheDCINPUTdriver:+ENAB_DCI‚DC.Wƒ0’Returnedstatusfromdriver-ŠDC.WƒENAB_INT‹Enableinterruptscommandcode.ŠDC.Wƒ0’Bitmaskforchannelstoreadandupon(*£returnholdstheactualchannelstatusCELEN_DCI‚EQU„*-ENAB_DCI‰LengthofENABLEINTERRUPTSparameterblock*D*‚ENABLEINTERRUPTScommandparameterblockfortheDCINPUTdriver:+DISB_DCI‚DC.Wƒ0’Returnedstatusfromdriver.ŠDC.WƒDISAB_INTŠEnableinterruptscommandcode.ŠDC.Wƒ0’Bitmaskforchannelstoreadandupon(*£returnholdstheactualchannelstatus>DLEN_DCI‚EQU„*-DISB_DCI‰LengthofDISABLEINTERRUPTSparameter*8*‚CLOSEcommandparameterblockfortheDCINPUTdriver:)CLSBLK„DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒCLOSEŽClosecommandcodeCLOSLENƒEQU„*-CLSBLKŠNEXTWBŠPAGE N*******************************************************************************Ì**œMESSAGES¡**Ì*N****************************************************************************** ŠSECTIONMESSAGES 9HEAD†DC.BƒCR,LF,LF,'MVME620DriverTestProgram',CR,LF,LF HEADE…EQU„*-1ŠNEXTWB1MESS1…DC.Bƒ'…Numberofthechanneltoconvertˆ>'MESS1E„EQU„*-1ŠNEXTWB(MESS2…DC.Bƒ'…Enteroneoftheabove...'MESS2E„EQU„*-1ŠNEXTWB?MESS4…DC.BƒCR,LF,LF,'…0=READTHECURRENTINPUTSTATUS.',CR,LFMESS4E„EQU„*-1ŠNEXTWB0MESS5…DC.Bƒ'…1=ENABLEFORANINTERRUPT.',CR,LFMESS5E„EQU„*-1ŠNEXTWBMESS6…DC.Bƒ'…2=QUIT.',CR,LFMESS6E„EQU„*-1ŠNEXTWB4MESS9…DC.BƒCR,LF,'STATUSOFALLCHANNELS(ASCII)='MESS9E„EQU„*-1ŠNEXTWB2MESS10„DC.BƒCR,LF,'<<>>',CR,LFMESS10EƒEQU„*-1ŠNEXTWB1MESS11„DC.BƒCR,LF,'<<>>',CR,LF,LFMESS11EƒEQU„*-1ŠNEXTWBŠPAGE,BADOPN„DC.BƒCR,LF,'***OPENABORTED***--'BADOPNEƒEQU„*-1ŠNEXTWB8BADEN…DC.BƒCR,LF,'***ENABLEINTERRRUPTABORTED***--'BADENE„EQU„*-1ŠNEXTWB:BADDIS„DC.BƒCR,LF,'***DISABLEINTERRRUPTABORTED***--'BADDISEƒEQU„*-1ŠNEXTWB4BADREADƒDC.BƒCR,LF,'***READSTATUSABORTED***--'BADREADE‚EQU„*-1ŠNEXTWB-BADCLS„DC.BƒCR,LF,'***CLOSEABORTED***--'BADCLSEƒEQU„*-1ŠNEXTWB+STATUSMƒDC.Bƒ'ErrorcodereturnedinD0=' STATUSME‚EQU„*-1ŠNEXTWBCRLF†DC.BƒCR,LF CRLFE…EQU„*-1ŠNEXTWBŠPAGE N*******************************************************************************Ì**–PROGRAMƒSECTION™**Ì*N****************************************************************************** ŠSECTIONCODEPROGSTRTŠLEA„STACK(PC),A7.ŠLEA„PBA(PC),A4‰GetProgramBaseAddress(PBA) &ŠOUTPUTHEAD,HEADE‰Displaytheheading N*-----------------------------------------------------------------------------***‰Getthenumberofthechanneltoconvert*N*-----------------------------------------------------------------------------GETCHAN.ŠOUTPUTMESS1,MESS1E‡ChannelnumbertoconvertŠINPUT‚INPUTBUF,INPUTBUF+8ŠLEA„INPUTBUF(PC),A0)ŠBSR„CVT2ConvertASCIIdecimaltobinary'ŠIF.LD0#0OR.LD0#7THEN.S ŒBRAGETCHANŠENDI8ŠMOVE.WD0,OPEN_DCI+6-PBA(A4)Savethechannelnumber... <ŠLEA„BIT_NUMBER(PC),A0‚Convertthechannelnumber(0-7)into?ŠMOVE.B(A0,D0.W),D0‡thecorrespondingbitnumber(1,2,4,8...).8ŠMOVE.WD0,READ_DCI+4-PBA(A4)Savethebitmaskvalue...ŠMOVE.WD0,ENAB_DCI+4-PBA(A4)ŠMOVE.WD0,DISB_DCI+4-PBA(A4) N*-----------------------------------------------------------------------------*4*‰Get„0=READSTATUS‚1=ENABLEINTERRUPTSƒ2=QUIT*N*-----------------------------------------------------------------------------GETCLST'ŠOUTPUTMESS4,MESS4E…Putupthemenu...ŠOUTPUTMESS5,MESS5EŠOUTPUTMESS6,MESS6EFGET_CHOICE‚OUTPUTMESS2,MESS2E…Asktheusertoenteroneoftheabove. +ŠINPUT‚INPUTBUF,INPUTBUF+8GettheirchoiceŠLEA„INPUTBUF(PC),A0)ŠBSR„CVT2ConvertASCIIdecimaltobinary'ŠIF.WD0#0OR.WD0#2THEN.SBRA.SGET_CHOICEŠENDIŠPAGE* *‰0=Readinputstatuscommand:*ŠIF.BD0#0THEN.L /ŒOUTPUTMESS10,MESS10Eƒ<<<ƒStartingcommandƒ>>> ŒBSR.L‚CLOSE_ALL>ŒMOVE.W#DEFAULT,D0†Usethedefaultconfigurationfortheopen$ŒBSR.L‚OPEN_CHANˆGoopenthechannel ŒLEA„CMRBLK(PC),A06ŒLEA„READ_DCI(PC),A1‚ReadinputstatusparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#RLEN_DCI,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1ŒIFTHEN.SŽMOVE.WREAD_DCI(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)4ŽOUTPUTBADREAD,BADREADEƒ***READSTATUSABORTED***ŒENDI ŒCLR.L‚D0<ŒMOVE.WREAD_DCI+4-PBA(A4),D0‚Getthestatusvaluereturned.ŒBSR„BHLCVTConvertittoASCII9ŒMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŒMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytesŒOUTPUTMESS9,MESS9EŒOUTPUTNUMBER,NUMBER+7ŒOUTPUTCRLF,CRLFE 3ŒOUTPUTMESS11,MESS11Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDIŠPAGE* *‰1=Enableinterruptscommand:*ŠIF.BD0#1THEN.S /ŒOUTPUTMESS10,MESS10Eƒ<<<ƒStartingcommandƒ>>> ŒBSR.L‚CLOSE_ALL 3ŒMOVE.W#$7F08,D0ˆEnableinterrupts,WAKEUPoption,8*‡softwaredebounce=508mSec,triggeronnegativeedge.$ŒBSR.S‚OPEN_CHANˆGoopenthechannel *(*‚Doawaituntilthedriverwakesusup*ŒMOVE.L#19,D0ŒTRAPƒ#1 ŒIFTHEN.SŽMOVE.WENAB_DCI(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)6ŽOUTPUTBADEN,BADENE„***ENABLEINTERRUPTSABORTED***ŒENDI 3ŒOUTPUTMESS11,MESS11Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDI **‰2=quitcommand:*ŠIF.BD0#2THEN.S BRA.LEXITŠENDI ŠBRA.LGETCHANGostartover.ŠPAGEM*----------------------------------------------------------------------------**ƒOPENTHECHANNEL*M*----------------------------------------------------------------------------OPEN_CHANLEA„CMRBLK(PC),A0ŠLEA„OPEN_DCI(PC),A1BŠMOVE.WD0,OPEN_DCI+8-PBA(A4)‚Savetheopenconfigurationoptions.ŠMOVE.LA1,$14(A0)ŠMOVE.W#OLEN_DCI,$18(A0)7ŠMOVE.L#CMR,D0ŒHereweperformanexecutiverequesttoŠTRAPƒ#1‘invokeCMR.ŠIFTHEN.SŒMOVE.LD0,STATUS-PBA(A4)+ŒOUTPUTBADOPN,BADOPNE…***OPENABORTED***ŒBRA.S‚SHOW_D0ŠENDIŠRTS  M*----------------------------------------------------------------------------**ƒOUTPUTTHEERRORCODE:*M*----------------------------------------------------------------------------:SHOW_D0ƒMOVE.LSTATUS(PC),D0†GetthestatusvaluereturnedŠBSR„BHLCVTConvertittoASCII9ŠMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŠMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytesŠOUTPUTSTATUSM,STATUSMEŠOUTPUTNUMBER,NUMBER+7ŠOUTPUTCRLF,CRLFE EXIT:ŠBSR.S‚CLOSE_ALL +EXIT_OUT:MOVE.L#15,D0TerminatethistaskŠTRAPƒ#1ŠPAGEN*-----------------------------------------------------------------------------**‚CLOSEALLCHANNEL'SROUTINE:*N*-----------------------------------------------------------------------------CLOSE_ALL MOVE.W D0,-(A7) ŠLEA„CMRBLK(PC),A0ŠLEA„CLSBLK(PC),A1ŠMOVE.LA1,$14(A0)ŠMOVE.W#CLOSLEN,$18(A0)6ŠMOVE.L#CMR,D0ŒTellCMRtoclosetheDCINPUTchannelŠTRAPƒ#1ŠIFTHEN.SŒMOVE.LD0,STATUS-PBA(A4)ŒBSR„BHLCVTConvertittoASCII9ŒMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŒMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytes,ŒOUTPUTBADCLS,BADCLSE…***CLOSEABORTED***ŒOUTPUTNUMBER,NUMBER+7ŒOUTPUTCRLF,CRLFEŒMOVE.W(A7)+,D0‰Restorestack.&ŒBRA.S‚EXIT_OUT‰Outputtheerrorcode.ŠENDI ŠMOVE.W(A7)+,D0ŠRTS M*----------------------------------------------------------------------------*A*ƒTABLETOCONVERTTHECHANNELNUMBER(0-7)TOIT'SCORRESPONDING**ƒBITMAPPEDVALUE(1,2,4,8,16,32,64,128).*M*----------------------------------------------------------------------------$BIT_NUMBER‚DC.B‚1,2,4,8,16,32,64,128 ŠEND„PROGSTRTéINP04ŸàCODE" SEG2"ÿÿÿÿ!"5ÿÿ$@&IpAú¨NAf¼.HßüB "K*O,OB•Hí(+I6Hí0@+B:;C>;FH+G0Bm4¼ `J(HÙüÿ$HGê`+Kp&üÿÿÿÿB›+K+Ll2<€0<ìBµX@YAbö&Jr`B›YfúAúv%H,Aú6%H0Aú„%H8Aúš%HJf @fpBNNCíK& –‰CCaZJfR@  g ;fÿz;@" ;fXa =faôg ,fò  g. Zg( Ae" [dCíK( ˜‰ -fDDHã‰Gíj7„aÀ  f¨JgŒáƒåƒaf() ˜©„‰ ƒŠclÖ„ƒÿBAíB¨BB¨BhBh B¨!|SEG2 pNAfþAí!CBB¨1| B¨!|SEG2 1| pNAfýè–„ƒŠ`BƒaÞ,iÝüˆÝÃKí¼0<¼=%U@fú.N*O$iGê`+Kp&üÿÿÿÿB›+K+i l&Jr`B›YfúAú´%H,Aút%H0AúÂ%H8AúØ%HHíÿÿ|+o t <+@xaÿ:`ÿ H@0-4H@,NAB€BIúT am zn ,gè4k6 -fÀ`Ög0ƒgÁ` =fRŠa`  f@` NuBƒ:< &J $g am zn 4 gˆ`6 am zn 4k6gãƒ(åƒÖ„ÖSEf΂ am zn 4jè  f" am zn +ÿþNu:< am zn  am zn 4k´fgŒ_郆SEfÌ`ÿz€€€@@ P€@  €@HÄR„„ÿÿÿþŸÄŸü ¿íb O÷H pNNOï .·HNu.LÐ2*(-0a®a+D0Nu"_. HÂ&g&<…(„QR„Dÿþ$O•ĵíldEïµíle•ílØŠaÿz!OEïP/JEò8ÿ/JA??B$O eTgv`gvC)C BjBBjBªL@O(-0fgA@aJf<gJ-(ga Xat`aúgJ-$ga @a\`aâgaÄ`8°m"b"?S@å@@,J5LŸg ga a$` ga¤`aŠgNq5A+D0NÑHçØžMê$gpÿS@å@@,Aõ|B€(@AõJa\$€ÿ€üLßyg/p(NNg g%m6*HBB|g€BNÁ Nupa |&8%m:*NuH瀀Aê$0¼€NCgNN *&o|&BjFB*K*E f|'` f|'`|'BjDLßNu.LÐ2*aHaxB f† fpÀj& g fa  g4/ &Ja Æ5 c ¼5‚a ˜a>H‚?a Æ2&_g*8 gAê0¼NBgNN` ap÷Áj&a AìB’5ANup`‚.LÐ ª2*a’ fFa pj&aV*8 &g, g&Aê$0¼€NCg f0¼NCf0¼€NCgNNa –B’A€ a ¬CòO%I5ANup` f?*8 &g pøÀj&€W5@&0Nu/(-0fBg<`"g<`BR ft bfì cp@NNB B)(NuB€BIúûr&H6<%B„aük$ #fÀ` ff&@€€€Nu€ü`öaÊkBfôgÚ .f R nÐ`Þ :f€@`Ð (f€`Ä )fª@`¸g Jfžf˜ggŒfF*H Kf  am zn (g24f.f. gD gô .fRˆ`*Rˆ`DÀ` 6<Gîa&4<aškÌ`À`Â&<€€€ am zn 4k^f0fR *g2À  am zn 4kR .fâ`JÆü Ö`¤ ƒ€f4 .fÄÀ6<ÿþ` ƒ€g ƒ'cÀ` =C ` À`À4<aÚk 6< Gî aN4<aÂkô n& f| 6< Gîa(4<aœkÎ (g 6<Gîa 4<a~k° (f¨BBBC am zn 4kD )gg8 Pn2AéK†AB`ÈBÿg BnÀ BcÀ=C `JÀÀÀBÿ BcÀ`.Rˆ6<Gîap4<aæk$< Gî &Â&Â&Â&Â6ÂBn $B|gÀ4B|gÀJ€NuJCfBA`$ am zn SC /f À<€`4Nu4HB€€»ÈgF am zn 4k.f(f @À`< *fÀÁSCn¾€€`$HB´CfÀ`< (*ÿþf<*`ÂSCnúNuJ€jÀ`QBgQBÀ`ÀBgÀNug g ³êga° ‰Nu%| 8%| .f %m@0%mD4` g%m6*NuHçùÀ./ T¯ a( ‚DÁLߟNuHçùÀ./ T¯ aãƒjD€ €DÁLߟNu G0å@A÷X@ @fB@C÷ "fpNN&âƒjD€³ƒJjDtÿB²€dã‰R`ödÐã’â‰SdòF‚"jD‚F‚[ÁNu.LÐR’aP ‰Nu0/8/`8/0/./ Gï 2RAAÿþ sLИ@a†J@g ›aŽS@nö ‰&_$_O÷NÒHçÀ€2*fpDNN³êggS‰` g¼ `S‰`¼ %IAê0¼NBg ÆgNNa&CòO%I"jLßNuJDo ¼ aSDnôNu³êfaÿzŸRIR’Nu./ LÐ 8+ fa¸8+gp"NN„7D +ŠR€Ñ“&_BNu.a2€Nu.a"€NuHçx"aõjLÐ 8+,Oa¤B +g -f -f|ÿaºa˜ am zn aÀ,OaÎJjD€ ŠÞü"LßH`Nu.HçPBYU@a"Lß 2‚Nu./ aJAgp ÀSAnú&_NuLÐ 8+24a.µëgaBJAgîÀSA`è”A ŠNua fa$`ðNu fa¨8+gp"NNB€NuR“µëf•Ê`RеëfÄ7DNuz"Bv 0m 9op1NN`@JEoJf 0g 0ÀPÁSE`RCaÿªaÿˆ am zn 0m 9oÀ #f¬ÃJEoÀSE`RCBaÿlaÿJ am zn 9o Am0 oJ@m @op1NN`TJEoJf gÀPÁSE`RCaÿaþî am zn 9o Am0 oJm o¬E"DENuB@BAt JEoNv #f(J@gpbNN` Ac AcpbNN`4B@BA`´CnpcNNÀÂÂÂÒƒHA6HAЃSE`°H@0NuHçøÐ2+$KaHÀgS€`R€@ÿþЫS€'@fpCNNAë0¼NBgz Ægt ÂgNNA€7A gXa5´5cJaÂ7AR55H‚5 J /g RB5 J /fôRB‚aê2*aT5ALß `ÿJ•Ê`8$k +gJ€fÁ¼ ` J€g0+HÀS€ÐŠ'@7ALß NuAê$0¼@NCgNN$-0*)Â+B0ÁNu0<…f0*NugH瀀Aê$0¼NCgNNLßNuaÞAý¿?* „6Nug0<$`g0<(`+OSH€å@@,NuAõ JHçMë$aõfLßpaù¸€ÿ€üg/p(NNNu pþ`B@ _.8˜@gAðañ,"OUDg"ØYDnúm2ØNÐ$_. 0HÀ`$_. "JaNò8&RƒCÿþ(gÙS€nú`â€UÁâ€UÂg ÙS€núJg0ÙJgÙNu$_. 8TDað¾"OUDg"ØYDnúm2ØNÒ."Ga|(` ."GapB„8R„„ÿÿÿþ.‰v¸ƒl(X„"mQ‰$I&)g""C¸‘nò „ €lX‰%Q`*"€ÓÀ"Ä`""mEñH ¿ÊbpNNEêÿØQ‰$Ñ"Ä$Ñ+J ‰NuOïÿà¿íOï bpNNNu _.02RAAÿþÞÁNÐNuNVÿîB.ÿópCîÿøAíÿøN«ŠN« ØBnÿô=|ÿö?.ÿöAîÿøN«ÒN«ˆ°_m„0.ÿö 60ùm 69ùo0.ÿö 6Aùmb 6FùnZ0.ÿö 6Aùm2.ÿôHÁé6ùH‚HÂÒ‚7=Aÿô` 0.ÿôHÀé€2.ÿö6ùH‚HÂЂ€0=@ÿô0.ÿöHÀR€=@ÿö`ÿj?.ÿöAîÿøN«ÒN«ˆ°_m>|ÿóHmÿðN«XInvalid hex number - reenter > BgN« /N“ÆJ.ÿófþð=nÿôN^NuNVÿîAîÿúN«‚ -|ÿò0.HÀrN« p-@ÿö4.HÂ&N« X=B € m8.ÿô€7€@û`0.ÿô".ÿö0ûS®ÿò ®ÿòl¤HmÿðAîÿúN«ÒBgN« N« îN^ _TNÐNVÿò-mÿ®ÿö-ÿÂ`\ nÿöBh`~ nÿö1|`p nÿö1|`b nÿö1|`T nÿö1|`F nÿö1|`8?<NN WnòAú Vˆ°númæÐÐNÐCÿ¨DÿÀEÿ®OÿŽSÿÂWÿz nÿö0(HÀJ€gÂHmÿðN«XEnter channel mnemonic > BgN« /N“BpCíÿžAíÿøN« N« Ø nÿö0(HÀ €gNHmÿðN«XEnter channels mask in hex. > BgN« /N“è nÿöHhUaý0 _0€`HmÿðN«X#Enter number of channels to open > BgN« /N“” nÿöCèAíÿøN«N« ØB®ÿú nÿö0(HÀS€-@ÿò`ªHmÿðN«XEnter channel number > BgN« /N“8 nÿö .ÿúå@CðAíÿøN«N« ØHmÿðN«X&Enter channel configuration in hex. > BgN« /N“à nÿö .ÿúå@HpUaûú0 _0€R®ÿúi .ÿò°®ÿúlÿNUHmÿ˜Hmÿ¼N“l nÿö0Ÿ0(HÀJ€gx0(HÀ €f6HmÿðN«XChannel Status = BgN« /N“\ nÿö?(aüžHmÿðN«XCommand Status is BgN« /N“& nÿö?aüjN^NužüntrpAíÿðN«âAíÿðN«®trpAíÿøN«âAíÿøN«ü|ÿšB-ÿ›Aíÿ®N«ü&HmÿðN«XEnter number of tasks (1-26) > BgN« /N“šCíÿ´AíÿøN«N« ØAíÿ¼N«‚INPx/-ÿ´N“F+|ÿ¸+mÿ´ÿ’` -ÿ¸€@@ÿ¿HmÿðN«X** Task BgN« //-ÿ¼?<?<N« þ/?<*/< *BgN« N« îHmÿðN«X9Command (O-pen,C-lose,E-nable,D-isable,S-tatus,W-ait ) > BgN« /N“Àp CíÿÀAíÿøN«ŠN« ØAíÿÀN«ÒN«ˆHÀJ€g,-ÿ "<ˆ€8t ?c°` m`gaûTAíÿÀN«ÒN«ˆHÀJ€fþþR­ÿ¸i -ÿ’°­ÿ¸lþì`þÖAíÿðN«ÆAíÿøN«ÆBgNN(_.S‡Oïÿœ O ¼INPAB¨1|@||1| Cú>!I1|2p NAgaàR(QÉÿð ¼INPA1| 1| ""Op#|CODE INAga®p#|SEG2 INAgašR)QÉÿÒ I ¼INPA| | !| Cú>!I"pNAgabR(QÉÿð ¼INPA1|"p NAgaBR(QÉÿðOïdNÔLßOïÿœ O ’1|€Eú˜!JEè!J B\4ü$Ì9|$l jf2*Âü\9Ap#NAgaàJ,ÿþgúOïd>’NÑ STAKpAúÿäNAga¬Oèøp$NAgúažpNAùþ`¹þ``êŸü Op"NAgav h ßü"hJigp  Enter one of the above... 0 = READ THE CURRENT INPUT STATUS. 1 = ENABLE FOR AN INTERRUPT. 2 = QUIT. STATUS OF ALL CHANNELS (ASCII) = <<< Starting command >>> <<< Command done >>> *** OPEN ABORTED *** -- *** ENABLE INTERRRUPT ABORTED *** -- *** DISABLE INTERRRUPT ABORTED *** -- *** READ STATUS ABORTED *** -- *** CLOSE ABORTED *** -- Error code returned in D0 = Oúý(Iúü\Aúþ)HDAúþ)HHAúý€NBAúþ)HDAúþ6)HHAúýjNBAúüô)H`Aúüô)HdAúýpNBAúüÞab €m €o`º9@’AúÜ09@š9@ 9@¦Aúþ)HDAúþ%)HHAúý NBAúþ)HDAúþ2)HHAúüöNBAúþ&)HDAúþ-)HHAúüàNBAúý )HDAúý¶)HHAúüÊNBAúüT)H`AúüT)HdAúüÐNBAúü>a @m @o`¾ fÈAúýú)HDAúþ )HHAúü€NBa²0< aAúü¦CúüÈ!I1|pNBB€0,ša¸)B0)C4Aúýl)HDAúý†)HHAúüNBAúü)HDAúü)HHAúüNBAúþ^)HDAúþW)HHAúûêNBAúýj)HDAúýz)HHAúûÔNB`þR f^Aúý.)HDAúýA)HHAúû´NBaæ0<aLpNAg0:ü)@,AúýP)HDAúýn)HHAúû†NBAúý)HDAúý)HHAúûpNB`ýî f`’`ýàAúûCúû¨9@”!I1| pŠMOVE.LA0,IOSOUT+16-PBA(A4)SettheendingaddressofmessageŠLEA„IOSOUT(PC),A0ŠTRAPƒ#2ŠENDM ŠPAGE 2ŠOPT„PCSWeuseaPCSoptionsotheassemblerwill%*£forcePCrelativeaddressingwithin(*£SECTION.‚ForcesPCrelativeaddressing-*£(wheneversuchanaddressingmodeislegal))*£inaninstructionwhichoccurswithina'*£relocatableSECTIONandreferencesan,*£operandinarelocatableSECTION(neednot**£bethesameSECTIONastheinstruction).,*£Failuretoresolvesucnareferenceintoa-*£16-bitdisplacementfromthePCwillresult)*£inanerror.‚Thisoptionmaybeusedto+*£forcepositionindependentcode;however,(*£thisoptiondoesnotforcePCrelative,*£addressingofabsoluteoperandsorunknown*£forwardreferences. ŠPAGE N*******************************************************************************Ì**™DATAƒSECTIONœ**Ì*N****************************************************************************** ŠSECTIONDATA $PBA‡EQU„*’ProgramBaseAddress(PBA)%*£Thislabelisusedtodesignatethe+*£beginningoftheprogram.‚Thisisusedto'*£makereferencestootherpartsofthe*£program,relocatable. 9ŠDS.WƒSTACKLEN‹ThisisthestackareafortheVME615test2STACK…EQU„*’program.‚Registersandotherimportant,*£informationwillbestoredonthestackas)*£theprogramisexecuted.‚Thestackarea'*£isdynamicandwillchangeduringthe *£executionofthetestprogram. =INPUTBUF‚DS.WƒSTRNGLEN‹Thisisthestorageareafortheinput*£stringsthatareentered. 9STATUS„DS.Lƒ1’Thiswillbethestorageareforthestatus ,*£codethatisreturnedfromCMR.‚Thisvalue-*£willbedisplayedtoshowtheuserwhatthe*£errorcodewas. 6NUMBER„DS.Lƒ2’SaveareafortheASCIIvalueofSTATUS.ŠPAGE N*******************************************************************************Ì*!*–PARAMETERƒBLOCKS—**Ì*N****************************************************************************** ŠNEXTWB”ForceevenboundaryIOSOUTŠDC.Bƒ0’Requestcode"ŠDC.BƒWRITEŽFunctionspecificationŠDC.Wƒ8’OptionsŠDC.Bƒ0’StatusŠDC.BƒCRTLogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress   ŠNEXTWB”ForceevenboundaryIOSINŠDC.Bƒ0’Requestcode!ŠDC.BƒREADFunctionspecificationŠDC.Wƒ0’OptionsŠDC.Bƒ0’Status"ŠDC.BƒKEYBOARD‹LogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress  CMRBLK„DC.Bƒ7’InitiateI/OŠDC.BƒUNUSEDUnusedŠDC.WƒUNUSEDUnusedŠDC.Lƒ'ACO1'ChannelnameŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnused$ŠDC.Lƒ0’AddressofI/Ocontrolblock#ŠDC.Lƒ0’LengthofI/OcontrolblockŠPAGE*8*‚OPENcommandparameterblockfortheACOUTPUTdriver:+OPEN_ACO‚DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒOPENOpencommandcodeŠDC.Wƒ1’#ofchannelstoopen-ŠDC.Wƒ0’Channeltoopen(Dynamicallychanged)-ŠDC.WƒDEFAULTŒChannelconfiguration(Dynamic)6OLEN_ACO‚EQU„*-OPEN_ACO‰LengthofOPENparameterblock*C*‚STARTOUTPUTONcommandparameterblockfortheACOUTPUTdriver:)ON_ACO„DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒON‘ONcommandcode2ŠDC.Wƒ0’Bitmaskforchannelstoturnon(Dynamic)2NLEN_ACO‚EQU„*-ON_ACO‹LengthofONparameterblock*C*‚TURNOUTPUTOFFcommandparameterblockfortheACOUTPUTdriver:*OFF_ACOƒDC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒOFFOffcommandcode3ŠDC.Wƒ0’Bitmaskforchannelstoturnoff(Dynamic)4FLEN_ACO‚EQU„*-OFF_ACOŠLengthofOFFparameterblock*A*‚PULSEDOUTPUTcommandparameterblockfortheACOUTPUTdriver:*PON_ACOƒDC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒPULSEŽPulsecommandcodeŠDC.Wƒ1’#ofchannels,ŠDC.Wƒ0’Channelnumber(Dynamicallychanged)/ŠDC.Lƒ0’Timeofpulseinmilliseconds(Dynamic)6PLEN_ACO‚EQU„*-PON_ACOŠLengthofPULSEparameterblock*F*‚READOUTPUTSTATUScommandparameterblockfortheACOUTPUTdriver:+READ_ACO‚DC.Wƒ0’Returnedstatusfromdriver*ŠDC.WƒREAD_STATUSˆReadstatuscommandcode.ŠDC.Wƒ0’Bitmaskforchannelstoreadandupon(*£returnholdstheactualchannelstatus=RLEN_ACO‚EQU„*-READ_ACO‰LengthofREADSTATUSparameterblock*9*‚CLOSEcommandparameterblockfortheACOUTPUTdriver:)CLSBLK„DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒCLOSEŽClosecommandcodeCLOSLENƒEQU„*-CLSBLKŠNEXTWBŠPAGE N*******************************************************************************Ì**œMESSAGES¡**Ì*N****************************************************************************** ŠSECTIONMESSAGES 9HEAD†DC.BƒCR,LF,LF,'MVME615DriverTestProgram',CR,LF,LF HEADE…EQU„*-1ŠNEXTWB1MESS1…DC.Bƒ'…Numberofthechanneltoconvertˆ>'MESS1E„EQU„*-1ŠNEXTWB(MESS2…DC.Bƒ'…Enteroneoftheabove...'MESS2E„EQU„*-1ŠNEXTWB8MESS3…DC.Bƒ'…Time(inmilliseconds)foroutputpulse>'MESS3E„EQU„*-1ŠNEXTWB+MESS4…DC.BƒCR,LF,LF,'…0=OUTPUTON.',CR,LFMESS4E„EQU„*-1ŠNEXTWB#MESS5…DC.Bƒ'…1=OUTPUTOFF.',CR,LFMESS5E„EQU„*-1ŠNEXTWB=MESS6…DC.Bƒ'…2=PULSEANOUTPUTFORASPECIFIEDTIME.',CR,LFMESS6E„EQU„*-1ŠNEXTWB7MESS7…DC.Bƒ'…3=READTHECURRENTOUTPUTSTATUS.',CR,LFMESS7E„EQU„*-1ŠNEXTWB MESS8…DC.Bƒ'…4=QUIT.',CR,LF,LFMESS8E„EQU„*-1ŠNEXTWB4MESS9…DC.BƒCR,LF,'STATUSOFALLCHANNELS(ASCII)='MESS9E„EQU„*-1ŠNEXTWB2MESS10„DC.BƒCR,LF,'<<>>',CR,LFMESS10EƒEQU„*-1ŠNEXTWB 1MESS11„DC.BƒCR,LF,'<<>>',CR,LF,LFMESS11EƒEQU„*-1ŠNEXTWBŠPAGE,BADOPN„DC.BƒCR,LF,'***OPENABORTED***--'BADOPNEƒEQU„*-1ŠNEXTWB6BADON…DC.BƒCR,LF,'***STARTOUTPUTONABORTED***--'BADONE„EQU„*-1ŠNEXTWB7BADOFF„DC.BƒCR,LF,'***TURNOUTPUTOFFABORTED***--'BADOFFEƒEQU„*-1ŠNEXTWB:BADPLS„DC.BƒCR,LF,'***STARTOUTPUTPULSEABORTED***--'BADPLSEƒEQU„*-1ŠNEXTWB4BADREADƒDC.BƒCR,LF,'***READSTATUSABORTED***--'BADREADE‚EQU„*-1ŠNEXTWB-BADCLS„DC.BƒCR,LF,'***CLOSEABORTED***--'BADCLSEƒEQU„*-1ŠNEXTWB+STATUSMƒDC.Bƒ'ErrorcodereturnedinD0='STATUSME‚EQU„*-1ŠNEXTWBCRLF†DC.BƒCR,LF CRLFE…EQU„*-1ŠNEXTWBŠPAGE N*******************************************************************************Ì**–PROGRAMƒSECTION™**Ì*N****************************************************************************** ŠSECTIONCODEPROGSTRTŠLEA„STACK(PC),A7.ŠLEA„PBA(PC),A4‰GetProgramBaseAddress(PBA) &ŠOUTPUTHEAD,HEADE‰Displaytheheading N*-----------------------------------------------------------------------------***‰Getthenumberofthechanneltoconvert*N*-----------------------------------------------------------------------------GETCHAN.ŠOUTPUTMESS1,MESS1E‡ChannelnumbertoconvertŠINPUT‚INPUTBUF,INPUTBUF+8ŠLEA„INPUTBUF(PC),A0)ŠBSR„CVT2ConvertASCIIdecimaltobinary'ŠIF.LD0#0OR.LD0#7THEN.S ŒBRAGETCHANŠENDI8ŠMOVE.WD0,OPEN_ACO+6-PBA(A4)Savethechannelnumber...ŠMOVE.WD0,PON_ACO+6-PBA(A4) <ŠLEA„BIT_NUMBER(PC),A0‚Convertthechannelnumber(0-7)into?ŠMOVE.B(A0,D0.W),D0‡thecorrespondingbitnumber(1,2,4,8...).6ŠMOVE.WD0,ON_ACO+4-PBA(A4)Savethebitmaskvalue...ŠMOVE.WD0,OFF_ACO+4-PBA(A4)ŠMOVE.WD0,READ_ACO+4-PBA(A4) N*-----------------------------------------------------------------------------*4*‰Get„0=OUTPUTON„1=OUTPUTOFFƒ2=PULSEDOUTPUT*3=READSTATUS‚4=QUIT*N*-----------------------------------------------------------------------------GETCLST'ŠOUTPUTMESS4,MESS4E…Putupthemenu...ŠOUTPUTMESS5,MESS5EŠOUTPUTMESS6,MESS6EŠOUTPUTMESS7,MESS7EŠOUTPUTMESS8,MESS8EFGET_CHOICE‚OUTPUTMESS2,MESS2E…Asktheusertoenteroneoftheabove. +ŠINPUT‚INPUTBUF,INPUTBUF+8GettheirchoiceŠLEA„INPUTBUF(PC),A0)ŠBSR„CVT2ConvertASCIIdecimaltobinary'ŠIF.WD0#0OR.WD0#4THEN.SBRA.SGET_CHOICEŠENDIŠPAGE**‰0=StartoutputONcommand:*ŠIF.BD0#0THEN.S 'ŒBSR.L‚CLOSE_ALLˆGocloseallchannels./ŒOUTPUTMESS10,MESS10Eƒ<<<ƒStartingcommandƒ>>> >ŒMOVE.W#DEFAULT,D0†Usethedefaultconfigurationfortheopen$ŒBSR.L‚OPEN_CHANˆGoopenthechannel ŒLEA„CMRBLK(PC),A02ŒLEA„ON_ACO(PC),A1„StartoutputONparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#NLEN_ACO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1ŒIFTHEN.SŽMOVE.WON_ACO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)4ŽOUTPUTBADON,BADONE…***STARTOUTPUTONABORTED***ŽBRA.L‚SHOW_D0ŒENDI 3ŒOUTPUTMESS11,MESS11Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDI **‰1=TurnoutputOFFcommand:*ŠIF.BD0#1THEN.S 'ŒBSR.L‚CLOSE_ALLˆGocloseallchannels./ŒOUTPUTMESS10,MESS10Eƒ<<<ƒStartingcommandƒ>>> >ŒMOVE.W#DEFAULT,D0†Usethedefaultconfigurationfortheopen$ŒBSR.L‚OPEN_CHANˆGoopenthechannel ŒLEA„CMRBLK(PC),A03ŒLEA„OFF_ACO(PC),A1ƒTurnoutputOFFparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#FLEN_ACO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1ŒIFTHEN.SŽMOVE.WOFF_ACO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)6ŽOUTPUTBADOFF,BADOFFE„***TURNOUTPUTOFFABORTED***ŽBRA.L‚SHOW_D0ŒENDI 3ŒOUTPUTMESS11,MESS11Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDI **‰2=PULSEanoutputcommand:*ŠIF.BD0#2THEN.L3ŒBSR„GET_TIME‰Getthepulseduration(milliseconds)+ŒMOVE.LD3,PON_ACO+8-PBA(A4)Storethetime  'ŒBSR.L‚CLOSE_ALLˆGocloseallchannels./ŒOUTPUTMESS10,MESS10E…<<<ƒStartingcommandƒ>>> 7ŒMOVE.W#WAKEUP_O,D0…UsetheWAKEUPoptionfortheopen$ŒBSR.L‚OPEN_CHANˆGoopenthechannel ŒLEA„CMRBLK(PC),A06ŒLEA„PON_ACO(PC),A1ƒStartoutputpulseparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#PLEN_ACO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1*(*ƒDoawaituntilthedriverwakesusup*ŒMOVE.L#19,D0ŒTRAPƒ#1 ŒIFTHEN.SŽMOVE.WPON_ACO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4);ŽOUTPUTBADREAD,BADREADEƒ***STARTOUTPUTPULSEABORTED***ŽBRA.L‚SHOW_D0ŒENDI 3ŒOUTPUTMESS11,MESS11Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDI **‰3=READSTATUScommand:*ŠIF.BD0#3THEN.L /ŒOUTPUTMESS10,MESS10Eƒ<<<ƒStartingcommandƒ>>> ŒLEA„CMRBLK(PC),A00ŒLEA„READ_ACO(PC),A1‚ReadstatusparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#RLEN_ACO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1ŒIFTHEN.SŽMOVE.WREAD_ACO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)4ŽOUTPUTBADREAD,BADREADEƒ***READSTATUSABORTED***ŒENDI ŒCLR.L‚D0;ŒMOVE.WREAD_ACO+4-PBA(A4),D0‚GetthestatusvaluereturnedŒBSR„BHLCVTConvertittoASCII9ŒMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŒMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytesŒOUTPUTMESS9,MESS9EŒOUTPUTNUMBER,NUMBER+7ŒOUTPUTCRLF,CRLFE 3ŒOUTPUTMESS11,MESS11Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDI**‰4=quitcommand:*ŠIF.BD0<EQ>#4THEN.S'BSR.L‚CLOSE_ALLˆGocloseallchannels. BRA.LEXITŠENDI ŠBRA.LGETCHANGostartover.ŠPAGEM*----------------------------------------------------------------------------**ƒOPENTHECHANNEL*M*----------------------------------------------------------------------------OPEN_CHANLEA„CMRBLK(PC),A0ŠLEA„OPEN_ACO(PC),A1BŠMOVE.WD0,OPEN_ACO+8-PBA(A4)‚Savetheopenconfigurationoptions.ŠMOVE.LA1,$14(A0)ŠMOVE.W#OLEN_ACO,$18(A0)7ŠMOVE.L#CMR,D0ŒHereweperformanexecutiverequesttoŠTRAPƒ#1‘invokeCMR.ŠIFTHEN.SŒMOVE.LD0,STATUS-PBA(A4)+ŒOUTPUTBADOPN,BADOPNE…***OPENABORTED***ŒBRA.S‚SHOW_D0ŠENDIŠRTS M*----------------------------------------------------------------------------*+*‚GETTHETIMEDURATIONFORANOUTPUTPULSE*M*----------------------------------------------------------------------------GET_TIMEŠOUTPUTMESS3,MESS3EŠINPUT‚INPUTBUF,INPUTBUF+8ŠLEA„INPUTBUF(PC),A0 ŠBSR„ASCVAL ŠTST.L‚D3 ŠBEQ„GET_TIME+ŠIF.LD3#0OR.LD3#$FFFFTHEN.S ŒBRA„GET_TIMEŠENDIŠAND.L‚#$0000FFFF,D3ŠRTS M*----------------------------------------------------------------------------**ƒOUTPUTTHEERRORCODE:*M*----------------------------------------------------------------------------:SHOW_D0ƒMOVE.LSTATUS(PC),D0†GetthestatusvaluereturnedŠBSR„BHLCVTConvertittoASCII9ŠMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŠMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytesŠOUTPUTSTATUSM,STATUSMEŠOUTPUTNUMBER,NUMBER+7ŠOUTPUTCRLF,CRLFE EXITŠBSR.S‚CLOSE_ALL"ŠMOVE.L#15,D0TerminatethistaskŠTRAPƒ#1ŠPAGEN*-----------------------------------------------------------------------------**‚CLOSEALLCHANNEL'SROUTINE:*N*-----------------------------------------------------------------------------CLOSE_ALL MOVE.W D0,-(A7) ŠLEA„CMRBLK(PC),A0ŠLEA„CLSBLK(PC),A1ŠMOVE.LA1,$14(A0)ŠMOVE.W#CLOSLEN,$18(A0)7ŠMOVE.L#CMR,D0ŒTellCMRtoclosetheACOUTPUTchannelŠTRAPƒ#1ŠIFTHEN.SŒMOVE.LD0,STATUS-PBA(A4),ŒOUTPUTBADCLS,BADCLSE…***CLOSEABORTED***ŒMOVE.W(A7)+,D0‰Restorestack.%ŒBRA.L‚SHOW_D0ŠOutputtheerrorcode.ŠENDI ŠMOVE.W(A7)+,D0ŠRTS M*----------------------------------------------------------------------------*A*ƒTABLETOCONVERTTHECHANNELNUMBER(0-7)TOIT'SCORRESPONDING**ƒBITMAPPEDVALUE(1,2,4,8,16,32,64,128).* M*----------------------------------------------------------------------------$BIT_NUMBER‚DC.B‚1,2,4,8,16,32,64,128 ŠEND„PROGSTRTééééééé=/*=/*†M615DRV.TESTAC.AF=/*;=/* Chain file to assemble ACO driver test routine 'TESTAC'=/*:=/* If no output argument is specified for the listing the0=/* chain file will default to M615DRV.TESTAC.LS=/*=/IFC \1ƒ=ARGM615DRV.TESTAC.LS=/ENDIF=/*2=ASM M615DRV.TESTAC.SA,M615DRV.TESTAC.RO,\1;MRZ=70=/*{ Included files are:=/*ƒ--none--=/*}=/*=ENDéééééé P=/*=/*†M615DRV.TESTAC.LF=/*/=/* Link chain file to create M615DRV.TESTAC.LO=/*:=/* If no output argument is specified for the listing the0=/* chain file will default to M615DRV.TESTAC.LL=/*=/IFC \1ƒ=ARGM615DRV.TESTAC.LL=/ENDIF=/* =LINK ,M615DRV.TESTAC.LO,\1;HMIX SEG SEG0:0INPUT M615DRV.TESTAC.ROEND=/*=ENDééééééYB*„ThisisTESTAC,arelocatableprogramthatteststheACOdriver.*$*„Copyrighted1983byMotorola,Inc.E**********************************************************************B*‚ThisprogramsetsupfortaskACO1andverifiesitexists.Ifit;*‚doesitproceedswiththetest,ifnotittrystaskACO2./*‚Ifeithertaskismissing,itskipsthetest.*:*‚Thisprogramperformsthefollowingtestsonthedriver:*9*ˆTEST1‚-‚individuallyopenseachchannel,outputstoit,-*’checksstatus,turnsitoff,checksstatus, *’andcloses.9*ˆTEST2‚-‚individuallyopenseachchannel,outputstoit,1*’checksstatus,continuesuntilallareon.Then,*’individuallyturnsoffeachchannel,checks0*’status,continuesuntilallareoff.Turnsall%*’channelsbackonforthenexttest.7*ˆTEST3‚-‚closesthechannels,OPERATORmustcheckthey *’turnedoff.4*ˆTEST4‚-‚opensallchannels,turnsallchannelson,-*’delays,turnsallchannelsoff,andcloses.9*ˆTEST5‚-‚individuallyopenseachchannel,commandspulse*’output,delays,andcloses.7*ˆTEST6‚-‚opensfourchannels,commandspulseoutputof3*’differentlengthstoeachsimultaneously,delays,*’closeschannels.;*ˆTEST7-ƒopenschanneltwowithqueueeventconfiguration,'*’pulsesoutput,waitsforqueueevent,)*’verifiesmessagesent,closeschannels.:*ˆTEST8‚-‚openschannelonewithwaitforwake-upconfig.,'*’pulsesoutput,waitsforwake-up,and*’closeschannels.:*ˆTEST9‚-‚trysoutputONwithchannelsclosedandverifies *’error.3*’trysoutputOFFwithchannelsclosedandverifies*’error./*’tryscheckingstatuswithchannelsclosedand*’verifieserror.,*’tryspulseoutputwithchannelsclosedand*’verifieserror.<*ˆTEST10-‚trysopeninginvalidchannelnumbersandverifies3*’errors.(ZEROchannels,morethaneightchannels,"*’channel#9,sametwochannels).:*ˆTEST11-‚openschannelandtrysinvalidcommands(0,6,*’7,>8)andverifieserrors. b/kPsP{PƒV‹\“\›U£W«P³Y»ZÃYËRÓRÛWãbë=*ˆTEST12-‚trysopeningchannelswhentheyarealreadyopened*’andverifieserror.*>*ˆIfitpassedthesetestsitreturnstothetoptosetupfor2*’taskACO2.IfthiswasfortaskACO2,itsetsup$*’totestbothtaskssimultaneously.7*ˆIFALLTESTSARESUCCESSFUL,printsmessageattesting0*’tothatfact.Ifanytestfails,ERRORmessage$*’isprintedandtestisterminated.*D********************************************************************‰PAGE*5IOADR0ƒEQU‡$F80000VM02basememmapI/Ochanaddress5IOADR1ƒEQU‡$FA0000VM03basememmapI/Ochanaddress7IOADR2ƒEQU‡$FE6000VME110basememmapI/Ochanaddress7IOADR3ƒEQU‡$F1C000VME/10basememmapI/Ochanaddress* ‰SECTIONƒ0*TEST…LEA‡STACK(PC),A7‰LEA‡INITIO(PC),A0.‰CLR.W…DUALFG-INITIO(A0)ƒcleardualtestflags‰CLR.W…DUALCK-INITIO(A0)**SETUPA.S.Q.*!‰MOVE.L„#31,D0Žstagecommandcode-‰LEA‡ASQBLOCK(PC),A0…stagecommandparameters.‰LEA‡TESTIRQ(PC),A1†initializesaddr.ofasync*‰MOVE.L„A1,ASQLA-ASQBLOCK(A0)‚servicertn.‰TRAP†#1 ‰BNE‡FAULT11*‰MOVE.L„#'ACO1',D0(TNAME„LEA‡INITIO(PC),A0‡SETUPTASKNAME‰MOVE.L„D0,ACOPAR-INITIO(A0)‰MOVE.L„D0,TMSG-INITIO(A0)*!TRYBTHƒLEA‡SMSG24(PC),A1‡spaceup‰LEA‡EMSG24(PC),A2 ‰BSR‡MSGOUT*‰LEA‡SMSG24(PC),A1†again‰LEA‡EMSG24(PC),A2 ‰BSR‡MSGOUT*.‰LEA‡SMSG1(PC),A1ˆoutputstartoftestmessage‰LEA‡EMSG1(PC),A2 ‰BSR‡MSGOUT*‰LEA‡SMSG24(PC),A1‡spaceup‰LEA‡EMSG24(PC),A2 ‰BSR‡MSGOUT*‰LEA‡INITIO(PC),A0‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)+‰MOVE.W„#CLSLNG,A1ŠINSURECHANNEL(S)CLOSED$‰MOVE.W„A1,CMDL-INITIO(A0)‚TOSTART.‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT16*‰PAGE* *…OPENTHECHANNELSINDIVIDUALLY*5TEST1„LEA‡SMSG2(PC),A1‡output'open&output'message‰LEA‡EMSG2(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*‰LEA‡EVNTCNT(PC),A0"‰CLR.W…0(A0)initializeparameters‰LEA‡INITIO(PC),A0*‰MOVE.W„#1,ONCMD1-INITIO(A0)'ON'bitmask,‰MOVE.W„#1,OFFCMD1-INITIO(A0)'OFF'bitmask2‰MOVE.W„#1,STATSHF-INITIO(A0)statusreq.bitmask;OPNLP„MOVE.W„EVNTCNT(PC),D0†OPENCHANNEL(eventcountholds‰LEA‡INITIO(PC),A0‡channel#)+‰MOVE.W„D0,OPNCH-INITIO(A0)channeltoopen‰LEA‡OPNCMDS(PC),A1,‰MOVE.L„A1,CMDA-INITIO(A0)‚parameterstoCMR‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*+‰LEA‡INITIO(PC),A0‡OUTPUTTOCHANNELOPENED‰LEA‡ONCMD(PC),A1,‰MOVE.L„A1,CMDA-INITIO(A0)‚parameterstoCMR ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT2*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#500,A0500MS‰TRAP†#1 ‰BNE‡FAULT15*!‰LEA‡OPNLP(PC),A1ˆloopbackaddr.&‰LEA‡TEST1B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*%TEST1BƒLEA‡INITIO(PC),A0‡CHECKSTATUS/‰MOVE.W„STATSHF(PC),D0†movechanneltocheckto1‰MOVE.W„D0,STAT-INITIO(A0)‚statusparameterblock‰LEA‡STATCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT3*3‰MOVE.W„STAT(PC),D0‰doesstatuscheckwithbitthat"‰CMP.W…ONCMD1(PC),D0‡shouldbeon? ‰BNE‡FAULT4*#‰LEA‡INITIO(PC),A0‡TURNOFFCHANNEL‰LEA‡O FFCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT5*‰LEA‡INITIO(PC),A0‡CHECKSTATUS/‰MOVE.W„STATSHF(PC),D0†movechanneltocheckto1‰MOVE.W„D0,STAT-INITIO(A0)‚statusparameterblock‰LEA‡STATCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT3*.‰MOVE.W„STAT(PC),D0‰doesstatuscheckshowbit#‰BNE‡FAULT4Žstillon?ifso,error.*#‰LEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST1B(PC),A1‡loopbackaddr.&‰LEA‡TEST1C(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*TEST1CƒLEA‡INITIO(PC),A0>‰ASL.W…ONCMD1-INITIO(A0)ƒshift'ON'channelbitmaskoneplace/‰ASL.W…OFFCMD1-INITIO(A0)‚shift'OFF'ƒ"…"ƒ"„"„"0‰ASL.W…STATSHF-INITIO(A0)‚shiftstatus‚"…"ƒ"„"„"‰LEA‡EVNTCNT(PC),A0'‰ADD.W…#1,0(A0)Œincrementeventcounter‰MOVE.W„EVNTCNT(PC),D0‰CMPI.W„#8,D0done? ‰BMI‡OPNLP*‰PAGE*2*„OUTPUTTOCHANNELSSEQUENTIALLYUNTILALLAREON*5TEST2„LEA‡SMSG3(PC),A1‡output'outputtoall'message‰LEA‡EMSG3(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*‰LEA‡EVNTCNT(PC),A0"‰CLR.W…0(A0)initializeparameters‰LEA‡INITIO(PC),A06‰MOVE.W„#1,ONCMD1-INITIO(A0)‚bitmaskfor'ON'channel9‰MOVE.W„#1,STATSHF-INITIO(A0)bitmaskforstatuschannel)OPNLP2ƒMOVE.W„EVNTCNT(PC),D0†OPENCHANNEL‰LEA‡INITIO(PC),A0‰MOVE.W„D0,OPNCH-INITIO(A0)/‰LEA‡INITIO(PC),A0‡pointtoCMRparameterblock‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*+‰LEA‡INITIO(PC),A0‡OUTPUTTOCHANNELOPENED‰LEA‡ONCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT2*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#500,A0500MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡OPNLP2(PC),A1‡loopbackaddr.&‰LEA‡TEST2A(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*1TEST2AƒLEA‡INITIO(PC),A0‡CHECKSTATUSOFCHANNELS‰MOVE.W„STATSHF(PC),D0‰MOVE.W„D0,STAT-INITIO(A0)‰LEA‡STATCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT3*&‰MOVE.W„STAT(PC),D0‰doesstatuscheck?‰CMP.W…STATSHF(PC),D0 ‰BNE‡FAULT4*"‰LEA‡TEST2A(PC),A1‡loopbackaddr.&‰LEA‡TEST2B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*TEST2BƒLEA‡INITIO(PC),A0>‰ASL.W…ONCMD1-INITIO(A0)ƒshift'ON'channelbitmaskoneplace‰ORI‡#$10,CCRŒsetXbit/‰ROXL.W„STATSHF-INITIO(A0)‚addstatusƒ"…"ƒ"„"„"‰LEA‡EVNTCNT(PC),A0'‰ADD.W…#1,0(A0)Œincrementeventcounter‰MOVE.W„EVNTCNT(PC),D0‰CMPI.W„#8,D0done? ‰BMI‡OPNLP2*7TEST2CƒLEA‡SMSG39(PC),A1‡output'turnoffseq.'message‰LEA‡EMSG39(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*‰LEA‡EVNTCNT(PC),A0"‰CLR.W…0(A0)initializeparameters‰LEA‡INITIO(PC),A08‰MOVE.W„#1,OFFCMD1-INITIO(A0)‚bitmaskfor'OFF'channel9‰MOVE.W„#1,STATSHF-INITIO(A0)bitmaskforstatuschannel*)OPNLP3ƒLEA‡INITIO(PC),A0‡TURNOFFCHANNEL‰LEA‡OFFCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT5*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#500,A0500MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡OPNLP3(PC),A1‡loopbackaddr.&‰LEA‡TEST2D(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*0TEST2DƒLEA‡INITIO(PC),A0‡CHECKSTATUSOFCHANNEL‰MOVE.W„STATSHF(PC),D0‰MOVE.W„D0,STAT-INITIO(A0)‰LEA‡STATCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT3*&‰MOVE.W„STAT(PC),D0‰doesstatuscheck? ‰BNE‡FAULT4*"‰LEA‡TEST2D(PC),A1‡loopbackaddr.&‰LEA‡TEST2E(PC),A2‡continueonforward ‰BRA‡FLOPtestfortoggle*TEST2EƒLEA‡INITIO(PC),A0@‰ASL.W…OFFCMD1-INITIO(A0)‚shift'OFF'channelbitmaskoneplace0‰ASL.W…STATSHF-INITIO(A0)‚shiftstatus‚"…"ƒ"„"„"‰LEA‡EVNTCNT(PC),A0'‰ADD.W…#1,0(A0)Œincrementeventcounter‰MOVE.W„EVNTCNT(PC),D0‰CMPI.W„#8,D0done? ‰BMI‡OPNLP3*+TEST2FƒLEA‡INITIO(PC),A0‡OUTPUTTOCHANNELS‰LEA‡ONCMDA(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT2*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡TEST2F(PC),A1‡loopbackaddr.%‰LEA‡TEST3(PC),A2ˆcontinueonforward‰BRA‡FLOPtestfortoggle**%**************************************ƒCLOSETEST–*%**************************************-TEST3„LEA‡SMSG4(PC),A1‡output'close'message‰LEA‡EMSG4(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*)TEST3AƒLEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST3A(PC),A1‡loopbackaddr.%‰LEA‡TEST4(PC),A2ˆcontinueonforward‰BRA‡FLOPtestfortoggle*‰PAGE$*„TURNONALLOUTPUTS,THENTURNOFF*9TEST4„LEA‡SMSG5(PC),A1‡output'turnon,turnoff'message‰LEA‡EMSG5(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15**TEST4AƒLEA‡INITIO(PC),A0‡OPENALLCHANNELS/‰LEA‡OPNCMD(PC),A1‡pointtoCMRparameterblock‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*,‰LEA‡INITIO(PC),A0‡OUTPUTTOCHANNELSOPENED‰LEA‡ONCMDA(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT2*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡TEST4A(PC),A1‡loopbackaddr.&‰LEA‡TEST4B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle**TEST4BƒLEA‡INITIO(PC),A0‡TURNOFFCHANNELS‰LEA‡OFFCMDA(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT5*#‰LEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST4B(PC),A1‡loopbackaddr.%‰LEA‡TEST5(PC),A2ˆcontinueonforward‰BRA‡FLOPtestfortoggle*‰PAGE*„PULSEEACHOUTPUTINTURN*2TEST5„LEA‡SMSG6(PC),A1‡output'pulseeach'message‰LEA‡EMSG6(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*‰LEA‡EVNTCNT(PC),A0‰CLR.W…0(A0)initializeevntcnt)OPNLP4ƒMOVE.W„EVNTCNT(PC),D0†OPENCHANNEL/‰LEA‡INITIO(PC),A0‡pointtoCMRparameterblock+‰MOVE.W„D0,OPNCH-INITIO(A0)channeltoopen,‰MOVE.W„D0,PLSO1-INITIO(A0)channeltopulse‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*‰LEA‡INITIO(PC),A0‰LEA‡PLSO(PC),A1‰PULSEOUTPUT‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#12,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT10*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡OPNLP4(PC),A1‡loopbackaddr.&‰LEA‡TEST5A(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*)TEST5AƒLEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST5A(PC),A1‡loopbackaddr.&‰LEA‡TEST5B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*TEST5BƒLEA‡EVNTCNT(PC),A0'‰ADD.W…#1,0(A0)Œincrementeventcounter‰MOVE.W„EVNTCNT(PC),D0‰CMPI.W„#8,D0done? ‰BMI‡OPNLP4*‰PAGE#*„PULSEFOUROUTPUTSSIMULTANEOUSL Y*6TEST6„LEA‡SMSG32(PC),A1†output'pulsesimult.'message‰LEA‡EMSG32(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1500,A0Œ1500MS‰TRAP†#1 ‰BNE‡FAULT15*&TEST6AƒLEA‡INITIO(PC),A0‡OPENCHANNELS‰LEA‡OPNCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*‰LEA‡INITIO(PC),A0‰LEA‡PLSTWO(PC),A1‰PULSEOUTPUT‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#PLSTLG,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT10*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#500,A0500MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡TEST6A(PC),A1‡loopbackaddr.&‰LEA‡TEST6B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*TEST6BƒMOVE.L„#21,D0ŽDELAY‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*)TEST6CƒLEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST6C(PC),A1‡loopbackaddr.%‰LEA‡TEST7(PC),A2ˆcontinueonforward‰BRA‡FLOPtestfortoggle*‰PAGE+*„PULSEOUTPUTTWOANDGENERATEQUEUEEVENT*6TEST7„LEA‡SMSG7(PC),A1‡output'pulseoutput2'message‰LEA‡EMSG7(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*1TEST7AƒLEA‡RCVBUF(PC),A0‡ensureRCVBUFzeroedout‰MOVE.L„#0,0(A0)‰MOVE.L„#0,4(A0)‰MOVE.L„#0,8(A0)*‰LEA‡INITIO(PC),A09‰MOVE.W„#0,OPNCNF-INITIO(A0)setupconfig.(queueevent)‰MOVE.W„#2,D0OPENCHANNELTWO+‰MOVE.W„D0,OPNCH-INITIO(A0)‚channeltoopen,‰MOVE.W„D0,PLSO1-INITIO(A0)‚channeltopulse‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*‰LEA‡INITIO(PC),A0‰LEA‡PLSO(PC),A1‰PULSEOUTPUT‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#12,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT10*+WAITQ„MOVE.L„#36,D0Žrequestwaitforevent.$‰TRAP†#1’tobeissuedbyACOdriver. ‰BNE‡FAULT13*4‰MOVE.L„RCVBUF(PC),D0‡verifymessagereturnedbyASQ4‰CMP.L…#$0C010002,D0‡$0C01 ‰BNE‡FAULT6‰MOVE.L„RCVBUF+4(PC),D0‰CMP.L…ACOPAR(PC),D0‡ACO-ID ‰BNE‡FAULT6‰MOVE.L„RCVBUF+8(PC),D0,‰AND.L…#$FFFFFF00,D0‡maskoffloworderbyte0‰CMP.L…#IOADR0,D0ŠVM02memorymappedI/Oaddress ‰BEQ.S…TEST710‰CMP.L…#IOADR1,D0ŠVM03memorymappedI/Oaddress ‰BEQ.S…TEST722‰CMP.L…#IOADR2,D0ŠVME110memorymappedI/Oaddress ‰BEQ.S…TEST732‰CMP.L…#IOADR3,D0ŠVME/10memorymappedI/Oaddress ‰BNE‡FAULT6*‰LEA‡SMSG43(PC),A1‰LEA‡EMSG43(PC),A2 ‰BSR‡MSGOUT ‰BRA.S…TEST74TEST71ƒLEA‡SMSG40(PC),A1‰LEA‡EMSG40(PC),A2 ‰BSR‡MSGOUT ‰BRA.S…TEST74TEST72ƒLEA‡SMSG41(PC),A1‰LEA‡EMSG41(PC),A2 ‰BSR‡MSGOUT ‰BRA.S…TEST74TEST73ƒLEA‡SMSG42(PC),A1‰LEA‡EMSG42(PC),A2 ‰BSR‡MSGOUT2TEST74ƒLEA‡SMSG38(PC),A1‡output'asqverified'msg‰LEA‡EMSG38(PC),A2 ‰BSR‡MSGOUT*"‰LEA‡TEST7A(PC),A1‡loopbackaddr.&‰LEA‡TEST7B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*)TEST7BƒLEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST7B(PC),A1‡loopbackaddr.&‰LEA‡TEST7C(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*6TEST7CƒMOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*‰PAGE'*…PULSEOUTPUTONEANDGENERATEWAKE-UP3TEST8„LEA‡SMSG8(PC),A1‡output'pulseled1'message‰LEA‡EMSG8(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*1TEST8AƒLEA‡INITIO(PC),A0‡pointtoCMRpara.block5‰MOVE.W„#1,OPNCNF-INITIO(A0)setupconfig.(wake-up)‰MOVE.W„#1,D0OPENCHANNELONE+‰MOVE.W„D0,OPNCH-INITIO(A0)‚channeltoopen,‰MOVE.W„D0,PLSO1-INITIO(A0)‚channeltopulse‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLN GS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*‰LEA‡INITIO(PC),A0‰LEA‡PLSO(PC),A1‰PULSEOUTPUT‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#12,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT10*-WAITW„MOVE.L„#19,D0Žrequestwaitforwake-up.$‰TRAP†#1’tobeissuedbyACOdriver. ‰BNE‡FAULT130‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡TEST8A(PC),A1‡loopbackaddr.&‰LEA‡TEST8B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*)TEST8BƒLEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST8B(PC),A1‡loopbackaddr.&‰LEA‡TEST8C(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*6TEST8CƒLEA‡INITIO(PC),A0‡restoredefaultconfiguration ‰MOVE.W„#$8000,OPNCNF-INITIO(A0)2‰MOVE.W„#0,OPNCH-INITIO(A0)restorechannelselect1‰MOVE.W„#1,STAT-INITIO(A0)‚restorestatuschannel3‰MOVE.W„#1,OFFCMD1-INITIO(A0)‚restoreoffcmdchan.*‰PAGE#*„TRYCOMMANDSWITHCHANNELSCLOSED7TEST9„LEA‡SMSG9(PC),A1‡output'trywithclosed'message‰LEA‡EMSG9(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*1TEST9AƒLEA‡INITIO(PC),A0‡OUTPUTTOCLOSEDCHANNEL‰LEA‡ONCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1)‰MOVE.W„ONCMD(PC),D0ˆreadreturnedstatus(‰CMP.W…#$F2,D0verifycorrecterrorcode ‰BNE‡FAULT2 ‰LEA‡SMSG12(PC),A1‡outputokmsg‰LEA‡EMSG12(PC),A2 ‰BSR‡MSGOUT*#‰LEA‡INITIO(PC),A0‡TURNOFFCHANNEL‰LEA‡OFFCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1*‰MOVE.W„OFFCMD(PC),D0‡readreturnedstatus(‰CMP.W…#$F2,D0verifycorrecterrorcode ‰BNE‡FAULT5‰LEA‡SMSG14(PC),A1‡offokmsg‰LEA‡EMSG14(PC),A2 ‰BSR‡MSGOUT*‰LEA‡INITIO(PC),A0‡CHECKSTATUS‰LEA‡STATCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1+‰MOVE.W„STATCMD(PC),D0†readreturnedstatus(‰CMP.W…#$F2,D0verifycorrecterrorcode ‰BNE‡FAULT3 ‰LEA‡SMSG16(PC),A1‡statusokmsg‰LEA‡EMSG16(PC),A2 ‰BSR‡MSGOUT*‰LEA‡INITIO(PC),A0‰LEA‡PLSO(PC),A1‰PULSEOUTPUT‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#12,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1(‰MOVE.W„PLSO(PC),D0‰readreturnedstatus(‰CMP.W…#$F6,D0verifycorrecterrorcode ‰BNE‡FAULT10*"‰LEA‡TEST9A(PC),A1‡loopbackaddr.&‰LEA‡TEST9B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*%TEST9BƒLEA‡SMSG18(PC),A1‡pulseokmsg‰LEA‡EMSG18(PC),A2 ‰BSR‡MSGOUT*‰PAGE*ƒTRYTOOPENINVALIDCHANNELS6TEST10ƒLEA‡SMSG11(PC),A1‡output'tryinvalidchannels'‰LEA‡EMSG11(PC),A2 ‰BSR‡MSGOUT0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*3TEST10A‚LEA‡INITIO(PC),A0‡TRYTOOPENZEROCHANNELS‰LEA‡OPNCH0(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNCHL,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1%‰MOVE.W„OPNCH0(PC),D0‡readcmdstatus‰CMP.W…#$F7,D0 ‰BNE‡FAULT7*3‰LEA‡INITIO(PC),A0‡TRYTOOPENMORETHAN8CHANNELS‰LEA‡OPNMOR(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNML,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1%‰MOVE.W„OPNMOR(PC),D0‡readcmdstatus‰CMP.W…#$F7,D0 ‰BNE‡FAULT7*,‰LEA‡INITIO(PC),A0‡TRYTOOPENCHANNEL#>8‰LEA‡OPNCH9(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNC9L,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1%‰MOVE.W„OPNCH9(PC),D0‡readcmdstatus‰CMP.W…#$F6,D0 ‰BNE‡FAULT7*0‰LEA‡INITIO(PC),A0‡TRYTOOPENSAMETWOCHANNELS‰LEA‡OPNTW(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNTL,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1$‰MOVE.W„OPNTW(PC),D0ˆreadcmdstatus‰CMP.W…#$FE,D0 ‰BNE‡FAULT7*#‰LEA‡TEST10A(PC),A1†loopbackaddr.'‰LEA‡TEST10B(PC),A2†continueonforward‰B RA‡FLOPtestfortoggle*6TEST10B‚LEA‡SMSG36(PC),A1‡output'invalidchannelsok'‰LEA‡EMSG36(PC),A2 ‰BSR‡MSGOUT*‰PAGE*„TRYTOUSEINVALIDCOMMANDS*2TEST11ƒLEA‡SMSG25(PC),A1‡output'tryinvalidcmds'‰LEA‡EMSG25(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*&TEST11A‚LEA‡INITIO(PC),A0‡OPENCHANNEL‰MOVE.W„#1,OPNCH-INITIO(A0)‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*$‰LEA‡INITIO(PC),A0‡INVALIDCOMMAND0‰LEA‡INVCM0(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#4,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1*‰MOVE.W„INVCM0(PC),D0‡readreturnedstatus‰CMP.W…#$F4,D0 ‰BNE‡FAULT9*$‰LEA‡INITIO(PC),A0‡INVALIDCOMMAND6‰LEA‡INVCM6(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#4,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1*‰MOVE.W„INVCM6(PC),D0‡readreturnedstatus‰CMP.W…#$F4,D0 ‰BNE‡FAULT9*$‰LEA‡INITIO(PC),A0‡INVALIDCOMMAND7‰LEA‡INVCM7(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#4,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1*‰MOVE.W„INVCM7(PC),D0‡readreturnedstatus‰CMP.W…#$F4,D0 ‰BNE‡FAULT9*&‰LEA‡INITIO(PC),A0‡INVALIDCOMMAND>8‰LEA‡INVCM9(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#4,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1*‰MOVE.W„INVCM9(PC),D0‡readreturnedstatus‰CMP.W…#$F4,D0 ‰BNE‡FAULT9*#‰LEA‡TEST11A(PC),A1†loopbackaddr.'‰LEA‡TEST11B(PC),A2†continueonforward‰BRA‡FLOPtestfortoggle*-TEST11B‚LEA‡SMSG26(PC),A1‡invalidcmdsokmsg‰LEA‡EMSG26(PC),A2 ‰BSR‡MSGOUT*‰PAGE*„TRYOPENANDALREADYOPENED9TEST12ƒLEA‡SMSG20(PC),A1†output'trywithopened'message‰LEA‡EMSG20(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*6TEST12A‚LEA‡INITIO(PC),A0‡pointtoCMRparameterblock(‰MOVE.W„#0,OPNCH-INITIO(A0)OPENCHANNEL‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*/‰LEA‡INITIO(PC),A0‡pointtoCMRparameterblock‰LEA‡OPNCMDS(PC),A1)‰MOVE.L„A1,CMDA-INITIO(A0)‚TRYOPENagain‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1+‰MOVE.W„OPNCMDS(PC),D0‡readreturnedstatus‰CMP.W…#$FE,D0 ‰BNE.S…FAULT1*#‰LEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*#‰LEA‡TEST12A(PC),A1†loopbackaddr.%‰LEA‡TESTC(PC),A2ˆcontinueonforward‰BRA‡FLOPtestfortoggle*1**************************************************„TESTCOMPLETED*1************************************************* TESTC„LEA‡SMSG24(PC),A1‡spaceup‰LEA‡EMSG24(PC),A2 ‰BSR‡MSGOUT*1‰LEA‡SMSG23(PC),A1†output'testcomplete'message‰LEA‡EMSG23(PC),A2 ‰BSR‡MSGOUT*‰LEA‡SMSG24(PC),A1†spaceup‰LEA‡EMSG24(PC),A2 ‰BSR‡MSGOUT*#NEXT…MOVE.W„DUALFG(PC),D0‡flagset? ‰BNE‡TERM.NEXTA„MOVE.L„ACOPAR(PC),D0‡tryforsecondtask‰CMP.L…#'ACO1',D0‰BNE‡TERMAdone‰MOVE.L„#'ACO2',D0‰BRA‡TNAMEsetupsecondtask*‰PAGE*#FAULT1ƒLEA‡SMSG22(PC),A1‡openerror‰LEA‡EMSG22(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM%FAULT2ƒLEA‡SMSG13(PC),A1‡outputerror‰LEA‡EMSG13(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM%FAULT3ƒLEA‡SMSG17(PC),A1‡statuserror‰LEA‡EMSG17(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM+FAULT4ƒLEA‡SMSG28(PC),A1‡statuscheckerror‰LEA‡EMSG28(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM"FAULT5ƒLEA‡SMSG15(PC),A1‡offerror‰LEA‡EMSG15(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM*FAULT6ƒLEA‡SMSG10(PC),A1‡ASQmessageerror‰LEA‡EMSG10(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM.FAULT7ƒLEA‡SMSG21(PC),A1‡invalidchannelerror‰LEA‡EMSG21(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM$FAULT8ƒLEA‡SMSG33(PC),A1‡closeerror‰LEA‡EMSG33(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM.FAULT9ƒLEA‡SMSG27(PC), A1‡invalidcmderrormsg‰LEA‡EMSG27(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM%FAULT10‚LEA‡SMSG19(PC),A1‡pulseerror‰LEA‡EMSG19(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM#FAULT11‚LEA‡SMSG30(PC),A1‡ASQerror‰LEA‡EMSG30(PC),A2 ‰BSR‡MSGOUT ‰BRA.S…TERM#FAULT12‚LEA‡SMSG29(PC),A1‡ASQerror‰LEA‡EMSG29(PC),A2 ‰BSR.S…MSGOUT ‰BRA.S…TERM6FAULT13‚LEA‡SMSG31(PC),A1‡WAKE-UPorQUEUEEVENTerror‰LEA‡EMSG31(PC),A2 ‰BSR.S…MSGOUT ‰BRA.S…TERM2FAULT14‚LEA‡SMSG34(PC),A1‡IOS(trap#2)callerror‰LEA‡EMSG34(PC),A2 ‰BSR.S…MSGOUT ‰BRA.S…TERM*FAULT15‚LEA‡SMSG35(PC),A1‡calldelayerror‰LEA‡EMSG35(PC),A2 ‰BSR.S…MSGOUT ‰BRA.S…TERM/FAULT16‚LEA‡SMSG37(PC),A1‡non-existanttaskmsg‰LEA‡EMSG37(PC),A2 ‰BSR.S…MSGOUT(‰LEA‡DUALFG(PC),A0‡setflagtoeliminate‰ADD.W…#1,(A0)dualtest ‰BRA‡NEXTA**„DE-ACTIVATESELF*0TERMA„LEA‡INITIO(PC),A0‡testfordualboardtest‰TST.W…DUALFG-INITIO(A0) ‰BNE.S…TERM4‰MOVE.W„#1,DUALFG-INITIO(A0)‚setupfordualbdtest‰MOVE.W„#1,DUALCK-INITIO(A0)!‰MOVE.L„#'ACO1',ACOPAR-INITIO(A0)*‰MOVE.L„#'ACO1',TMSG-INITIO(A0)‚setupmsg‰MOVE.W„#'&2',TMSG+4-INITIO(A0) ‰BRA‡TRYBTH*%TERM…MOVE.L„#32,D0ŽDE-ALLOCATEA.S.Q.‰TRAP†#1**‰MOVE.L„#15,D0ŽNOWDE-ACTIVATESELF(EXIT)‰TRAP†#1**„MESSAGEOUTPUTSUBROUTINE*/MSGOUTƒLEA‡MSG(PC),A0Šoutputmessagepointedto(‰MOVE.L„A1,X1-MSG(A0)‡byA1,endedbyA2‰MOVE.L„A2,X2-MSG(A0)‰TRAP†#2 ‰BNE‡FAULT14‰RTS*1FLOP…LEA‡INITIO(PC),A0‡togglebetweenACO1&ACO2‰MOVE.W„DUALCK-INITIO(A0),D0 ‰BEQ.S…FLOP2continueonifzero‰CMP.W…#1,D0seeif=1 ‰BNE.S…FLOP11‰MOVE.W„#2,DUALCK-INITIO(A0)‚is=1,setupfor2!‰MOVE.L„#'ACO2',ACOPAR-INITIO(A0)‰JMP‡(A1)loopback6FLOP1„MOVE.W„#1,DUALCK-INITIO(A0)‚is=2,setupfor1!‰MOVE.L„#'ACO1',ACOPAR-INITIO(A0))FLOP2„JMP‡(A2)continueonwithnexttest*-*ƒMOVETHEASQMESSAGEFROMTHEASQTORCVBUF*8TESTIRQ‚EQU‡*‰entrypointmovingdatafromASQtoRCVBUF!‰MOVE.L„#34,D0„stagecommandcode‰LEA‡RCVBUF(PC),A0‰TRAP†#1 ‰BNE‡FAULT12*„RETURNFROMEVENT!‰MOVE.L„#37,D0„stagecommandcode ‰MOVE.W„#1,A0‰TRAP†#1*‰PAGE**„CMRparameterblock*INITIOƒDC.B†7,0,0,0ACOPARƒDC.L†'ACO1'„TASKNAME ‰DC.L†0,0,0*CMDA…DC.L†0‰addressofACOparameterblockCMDL…DC.W†0‰commandlength**„A.S.Q.parameterblock*ASQBLOCKEQU‡*‰DC.L†0‰taskname‰DC.L†0‰dummyfield*‰DC.B†5‰ASQ&ASRenabled=initialstatus"‰DC.B†16ˆlengthofmessageforASQ‰DC.L†16ˆstoragefor4events?ASQLA„DC.L†TESTIRQƒlogicaladdressoftargettaskasyncsvcrtn‰DC.L†0‰dummyfieldASQLNGƒEQU‡*-ASQBLOCK*0*„ACOparameterblocktoopenindividualchannel*OPNCMDS‚DC.W†0‰returnedstatus‰DC.W†1‰OPENcommandcode‰DC.W†1‰open1channelOPNCH„DC.W†0‰channel#/OPNCNFƒDC.W†$8000…DefaultchannelconfigurationOPNLNGS‚EQU‡*-OPNCMDSlength***„ACOparameterblocktoopenALLchannels*OPNCMDƒDC.W†0‰returnedstatus‰DC.W†1‰OPENcommandcode‰DC.W†8‰open8channels*‰DC.W†0,$8000ƒCHAN0,defaultconfiguration‰DC.W†1,$8000ƒCHAN1,ƒ"‰"‰DC.W†2,$8000ƒCHAN2,ƒ"‰"‰DC.W†3,$8000ƒCHAN3,ƒ"‰"‰DC.W†4,$8000ƒCHAN4,ƒ"‰"‰DC.W†5,$8000ƒCHAN5,ƒ"‰"‰DC.W†6,$8000ƒCHAN6,ƒ"‰"‰DC.W†7,$8000ƒCHAN7,ƒ"‰"OPNLNGƒEQU‡*-OPNCMD‚length*#*ƒparameterblockforCLOSEcommand*CLSCMDƒDC.W†0‰returnedstatus‰DC.W†2‰CLOSEcommand(CLSLNGƒEQU‡*-CLSCMD‚closecommandlength*$*…ACOparameterblockforONcommand* ONCMD„EQU‡*‰DC.W†0‰returnedcommandstatus‰DC.W†3‰OUTPUTONcommand,ONCMD1ƒDC.W†1‰bitmaskofchanneltoturnON* ONCMDAƒEQU‡*‰DC.W†0‰returnedcommandstatus‰DC.W†3‰OUTPUTONcommand,‰DC.W†$00FF…bitmasktoturnONallchannels*%*…ACOparameterblockforOFFcommand* OFFCMDƒEQU‡*&‰DC.W†0‰returncommandstatuslocation‰DC.W†4‰OFFcommand.OFFCMD1‚DC.W†1‰bitmaskofchanneltoturnOFF* OFFCMDA‚EQU‡*&‰DC.W†0‰returncommandstatuslocation‰DC.W†4‰OFFcommand-‰DC.W†$00FF…bitmasktoturnOFFallchannels*$*„parameterblockforSTATUScommand* STATCM D‚EQU‡*‰DC.W†0‰returnedcommandstatus‰DC.W†5‰STATUScommand2STAT…DC.W†1‰bitmask&readstatusofchannels0-7*:*„ACOparameterblocktodo1000msPULSEonselectedchan*PLSO…DC.W†0‰returnedcmdstatus‰DC.W†8‰PULSEcommandcode‰DC.W†1‰onechannelPLSO1„DC.W†1‰pulsechannel#‰DC.L†500‡500mspulse*7*„parameterblocktoPULSEfourchannelssimultaneously*!PLSTWOƒDC.W†0‰returnedcmdstatus‰DC.W†8‰PULSEcommandcode‰DC.W†4‰fourchannels‰DC.W†4‰chan.#4‰DC.L†250‡250ms‰DC.W†5‰chan.#5‰DC.L†500‡500ms‰DC.W†6‰chan.#6‰DC.L†750‡750ms‰DC.W†7‰chan.#7‰DC.L†1000†1000msPLSTLGƒEQU‡*-PLSTWO*"*„INVALIDCHANNELparameterblocks*!OPNCH0ƒDC.W†0‰returnedcmdstatus‰DC.W†1‰OPENcommandcode‰DC.W†0‰openzerochannels‰DC.W†0‰channel0‰DC.W†$8000…config.OPNCHLƒEQU‡*-OPNCH0*!OPNCH9ƒDC.W†0‰returnedcmdstatus‰DC.W†1‰OPENcmdcode‰DC.W†1‰openonechannel‰DC.W†9‰openchannel#9‰DC.W†$8000…config.OPNC9LƒEQU‡*-OPNCH9* OPNTW„DC.W†0‰returnedcmdstatus‰DC.W†1‰OPENcmdcode‰DC.W†3‰openthreechan.‰DC.W†1,$8000ƒchan,config.‰DC.W†2,$8000ƒchan,config.‰DC.W†2,$8000ƒchan,config.OPNTL„EQU‡*-OPNTW*!OPNMORƒDC.W†0‰returnedcmdstatus‰DC.W†1‰OPENcmdcode‰DC.W†9‰open9channels‰DC.W†0,$8000ƒchan,config.‰DC.W†1,$8000ƒchan,config.‰DC.W†2,$8000ƒchan,config.‰DC.W†3,$8000ƒchan,config.‰DC.W†4,$8000ƒchan,config.‰DC.W†5,$8000ƒchan,config.‰DC.W†6,$8000ƒchan,config.‰DC.W†7,$8000ƒchan,config.‰DC.W†8,$8000ƒchan,config.OPNML„EQU‡*-OPNMOR*#*…INVALIDCOMMANDSparameterblocks*!INVCM0ƒDC.W†0‰returnedcmdstatus‰DC.W†0‰invalidcommand0*!INVCM6ƒDC.W†0‰returnedcmdstatus‰DC.W†6‰invalidcommand6*!INVCM7ƒDC.W†0‰returnedcmdstatus‰DC.W†7‰invalidcommand7*!INVCM9ƒDC.W†0‰returnedcmdstatus"‰DC.W†9‰invalidcmdgreaterthan8**„IOSMESSAGEparameterblock*MSG†DC.B†0‰Dataxfercode=0‰DC.B†2‰Writedata‰DC.W†0‰Options-none‰DC.B†0‰Status ‰DC.B†6‰LUN‰DC.W†0‰reserved‰DC.L†0‰randomrecordcountX1‡DC.L†0‰bfrstartaddr.X2‡DC.L†0‰bfrendaddr.‰DC.L†0‰lengthofdataxfer ‰DC.L†0‰completion/serviceaddr.*‰PAGE *„MESSAGES*6SMSG1„DC.W†'**********ACOUTPUTTESTPROGRAM******'TMSG…DC.W†'ACO1‚' EMSG1„EQU‡*-1*8SMSG2„DC.W†'‚OPEN&OUTPUTTOEACHCHANNELINDIVIDUALLY' EMSG2„EQU‡*-1*9SMSG3„DC.W†'‚OPEN&OUTPUTEACHCHANNELUNTILALLAREON' EMSG3„EQU‡*-1*5SMSG4„DC.W†'‚CLOSECHANNELS,OUTPUTSSHOULDTURNOFF' EMSG4„EQU‡*-1*0SMSG5„DC.W†'‚TURNONALLOUTPUTS,THENTURNOFF' EMSG5„EQU‡*-1*'SMSG6„DC.W†'‚PULSEEACHOUTPUTINTURN' EMSG6„EQU‡*-1*5SMSG7„DC.W†'‚PULSEOUTPUT2ANDGENERATEQUEUEEVENT' EMSG7„EQU‡*-1*1SMSG8„DC.W†'‚PULSEOUTPUT1ANDGENERATEWAKE-UP' EMSG8„EQU‡*-1*/SMSG9„DC.W†'‚TRYCOMMANDSWITHCHANNELSCLOSED' EMSG9„EQU‡*-1**SMSG10ƒDC.W†'‚INVALIDASQMESSAGE-ERROR'EMSG10ƒEQU‡*-1*+SMSG11ƒDC.W†'‚TRYTOOPENINVALIDCHANNELS'EMSG11ƒEQU‡*-1*4SMSG12ƒDC.W†'‚CALLOUTPUTANDCHANNELSCLOSED-OK!'EMSG12ƒEQU‡*-1*"SMSG13ƒDC.W†'‚CALLOUTPUT-ERROR'EMSG13ƒEQU‡*-1*1SMSG14ƒDC.W†'‚CALL‚OFFƒANDCHANNELSCLOSED-OK!'EMSG14ƒEQU‡*-1*SMSG15ƒDC.W†'‚CALLOFF-ERROR'EMSG15ƒEQU‡*-1*4SMSG16ƒDC.W†'‚CALLSTATUSANDCHANNELSCLOSED-OK!'EMSG16ƒEQU‡*-1*"SMSG17ƒDC.W†'‚CALLSTATUS-ERROR'EMSG17ƒEQU‡*-1*3SMSG18ƒDC.W†'‚CALLPULSE‚ANDCHANNELSCLOSED-OK!'EMSG18ƒEQU‡*-1*!SMSG19ƒDC.W†'‚CALLPULSE-ERROR'EMSG19ƒEQU‡*-1*4SMSG20ƒDC.W†'‚TRYCALLOPENANDALREADYOPENED-OK!'EMSG20ƒEQU‡*-1*&SMSG21ƒDC.W†'‚INVALIDCHANNEL-ERROR'EMSG21ƒEQU‡*-1* SMSG22ƒDC.W†'‚CALLOPEN-ERROR'EMSG22ƒEQU‡*-1*9SMSG23ƒDC.W†'‚******TESTCOMPLETEDSUCCESSFULLY*******'EMSG23ƒEQU‡*-1*SMSG24ƒDC.W†'‚'EMSG24ƒEQU‡*-1**SMSG25ƒDC.W†'‚TRYTOUSEINVALIDCOMMANDS'EMSG25ƒEQU‡*-1**SMSG26ƒDC.W†'‚CALL„INVALID„COMMANDS„-‚OK!'EMSG26ƒEQU‡*-1*&SMSG27ƒDC.W†'‚INVALIDCOMMAND-ERROR'EMSG27ƒEQU‡*-1 *#SMSG28ƒDC.W†'‚STATUSCHECK-ERROR'EMSG28ƒEQU‡*-1*"SMSG29ƒDC.W†'‚A.S.Q.MOVE‚-ERROR'EMSG29ƒEQU‡*-1*SMSG30ƒDC.W†'‚A.S.Q.-ERROR'EMSG30ƒEQU‡*-1*$SMSG31ƒDC.W†'‚WAKEUPORQUEUEERROR'EMSG31ƒEQU‡*-1*9SMSG32ƒDC.W†'‚PULSECHANNELS4,5,6,&7SIMULTANEOUSLY'EMSG32ƒEQU‡*-1*!SMSG33ƒDC.W†'‚CALLCLOSE-ERROR'EMSG33ƒEQU‡*-1*#SMSG34ƒDC.W†'‚TRAP#2(IOS)ERROR'EMSG34ƒEQU‡*-1*!SMSG35ƒDC.W†'‚CALLDELAY-ERROR'EMSG35ƒEQU‡*-1**SMSG36ƒDC.W†'‚CALL„INVALID„CHANNELS„-‚OK!'EMSG36ƒEQU‡*-1*‰PAGE*:SMSG37ƒDC.W†'---NON-EXISTANTTASK/BOARD-------^'EMSG37ƒEQU‡*-1*&SMSG38ƒDC.W†'‚A.S.Q.MESSAGEVERIFIED'EMSG38ƒEQU‡*-1*-SMSG39ƒDC.W†'‚TURNOFFCHANNELSSEQUENTIALLY'EMSG39ƒEQU‡*-1*SMSG40ƒDC.W†'‚VM02'EMSG40ƒEQU‡*-1*SMSG41ƒDC.W†'‚VM03'EMSG41ƒEQU‡*-1*SMSG42ƒDC.W†'‚VME110'EMSG42ƒEQU‡*-1*SMSG43ƒDC.W†'‚VME/10'EMSG43ƒEQU‡*-1*‰PAGE*EVNTCNT‚DS.W†1‰eventcounter!STATSHF‚DS.W†1‰statusbitshifter1DUALFGƒDS.W†1‰dualboardtestflag(1=donottest) Enter one of the above... Time (in milliseconds) for output pulse > 0 = OUTPUT ON. 1 = OUTPUT OFF. 2 = PULSE AN OUTPUT FOR A SPECIFIED TIME. 3 = READ THE CURRENT OUTPUT STATUS. 4 = QUIT. STATUS OF ALL CHANNELS (ASCII) = <<< Starting command >>> <<< Command done >>> *** OPEN ABORTED *** -- *** START OUTPUT ON ABORTED *** -- *** TURN OUTPUT OFF ABORTED *** -- *** START OUTPUT PULSE ABORTED *** -- *** READ STATUS ABORTED *** --   *** CLOSE ABORTED *** -- Error code returned in D0 = OúüŽIúûÂAúýv)HDAúýŽ)HHAúüæNBAúý‚)HDAúý¨)HHAúüÐNBAúüZ)H`AúüZ)HdAúüÖNBAúüDaÄ €m €o`º9@’9@¨Aú:09@š9@ 9@²Aúý )HDAúý¯)HHAúünNBAúý¢)HDAúý¯)HHAúüXNBAúý¢)HDAúýÉ)HHAúüBNBAúý¼)HDAúýÝ)HHAúü,NBAúýÐ)HDAúýØ)HHAúüNBAúüâ)HDAúüø)HHAúüNBAúûŠ)H`AúûŠ)HdAúüNBAúûtaô @m @o`¾ fva2Aúý¤)HDAúý·)HHAúû´NB0<€a0AúûÞCúü!I1|pCúÐEúÍa 2Cú ¬Eú ×a &Cú¸Eúµa Aú lCú È!I2|1Ip!I2| 1IpCúÿÔEú` >Aú ~áètáè Aú|RP0:v @kÿxAú `Cú Æ!I2|1Ip!I2| 1IpŠMOVE.LA0,IOSOUT+16-PBA(A4)SettheendingaddressofmessageŠLEA„IOSOUT(PC),A0ŠTRAPƒ#2ŠENDM ŠPAGE 2ŠOPT„PCSWeuseaPCSoptionsotheassemblerwill%*£forcePCrelativeaddressingwithin(*£SECTION.‚ForcesPCrelativeaddressing-*£(wheneversuchanaddressingmodeislegal))*£inaninstructionwhichoccurswithina'*£relocatableSECTIONandreferencesan,*£operandinarelocatableSECTION(neednot**£bethesameSECTIONastheinstruction).,*£Failuretoresolvesucnareferenceintoa-*£16-bitdisplacementfromthePCwillresult)*£inanerror.‚Thisoptionmaybeusedto+*£forcepositionindependentcode;however,(*£thisoptiondoesnotforcePCrelative,*£addressingofabsoluteoperandsorunknown*£forwardreferences. ŠPAGE N*******************************************************************************Ì**™DATAƒSECTIONœ**Ì*N****************************************************************************** ŠSECTIONDATA $PBA‡EQU„*’ProgramBaseAddress(PBA)%*£Thislabelisusedtodesignatethe+*£beginningoftheprogram.‚Thisisusedto'*£makereferencestootherpartsofthe*£program,relocatable. 9ŠDS.WƒSTACKLEN‹ThisisthestackareafortheVME625test2STACK…EQU„*’program.‚Registersandotherimportant,*£informationwillbestoredonthestackas)*£theprogramisexecuted.‚Thestackarea'*£isdynamicandwillchangeduringthe *£executionofthetestprogram. =INPUTBUF‚DS.WƒSTRNGLEN‹Thisisthestorageareafortheinput*£stringsthatareentered. 9STATUS„DS.Lƒ1’Thiswillbethestorageareforthestatus,*£codethatisreturnedfromCMR.‚Thisvalue-*£willbedisplayedtoshowtheuserwhatthe*£errorcodewas. 6NUMBER„DS.Lƒ2’SaveareafortheASCIIvalueofSTATUS.ŠPAGE N*******************************************************************************Ì*!*–PARAMETERƒBLOCKS—**Ì*N****************************************************************************** ŠNEXTWB”ForceevenboundaryIOSOUTŠDC.Bƒ0’Requestcode"ŠDC.BƒWRITEŽFunctionspecificationŠDC.Wƒ8’OptionsŠDC.Bƒ0’StatusŠDC.BƒCRTLogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress   ŠNEXTWB”ForceevenboundaryIOSINŠDC.Bƒ0’Requestcode!ŠDC.BƒREADFunctionspecificationŠDC.Wƒ0’OptionsŠDC.Bƒ0’Status"ŠDC.BƒKEYBOARD‹LogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress  CMRBLK„DC.Bƒ7’InitiateI/OŠDC.BƒUNUSEDUnusedŠDC.WƒUNUSEDUnusedŠDC.Lƒ'DCO1'ChannelnameŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnused$ŠDC.Lƒ0’AddressofI/Ocontrolblock#ŠDC.Lƒ0’LengthofI/OcontrolblockŠPAGE*8*‚OPENcommandparameterblockfortheDCOUTPUTdriver:+OPEN_DCO‚DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒOPENOpencommandcodeŠDC.Wƒ1’#ofchannelstoopen-ŠDC.Wƒ0’Channeltoopen(Dynamicallychanged)-ŠDC.WƒDEFAULTŒChannelconfiguration(Dynamic)6OLEN_DCO‚EQU„*-OPEN_DCO‰LengthofOPENparameterblock*C*‚STARTOUTPUTONcommandparameterblockfortheDCOUTPUTdriver:)ON_DCO„DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒON‘ONcommandcode2ŠDC.Wƒ0’Bitmaskforchannelstoturnon(Dynamic)2NLEN_DCO‚EQU„*-ON_DCO‹LengthofONparameterblock*C*‚TURNOUTPUTOFFcommandparameterblockfortheDCOUTPUTdriver:*OFF_DCOƒDC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒOFFOffcommandcode3ŠDC.Wƒ0’Bitmaskforchannelstoturnoff(Dynamic)4FLEN_DCO‚EQU„*-OFF_DCOŠLengthofOFFparameterblock*A*‚PULSEDOUTPUTcommandparameterblockfortheDCOUTPUTdriver:*PON_DCOƒDC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒPULSEŽPulsecommandcodeŠDC.Wƒ1’#ofchannels,ŠDC.Wƒ0’Channelnumber(Dynamicallychanged)/ŠDC.Lƒ0’Timeofpulseinmilliseconds(D# ynamic)6PLEN_DCO‚EQU„*-PON_DCOŠLengthofPULSEparameterblock*F*‚READOUTPUTSTATUScommandparameterblockfortheDCOUTPUTdriver:+READ_DCO‚DC.Wƒ0’Returnedstatusfromdriver*ŠDC.WƒREAD_STATUSˆReadstatuscommandcode.ŠDC.Wƒ0’Bitmaskforchannelstoreadandupon(*£returnholdstheactualchannelstatus=RLEN_DCO‚EQU„*-READ_DCO‰LengthofREADSTATUSparameterblock*9*‚CLOSEcommandparameterblockfortheDCOUTPUTdriver:)CLSBLK„DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒCLOSEŽClosecommandcodeCLOSLENƒEQU„*-CLSBLKŠNEXTWBŠPAGE N*******************************************************************************Ì**œMESSAGES¡**Ì*N****************************************************************************** ŠSECTIONMESSAGES 9HEAD†DC.BƒCR,LF,LF,'MVME625DriverTestProgram',CR,LF,LF HEADE…EQU„*-1ŠNEXTWB1MESS1…DC.Bƒ'…Numberofthechanneltoconvertˆ>'MESS1E„EQU„*-1ŠNEXTWB(MESS2…DC.Bƒ'…Enteroneoftheabove...'MESS2E„EQU„*-1ŠNEXTWB8MESS3…DC.Bƒ'…Time(inmilliseconds)foroutputpulse>'MESS3E„EQU„*-1ŠNEXTWB+MESS4…DC.BƒCR,LF,LF,'…0=OUTPUTON.',CR,LFMESS4E„EQU„*-1ŠNEXTWB#MESS5…DC.Bƒ'…1=OUTPUTOFF.',CR,LFMESS5E„EQU„*-1ŠNEXTWB=MESS6…DC.Bƒ'…2=PULSEANOUTPUTFORASPECIFIEDTIME.',CR,LFMESS6E„EQU„*-1ŠNEXTWB7MESS7…DC.Bƒ'…3=READTHECURRENTOUTPUTSTATUS.',CR,LFMESS7E„EQU„*-1ŠNEXTWB MESS8…DC.Bƒ'…4=QUIT.',CR,LF,LFMESS8E„EQU„*-1ŠNEXTWB4MESS9…DC.BƒCR,LF,'STATUSOFALLCHANNELS(ASCII)='MESS9E„EQU„*-1ŠNEXTWB2MESS10„DC.BƒCR,LF,'<<>>',CR,LFMESS10EƒEQU„*-1ŠNEXTWB1MESS11„DC.BƒCR,LF,'<<>>',CR,LF,LFMESS11EƒEQU„*-1ŠNEXTWBŠPAGE,BADOPN„DC.BƒCR,LF,'***OPENABORTED***--'BADOPNEƒEQU„*-1ŠNEXTWB6BADON…DC.BƒCR,LF,'***STARTOUTPUTONABORTED***--'BADONE„EQU„*-1ŠNEXTWB7BADOFF„DC.BƒCR,LF,'***TURNOUTPUTOFFABORTED***--'BADOFFEƒEQU„*-1ŠNEXTWB:BADPLS„DC.BƒCR,LF,'***STARTOUTPUTPULSEABORTED***--'BADPLSEƒEQU„*-1ŠNEXTWB4BADREADƒDC.BƒCR,LF,'***READSTATUSABORTED***--'BADREADE‚EQU„*-1ŠNEXTWB-BADCLS„DC.BƒCR,LF,'***CLOSEABORTED***--'BADCLSEƒEQU„*-1ŠNEXTWB+STATUSMƒDC.Bƒ'ErrorcodereturnedinD0='STATUSME‚EQU„*-1ŠNEXTWBCRLF†DC.BƒCR,LF CRLFE…EQU„*-1ŠNEXTWBŠPAGE N*******************************************************************************Ì**–PROGRAMƒSECTION™**Ì*N****************************************************************************** ŠSECTIONCODEPROGSTRTŠLEA„STACK(PC),A7.ŠLEA„PBA(PC),A4‰GetProgramBaseAddress(PBA) &ŠOUTPUTHEAD,HEADE‰Displaytheheading N*-----------------------------------------------------------------------------***‰Getthenumberofthechanneltoconvert*N*-----------------------------------------------------------------------------GETCHAN.ŠOUTPUTMESS1,MESS1E‡ChannelnumbertoconvertŠINPUT‚INPUTBUF,INPUTBUF+8ŠLEA„INPUTBUF(PC),A0)ŠBSR„CVT2ConvertASCIIdecimaltobinary'ŠIF.LD0#0OR.LD0#7THEN.S ŒBRAGETCHANŠENDI8ŠMOVE.WD0,OPEN_DCO+6-PBA(A4)Savethechannelnumber...ŠMOVE.WD0,PON_DCO+6-PBA(A4) <ŠLEA„BIT_NUMBER(PC),A0‚Convertthechannelnumber(0-7)into?ŠMOVE.B(A0,D0.W),D0‡thecorrespondingbitnumber(1,2,4,8...).6ŠMOVE.WD0,ON_DCO+4-PBA(A4)Savethebitmaskvalue...ŠMOVE.WD0,OFF_DCO+4-PBA(A4)ŠMOVE.WD0,READ_DCO+4-PBA(A4) N*-----------------------------------------------------------------------------*4*‰Get„0=OUTPUTON„1=OUTPUTOFFƒ2=PULSEDOUTPUT*3=READSTATUS‚4=QUIT*N*-----------------------------------------------------------------------------GETCLST'ŠOUTPUTMESS4,MESS4E…Putupthemenu...ŠOUTPUTMESS5,MESS5EŠOUTPUTMESS6,MESS6EŠOUTPUTMESS7,MESS7EŠOUTPUTMESS8,MESS8EFGET_CHOICE‚OUTPUTMESS2,MESS2E…Asktheusertoenteroneoftheabove. +ŠINPUT‚INPUTBUF,INPUTBUF+8GettheirchoiceŠLEA„INPUTBUF(PC),A0)ŠBSR„CVT2ConvertASCIIdecimaltobinary'ŠIF.WD0#0OR.WD0#4THEN.SB# RA.SGET_CHOICEŠENDIŠPAGE**‰0=StartoutputONcommand:*ŠIF.BD0#0THEN.S 'ŒBSR.L‚CLOSE_ALLˆGocloseallchannels./ŒOUTPUTMESS10,MESS10Eƒ<<<ƒStartingcommandƒ>>> >ŒMOVE.W#DEFAULT,D0†Usethedefaultconfigurationfortheopen$ŒBSR.L‚OPEN_CHANˆGoopenthechannel ŒLEA„CMRBLK(PC),A02ŒLEA„ON_DCO(PC),A1„StartoutputONparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#NLEN_DCO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1ŒIFTHEN.SŽMOVE.WON_DCO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)4ŽOUTPUTBADON,BADONE…***STARTOUTPUTONABORTED***ŽBRA.L‚SHOW_D0ŒENDI 3ŒOUTPUTMESS11,MESS11Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDI **‰1=TurnoutputOFFcommand:*ŠIF.BD0#1THEN.S 'ŒBSR.L‚CLOSE_ALLˆGocloseallchannels./ŒOUTPUTMESS10,MESS10Eƒ<<<ƒStartingcommandƒ>>> >ŒMOVE.W#DEFAULT,D0†Usethedefaultconfigurationfortheopen$ŒBSR.L‚OPEN_CHANˆGoopenthechannel ŒLEA„CMRBLK(PC),A03ŒLEA„OFF_DCO(PC),A1ƒTurnoutputOFFparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#FLEN_DCO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1ŒIFTHEN.SŽMOVE.WOFF_DCO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)6ŽOUTPUTBADOFF,BADOFFE„***TURNOUTPUTOFFABORTED***ŽBRA.L‚SHOW_D0ŒENDI 3ŒOUTPUTMESS11,MESS11Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDI **‰2=PULSEanoutputcommand:*ŠIF.BD0#2THEN.L3ŒBSR„GET_TIME‰Getthepulseduration(milliseconds)+ŒMOVE.LD3,PON_DCO+8-PBA(A4)Storethetime 'ŒBSR.L‚CLOSE_ALLˆGocloseallchannels./ŒOUTPUTMESS10,MESS10E…<<<ƒStartingcommandƒ>>> 7ŒMOVE.W#WAKEUP_O,D0…UsetheWAKEUPoptionfortheopen$ŒBSR.L‚OPEN_CHANˆGoopenthechannel ŒLEA„CMRBLK(PC),A06ŒLEA„PON_DCO(PC),A1ƒStartoutputpulseparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#PLEN_DCO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1*(*ƒDoawaituntilthedriverwakesusup*ŒMOVE.L#19,D0ŒTRAPƒ#1 ŒIFTHEN.SŽMOVE.WPON_DCO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4);ŽOUTPUTBADREAD,BADREADEƒ***STARTOUTPUTPULSEABORTED***ŽBRA.L‚SHOW_D0ŒENDI 3ŒOUTPUTMESS11,MESS11Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDI **‰3=READSTATUScommand:*ŠIF.BD0#3THEN.L /ŒOUTPUTMESS10,MESS10Eƒ<<<ƒStartingcommandƒ>>> ŒLEA„CMRBLK(PC),A00ŒLEA„READ_DCO(PC),A1‚ReadstatusparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#RLEN_DCO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1ŒIFTHEN.SŽMOVE.WREAD_DCO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)4ŽOUTPUTBADREAD,BADREADEƒ***READSTATUSABORTED***ŒENDI ŒCLR.L‚D0;ŒMOVE.WREAD_DCO+4-PBA(A4),D0‚GetthestatusvaluereturnedŒBSR„BHLCVTConvertittoASCII9ŒMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŒMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytesŒOUTPUTMESS9,MESS9EŒOUTPUTNUMBER,NUMBER+7ŒOUTPUTCRLF,CRLFE 3ŒOUTPUTMESS11,MESS11Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDI**‰4=quitcommand:*ŠIF.BD0#4THEN.S'BSR.L‚CLOSE_ALLˆGocloseallchannels. BRA.LEXITŠENDI ŠBRA.LGETCHANGostartover.ŠPAGEM*----------------------------------------------------------------------------**ƒOPENTHECHANNEL*M*----------------------------------------------------------------------------OPEN_CHANLEA„CMRBLK(PC),A0ŠLEA„OPEN_DCO(PC),A1BŠMOVE.WD0,OPEN_DCO+8-PBA(A4)‚Savetheopenconfigurationoptions.ŠMOVE.LA1,$14(A0)ŠMOVE.W#OLEN_DCO,$18(A0)7ŠMOVE.L#CMR,D0ŒHereweperformanexecutiverequesttoŠTRAPƒ#1‘invokeCMR.ŠIFTHEN.SŒMOVE.LD0,STATUS-PBA(A4)+ŒOUTPUTBADOPN,BADOPNE…***OPENABORTED***ŒBRA.S‚SHOW_D0ŠENDIŠRTS M*----------------------------------------------------------------------------*+*‚GETTHETIMEDURATIONFORANOUTPUTPULSE*M*----------------------------------------------------------------------------GET_TIMEŠOUTPUTMESS3,MESS3EŠINPUT‚I$ NPUTBUF,INPUTBUF+8ŠLEA„INPUTBUF(PC),A0 ŠBSR„ASCVAL ŠTST.L‚D3 ŠBEQ„GET_TIME+ŠIF.LD3#0OR.LD3#$FFFFTHEN.S ŒBRA„GET_TIMEŠENDIŠAND.L‚#$0000FFFF,D3ŠRTS M*----------------------------------------------------------------------------**ƒOUTPUTTHEERRORCODE:*M*----------------------------------------------------------------------------:SHOW_D0ƒMOVE.LSTATUS(PC),D0†GetthestatusvaluereturnedŠBSR„BHLCVTConvertittoASCII9ŠMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŠMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytesŠOUTPUTSTATUSM,STATUSMEŠOUTPUTNUMBER,NUMBER+7ŠOUTPUTCRLF,CRLFE EXITŠBSR.S‚CLOSE_ALL"ŠMOVE.L#15,D0TerminatethistaskŠTRAPƒ#1ŠPAGEN*-----------------------------------------------------------------------------**‚CLOSEALLCHANNEL'SROUTINE:*N*-----------------------------------------------------------------------------CLOSE_ALL MOVE.W D0,-(A7) ŠLEA„CMRBLK(PC),A0ŠLEA„CLSBLK(PC),A1ŠMOVE.LA1,$14(A0)ŠMOVE.W#CLOSLEN,$18(A0)7ŠMOVE.L#CMR,D0ŒTellCMRtoclosetheDCOUTPUTchannelŠTRAPƒ#1ŠIFTHEN.SŒMOVE.LD0,STATUS-PBA(A4),ŒOUTPUTBADCLS,BADCLSE…***CLOSEABORTED***ŒMOVE.W(A7)+,D0‰Restorestack.%ŒBRA.L‚SHOW_D0ŠOutputtheerrorcode.ŠENDI ŠMOVE.W(A7)+,D0ŠRTS M*----------------------------------------------------------------------------*A*ƒTABLETOCONVERTTHECHANNELNUMBER(0-7)TOIT'SCORRESPONDING**ƒBITMAPPEDVALUE(1,2,4,8,16,32,64,128).*M*----------------------------------------------------------------------------$BIT_NUMBER‚DC.B‚1,2,4,8,16,32,64,128 ŠEND„PROGSTRT=/*=/*†M625DRV.TESTDC.AF=/*;=/* Chain file to assemble DCO driver test routine 'TESTDC'=/*:=/* If no output argument is specified for the listing the0=/* chain file will default to M625DRV.TESTDC.LS=/*=/IFC \1ƒ=ARGM625DRV.TESTDC.LS=/ENDIF=/*2=ASM M625DRV.TESTDC.SA,M625DRV.TESTDC.RO,\1;MRZ=70=/*{ Included files are:=/*ƒ--none--=/*}=/*=ENDéééééé$ =/*=/*†M625DRV.TESTDC.LF=/*/=/* Link chain file to create M625DRV.TESTDC.LO=/*:=/* If no output argument is specified for the listing the0=/* chain file will default to M625DRV.TESTDC.LL=/*=/IFC \1ƒ=ARGM625DRV.TESTDC.LL=/ENDIF=/* =LINK ,M625DRV.TESTDC.LO,\1;HMIX SEG SEG0:0INPUT M625DRV.TESTDC.ROEND=/*=ENDééééééˆB*„ThisisTESTDC,arelocatableprogramthatteststheDCOdriver.*$*„Copyrighted1983byMotorola,Inc.E**********************************************************************B*‚ThisprogramsetsupfortaskDCO1andverifiesitexists.Ifit;*‚doesitproceedswiththetest,ifnotittrystaskDCO2./*‚Ifeithertaskismissing,itskipsthetest.*:*‚Thisprogramperformsthefollowingtestsonthedriver:*9*ˆTEST1‚-‚individuallyopenseachchannel,outputstoit,-*’checksstatus,turnsitoff,checksstatus, *’andcloses.9*ˆTEST2‚-‚individuallyopenseachchannel,outputstoit,1*’checksstatus,continuesuntilallareon.Then,*’individuallyturnsoffeachchannel,checks0*’status,continuesuntilallareoff.Turnsall%*’channelsbackonforthenexttest.7*ˆTEST3‚-‚closesthechannels,OPERATORmustcheckthey *’turnedoff.4*ˆTEST4‚-‚opensallchannels,turnsallchannelson,-*’delays,turnsallchannelsoff,andcloses.9*ˆTEST5‚-‚individuallyopenseachchannel,commandspulse*’output,delays,andcloses.7*ˆTEST6‚-‚opensfourchannels,commandspulseoutputof3*’differentlengthstoeachsimultaneously,delays,*’closeschannels.;*ˆTEST7-ƒopenschanneltwowithqueueeventconfiguration,'*’pulsesoutput,waitsforqueueevent,)*’verifiesmessagesent,closeschannels.:*ˆTEST8‚-‚openschannelonewithwaitforwake-upconfig.,'*’pulsesoutput,waitsforwake-up,and*’closeschannels.:*ˆTEST9‚-‚trysoutputONwithchannelsclosedandverifies*’error.3*’trysoutputOFFwithchannelsclosedandverifies*’error./*’tryscheckingstatuswithchannelsclosedand*’verifieserror.,*’tryspulseoutputwithchannelsclosedand*’verifieserror.<*ˆTEST10-‚trysopeninginvalidchannelnumb% ersandverifies3*’errors.(ZEROchannels,morethaneightchannels,"*’channel#9,sametwochannels).:*ˆTEST11-‚openschannelandtrysinvalidcommands(0,6,*’7,>8)andverifieserrors. ‘/šP¢PªP²Vº\Â\ÊUÒWÚPâYêZòYúRR Wb=*ˆTEST12-‚trysopeningchannelswhentheyarealreadyopened*’andverifieserror.*>*ˆIfitpassedthesetestsitreturnstothetoptosetupfor2*’taskDCO2.IfthiswasfortaskDCO2,itsetsup$*’totestbothtaskssimultaneously.7*ˆIFALLTESTSARESUCCESSFUL,printsmessageattesting0*’tothatfact.Ifanytestfails,ERRORmessage$*’isprintedandtestisterminated.*D********************************************************************‰PAGE*5IOADR0ƒEQU‡$F80000VM02basememmapI/Ochanaddress5IOADR1ƒEQU‡$FA0000VM03basememmapI/Ochanaddress7IOADR2ƒEQU‡$FE6000VME110basememmapI/Ochanaddress7IOADR3ƒEQU‡$F1C000VME/10basememmapI/Ochanaddress* ‰SECTIONƒ0*TEST…LEA‡STACK(PC),A7‰LEA‡INITIO(PC),A0.‰CLR.W…DUALFG-INITIO(A0)ƒcleardualtestflags‰CLR.W…DUALCK-INITIO(A0)**SETUPA.S.Q.*!‰MOVE.L„#31,D0Žstagecommandcode-‰LEA‡ASQBLOCK(PC),A0…stagecommandparameters.‰LEA‡TESTIRQ(PC),A1†initializesaddr.ofasync*‰MOVE.L„A1,ASQLA-ASQBLOCK(A0)‚servicertn.‰TRAP†#1 ‰BNE‡FAULT11*‰MOVE.L„#'DCO1',D0(TNAME„LEA‡INITIO(PC),A0‡SETUPTASKNAME‰MOVE.L„D0,DCOPAR-INITIO(A0)‰MOVE.L„D0,TMSG-INITIO(A0)*!TRYBTHƒLEA‡SMSG24(PC),A1‡spaceup‰LEA‡EMSG24(PC),A2 ‰BSR‡MSGOUT*‰LEA‡SMSG24(PC),A1†again‰LEA‡EMSG24(PC),A2 ‰BSR‡MSGOUT*.‰LEA‡SMSG1(PC),A1ˆoutputstartoftestmessage‰LEA‡EMSG1(PC),A2 ‰BSR‡MSGOUT*‰LEA‡SMSG24(PC),A1‡spaceup‰LEA‡EMSG24(PC),A2 ‰BSR‡MSGOUT*‰LEA‡INITIO(PC),A0‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)+‰MOVE.W„#CLSLNG,A1ŠINSURECHANNEL(S)CLOSED$‰MOVE.W„A1,CMDL-INITIO(A0)‚TOSTART.‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT16*‰PAGE* *…OPENTHECHANNELSINDIVIDUALLY*5TEST1„LEA‡SMSG2(PC),A1‡output'open&output'message‰LEA‡EMSG2(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*‰LEA‡EVNTCNT(PC),A0"‰CLR.W…0(A0)initializeparameters‰LEA‡INITIO(PC),A0*‰MOVE.W„#1,ONCMD1-INITIO(A0)'ON'bitmask,‰MOVE.W„#1,OFFCMD1-INITIO(A0)'OFF'bitmask2‰MOVE.W„#1,STATSHF-INITIO(A0)statusreq.bitmask;OPNLP„MOVE.W„EVNTCNT(PC),D0†OPENCHANNEL(eventcountholds‰LEA‡INITIO(PC),A0‡channel#)+‰MOVE.W„D0,OPNCH-INITIO(A0)channeltoopen‰LEA‡OPNCMDS(PC),A1,‰MOVE.L„A1,CMDA-INITIO(A0)‚parameterstoCMR‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*+‰LEA‡INITIO(PC),A0‡OUTPUTTOCHANNELOPENED‰LEA‡ONCMD(PC),A1,‰MOVE.L„A1,CMDA-INITIO(A0)‚parameterstoCMR ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT2*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#500,A0500MS‰TRAP†#1 ‰BNE‡FAULT15*!‰LEA‡OPNLP(PC),A1ˆloopbackaddr.&‰LEA‡TEST1B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*%TEST1BƒLEA‡INITIO(PC),A0‡CHECKSTATUS/‰MOVE.W„STATSHF(PC),D0†movechanneltocheckto1‰MOVE.W„D0,STAT-INITIO(A0)‚statusparameterblock‰LEA‡STATCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT3*3‰MOVE.W„STAT(PC),D0‰doesstatuscheckwithbitthat"‰CMP.W…ONCMD1(PC),D0‡shouldbeon? ‰BNE‡FAULT4*#‰LEA‡INITIO(PC),A0‡TURNOFFCHANNEL‰LEA‡OFFCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT5*‰LEA‡INITIO(PC),A0‡CHECKSTATUS/‰MOVE.W„STATSHF(PC),D0†movechanneltocheckto1‰MOVE.W„D0,STAT-INITIO(A0)‚statusparameterblock‰LEA‡S% TATCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT3*.‰MOVE.W„STAT(PC),D0‰doesstatuscheckshowbit#‰BNE‡FAULT4Žstillon?ifso,error.*#‰LEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST1B(PC),A1‡loopbackaddr.&‰LEA‡TEST1C(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*TEST1CƒLEA‡INITIO(PC),A0>‰ASL.W…ONCMD1-INITIO(A0)ƒshift'ON'channelbitmaskoneplace/‰ASL.W…OFFCMD1-INITIO(A0)‚shift'OFF'ƒ"…"ƒ"„"„"0‰ASL.W…STATSHF-INITIO(A0)‚shiftstatus‚"…"ƒ"„"„"‰LEA‡EVNTCNT(PC),A0'‰ADD.W…#1,0(A0)Œincrementeventcounter‰MOVE.W„EVNTCNT(PC),D0‰CMPI.W„#8,D0done? ‰BMI‡OPNLP*‰PAGE*2*„OUTPUTTOCHANNELSSEQUENTIALLYUNTILALLAREON*5TEST2„LEA‡SMSG3(PC),A1‡output'outputtoall'message‰LEA‡EMSG3(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*‰LEA‡EVNTCNT(PC),A0"‰CLR.W…0(A0)initializeparameters‰LEA‡INITIO(PC),A06‰MOVE.W„#1,ONCMD1-INITIO(A0)‚bitmaskfor'ON'channel9‰MOVE.W„#1,STATSHF-INITIO(A0)bitmaskforstatuschannel)OPNLP2ƒMOVE.W„EVNTCNT(PC),D0†OPENCHANNEL‰LEA‡INITIO(PC),A0‰MOVE.W„D0,OPNCH-INITIO(A0)/‰LEA‡INITIO(PC),A0‡pointtoCMRparameterblock‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*+‰LEA‡INITIO(PC),A0‡OUTPUTTOCHANNELOPENED‰LEA‡ONCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT2*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#500,A0500MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡OPNLP2(PC),A1‡loopbackaddr.&‰LEA‡TEST2A(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*1TEST2AƒLEA‡INITIO(PC),A0‡CHECKSTATUSOFCHANNELS‰MOVE.W„STATSHF(PC),D0‰MOVE.W„D0,STAT-INITIO(A0)‰LEA‡STATCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT3*&‰MOVE.W„STAT(PC),D0‰doesstatuscheck?‰CMP.W…STATSHF(PC),D0 ‰BNE‡FAULT4*"‰LEA‡TEST2A(PC),A1‡loopbackaddr.&‰LEA‡TEST2B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*TEST2BƒLEA‡INITIO(PC),A0>‰ASL.W…ONCMD1-INITIO(A0)ƒshift'ON'channelbitmaskoneplace‰ORI‡#$10,CCRŒsetXbit/‰ROXL.W„STATSHF-INITIO(A0)‚addstatusƒ"…"ƒ"„"„"‰LEA‡EVNTCNT(PC),A0'‰ADD.W…#1,0(A0)Œincrementeventcounter‰MOVE.W„EVNTCNT(PC),D0‰CMPI.W„#8,D0done? ‰BMI‡OPNLP2*7TEST2CƒLEA‡SMSG39(PC),A1‡output'turnoffseq.'message‰LEA‡EMSG39(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*‰LEA‡EVNTCNT(PC),A0"‰CLR.W…0(A0)initializeparameters‰LEA‡INITIO(PC),A08‰MOVE.W„#1,OFFCMD1-INITIO(A0)‚bitmaskfor'OFF'channel9‰MOVE.W„#1,STATSHF-INITIO(A0)bitmaskforstatuschannel*)OPNLP3ƒLEA‡INITIO(PC),A0‡TURNOFFCHANNEL‰LEA‡OFFCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT5*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#500,A0500MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡OPNLP3(PC),A1‡loopbackaddr.&‰LEA‡TEST2D(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*0TEST2DƒLEA‡INITIO(PC),A0‡CHECKSTATUSOFCHANNEL‰MOVE.W„STATSHF(PC),D0‰MOVE.W„D0,STAT-INITIO(A0)‰LEA‡STATCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT3*&‰MOVE.W„STAT(PC),D0‰doesstatuscheck? ‰BNE‡FAULT4*"‰LEA‡TEST2D(PC),A1‡loopbackaddr.&‰LEA‡TEST2E(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*TEST2EƒLEA‡INITIO(PC),A0@‰ASL.W…OFFCMD1-INITIO(A0)‚shift'OFF'channelbitmaskoneplace0‰ASL.W…STATSHF-INITIO(A0)‚shiftstatus‚"…"ƒ"„"„"‰LEA‡EVNTCNT(PC),A0'‰ADD.W…#1,0(A0)Œincrementeventcounter‰MOVE.W„EVNTCNT(& PC),D0‰CMPI.W„#8,D0done? ‰BMI‡OPNLP3*+TEST2FƒLEA‡INITIO(PC),A0‡OUTPUTTOCHANNELS‰LEA‡ONCMDA(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT2*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡TEST2F(PC),A1‡loopbackaddr.%‰LEA‡TEST3(PC),A2ˆcontinueonforward‰BRA‡FLOPtestfortoggle**%**************************************ƒCLOSETEST–*%**************************************-TEST3„LEA‡SMSG4(PC),A1‡output'close'message‰LEA‡EMSG4(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*)TEST3AƒLEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST3A(PC),A1‡loopbackaddr.%‰LEA‡TEST4(PC),A2ˆcontinueonforward‰BRA‡FLOPtestfortoggle*‰PAGE$*„TURNONALLOUTPUTS,THENTURNOFF*9TEST4„LEA‡SMSG5(PC),A1‡output'turnon,turnoff'message‰LEA‡EMSG5(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15**TEST4AƒLEA‡INITIO(PC),A0‡OPENALLCHANNELS/‰LEA‡OPNCMD(PC),A1‡pointtoCMRparameterblock‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*,‰LEA‡INITIO(PC),A0‡OUTPUTTOCHANNELSOPENED‰LEA‡ONCMDA(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT2*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡TEST4A(PC),A1‡loopbackaddr.&‰LEA‡TEST4B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle**TEST4BƒLEA‡INITIO(PC),A0‡TURNOFFCHANNELS‰LEA‡OFFCMDA(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT5*#‰LEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST4B(PC),A1‡loopbackaddr.%‰LEA‡TEST5(PC),A2ˆcontinueonforward‰BRA‡FLOPtestfortoggle*‰PAGE*„PULSEEACHOUTPUTINTURN*2TEST5„LEA‡SMSG6(PC),A1‡output'pulseeach'message‰LEA‡EMSG6(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*‰LEA‡EVNTCNT(PC),A0‰CLR.W…0(A0)initializeevntcnt)OPNLP4ƒMOVE.W„EVNTCNT(PC),D0†OPENCHANNEL/‰LEA‡INITIO(PC),A0‡pointtoCMRparameterblock+‰MOVE.W„D0,OPNCH-INITIO(A0)channeltoopen,‰MOVE.W„D0,PLSO1-INITIO(A0)channeltopulse‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*‰LEA‡INITIO(PC),A0‰LEA‡PLSO(PC),A1‰PULSEOUTPUT‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#12,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT10*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡OPNLP4(PC),A1‡loopbackaddr.&‰LEA‡TEST5A(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*)TEST5AƒLEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST5A(PC),A1‡loopbackaddr.&‰LEA‡TEST5B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*TEST5BƒLEA‡EVNTCNT(PC),A0'‰ADD.W…#1,0(A0)Œincrementeventcounter‰MOVE.W„EVNTCNT(PC),D0‰CMPI.W„#8,D0done? ‰BMI‡OPNLP4*‰PAGE#*„PULSEFOUROUTPUTSSIMULTANEOUSLY*6TEST6„LEA‡SMSG32(PC),A1†output'pulsesimult.'message‰LEA‡EMSG32(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1500,A0Œ1500MS‰TRAP†#1 ‰BNE‡FAULT15*&TEST6AƒLEA‡INITIO(PC),A0‡OPENCHANNELS‰LEA‡OPNCM& D(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*‰LEA‡INITIO(PC),A0‰LEA‡PLSTWO(PC),A1‰PULSEOUTPUT‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#PLSTLG,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT10*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#500,A0500MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡TEST6A(PC),A1‡loopbackaddr.&‰LEA‡TEST6B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*TEST6BƒMOVE.L„#21,D0ŽDELAY‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*)TEST6CƒLEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST6C(PC),A1‡loopbackaddr.%‰LEA‡TEST7(PC),A2ˆcontinueonforward‰BRA‡FLOPtestfortoggle*‰PAGE+*„PULSEOUTPUTTWOANDGENERATEQUEUEEVENT*6TEST7„LEA‡SMSG7(PC),A1‡output'pulseoutput2'message‰LEA‡EMSG7(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*1TEST7AƒLEA‡RCVBUF(PC),A0‡ensureRCVBUFzeroedout‰MOVE.L„#0,0(A0)‰MOVE.L„#0,4(A0)‰MOVE.L„#0,8(A0)*‰LEA‡INITIO(PC),A09‰MOVE.W„#0,OPNCNF-INITIO(A0)setupconfig.(queueevent)‰MOVE.W„#2,D0OPENCHANNELTWO+‰MOVE.W„D0,OPNCH-INITIO(A0)‚channeltoopen,‰MOVE.W„D0,PLSO1-INITIO(A0)‚channeltopulse‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*‰LEA‡INITIO(PC),A0‰LEA‡PLSO(PC),A1‰PULSEOUTPUT‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#12,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT10*+WAITQ„MOVE.L„#36,D0Žrequestwaitforevent.$‰TRAP†#1’tobeissuedbyDCOdriver. ‰BNE‡FAULT13*4‰MOVE.L„RCVBUF(PC),D0‡verifymessagereturnedbyASQ4‰CMP.L…#$0C010002,D0‡$0C01 ‰BNE‡FAULT6‰MOVE.L„RCVBUF+4(PC),D0‰CMP.L…DCOPAR(PC),D0‡DCO-ID ‰BNE‡FAULT6‰MOVE.L„RCVBUF+8(PC),D0,‰AND.L…#$FFFFFF00,D0‡maskoffloworderbyte0‰CMP.L…#IOADR0,D0ŠVM02memorymappedI/Oaddress ‰BEQ.S…TEST710‰CMP.L…#IOADR1,D0ŠVM03memorymappedI/Oaddress ‰BEQ.S…TEST722‰CMP.L…#IOADR2,D0ŠVME110memorymappedI/Oaddress ‰BEQ.S…TEST732‰CMP.L…#IOADR3,D0ŠVME/10memorymappedI/Oaddress ‰BNE‡FAULT6*‰LEA‡SMSG43(PC),A1‰LEA‡EMSG43(PC),A2 ‰BSR‡MSGOUT ‰BRA.S…TEST74TEST71ƒLEA‡SMSG40(PC),A1‰LEA‡EMSG40(PC),A2 ‰BSR‡MSGOUT ‰BRA.S…TEST74TEST72ƒLEA‡SMSG41(PC),A1‰LEA‡EMSG41(PC),A2 ‰BSR‡MSGOUT ‰BRA.S…TEST74TEST73ƒLEA‡SMSG42(PC),A1‰LEA‡EMSG42(PC),A2 ‰BSR‡MSGOUT2TEST74ƒLEA‡SMSG38(PC),A1‡output'asqverified'msg‰LEA‡EMSG38(PC),A2 ‰BSR‡MSGOUT*"‰LEA‡TEST7A(PC),A1‡loopbackaddr.&‰LEA‡TEST7B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*)TEST7BƒLEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST7B(PC),A1‡loopbackaddr.&‰LEA‡TEST7C(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*6TEST7CƒMOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*‰PAGE'*…PULSEOUTPUTONEANDGENERATEWAKE-UP3TEST8„LEA‡SMSG8(PC),A1‡output'pulseled1'message‰LEA‡EMSG8(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*1TEST8AƒLEA‡INITIO(PC),A0‡pointtoCMRpara.block5‰MOVE.W„#1,OPNCNF-INITIO(A0)setupconfig.(wake-up)‰MOVE.W„#1,D0OPENCHANNELONE+‰MOVE.W„D0,OPNCH-INITIO(A0)‚channeltoopen,‰MOVE.W„D0,PLSO1-INITIO(A0)‚channeltopulse‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*‰LEA‡INITIO(PC),A0‰LEA‡PLSO(PC),A1‰PULSEOUTPUT‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#12,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT10*-WAITW„MOVE.L„#19,D' 0Žrequestwaitforwake-up.$‰TRAP†#1’tobeissuedbyDCOdriver. ‰BNE‡FAULT130‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEECHANNEL‰MOVE.L„#1000,A0Œ1000MS‰TRAP†#1 ‰BNE‡FAULT15*"‰LEA‡TEST8A(PC),A1‡loopbackaddr.&‰LEA‡TEST8B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*)TEST8BƒLEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*"‰LEA‡TEST8B(PC),A1‡loopbackaddr.&‰LEA‡TEST8C(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*6TEST8CƒLEA‡INITIO(PC),A0‡restoredefaultconfiguration ‰MOVE.W„#$8000,OPNCNF-INITIO(A0)2‰MOVE.W„#0,OPNCH-INITIO(A0)restorechannelselect1‰MOVE.W„#1,STAT-INITIO(A0)‚restorestatuschannel3‰MOVE.W„#1,OFFCMD1-INITIO(A0)‚restoreoffcmdchan.*‰PAGE#*„TRYCOMMANDSWITHCHANNELSCLOSED7TEST9„LEA‡SMSG9(PC),A1‡output'trywithclosed'message‰LEA‡EMSG9(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*1TEST9AƒLEA‡INITIO(PC),A0‡OUTPUTTOCLOSEDCHANNEL‰LEA‡ONCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#6,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1)‰MOVE.W„ONCMD(PC),D0ˆreadreturnedstatus(‰CMP.W…#$F2,D0verifycorrecterrorcode ‰BNE‡FAULT2 ‰LEA‡SMSG12(PC),A1‡outputokmsg‰LEA‡EMSG12(PC),A2 ‰BSR‡MSGOUT*#‰LEA‡INITIO(PC),A0‡TURNOFFCHANNEL‰LEA‡OFFCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1*‰MOVE.W„OFFCMD(PC),D0‡readreturnedstatus(‰CMP.W…#$F2,D0verifycorrecterrorcode ‰BNE‡FAULT5‰LEA‡SMSG14(PC),A1‡offokmsg‰LEA‡EMSG14(PC),A2 ‰BSR‡MSGOUT*‰LEA‡INITIO(PC),A0‡CHECKSTATUS‰LEA‡STATCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#6,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1+‰MOVE.W„STATCMD(PC),D0†readreturnedstatus(‰CMP.W…#$F2,D0verifycorrecterrorcode ‰BNE‡FAULT3 ‰LEA‡SMSG16(PC),A1‡statusokmsg‰LEA‡EMSG16(PC),A2 ‰BSR‡MSGOUT*‰LEA‡INITIO(PC),A0‰LEA‡PLSO(PC),A1‰PULSEOUTPUT‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#12,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1(‰MOVE.W„PLSO(PC),D0‰readreturnedstatus(‰CMP.W…#$F6,D0verifycorrecterrorcode ‰BNE‡FAULT10*"‰LEA‡TEST9A(PC),A1‡loopbackaddr.&‰LEA‡TEST9B(PC),A2‡continueonforward‰BRA‡FLOPtestfortoggle*%TEST9BƒLEA‡SMSG18(PC),A1‡pulseokmsg‰LEA‡EMSG18(PC),A2 ‰BSR‡MSGOUT*‰PAGE*ƒTRYTOOPENINVALIDCHANNELS6TEST10ƒLEA‡SMSG11(PC),A1‡output'tryinvalidchannels'‰LEA‡EMSG11(PC),A2 ‰BSR‡MSGOUT0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*3TEST10A‚LEA‡INITIO(PC),A0‡TRYTOOPENZEROCHANNELS‰LEA‡OPNCH0(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNCHL,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1%‰MOVE.W„OPNCH0(PC),D0‡readcmdstatus‰CMP.W…#$F7,D0 ‰BNE‡FAULT7*3‰LEA‡INITIO(PC),A0‡TRYTOOPENMORETHAN8CHANNELS‰LEA‡OPNMOR(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNML,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1%‰MOVE.W„OPNMOR(PC),D0‡readcmdstatus‰CMP.W…#$F7,D0 ‰BNE‡FAULT7*,‰LEA‡INITIO(PC),A0‡TRYTOOPENCHANNEL#>8‰LEA‡OPNCH9(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNC9L,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1%‰MOVE.W„OPNCH9(PC),D0‡readcmdstatus‰CMP.W…#$F6,D0 ‰BNE‡FAULT7*0‰LEA‡INITIO(PC),A0‡TRYTOOPENSAMETWOCHANNELS‰LEA‡OPNTW(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNTL,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1$‰MOVE.W„OPNTW(PC),D0ˆreadcmdstatus‰CMP.W…#$FE,D0 ‰BNE‡FAULT7*#‰LEA‡TEST10A(PC),A1†loopbackaddr.'‰LEA‡TEST10B(PC),A2†continueonforward‰BRA‡FLOPtestfortoggle*6TEST10B‚LEA‡SMSG36(PC),A1‡output'invalidchannelsok'‰LEA‡EMSG36(PC),A2 ‰BSR‡MSGOUT*‰PAGE*„TRYTOUSEINVALIDCOMMANDS*2TEST11ƒLEA‡SMSG25(PC),A1‡output'tryinvalidcmds'‰LEA‡EMSG25(PC),A2 ‰BSR‡MSGOUT*' 0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*&TEST11A‚LEA‡INITIO(PC),A0‡OPENCHANNEL‰MOVE.W„#1,OPNCH-INITIO(A0)‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*$‰LEA‡INITIO(PC),A0‡INVALIDCOMMAND0‰LEA‡INVCM0(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#4,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1*‰MOVE.W„INVCM0(PC),D0‡readreturnedstatus‰CMP.W…#$F4,D0 ‰BNE‡FAULT9*$‰LEA‡INITIO(PC),A0‡INVALIDCOMMAND6‰LEA‡INVCM6(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#4,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1*‰MOVE.W„INVCM6(PC),D0‡readreturnedstatus‰CMP.W…#$F4,D0 ‰BNE‡FAULT9*$‰LEA‡INITIO(PC),A0‡INVALIDCOMMAND7‰LEA‡INVCM7(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#4,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1*‰MOVE.W„INVCM7(PC),D0‡readreturnedstatus‰CMP.W…#$F4,D0 ‰BNE‡FAULT9*&‰LEA‡INITIO(PC),A0‡INVALIDCOMMAND>8‰LEA‡INVCM9(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0) ‰MOVE.W„#4,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1*‰MOVE.W„INVCM9(PC),D0‡readreturnedstatus‰CMP.W…#$F4,D0 ‰BNE‡FAULT9*#‰LEA‡TEST11A(PC),A1†loopbackaddr.'‰LEA‡TEST11B(PC),A2†continueonforward‰BRA‡FLOPtestfortoggle*-TEST11B‚LEA‡SMSG26(PC),A1‡invalidcmdsokmsg‰LEA‡EMSG26(PC),A2 ‰BSR‡MSGOUT*‰PAGE*„TRYOPENANDALREADYOPENED9TEST12ƒLEA‡SMSG20(PC),A1†output'trywithopened'message‰LEA‡EMSG20(PC),A2 ‰BSR‡MSGOUT*0‰MOVE.L„#21,D0ŽDELAYSOOPERATORCANSEEMESSAGE‰MOVE.L„#1200,A0Œ1200MS‰TRAP†#1 ‰BNE‡FAULT15*6TEST12A‚LEA‡INITIO(PC),A0‡pointtoCMRparameterblock(‰MOVE.W„#0,OPNCH-INITIO(A0)OPENCHANNEL‰LEA‡OPNCMDS(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1 ‰BNE‡FAULT1*/‰LEA‡INITIO(PC),A0‡pointtoCMRparameterblock‰LEA‡OPNCMDS(PC),A1)‰MOVE.L„A1,CMDA-INITIO(A0)‚TRYOPENagain‰MOVE.W„#OPNLNGS,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0ŽCMR‰TRAP†#1+‰MOVE.W„OPNCMDS(PC),D0‡readreturnedstatus‰CMP.W…#$FE,D0 ‰BNE.S…FAULT1*#‰LEA‡INITIO(PC),A0‡CLOSECHANNEL(S)‰LEA‡CLSCMD(PC),A1‰MOVE.L„A1,CMDA-INITIO(A0)‰MOVE.W„#CLSLNG,A1‰MOVE.W„A1,CMDL-INITIO(A0)‰MOVE.L„#60,D0‰TRAP†#1 ‰BNE‡FAULT8*#‰LEA‡TEST12A(PC),A1†loopbackaddr.%‰LEA‡TESTC(PC),A2ˆcontinueonforward‰BRA‡FLOPtestfortoggle*1**************************************************„TESTCOMPLETED*1************************************************* TESTC„LEA‡SMSG24(PC),A1‡spaceup‰LEA‡EMSG24(PC),A2 ‰BSR‡MSGOUT*1‰LEA‡SMSG23(PC),A1†output'testcomplete'message‰LEA‡EMSG23(PC),A2 ‰BSR‡MSGOUT*‰LEA‡SMSG24(PC),A1†spaceup‰LEA‡EMSG24(PC),A2 ‰BSR‡MSGOUT*#NEXT…MOVE.W„DUALFG(PC),D0‡flagset? ‰BNE‡TERM.NEXTA„MOVE.L„DCOPAR(PC),D0‡tryforsecondtask‰CMP.L…#'DCO1',D0‰BNE‡TERMAdone‰MOVE.L„#'DCO2',D0‰BRA‡TNAMEsetupsecondtask*‰PAGE*#FAULT1ƒLEA‡SMSG22(PC),A1‡openerror‰LEA‡EMSG22(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM%FAULT2ƒLEA‡SMSG13(PC),A1‡outputerror‰LEA‡EMSG13(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM%FAULT3ƒLEA‡SMSG17(PC),A1‡statuserror‰LEA‡EMSG17(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM+FAULT4ƒLEA‡SMSG28(PC),A1‡statuscheckerror‰LEA‡EMSG28(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM"FAULT5ƒLEA‡SMSG15(PC),A1‡offerror‰LEA‡EMSG15(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM*FAULT6ƒLEA‡SMSG10(PC),A1‡ASQmessageerror‰LEA‡EMSG10(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM.FAULT7ƒLEA‡SMSG21(PC),A1‡invalidchannelerror‰LEA‡EMSG21(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM$FAULT8ƒLEA‡SMSG33(PC),A1‡closeerror‰LEA‡EMSG33(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM.FAULT9ƒLEA‡SMSG27(PC),A1‡invalidcmderrormsg‰LEA‡EMSG27(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM%FAULT10‚LEA‡SMSG19(PC),A1‡pulseerror‰LEA‡EMSG19(PC),A2 ‰BSR‡MSGOUT ‰BRA‡TERM#FAULT11‚LEA‡SMSG30(PC),A1‡ASQerror‰LEA‡EMSG30(PC),A2 ‰BSR‡MSGOUT ‰BRA.S…TERM#FAULT12‚LEA‡( SMSG29(PC),A1‡ASQerror‰LEA‡EMSG29(PC),A2 ‰BSR.S…MSGOUT ‰BRA.S…TERM6FAULT13‚LEA‡SMSG31(PC),A1‡WAKE-UPorQUEUEEVENTerror‰LEA‡EMSG31(PC),A2 ‰BSR.S…MSGOUT ‰BRA.S…TERM2FAULT14‚LEA‡SMSG34(PC),A1‡IOS(trap#2)callerror‰LEA‡EMSG34(PC),A2 ‰BSR.S…MSGOUT ‰BRA.S…TERM*FAULT15‚LEA‡SMSG35(PC),A1‡calldelayerror‰LEA‡EMSG35(PC),A2 ‰BSR.S…MSGOUT ‰BRA.S…TERM/FAULT16‚LEA‡SMSG37(PC),A1‡non-existanttaskmsg‰LEA‡EMSG37(PC),A2 ‰BSR.S…MSGOUT(‰LEA‡DUALFG(PC),A0‡setflagtoeliminate‰ADD.W…#1,(A0)dualtest ‰BRA‡NEXTA**„DE-ACTIVATESELF*0TERMA„LEA‡INITIO(PC),A0‡testfordualboardtest‰TST.W…DUALFG-INITIO(A0) ‰BNE.S…TERM4‰MOVE.W„#1,DUALFG-INITIO(A0)‚setupfordualbdtest‰MOVE.W„#1,DUALCK-INITIO(A0)!‰MOVE.L„#'DCO1',DCOPAR-INITIO(A0)*‰MOVE.L„#'DCO1',TMSG-INITIO(A0)‚setupmsg‰MOVE.W„#'&2',TMSG+4-INITIO(A0) ‰BRA‡TRYBTH*%TERM…MOVE.L„#32,D0ŽDE-ALLOCATEA.S.Q.‰TRAP†#1**‰MOVE.L„#15,D0ŽNOWDE-ACTIVATESELF(EXIT)‰TRAP†#1**„MESSAGEOUTPUTSUBROUTINE*/MSGOUTƒLEA‡MSG(PC),A0Šoutputmessagepointedto(‰MOVE.L„A1,X1-MSG(A0)‡byA1,endedbyA2‰MOVE.L„A2,X2-MSG(A0)‰TRAP†#2 ‰BNE‡FAULT14‰RTS*1FLOP…LEA‡INITIO(PC),A0‡togglebetweenDCO1&DCO2‰MOVE.W„DUALCK-INITIO(A0),D0 ‰BEQ.S…FLOP2continueonifzero‰CMP.W…#1,D0seeif=1 ‰BNE.S…FLOP11‰MOVE.W„#2,DUALCK-INITIO(A0)‚is=1,setupfor2!‰MOVE.L„#'DCO2',DCOPAR-INITIO(A0)‰JMP‡(A1)loopback6FLOP1„MOVE.W„#1,DUALCK-INITIO(A0)‚is=2,setupfor1!‰MOVE.L„#'DCO1',DCOPAR-INITIO(A0))FLOP2„JMP‡(A2)continueonwithnexttest*-*ƒMOVETHEASQMESSAGEFROMTHEASQTORCVBUF*8TESTIRQ‚EQU‡*‰entrypointmovingdatafromASQtoRCVBUF!‰MOVE.L„#34,D0„stagecommandcode‰LEA‡RCVBUF(PC),A0‰TRAP†#1 ‰BNE‡FAULT12*„RETURNFROMEVENT!‰MOVE.L„#37,D0„stagecommandcode ‰MOVE.W„#1,A0‰TRAP†#1*‰PAGE**„CMRparameterblock*INITIOƒDC.B†7,0,0,0DCOPARƒDC.L†'DCO1'„TASKNAME ‰DC.L†0,0,0*CMDA…DC.L†0‰addressofDCOparameterblockCMDL…DC.W†0‰commandlength**„A.S.Q.parameterblock*ASQBLOCKEQU‡*‰DC.L†0‰taskname‰DC.L†0‰dummyfield*‰DC.B†5‰ASQ&ASRenabled=initialstatus"‰DC.B†16ˆlengthofmessageforASQ‰DC.L†16ˆstoragefor4events?ASQLA„DC.L†TESTIRQƒlogicaladdressoftargettaskasyncsvcrtn‰DC.L†0‰dummyfieldASQLNGƒEQU‡*-ASQBLOCK*0*„DCOparameterblocktoopenindividualchannel*OPNCMDS‚DC.W†0‰returnedstatus‰DC.W†1‰OPENcommandcode‰DC.W†1‰open1channelOPNCH„DC.W†0‰channel#/OPNCNFƒDC.W†$8000…DefaultchannelconfigurationOPNLNGS‚EQU‡*-OPNCMDSlength***„DCOparameterblocktoopenALLchannels*OPNCMDƒDC.W†0‰returnedstatus‰DC.W†1‰OPENcommandcode‰DC.W†8‰open8channels*‰DC.W†0,$8000ƒCHAN0,defaultconfiguration‰DC.W†1,$8000ƒCHAN1,ƒ"‰"‰DC.W†2,$8000ƒCHAN2,ƒ"‰"‰DC.W†3,$8000ƒCHAN3,ƒ"‰"‰DC.W†4,$8000ƒCHAN4,ƒ"‰"‰DC.W†5,$8000ƒCHAN5,ƒ"‰"‰DC.W†6,$8000ƒCHAN6,ƒ"‰"‰DC.W†7,$8000ƒCHAN7,ƒ"‰"OPNLNGƒEQU‡*-OPNCMD‚length*#*ƒparameterblockforCLOSEcommand*CLSCMDƒDC.W†0‰returnedstatus‰DC.W†2‰CLOSEcommand(CLSLNGƒEQU‡*-CLSCMD‚closecommandlength*$*…DCOparameterblockforONcommand* ONCMD„EQU‡*‰DC.W†0‰returnedcommandstatus‰DC.W†3‰OUTPUTONcommand,ONCMD1ƒDC.W†1‰bitmaskofchanneltoturnON* ONCMDAƒEQU‡*‰DC.W†0‰returnedcommandstatus‰DC.W†3‰OUTPUTONcommand,‰DC.W†$00FF…bitmasktoturnONallchannels*%*…DCOparameterblockforOFFcommand* OFFCMDƒEQU‡*&‰DC.W†0‰returncommandstatuslocation‰DC.W†4‰OFFcommand.OFFCMD1‚DC.W†1‰bitmaskofchanneltoturnOFF* OFFCMDA‚EQU‡*&‰DC.W†0‰returncommandstatuslocation‰DC.W†4‰OFFcommand-‰DC.W†$00FF…bitmasktoturnOFFallchannels*$*„parameterblockforSTATUScommand* STATCMD‚EQU‡*‰DC.W†0‰returnedcommandstatus‰DC.W†5‰STATUScommand2STAT…DC.W†1‰bitmask&readstatusofchannels0-7*:*„DCOparameterblocktodo1000msPULSEonselectedchan*PLSO…DC.W†0‰returnedcmdstatus‰DC.W†8‰PULSEcommandcode‰DC.W†( 1‰onechannelPLSO1„DC.W†1‰pulsechannel#‰DC.L†500‡500mspulse*7*„parameterblocktoPULSEfourchannelssimultaneously*!PLSTWOƒDC.W†0‰returnedcmdstatus‰DC.W†8‰PULSEcommandcode‰DC.W†4‰fourchannels‰DC.W†4‰chan.#4‰DC.L†250‡250ms‰DC.W†5‰chan.#5‰DC.L†500‡500ms‰DC.W†6‰chan.#6‰DC.L†750‡750ms‰DC.W†7‰chan.#7‰DC.L†1000†1000msPLSTLGƒEQU‡*-PLSTWO*"*„INVALIDCHANNELparameterblocks*!OPNCH0ƒDC.W†0‰returnedcmdstatus‰DC.W†1‰OPENcommandcode‰DC.W†0‰openzerochannels‰DC.W†0‰channel0‰DC.W†$8000…config.OPNCHLƒEQU‡*-OPNCH0*!OPNCH9ƒDC.W†0‰returnedcmdstatus‰DC.W†1‰OPENcmdcode‰DC.W†1‰openonechannel‰DC.W†9‰openchannel#9‰DC.W†$8000…config.OPNC9LƒEQU‡*-OPNCH9* OPNTW„DC.W†0‰returnedcmdstatus‰DC.W†1‰OPENcmdcode‰DC.W†3‰openthreechan.‰DC.W†1,$8000ƒchan,config.‰DC.W†2,$8000ƒchan,config.‰DC.W†2,$8000ƒchan,config.OPNTL„EQU‡*-OPNTW*!OPNMORƒDC.W†0‰returnedcmdstatus‰DC.W†1‰OPENcmdcode‰DC.W†9‰open9channels‰DC.W†0,$8000ƒchan,config.‰DC.W†1,$8000ƒchan,config.‰DC.W†2,$8000ƒchan,config.‰DC.W†3,$8000ƒchan,config.‰DC.W†4,$8000ƒchan,config.‰DC.W†5,$8000ƒchan,config.‰DC.W†6,$8000ƒchan,config.‰DC.W†7,$8000ƒchan,config.‰DC.W†8,$8000ƒchan,config.OPNML„EQU‡*-OPNMOR*#*…INVALIDCOMMANDSparameterblocks*!INVCM0ƒDC.W†0‰returnedcmdstatus‰DC.W†0‰invalidcommand0*!INVCM6ƒDC.W†0‰returnedcmdstatus‰DC.W†6‰invalidcommand6*!INVCM7ƒDC.W†0‰returnedcmdstatus‰DC.W†7‰invalidcommand7*!INVCM9ƒDC.W†0‰returnedcmdstatus"‰DC.W†9‰invalidcmdgreaterthan8**„IOSMESSAGEparameterblock*MSG†DC.B†0‰Dataxfercode=0‰DC.B†2‰Writedata‰DC.W†0‰Options-none‰DC.B†0‰Status ‰DC.B†6‰LUN‰DC.W†0‰reserved‰DC.L†0‰randomrecordcountX1‡DC.L†0‰bfrstartaddr.X2‡DC.L†0‰bfrendaddr.‰DC.L†0‰lengthofdataxfer ‰DC.L†0‰completion/serviceaddr.*‰PAGE *„MESSAGES*6SMSG1„DC.W†'**********DCOUTPUTTESTPROGRAM******'TMSG…DC.W†'DCO1‚' EMSG1„EQU‡*-1*8SMSG2„DC.W†'‚OPEN&OUTPUTTOEACHCHANNELINDIVIDUALLY' EMSG2„EQU‡*-1*9SMSG3„DC.W†'‚OPEN&OUTPUTEACHCHANNELUNTILALLAREON' EMSG3„EQU‡*-1*5SMSG4„DC.W†'‚CLOSECHANNELS,OUTPUTSSHOULDTURNOFF' EMSG4„EQU‡*-1*0SMSG5„DC.W†'‚TURNONALLOUTPUTS,THENTURNOFF' EMSG5„EQU‡*-1*'SMSG6„DC.W†'‚PULSEEACHOUTPUTINTURN' EMSG6„EQU‡*-1*5SMSG7„DC.W†'‚PULSEOUTPUT2ANDGENERATEQUEUEEVENT' EMSG7„EQU‡*-1*1SMSG8„DC.W†'‚PULSEOUTPUT1ANDGENERATEWAKE-UP' EMSG8„EQU‡*-1*/SMSG9„DC.W†'‚TRYCOMMANDSWITHCHANNELSCLOSED' EMSG9„EQU‡*-1**SMSG10ƒDC.W†'‚INVALIDASQMESSAGE-ERROR'EMSG10ƒEQU‡*-1*+SMSG11ƒDC.W†'‚TRYTOOPENINVALIDCHANNELS'EMSG11ƒEQU‡*-1*4SMSG12ƒDC.W†'‚CALLOUTPUTANDCHANNELSCLOSED-OK!'EMSG12ƒEQU‡*-1*"SMSG13ƒDC.W†'‚CALLOUTPUT-ERROR'EMSG13ƒEQU‡*-1*1SMSG14ƒDC.W†'‚CALL‚OFFƒANDCHANNELSCLOSED-OK!'EMSG14ƒEQU‡*-1*SMSG15ƒDC.W†'‚CALLOFF-ERROR'EMSG15ƒEQU‡*-1*4SMSG16ƒDC.W†'‚CALLSTATUSANDCHANNELSCLOSED-OK!'EMSG16ƒEQU‡*-1*"SMSG17ƒDC.W†'‚CALLSTATUS-ERROR'EMSG17ƒEQU‡*-1*3SMSG18ƒDC.W†'‚CALLPULSE‚ANDCHANNELSCLOSED-OK!'EMSG18ƒEQU‡*-1*!SMSG19ƒDC.W†'‚CALLPULSE-ERROR'EMSG19ƒEQU‡*-1*4SMSG20ƒDC.W†'‚TRYCALLOPENANDALREADYOPENED-OK!'EMSG20ƒEQU‡*-1*&SMSG21ƒDC.W†'‚INVALIDCHANNEL-ERROR'EMSG21ƒEQU‡*-1* SMSG22ƒDC.W†'‚CALLOPEN-ERROR'EMSG22ƒEQU‡*-1*9SMSG23ƒDC.W†'‚******TESTCOMPLETEDSUCCESSFULLY*******'EMSG23ƒEQU‡*-1*SMSG24ƒDC.W†'‚'EMSG24ƒEQU‡*-1**SMSG25ƒDC.W†'‚TRYTOUSEINVALIDCOMMANDS'EMSG25ƒEQU‡*-1**SMSG26ƒDC.W†'‚CALL„INVALID„COMMANDS„-‚OK!'EMSG26ƒEQU‡*-1*&SMSG27ƒDC.W†'‚INVALIDCOMMAND-ERROR'EMSG27ƒEQU‡*-1*#SMSG28ƒDC.W†'‚STATUSCHECK-ERROR'EMSG28ƒEQU‡*-1*"SMSG29ƒDC.W†'‚A.S.Q.MOVE‚-ERROR'EMSG29ƒEQU‡*-1*SMSG30ƒDC.W†'‚A.S.Q.-ERROR'EMSG30ƒEQU‡*-1*$SMSG31ƒDC.W†'‚WAKEUPORQUEUEERROR'EMSG31ƒEQU‡*-1*9SMSG32ƒDC.W†'‚PULSECHANNELS) 4,5,6,&7SIMULTANEOUSLY'EMSG32ƒEQU‡*-1*!SMSG33ƒDC.W†'‚CALLCLOSE-ERROR'EMSG33ƒEQU‡*-1*#SMSG34ƒDC.W†'‚TRAP#2(IOS)ERROR'EMSG34ƒEQU‡*-1*!SMSG35ƒDC.W†'‚CALLDELAY-ERROR'EMSG35ƒEQU‡*-1**SMSG36ƒDC.W†'‚CALL„INVALID„CHANNELS„-‚OK!'EMSG36ƒEQU‡*-1*‰PAGE*:SMSG37ƒDC.W†'---NON-EXISTANTTASK/BOARD-------^'EMSG37ƒEQU‡*-1*&SMSG38ƒDC.W†'‚A.S.Q.MESSAGEVERIFIED'EMSG38ƒEQU‡*-1*-SMSG39ƒDC.W†'‚TURNOFFCHANNELSSEQUENTIALLY'EMSG39ƒEQU‡*-1*SMSG40ƒDC.W†'‚VM02'EMSG40ƒEQU‡*-1*SMSG41ƒDC.W†'‚VM03'EMSG41ƒEQU‡*-1*SMSG42ƒDC.W†'‚VME110'EMSG42ƒEQU‡*-1*SMSG43ƒDC.W†'‚VME/10'EMSG43ƒEQU‡*-1*‰PAGE*EVNTCNT‚DS.W†1‰eventcounter!STATSHF‚DS.W†1‰statusbitshifter1DUALFGƒDS.W†1‰dualboardtestflag(1=donottest)500ƒFORMAT('OPEN&OUTPUTTOEACHCHANNELUNTILALLAREON')C †DO600I=1,8 †OPN(3)=1 †OPN(4)=I-1†OPN(5)=IHEX(10)†CALLDCOPEN(ID,OPN)+q4c<(†OUT(3)=IHEX(I)†CALLDCOOUT(ID,OUT)C †CALLDELAYC†STATUS(3)=MSK(I)†CALLDCOSTA(ID,STATUS)"†IF(STATUS(3)-MSK(I))550,600,550550ƒCALLERRPR1(I-1) 600ƒCONTINUEC†WRITE(6,620)7620ƒFORMAT('CLOSECHANNELS,OUTPUTSSHOULDTURNOFF') †CALLDELAY†CALLDCOCLS(ID,CLSE) †CALLDELAYC†WRITE(6,750)2750ƒFORMAT('TURNONALLOUTPUTS,THENTURNOFF')C †OPN(3)=8†K=0†DO800I=4,18,2 †OPN(I)=K†OPN(I+1)=IHEX(10)†K=K+1 800ƒCONTINUE†CALLDCOPEN(ID,OPN)†OUT(3)=IHEX(9)†CALLDCOOUT(ID,OUT)C †CALLDELAY†OFF(3)=IHEX(9)†CALLDCOOFF(ID,OFF)†CALLDCOCLS(ID,CLSE)C†WRITE(6,950))950ƒFORMAT('PULSEEACHOUTPUTINTURN')C†DO1000I=1,8 †OPN(3)=1 †OPN(4)=I-1†OPN(5)=IHEX(10)†CALLDCOPEN(ID,OPN) †PULSE(3)=1†PULSE(4)=I-1 †PULSE(5)=0†PULSE(6)=500†CALLDCOPLS(ID,PULSE)C †CALLDELAY †CALLDELAY 1000‚CONTINUE†CALLDCOCLS(ID,CLSE)C†WRITE(6,1030)11030‚FORMAT('TRYCOMMANDSWIT* HCHANNELSCLOSED')C†CALLDCOCLS(ID,CLSE)†IF(CLSE(1))1090,1070,10901070‚WRITE(6,1080)31080‚FORMAT('CALLCLOSEANDCHANNELSCLOSED--OK') †GOTO10951090‚WRITE(6,1093)#1093‚FORMAT('CALLCLOSE-ERROR')C1095‚OUT(3)=1†CALLDCOOUT(ID,OUT)†IF(OUT(1))1040,1060,10401040‚WRITE(6,1050)01050‚FORMAT('CALL‚OUT‚ANDCHANNELSCLOSED--OK') †GOTO10651060‚WRITE(6,1063)!1063‚FORMAT('CALLOUT-ERROR')C1065‚OFF(3)=1†CALLDCOOFF(ID,OFF)†IF(OFF(1))1100,1120,11001100‚WRITE(6,1110)11110‚FORMAT('CALL‚OFF‚ANDCHANNELSCLOSED--OK') †GOTO11251120‚WRITE(6,1123)!1123‚FORMAT('CALLOFF-ERROR')C1125‚STATUS(3)=1†CALLDCOSTA(ID,STATUS)†IF(STATUS(1))1130,1150,11301130‚WRITE(6,1140)21140‚FORMAT('CALLSTATUSANDCHANNELSCLOSED-OK') †GOTO11551150‚WRITE(6,1153)$1153‚FORMAT('CALLSTATUS-ERROR')C1155‚PULSE(3)=1 †PULSE(4)=1 †PULSE(5)=0†PULSE(6)=10†CALLDCOPLS(ID,PULSE)†IF(PULSE(1))1160,1180,11601160‚WRITE(6,1170)21170‚FORMAT('CALLPULSEANDCHANNELSCLOSED--OK') †GOTO11851180‚WRITE(6,1183)#1183‚FORMAT('CALLPULSE-ERROR')C1185‚OPN(3)=1 †OPN(4)=1†OPN(5)=IHEX(10)†CALLDCOPEN(ID,OPN)C†WRITE(6,1190)01190‚FORMAT('TRYCALLOPENANDALREADYOPENED')C †OPN(3)=1 †OPN(4)=1†OPN(5)=IHEX(10)†CALLDCOPEN(ID,OPN)†IF(OPN(1))1200,1220,12001200‚WRITE(6,1210)21210‚FORMAT('CALLOPENANDCHANNELSAREOPEN-OK') †GOTO12251220‚WRITE(6,1222)"1222‚FORMAT('CALLOPEN-ERROR')C1225‚WRITE(6,60)C†WRITE(6,1300)31300‚FORMAT('*********TESTCOMPLETED**********')C †WRITE(6,60)CCˆSEEIFSECONDBOARDTOTESTC#1350‚IF(ID.EQ.'DCO2')GOTO15001400‚ID='DCO2'†GOTO5C 1500‚STOP†ENDééééC:C ********************************************************C†SUBROUTINEDELAY C–DELAYAPPROXIMATELYONESECOND†DO30J=1,100†DO20K=1,350 20„CONTINUE 30„CONTINUE†RETURN†ENDééé* ééééD C:C ********************************************************C†SUBROUTINEERRPR1(I)†WRITE(6,10)I#10„FORMAT('STATUSERROR-BIT',I1)†RETURN†ENDéééééééM=/*=/*†M625DRV.TSTDCO.FF=/*7=FORTRAN M625DRV.TSTDCO.SA,M625DRV.TSTDCO.RO,;A,S,H=1207=FORTRAN M625DRV.TSTPR1.SA,M625DRV.TSTPR1.RO,;A,S,H=1207=FORTRAN M625DRV.TSTDLY.SA,M625DRV.TSTDLY.RO,;A,S,H=120=/*=ENDé+ ééééééVTEST8ÿÿÿÿÿ€SEG0 ÿÿÿÿ ÿÿDCO1€ MVME625 Driver Test Program Number of the channel to convert  > Enter one of the above... Time (in milliseconds) for output pulse > 0 = OUTPUT ON. 1 = OUTPUT OFF. 2 = PULSE AN OUTPUT FOR A SPECIFIED TIME. 3 = READ THE CURRENT OUTPUT STATUS. 4 = QUIT. STATUS OF ALL CHANNELS (ASCII) = <<< Starting command >>> <<< Command done >>> *** OPEN ABORTED *** -- *** START OUTPUT ON ABORTED *** -- *** TURN OUTPUT OFF ABORTED *** -- *** START OUTPUT PULSE ABORTED *** -- *** READ STATUS ABORTED *** -- *** CLOSE ABORTED *** -- Error code returned in D0 = OúüŽIúûÂAúýv)HDAúýŽ)HHAúüæNBAúý‚)HDAúý¨)HHAúüÐNBAúüZ)H`AúüZ)HdAúüÖNBAúüDaÄ €m €o`º9@’9@¨Aú:09@š9@ 9@²Aúý )HDAúý¯)HHAúünNBAúý¢)HDAúý¯)HHAúüXNBAúý¢)HDAúýÉ)HHAúüBNBAúý¼)HDAúýÝ)HHAúü,NBAúýÐ)HDAúýØ)HHAúüNBAúüâ)HDAúüø)HHAúüNBAúûŠ)H`AúûŠ)HdAúüNBAúûtaô @m @o`¾ fva2Aúý¤)HDAúý·)HHAúû´NB0<€a0AúûÞCúü!I1|pCúÐEúÍa 2Cú ¬Eú ×a &Cú¸Eúµa Aú lCú È!I2|1Ip!I2| 1IpCúÿÔEú` >Aú ~áètáè Aú|RP0:v @kÿxAú `Cú Æ!I2|1Ip!I2| 1IpH{ˆB§B§rHÁ/HxN« OïN«v=|ÿÚ=|ÿÜBnÿÞ=| ÿàHnÿvHnÿÖAùN»ˆP2.ÿÖJAk g0`B§AùIôH{ˆB§B§rHÁ/HxN« OïN«v`(B§AùIòH{ˆB§B§rHÁ/HxN« OïN«v=|ÿ´=|ÿ¶=nÿ¢ÿ¸HnÿvHnÿ°AùN»ˆPB§AùI¾H{ˆB§B§rHÁ/HxN« OïN«v=|ÿ´=|ÿ¶=nÿ¢ÿ¸HnÿvHnÿ°AùÆN»ˆP2.ÿ°JAk g0`B§AùI†H{ˆB§B§rHÁ/HxN« OïN«v`(B§AùI„H{ˆB§B§rHÁ/HxN« OïN«vB§AùFŠH{ˆB§B§rHÁ/HxN« OïN«vB§AùINH{ˆB§B§rHÁ/HxN« OïN«vB§AùF>H{ˆB§B§rHÁ/HxN« OïN«vAùI,EûˆAîÿv <N«<¬gAùIEîÿvAûˆü <N«<Œ`õJB§N«\XLßþN^Nu/,OŸüHçB§AùHÜH{ˆB§B§rHÁ/HxN« Oï n/HxHx!B§N«zOïN«vLßþN^Nu/,OŸü Hçp-@ÿü=|cÿúJnÿúm*p-@ÿö=|]ÿôJnÿôm SnÿôR®ÿö`îSnÿúR®ÿü`ÐLßþN^NuHç€pa‚$¼B€0*å€\€2€ KpJAf Cðh.IŸÇGÔ*‹'I8AìÿÄ'H`«ƒ++g, (=f$Tˆ&ˆ ,gJgJƒf ;gRˆ`èB`pRˆNu ,fRˆ`öNuHç0øNVÿ¬$U(jd Ef #gZ&O"KvSüQËÿú7|,E1"Aë,NC A|,|@-7|.|0E1aœJ@f€B (f (WfPk. ()g``"Aë,NCg fkÿþ.NCf Jf0`H f$Jg^ A (Dfk.k.7|P` (Ff ((fþCèah :g )fè ÿþbÞRAÿþ7AN" |€-|0Aë,NCf¬|@-|0NCfšJg° A :f¦CèaJAg˜||7|+.g7|d‰- |k1'|B€0+NAïÿÿ'H ŸÀ'OB—SAAëSAR«R—NBfQÉÿô7|NBg,pB+N^Lß NupB+0N^Lß NupBN^Lß NuB€N^Lß Nu #faÊNu)| 2"j<'i27i6'i8'i<'| @'| D7|FTH :gL 0m 9oJ"Hp :g*QÈÿøB€"H .fR€` 0m ZnR‰`æ @oL`.pCë2avJ@fnÐü .g"Ha¶ A'bX I7A6 .fL .gpCë8aBJ@f: .f4ÐüpCë@a,J@f$ .fÐüpCëHaJ@fJg (fB€NupNu @b2¼ `"¼ @c#|  Am$ ZbØ 0m 9c Am ZbQÈÿäpNuB€NuB€B 0m 9bÃü Ò@`æNu&LaRJ@fþVEE19|,Aì,NC|@-9|.NCg&L`þ,|l1l.9lL9lN `þ& < '@2'@8'@<'@@'@D7@HRˆJf "j<'i$2`" Ef)| 2Cë2rJg ØQÉÿøpNuB€NuHçÿþ?oL@/oHJ?oBD?oNBAïD*UEí@$|Œ *ÿ†f5|ex|zNº|ÿ†5PÐü*g5P%h Cúð%IlÐü ``*f"25A Ao Aco$5|fx|zNº®5|*g5|ÐüCú Æ*g Cú %hÿòÐü%IlCúà*gCú%P<Ðü%IhCú" *f@Cú,f%|*g%PÐü%|*g%PÐü*g%P%Ipr"jlN‘J@gT f*g"j`Nºè*g"j`NºÖ*g j0€*f €5|†.R/Ia²%L0pNuB‚‚"jb*f ü QÊÿú&+$"jba€%L0pNu‘ê,5Hv&*,–Œgad"j(*g.&*,–ª(C3C2¼4*t Bÿf(5|ux|zNº°4 Bg5|tx|zNº˜4*tB5Bt0<Nuƒ*fÉIÙQËÿü*fÉINu *ÿ[f|[ *ðUg`Æ *ŒgN *[fl *ÿUg*Ua¤ @gT|ðUNu&j@ )f5|hx|zNº|U0<Nu&j@S‹Öü (g  gð`Öü%KD%K@`H"jpN‘B2*\ÒŒ²ª,bz(A%L02*P Ab^|[%|\|X|W|Y|VBƒ&j@CúšBBB1ÄüCú(Nñ *WfÖü%K@`Ì2*PA5APB€Nu`Þ`Ö`¶` `†``F``z`"`P`z`Ò``0`f`~``’`ª`Â`Þ`ö `ÿ5|ix|z|{%K~Nº @5|gx|zNº 05|mx|zNº "aÔ&5|P2*LJAf05|L5|Ž Cg5CL5CŽªÖü%KD%K@`þV2*NJAf 5|N Cg5CNÖü%KH%K@`þ.5|jx|zNº ¢aX2*NJAgA5ANJAgþ.&jH%K@`ýø2*LJAgA5ALJAgþ &jD%K@`ýÖ|ÿU *Œgþ*f5|hx|zNº 0%jD@5jŽLB@Nu&j<×ü%K@B@NuaÄ|ðV`ý®a¶|ÿV`ý a¨Öü%K@0<|ÿ[NuÖü%K@aˆ`ýFS‹%K@`þhÆü ÖA Cmý\5|kx|zNº ž *Vfþf *[g * [g *[g *[fþJCgþ *ÿXgþ *[gþ|ÿX5C\BC`üö *VfþJCg~ *[f5CPBƒNu *ÿYgR *Xg5C^`5C\Bƒ2*\4*^ *[g$ * [g *[gJAg6JBf` *[g`6JAg"´Al.` C5C`BƒÞü`ü€ *[fŒNu5|kx|zNº ¢5|lx|zNº ’ê +,g( +)g +/gaÿ* *Vfý8|[`ü aÿBƒ*f5C\|$[ *ŒfJfv`ûä *[gaþä *Vfüò CfüÀÖü Nf|ÿT` Zfü¦|TÖü%K@`ûhêaþœ|[Öü%K@`ûLê *[faþx| [Öü%K@`û(5C^|ÿYÖü%K@`ûêaþF|[Öü%K@`úöêaþ*|[Öü%K@`úÚêaþ|[Öü%K@`ú¾êaýò|[Öü%K@`ú¢JCg *ÿVfDC5CRBCÖü%K@`ú‚ *VfûÎJCf6<(j0ØÃ¹ê,nû¨%L0Öü%K@`úR *VfûžJCf5|kx|zNº¸(j0"LØÃ¹ê,nûjÖü*fÇICÛQËÿü*fÇI%L0%K@`ùö *[gaý( *Vfû6JCfû(j0Öü"KBƒ 'g ÖüC`ð LÐñê,búø*fÉIJCg CÙQËÿü*fÉIÖü 'f*g¤“Øü%L0`˜%K- @%L0`ùfêaüš| [Öü%K@`ùJHçÿþCúNñ` `(`.Nºô« @g|Nº¾NºÚë +f5|‚x|zNºz +(g +)g +2g +3g +4f5|x|zNºB*g+ f.5|zx`+ f5|yx| z||Cë%I‚Nº+ gë « « « « « *g« 7| +fª7|I`~ +g( +#g +Zg +[g +_g +df5|€x|zNºrë 7|  +f k f«««`0 +f7|I+ f«+ f ««B@@*fë |` ë ||*gV < *fB€&*,(j(–Œ Cm (ÀCg`ð Cm 8ÀCg`ð8€Lßÿ(j(B@Nu&j« &j*g*(j0 +Zg$ +[g +_g +g, +#g$`äaʪ( €„o"5|gx|zNº,BkNa¦/+ "k`h/+ ë"k 1fAú”'HRH'H `( 0fAú‚'HRH'H ` +g(Aúj'H'H AëNBJkNf¹Éf 'IOï`®'I «f¼ `JkNgSŒ IS@RHØQÈÿü"_¼ 'I ` JkNfS€'@ Nu kNf °«gSŒ'L AëNBgF*g +Êf||NBg *f +Âgˆ5|„x|z`t|(k%L(%L0*fþ kNf"LÓë$%I,S‰'I `þ6"k Òü%I, +$"k lþD@HÀ j(ÐÁ< *fBAÁQÈÿü`ýúp`5|†x|zpÞüLßþNuHçÿþCúNñ` `þ`úNº¢ @g5|x|zNºJ +f5|ƒx|zNº2*g+ f05|zx`+ f 5|yx| z||Cë%I‚Nºò*g> +(g6 +)g. +2g& +3g +4g7|` +fR7|dI`7|d  +f7|dIë*fë+ f«+ f ««|*g$| +g +g +g|| *n5|Šx| z||Cê%I‚Nº'@(j((€*gˆ < *fB€&*,(j(–Œ Cm (ÀCg`ð Cm 8ÀCg`ð8€ Af*g (j( *(€(j( AfØü%L0Lßÿ(j(B@NupÞüLßþ(j(%L0Nu&jAë*ga$J€fNBg5|…x|z`Â*fÿH`€0¼NBJf0¼B€` Ég Âf0¼B€Nu o /Hçÿþ*UEí@$&j +gfÀ7|,NC7|@,7|.NC|7|(k"LÒü…%I,(ü** F(üORTR8üANü Bƒ:CúŽ f:Cú„ÙQËÿü&ƒÿÿÿg"*,’Œ¶Ao6 o CØQËÿüSŒ'L |AëNBg5|Œx|zNº< g|NBfÞLßÿNuNº pAúNAPAUSE STOP Hçÿþ` Hçÿþ*UEí@5@x|zfêzNVÿê.ª0/j(/j,/jb jfjgj[?j\"j$&j ")2²«2g ©PR 2f&I +g *zfè7|,NC7|@,7|.NC(k%L(%L0"LÒü…%I,"L"<„ü QÉÿú(ü** E(üRRORØü%L0|[5|\Cêx%Ib|f|gHçNº øLß4*x”y-ìCú ÌBƒÄü61 Cú¤81 CúÖÒÄ(j0Øüa®Øü*zgBƒ*{"j~a”%L0*zgB|[5|\0* @co5|\Cê%Ib|fHçNº jLߨê\Øü%L0*zg2| [5|\"jCé%Ib|fHçNºªLߨü%L0*zg*| [*|CfÆü5C\"j‚%IbHçNºpLß||7|·ê$fAúÔ'HTH'H AëNB'j(SŒ'L AëNB·ê$f &j +g°7|@,7|.Aë,NCgœ*zgB5|x|z%W0%o(%o,%o bofogo[5o\N^LßÿNuNº :B€B0*xüd2áIB@H@ü éH‚@H@‚@p ANAJCgC¹ê0gÙQËÿöNu d RECURSIVE CALL UNIT NO. OUT OF RANGE END OF RECORD FORMAT CODE MISSING INVALID CHARACTER IN FORMAT NEST OUT OF RANGE IN FORMAT NUMBER OUT OF RANGE IN FORMAT ILLEGAL DESCRIPTORS IN FORMAT ILLEGAL SIGN WITHOUT SCALE FACTOR INVALID DECIMAL CHARACTER INVALID CHARACTER INVALID HEXADECIMAL CHARACTER FIXED OVERFLOW FLOATING OVERFLOW FLOATING UNDERFLOW NOT ENOUGH RECORDS UNFORMATED READ TOO MANY RECORDS UNFORMATED WRITE ASSIGN MISSING INSUFFICIENT MEMORY FOR BUFFER ERROR RETURN ON FHS READ NOT SUPORTED DEVICE WRITE NOT SUPORTED DEVICE BACKSPACE NOT SUPORTED DEVICE REWIND NOT SUPORTED DEVICE ENDFILE NOT SUPORTED DEVICE DIRECT ACCESS NOT SUPORTED SEQUENTIAL ACCESS NOT SUPORTED UNFORMATED NOT SUPORTED ILLEGAL DIRECT WITHOUT OPEN STMT. ALREADY ACCESSED DIRECT ALREADY ACCESSED SEQUENTIAL I/O ERROR AT SEQUENTIAL ACCESS I/O ERROR AT DIRECT ACCESS END OF FILE ALREADY OPENED ILLEGAL RECORD FORMAT RECORD LENGTH OF OPEN STMT GT OF FILE RECORD NUMBER LE 0 NO FORMATTING FILE I/O ERROR AT PAUSE OR STOP ERROR OCCURED AT CLOSE OUT OF RANGE OF ARRAY ELEMENT INSUFFICIENT MEMORY ZERO DIVIDE SOURCE ERROR ILLEGAL LABEL ASSIGNED TO VARIABLE IN ASSIGNED GOTO REAL ZERO DIVIDE DOUBLE PRECISION ZERO DIVIDE INTEGER ZERO DIVIDE REAL POWER BASE=0,EXP=<0 DOUBLE PRECISION POWER BASE=0,EXP=<0 INTEGER POWER BASE. =0,EXP=<0 SQRT ARG.<0 DSQRT ARG.<0 EXP ARG.>=127LOG(2) DEXP ARG.>=1023LOG(2) ALOG ARG.=<0 DLOG ARG.=<0 ALOG10 ARG.=<0 DLOG10 ARG.=<0 SIN ARG.>=10**6 DSIN ARG.>=10**14 COS ARG.>=10**6 DCOS ARG.>=10**14 TAN ARG. TOO LARGE DTAN ARG. TOO LARGE ARSIN ABS ARG.>1 DARSIN ABS ARG.>1 ATAN ABS ARG. TOO LARGE DATAN ABS ARG. TOO LARGE ATAN2(X/Y) ARG.X=Y=0 DATAN2(X/Y) ARG.X=Y=0 ATAN2(X/Y) ARG. Y TOO LARGE DATAN2(X/Y) ARG. Y TOO LARGE &4Hd€ž¼Þø (7I\¡°Ïãü4Ok†¥½ß÷2MYh~¤·Êåü.:G{|}~­ÁÚÿ'4H^kx‡–¦¸ÈÚí$<Uj€œ¹º»¼½¾¿ÀÁÂÃÄ"#"" & 4%  Hçÿþ&j·üg8|,|-Aë,NCg @gk05|x|†zNºóÎ&S·êfÀLßÿNu/&j·üf&j8 Ъˆ°ª4nj`€0*°+fDB@ +g0<"j8%I(%I0'I"j4 kNg"j8ÒëN%I,S‰'I %K"Nu&S·êfª"j8 Ъˆ°ª4o5|wx|zNºó("“&‰&I`&‹(KØü"*ˆAüQÉÿú%K%@8jj1|,|€-0<`ÿ\Aë,NCg jxgNuk05|vx|zNºò¸ j (1g Aè1Cë1³gÒ+Lg7|„N|k1k.7kL7kN kNg"kÒëNS‰'I Nu"j4S‰'I NuHçÿþBA*[Cú$1N» LßÿNu0f$Rp®pNVÿð(j0"L-LÿüÒê\-Iÿø-jbÿôB@*f=@ÿò=|ÿð*NNº N^NuNVÿè|ÿè&jb g|ÿÿè(j0-Lÿì:*\=Eÿê*NNº²(j0&LÖê\B@0*^ÖÀÖÇÐGg~ÖêR¹ËbtÐjRJ@lD  gdB€S‹ :m8 @¹Ëb €`âBƒ6*\C&LÖÃCcQËÿú¼1RG`†6*^ÖG&LÖê\ÖÃDƒCü QËÿú0*^ÐGÐjRD@J@oÈ2*^4*\”@n"LÒê\Bƒ6Ckh<0QËÿú`^&LÖÂ"LÒê\Bƒ6´Ao6Ck + ÿÿg#` <0—üQËÿè´Amg$<.6–AC#QËÿü`6–BC<0QËÿú<.&I³Ìc<0&I³Ìc< `ö .ÿÿèf·Ìc<-` 0f ,.f¼-N^Nu6*\Cü*QËÿú`êNVÿä|ÿè&jb g|ÿÿèB2*`Aÿé *fg|ÿé(j00*\j^BA.ÿéA @m¨ØÀ-Lÿì0*^@=@ÿê*NNºÊ(mÿìØíÿê , ÿÿg>$"L :m.$ :m$¹íÿìg¼0`ê(mÿìØíÿê"LSŒRG$¹íÿìfø`¶¼ *[f„JGl~B€0-ÿêD€¾@opBA-ÿéDAÒj\’j^(j0"nÿì6-ÿê¼ 0ÿGD€S‰J@g³Ìmô&ƒéQËÿú¼. ) ÿÿf|0ÿÿ .ÿÿèfÄ“ÀS‰³Ìm¾¼-`²0-ÿêjRÐG;@ÿäCíÿä+Iÿô;|ÿò;|ÿð(j0Øê\+LÿøB€-ÿé™ÀØü+LÿüNºf0-ÿð(mÿüJ@g8B2A¼+ 4-f¼-¼ @AJAm¼0ÿ@QÉÿð|Dÿÿ *fg|EÿÿBA-ÿéDAÒj\’j^ÒjR(j0 j^g4*RJBnmv¼.ÿ`Ž´j^b"&mÿì·ÌgÔBƒ6C"KS‰ÛQËÿü¼.`r6–j^C8˜jR¸Cm¦&mÿì"K“ÃB…:*^EÛQÍÿü:Eü0QÍÿú¼.`0 Acr¼.ÿCô6DCCü0QËÿú Ac¼0þ .ÿÿèf< Bb Am4gA¼-þ`"´j^b Dm¼-@þ`C¸Cm ¼-@úN^Nu(j06*\Cü*QËÿú`æ*ggNºûNugNºüÜNugNº NuNº"Nu(j0Øê\<F"jbJ‘g<TAÿÿNuB*[ $f*f5A\(j0&jb2*\Bƒ*f’CgmØÁ`ÖACÛQËÿüNu(j0&jbØê\BC*fÖÃÆü¶j\c6*\JCg CB# m0QËNuQÉÿàèH`ÜNVÿþ&mÿô6-ÿò| ÿÿ(mÿø Cb&gB2JAlDA|-ÿÿ`"JlD|-ÿÿB€` "+B„B…B†B‡:H@8>HA<" Db Eb Fb* ‡'mB`0ˆü' "a’(*Šü' "a‚*,Œü' "ar,.Žü' Bab.HA`B‡vJAg‚ü HA0BAHA¹íÿügb0QËÿâJDfBJEf>JFf:JGf6¹íÿøf<0 .-ÿÿf ¹íÿüg0<-™íÿü;LÿðN^Nu$BBH@B@H@Ò‚NuJCkÿ4<0QËÿô`ÿ((mÿüü*¹íÿøföN^NuNVÿÈ"jb € €f4 *fg ") f "mÿìBƒ6-ÿêCü0QËÿú>-ÿêDGN^Nu *fgH"€ÿÿ€HAîI4 f4<Bãˆgô€Bvâˆâ‘QËÿúB€éJHBBB€‚`")Cú úB‡$‚ðfAúL/ / //N‘ "><ÿà$‚ðHB€ÿÿ€C0-@ÿè-AÿìB@(HBBƒ-Bÿð-CÿôD?ð:<ÑÉÅHD DnDÞDDDHĉü :HDçDçEAú ~ 0@"0@ Eg Aú ÔÐÅ Dg/ / //N‘ "`" Юÿð€?ðJEgm€`€ €?ðlGAúŠ/ / //N‘ "`( €@$m n mGAúh/ / //N‘ "Aîÿð/ / //N‘ "$€ÿÿÀ-@ÿø-AÿüBBHBèJB3oB&.ÿüã‹-Cÿü&.ÿøã“-CÿøQÊÿêCîÿø+Iÿô;|ÿòCîÿÈ+IÿüÒü +Iÿø;|ÿð/NºüŽ.G žmÿðžmÿê"mÿüÒíÿð&IB€*fÁü@°mÿêo0-ÿêÖÀZ@S‹ :m2 @³ËbR@€`äBƒ6-ÿêC&IÖÃcQËÿú|1RG&mÿìBƒ6-ÿêB€*fÁü@¶@o60CÙQËÿü°mÿêg$ * [g6-ÿê–@0ÖG¶@bCkü0QËÿúN^NuF“¸µµn@$. ?¹™™™™™šHçÿþBA*[Cú$1N» LßÿNu0üüüN|Ò$ÒNVÿð=|ÿð=|ÿò=|ÿô=|ÿöjfÿ÷-jbÿø&nÿø6¼ .ÿ÷g7| .ÿ÷g'|(j0"LÒê\-Iÿü*NNºb¹íÿüg5|nx|zNºç, mÿôg&5|qx|€zNºç"mÿø2¼ÿ -ÿ÷g"¼ÿÿÿ -ÿÿðf"mÿø -ÿ÷g2DA2`"D"N^NuNVÿè=|ÿè=|ÿê=|ÿî=|ÿð=|ÿò=|ÿô|ÿöjfÿ÷-jbÿø(j0"LÒê\-Iÿü*NNºêN^Nu*ggNºþÖNugNºÿ–NugNº NuNºZNuNVÿü(j0"LÒê\-Iÿü¹îÿüg2  gô ,.ÿÿg ,Tÿÿfr`¹îÿüg  gô ,Tÿÿfr`B"jb"N^NuB*[ $f*f5A\(j0&jb2*\Bƒ*f’CgmØÁ`ÖADAÖÃAü QÉÿú&jbCÜQËÿüNu(j0Øê\&jbB€*fJ@gb@üQÈÿúBƒ6*\B@*fÀü¶@m6JCg<C$ f *ÿTfQËÿîNu 0mT 9c FbH @ÿÿQËNu$ f *ÿTfQËÿîNu 0m 9c Fb éÑ#QËÿ”Nu5|px|z|{Cìÿÿ%I~NºäâB€¹íÿüfNu mÿòf +fSŒNu -fSŒNuSŒ` gÎ +g -f|ÿÿð`SŒ¹íÿüfNu 1m 9b2-ÿòA;Aÿò`( 0g gSŒNu2-ÿòJAgÀ 0gÐ *ÿTg²`Æ4-ÿô Bg B;Bÿô`œ"mÿø6-ÿö Cmb4(ã„ir*å…ilØ…ihØ€id"„`ÿt8ãDiX:åEiRØEiNØ@iJ2„`ÿZ(*)B‚ãÕ‚ã„i4Ø‚i0,.B‚ãÕ‚ãJBƒãÕƒå„iØ‚iÚ‡Ù†iÚ€Ùƒi "„#E`ÿ;|ÿô`ÿ NVÿò=mÿöÿú-mÿøÿüCîÿò+Iÿø;|ÿö-|ÿò-|ÿöNºþ;mÿôÿê¹íÿüf2-ÿê’j^;Aÿê`: Eg4 Dg. +g( -g" .g +g¶ -f|ÿÿî`¦2-ÿê’j^;Aÿê`Ð Eg( Dg"5|ox|zNVÿþ@ÿþ|{%O~Nºâܹíÿügº  fØü`ì +gL -f|ÿÿî`> 0m® 9b¨SŒ`.;|ÿòNºý¸2-ÿòA mÿêf’mÿô“mÿê¹íÿüg^`ÿFCíÿè+Iÿø;|ÿö;|ÿè;|ÿò;|ÿôNºýp¹íÿüg5|ox|z|{%L~Nºâ02-ÿè -ÿÿîfDAÓmÿê` 2-ÿê’jR;AÿêCîÿò"<B‚&f6QÉÿø"<$< &)fQÉÿöB€"nÿü"€ nÿúgò#@`ꔂ <3BéHH@ Bg6nD‚B&â‹"ƒ&)â“#CQÊÿî`B&)ã‹#C&ã“"ƒQÊÿî&ƒ€ƒ")B‚4-ÿêH ‚gÀ…ü 6HB BlB C C"nb CÿÞmxÅüÇüCúÐ BgAúÈÐÂ///(/N‘ "JCglAúÐÃ///(/N‘ "$BBHBèJ8< é¨è¨JCmB€ Bÿlø`DB€ BÿËoJBl4ÀDBB„â‰dxâˆdÁQÊÿîB‚Ò„Ñ‚B‚`$BBHBèJ8< é¨è¨ nÿúftBÿB Bÿlš Bÿèo°À8HDHA8HAçˆç‰çŒJBnBDBB„8B‚è¨e`"HA2HAHD0g€gâˆR‚eî€(<骀‚`€(<骀‚"nÿü"€ nÿúg#A -ÿÿðf"nÿüÑN^Nu5|rx <€ nÿúg <ðB` 5|sxB€B|€zNºßª`¦=Û|ßÙ×½»>. è&Ö•>EyŽâ0Œ:>z×òš¼¯I>°Æ÷ µí>äøµˆãhñ?6âëC-?PbMÒñ©ü?„záG®{?¹™™™™™š?ð@$@Y@@@È@øjA.„€AcÐA—ׄAÍÍeWUÜ/ôGÜk*} IpË èðX’h‹pæ+ ¥nÂøóa ¸ò°a® | Í ¤‘ë’àçÉî¼DSó®5‘õ´âé?]¢‚S¬ ù¹æh/ 䃑˜äBÝMç U aÖ©Áh~’N÷³ |ƒç­No"™›úXÏ$£R›§Ñžº&¶~œ{n}(Ê/çj?”}*Þ|_{Ø„,ñ¾½õx²ù/¨rŸÃݼ1 ?syö3+ÿ.äŽ45@KÙ„™r7Rø¬Ma$9fé5ž;y¶ª¬¦&=îzJÔ¸?¡l&'wWœA´HKþëŸCÇœ¡ ’B#EÛ|ßÙ×½»7ð: _ <¯xµŒ@>)>Y9 Œê@=c)ñÃ\¦BQÅ~dšDcéääÂóDFw.ºÖÝÇ=HŠüïQðû_JŸk )YÇL²I­%”Ã|NÅJ0GÆ”ýPØÈÚÆ 4)RìÚb[-UËpÒKsxW5.P–®Y&ÂÔ%oüÁ[:REå¢Î]NØÓNTs_aôޝ#JÓatç××bYcˆU12k»eœT»’ãåg°}Eq$:iÃ24Þz×àkÖXã«yRmêýâÊéoþI@4çžTr üfЬjt$…ΞzWv7ä<ˆu‘xKÐ<@inz`0…å>Y’|rØÜV¡4~…ðàGs~/2H@S@ØSAgQÈÿøSAü QÉÿú"NuHç@ 2H@€°AlÅHÁAÀSAS@± VÉÿúggÅH °"LßNuS@k"  VÈÿúgLßf Nu< ° NuLßDüNuHçÿNVLî(J€fJgÂJ‚fJƒg’(µ„/*.…ÿÿ‡ÿÿB@BBH@HB<<ðÀFÄF°Fgl´FgfJ@fB„Dfãã‰dÅD`êDÅJBfBDDfãã‹dÇD`ê”DÇÔ@/8<ãã‰dÅãã‹dÇQÌÿê8<HAHC $H@HBÌÀÈÂBFBDHFHDÜ„8ÈÅBDHDÜ„8ÈÇBDHDÜ„B„ÆÀÂÂÖdx"ÂÇÖd„܃d„ÎÀÊÂÞ…d(<*BEHEHGBGÞ†d„ÀÂЅЄ" d€BC8<gD6<JDgâ‰âˆdÁSD`î$(/ÔCB?ðc B¿Ðb Bðj,`4DBBèŠ B5jJBg"â‰âˆdÁB`ìB€B` YB <ð` €HBBB€‚gÀ €€fJfB€Hî0N^LßÿPNÐDCO1(' ***** DC OUTPUT MODULE TEST PROGRAM ****** ',A4)(' ')(' NON-EXISTANT TASK - ',A4)(' OPEN & OUTPUT TO EACH CHANNEL INDIVIDUALLY')(' CALL OPEN - ERROR')(' CALL OUT - ERROR')(' OPEN & OUTPUT TO EACH CHANNEL UNTIL ALL ARE ON')(' CLOSE CHANNELS, OUTPUTS SHOULD TURN OFF')(' TURN ON ALL OUTPUTS, THEN TURN OFF')(' PULSE EACH OUTPUT IN TURN')(' TRY COMMANDS WITH CHANNELS CLOSED')(' CALL CLOSE AND CHANNELS CLOSED--OK')(' CALL CLOSE - ERROR')(' CALL OUT AND CHANNELS CLOSED--OK')(' CALL OUT - ERROR')(' CALL OFF AND CHANNELS CLOSED--OK')(' CALL OFF - ERROR')(' CALL STATUS AND CHANNELS CLOSED-OK')(' CALL ST/ ATUS - ERROR')(' CALL PULSE AND CHANNELS CLOSED--OK')(' CALL PULSE - ERROR')(' TRY CALL OPEN AND ALREADY OPENED')(' CALL OPEN AND CHANNELS ARE OPEN-OK')(' CALL OPEN - ERROR')('********* TEST COMPLETED **********')DCO2DCO2(' STATUS ERROR-BIT ',I1)(ÿÿÿÿZIO 'RIODRV TESTE AFééqqTESTE LFòò qqTESTE SAûûqqTESTRIO AF$$qqTESTRIO LF--qqTESTRIO SA66WqqTESTE LO‡qqTESTRIO LO qq=/*=/*†RIODRV.TESTE.AF=/*:=/* Chain file to assemble RIO driver test routine 'TESTE'=/*:=/* If no output argument is specified for the listing the.=/* chain file will default to RIODRV.TESTE.LS=/*=/IFC \1ƒ=ARGRIODRV.TESTE.LS=/ENDIF=/*)=ASM RIODRV.TESTE.SA,RIODRV.TESTE.RO,\1;R=/*{ Included files are:=/*ƒ--none--=/*}=/*=ENDééééé/ éá=/*=/*†RIODRV.TESTE.LF=/*=/*=/IFC \1ƒ=ARGRIODRV.TESTE.LL=/ENDIF=/*=LINK ,RIODRV.TESTE.LO,\1;MIXHS SEG SEG0:0 $0INPUT RIODRV.TESTE.ROEND=/*=ENDéééééééêŠOPT„EQU5*This is TESTE the version that tests wait for event. ŠSECTION0 PBA‡EQU„*TEST†LEA„PBA(PC),A6ŠLEA„STACK-PBA(A6),A7+ŠCLR.L‚EVENTCNT-PBA(A6)ƒcleareventcounter* *‚GETA.S.Q.1ŠLEA„ASQBLOCK-PBA(A6),A0stagecommandparametersŠLEA„TESTIRQ-PBA(A6),A1ŠMOVE.LA1,ASQBLOCK+14-PBA(A6)!ŠMOVE.L#31,D0‚stagecommandcodeŠTRAPƒ#1 ŠBNE„FAULT2*‚OPENTHECHANNELS 3ŠLEA„INITIO-PBA(A6),A0‚pointtoCMRparameterblockŠLEA„OPNCMD-PBA(A6),A1ŠMOVE.LA1,CMDA-PBA(A6)ŠMOVE.W#OPNLNG,CMDL-PBA(A6)ŠMOVE.L#60,D0ŠTRAPƒ#1 ŠBNE„FAULT1**** WAIT EQU **‚REQUESTWAITFOREVENTŠMOVE.L#36,D0ŠTRAPƒ#1 ŠBNE„FAULT3**RUNTEST*‚readstatusofchannel‚10**‚stagecodeforreadcommandŠLEA„STATCMD-PBA(A6),A1ŠMOVE.LA1,CMDA-PBA(A6)-ŠMOVE.W#6,CMDL-PBA(A6)„setupcommandlengthŠMOVE.L#60,D0setupCMRcallŠTRAPƒ#1 ŠBNE„FAULT7ŠSPC„2*Pulse channel 7ŠLEA„PLS7-PBA(A6),A1ŠMOVE.LA1,CMDA-PBA(A6)ŠMOVE.W#12,CMDL-PBA(A6)ŠMOVE.L#60,D0ŠTRAPƒ#1 ŠBNE„FAULT10ŠSPC2*Pulse channel 8ŠLEA„PLS8-PBA(A6),A10 éééó7üF  MFŠMOVE.LA1,CMDA-PBA(A6)ŠMOVE.W#12,CMDL-PBA(A6)ŠMOVE.L#60,D0ŠTRAPƒ#1 ŠBNE„FAULT11*Pulse channel 9ŠLEA„PLS9-PBA(A6),A1ŠMOVE.LA1,CMDA-PBA(A6)ŠMOVE.W#12,CMDL-PBA(A6)ŠMOVE.L#60,D0ŠTRAPƒ#1 ŠBNE„FAULT12* *Inc EVENTCNTŠADD.L‚#1,EVENTCNT-PBA(A6)**If EVENTCNT = 10 THENŠCMP.L‚#10,EVENTCNT-PBA(A6) ŠBEQ.S‚TEST1*DO*‚disablechannel1interupts*‚waitforevent*END*IF EVENTCNT >= 20 THENŠCMP.L‚#20,EVENTCNT-PBA(A6) ŠBGE.S‚TEST2*DO*‚EVENTCNT=0*‚enablechannel1interrupts*‚waitforevent*END*ELSE*DO ŠBRA.S‚TEST3#*‚toggleoutputonsucessiveevents*END** TEST1…EQU„*!*Stage code for disable channel 1ŠLEA„INITIO-PBA(A6),A0ŠLEA„DSA1-PBA(A6),A1ŠMOVE.LA1,CMDA-PBA(A6)ŠMOVE.W#6,CMDL-PBA(A6)ŠMOVE.L#60,D0ŠTRAPƒ#1 ŠBNE„FAULT8 ŠBRA„WAIT* TEST2…EQU„*ŠCLR.L‚EVENTCNT"* Stage code for enable interruptsŠLEA„INITIO-PBA(A6),A0ŠLEA„ENA1-PBA(A6),A1ŠMOVE.LA1,CMDA-PBA(A6)ŠMOVE.W#6,CMDL-PBA(A6)ŠMOVE.L#60,D0ŠTRAPƒ#1 ŠBNE.S‚FAULT9 ŠBRA„WAIT* TEST3…EQU„*-*toggle EVENTCNT & output on sucessive eventsBŠBTSTƒ#0,EVENTCNT+3-PBA(A6)MickyMousewaytotestLSbyteinmem ŠBNE.S‚LAMPON*Stage code for OFF-ŠLEA„INITIO-PBA(A6),A0‚pointtocommandtableŠLEA„OFFCMD-PBA(A6),A1;ŠMOVE.LA1,CMDA-PBA(A6)„passaddressofRIOparameterblock+ŠMOVE.W#6,CMDL-PBA(A6)„passcommandlengthéé)ŠMOVE.L#60,D0setuptrap1servicecodeŠTRAPƒ#1‘callforservice"ŠBNE.S‚FAULT6branchontraperror ŠBRA„WAITŠSPC„3#LAMPONEQU*‚turnoutput(lamp)on.**Stage code for ON-ŠLEA„INITIO-PBA(A6),A0‚pointtocommandtableŠLEA„ONCMD-PBA(A6),A1;ŠMOVE.LA1,CMDA-PBA(A6)„passaddressofRIOparameterblockéé0 éééé#ŠMOVE.W#6,CMDL-PBA(A6)„passlength/ŠMOVE.L#60,D0setuptrap1servicerequestcodeŠTRAPƒ#1 ŠBNE.S‚FAULT5ŠBRA„WAITwaitfornexteventŠSPC„8*‚CLOSECHANNELSŠLEA„CLSCMD-PBA(A6),A1ŠMOVE.LA1,CMDA-PBA(A6)ŠMOVE.W#CLSLNG,CMDL-PBA(A6)ŠMOVE.L#60,D0ŠTRAPƒ#1 FAULT1„NOP FAULT2„NOP FAULT3„NOP FAULT4„NOP FAULT5„NOP FAULT6„NOP FAULT7„NOP FAULT8„NOP FAULT9„NOP FAULT10ƒNOP FAULT11ƒNOP FAULT12ƒNOP*‚DE-ACTIVATESELF ŠMOVE.L#15,D0ŠTRAPƒ#1ŠSPC„10A*ƒ---ƒ---ƒ---MOVETHEASQMESSAGEFROMTHEASQTORCVBUF‚---‚---ŠSPC„18TESTIRQƒEQU„*‚entrypointmovingdatafromASQtoRCVBUFŠLEA„RCVBUF-PBA(A6),A0!ŠMOVE.L#34,D0„stagecommandcodeŠTRAPƒ#1 ŠBNE.S‚FAULT4*‚RETURNFROMEVENT ŠMOVE.W#1,A0!ŠMOVE.L#37,D0„stagecommandcodeŠTRAPƒ#1ŠRTS  ASQBLOCK‚EQU„*ŠDC.Lƒ0‰tasknameŠDC.Lƒ0‰dummyfield1ŠDC.B†5‰initialstatusofASQ=ASQ&ASRenabled"ŠDC.B†16ˆlengthofmessageforASQŠDC.L†64ˆstoragefor4events4ŠDC.L†0‰logicaladdressoftargettaskasyncsvcrtnŠDC.L†0‰dummyfield*%RCVBUFƒDS.L†64ˆdefinerecieverbufferEVENTCNTDS.L†1‰eventcounter**‚CMRPARAMETERBLOCK*INITIO„DC.Bƒ7,0,0,0ŠDC.Lƒ'RI01'†TASKNAME ŠDC.Lƒ0,0,0*CMDA†DC.Lƒ0‹addressofRIOparameterblockCMDL†DC.Wƒ0‹commandlength*&*‚RIOPARAMETERBLOCKtoopenchannels*OPNCMD„DC.Wƒ0,1ŠDC.Wƒ9‘open9channels1ŠDC.Wƒ0,$7F00‹CHAN0IRQonfall,512msdebounce1ŠDC.Wƒ1,$3F04‹CHAN1IRQonfall,255msdebounce)ŠDC.Wƒ2,4CHAN2interruptonrisingedge*ŠDC.Wƒ3,0CHAN3interruptonfallingedge&*¢CHAN4ˆ{{‚CH4ISNOGOODONHARDWAR0ŠDC.Wƒ5,1CHAN5output{{hardwarecheckedok}}ŠDC.Wƒ7,1CHAN7outputŠDC.Wƒ8,1CHAN8outputŠDC.Wƒ9,1CHAN9outputŠDC.Wƒ10,0CHAN10INPUTéOPNLNG„EQU„*-OPNCMD„lengthCLSCMD„DC.Wƒ0,2‰closecommand(CLSLNG„EQU„*-CLSCMD„closecommandlength*$*ˆRIOparameterblockforONcommand ONCMD EQU *ŠDC.W…0‰returnedcommandstatusŠDC.W…3‰OUTPUTONcommandŠDC.W…$0020…turnonchannel#5‰SPC5%*ˆRioparameterblockforOFFcommand‰SPC1 OFFCMD EQU *&ŠDC.W…0‰returncommandstatuslocationŠDC.W…4‰offcommandŠDC.W…$0020…turnoffchannel5ŠSPC5 STATCMD EQU *ŠDC.W…0‰returnedcommandstatusŠDC.W…5‰readcommandŠDC.W…$0400…readchannel10*:*ƒRIOparameterblockforDISABLEINTERRUPTSonchannel1:* DSA1…EQU*‰DC.W†0‰returnedstatus‰DC.W†7‰disableinterruptcode$‰DC.W†2‰bitmaskselectingchannel1**8*‚RIOparameterblockforENABLEINTERRUPTSonchannel1* ENA1…EQU*‰DC.W†0‰returnedstatus‰DC.W†6‰enableinterruptcode$‰DC.W†2‰bitmaskselectingchannel1******†stack‚definition* ŠDS.Bƒ$400 STACK…EQU„**PLS7:2* RIO parameter block to do 200 ms pulse on chan 7‰DC.1 W†0‰returnedcmdstatus‰DC.W†8‰pulsecommandcode‰DC.W†1‰onechannels‰DC.W†7‰pulsechannel7‰DC.L†200ˆ200mspulse‰SPC2PLS8:1*RIO parameter block to do 300 ms pulse on chan 8‰DC.W†0‰returnedcmdstatus‰DC.W†8‰pulsecommandcode‰DC.W†1‰onechannels‰DC.W†8‰pulsechannel8‰DC.L†300ˆ300mspulsePLS9:1*RIO parameter block to do 550 ms pulse on chan 9‰DC.W†0‰returnedcmdstatus‰DC.W†8‰pulsecommandcode‰DC.W†1‰onechannels‰DC.W†9‰pulsechannel9‰DC.L†550‡550mspulse ŠENDTESTé=/*=/*†RIODRV.TESTRIO.AF=/*,=/*†TESTRIOtestprogramassemblychainfile=/*6=/*†Thecommandlinewillacceptargumentsasfollows:=/*;=/*‹Argument01…\1=Outputfileassemblylistingordevice=/*H=/*†Thefollowingshowstheassemblychainsequence.‚InthisexampletheH=/*†NULLdevicewaschosenasArgument01,however,theusercouldifhe5=/*†sodesiredhaverequestedanoutputlistingfile.=/*"=/*=CHAINRIODRV.TESTRIO.AF#NULL=/*,=/*†Defaultargument01isRIODRV.TESTRIO.LS=/*=/IFC \1ƒ=ARGRIODRV.TESTRIO.LS=/ENDIF=/*2=ASM RIODRV.TESTRIO.SA,RIODRV.TESTRIO.RO,\1;RZ=100=/*{ Included files are:=/*ƒ--none--=/*}=/*=ENDééééé=/*=/*†RIODRV.TESTRIO.LF=/*G=/*†ThischainfilewillgeneratetheTESTRIOtestprogramloadmodule.=/*5=/*†Thecommandlinewillacceptargumentsasfollows=/*7=/*‹Argument01ˆ\1=Outputfilelinklistingordevice=/*D=/*†Thefollowingshowsthelinkchainsequence.‚InthisexampletheF=/*†printerwaschosenasArgument1,however,theusercouldifheso2=/*†desiredhaverequestedanoutputlistingfile.=/* =/*=CHAINRIODRV.TESTRIO.LF#PR=/*,=/*†Defaultargument01isRIODRV.TESTRIO.LL=/*=/IFC \1ƒ=ARGRIODRV.TESTRIO.LL=/ENDIF=/*!=LINK ,RIODRV.TESTRIO.LO,\1;HAMIXSEG SEG0:0,1,8,14 $000000ATTRIBUTES D PINPUT RIODRV.TESTRIO.ROLIB 0.&.UTILIB.ROEND=/*=END1 ééééé%N*******************************************************************************Ì**Ì**™RIO1…TestProgramž**Ì**Ì*N********************************************************************************2* This program was written to test the RIO driver.**    *‰ModificationHistoryN*-----------------------------------------------------------------------------*11/02/84‡DUHInitialwriting   *1.‚Introduction*D*‰ThisprogramwaswrittentotesttheRIOdriver.‚ThisprogramwillJ*‚askforthechannelnumber.‚Itwillthenputupamenuforthefollowing *‚functions:*…1.‚Turnanoutputchannelon. *…2.‚Turnanoutputchanneloff.*…3.‚Pulseanoutputchannel.)*…4.‚Readthestatusofaninputchannel.:*…5.‚Enableandwaitforaninterruptonaninputchannel.*6*‰Thisprogramassumestheboardisjumperedasshown:*%*„J9‚1,2‚3,4‚7,8…addressoffset$0021=*„Theinterruptlevelforall4interruptsshouldbeonINT3.*ŠPAGE ,*£ASCVAL,BHLCVT,andCVT2arecommonlyused**£functionswhicharemodulesinalibrary(*£filecalledUTILIB.RO.‚Acalltothese'*£functionsareincludedinthissource)*£program,whichisprovidedwithanXREF&*£declaration.‚Thisalsorequiresthat'*£UTILIB.RObeavailabletothelinkage$*£editorduringthelinkingprocess.!*£SeeRIO.LFforlinkchainfile. -ŠXREFƒASCVALConvertsASCIItoabinaryvalue$*£ThisroutinewillconvertanASCII,*£characterstringrepresentingadecimalor,*£hexidecimalvaluetotheequivalentbinary,*£value.‚Ifadollarsign($)isencountered&*£hexidecimalconversionisperformed;,*£otherwisedecimalconversionisperformed.+*£Anemptycharacterstringfieldpassedto,*£thisfunctioninA0producesazerobinary'*£value.‚Conversionterminateswhenthe)*£firstinvalidcharacterisencountered.'*£ENTRY:‚A0-StartingaddressofASCII*°characterstringtoconvert#*£EXIT:‚D1-Characterthatcaused *°termination%*«D2-Classcodeofterminatingchar.B7;??GGOIW7_OgCoWwXB"*«D3-Binaryresultofconversion*«A0-Addressofthecharacter *°followingtheterminatingchar 8ŠXREFƒBHLCVTConverts4-bytebinaryvaluetoASCIIdigit)*£Thisroutinewillconvertalongbinary-*£wordvaluetoahexadecimalvalueexpresse2 d)*£asan8characterASCIIstring.‚Leading*£zerosaresuppressed.,*£ENTRY:‚D0.L-Binaryvaluetobeconverted(*£EXIT:‚D2.L-Fourhighorderbytesof*²convertedvalue *«D3.L-Fourloworderbytesof*²convertedvalue 6ŠXREFƒCVT2ConvertstwoASCIIdecimaldigitstobinary-*£ThisroutinewillconverttwoASCIIdecimal(*£digitstotheequivalentbinaryvalue.+*£Anemptycharacterstringfieldpassedto,*£thisfunctioninA0producesazerobinary**£value.‚Conversionterminateswhenanon-*£decimaldigitisencountered)*£ENTRY:‚A0-Addressofmostsignificant*°ASCIIdecimaldigit)*£EXIT:‚D0-Binaryresultofconversion!*«A0-Addressoftheterminating *°character ŠPAGEŠMOVE.LA0,IOSOUT+16-PBA(A4)SettheendingaddressofmessageŠLEA„IOSOUT(PC),A0ŠTRAPƒ#2ŠENDM ŠPAGE 2ŠOPT„PCSWeuseaPCSoptionsotheassemblerwill%*£forcePCrelativeaddressingwithin(*£SECTION.‚ForcesPCrelativeaddressing-*£(wheneversuchanaddressingmodeislegal))*£inaninstructionwhichoccurswithina'*£relocatableSECTIONandreferencesan,*£operandinarelocatableSECTION(neednot**£bethesameSECTIONastheinstruction).,*£Failuretoresolvesucnareferenceintoa-*£16-bitdisplacementfromthePCwillresult)*£inanerror.‚Thisoptionmaybeusedto+*£forcepositionindependentcode;however,(*£thisoptiondoesnotforcePCrelative,*£addressingofabsoluteoperandsorunknown*£forwardreferences. ŠPAGE N*******************************************************************************Ì**™DATAƒSECTIONœ**Ì*N****************************************************************************** ŠSECTIONDATA $PBA‡EQU„*’ProgramBaseAddress(PBA)%*£Thislabelisusedtodesignatethe+*£beginningoftheprogram.‚Thisisusedto'*£makereferencestootherpartsofthe*£program,relocatable. 6ŠDS.WƒSTACKLEN‹ThisisthestackareafortheRIOtest2STACK…EQU„*’program.‚Registersandotherimportant,*£informationwillbestoredonthestackas)*£theprogramisexecuted.‚Thestackarea'*£isdynamicandwillchangeduringthe *£executionofthetestprogram. =INPUTBUF‚DS.WƒSTRNGLEN‹Thisisthestorageareafortheinput*£stringsthatareentered. 9STATUS„DS.Lƒ1’Thiswillbethestorageareforthestatus,*£codethatisreturnedfromCMR.‚Thisvalue-*£willbedisplayedtoshowtheuserwhatthe*£errorcodewas. 6NUMBER„DS.Lƒ2’SaveareafortheASCIIvalueofSTATUS.ŠPAGE N*******************************************************************************Ì*!*–PARAMETERƒBLOCKS—**Ì*N****************************************************************************** ŠNEXTWB”ForceevenboundaryIOSOUTŠDC.Bƒ0’Requestcode"ŠDC.BƒWRITEŽFunctionspecificationŠDC.Wƒ8’OptionsŠDC.Bƒ0’StatusŠDC.BƒCRTLogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress   ŠNEXTWB”ForceevenboundaryIOSINŠDC.Bƒ0’Requestcode!ŠDC.BƒREADFunctionspecificationŠDC.Wƒ0’OptionsŠDC.Bƒ0’Status"ŠDC.BƒKEYBOARD‹LogicalunitnumberŠDC.Wƒ0’ReservedŠDC.Lƒ0’RandomrecordnumberŠDC.Lƒ0’StartaddressŠDC.Lƒ0’EndaddressŠDC.Lƒ0’LengthofdatatransferŠDC.Lƒ0’Completionaddress  CMRBLK„DC.Bƒ7’InitiateI/OŠDC.BƒUNUSEDUnusedŠDC.WƒUNUSEDUnusedŠDC.Lƒ'RI01'ChannelnameŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnusedŠDC.LƒUNUSEDUnused$ŠDC.Lƒ0’AddressofI/Ocontrolblock#ŠDC.Lƒ0’LengthofI/OcontrolblockŠPAGE*2*‚OPENcommandparameterblockfortheRIOdriver:+OPEN_RIO‚DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒOPENOpencommandcodeŠDC.Wƒ1’#ofchannelstoopen-ŠDC.Wƒ0’Channeltoopen(Dynamicallychanged)-ŠDC.WƒDEFAULTŒChannelconfiguration(Dynamic)6OLEN_RIO‚EQU„*-OPEN_RIO‰LengthofOPENparameterblock*=*‚STARTOUTPUTONcommandparameterblockfortheRIOdriver:)ON_RIO„DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒON‘ONcommandcode2ŠDC.Wƒ0’Bitmaskforchannelstoturnon(Dynamic)2NLEN_RIO‚EQU„*-ON_RIO‹LengthofONparameterblock*=*‚TURNOUTPUTOFFcommandparameterblockfortheRIOdriver:*OFF_RIOƒDC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒOFFOffcommandcode3ŠDC.Wƒ0’Bitmaskforchannelstoturnoff(Dynamic)4FLEN_RIO3 ‚EQU„*-OFF_RIOŠLengthofOFFparameterblock*;*‚PULSEDOUTPUTcommandparameterblockfortheRIOdriver:*PON_RIOƒDC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒPULSEŽPulsecommandcodeŠDC.Wƒ1’#ofchannels,ŠDC.Wƒ0’Channelnumber(Dynamicallychanged)/ŠDC.Lƒ0’Timeofpulseinmilliseconds(Dynamic)6PLEN_RIO‚EQU„*-PON_RIOŠLengthofPULSEparameterblock*?*‚READINPUTSTATUScommandparameterblockfortheRIOdriver:+READ_RIO‚DC.Wƒ0’Returnedstatusfromdriver*ŠDC.WƒREAD_STATUSˆReadstatuscommandcode.ŠDC.Wƒ0’Bitmaskforchannelstoreadandupon(*§returnholdstheactualchannelstatus=RLEN_RIO‚EQU„*-READ_RIO‰LengthofREADSTATUSparameterblock*?*‚ENABLEINTERRUPTScommandparameterblockfortheRIOdriver:+ENAB_RIO‚DC.Wƒ0’Returnedstatusfromdriver-ŠDC.WƒENAB_INT‹Enableinterruptscommandcode2ŠDC.Wƒ0’BitmaskforchannelstoenableinterruptsCELEN_RIO‚EQU„*-ENAB_RIO‰LengthofENABLEINTERRUPTSparameterblock*?*‚ENABLEINTERRUPTScommandparameterblockfortheRIOdriver:+DISB_RIO‚DC.Wƒ0’Returnedstatusfromdriver.ŠDC.WƒDISAB_INTŠEnableinterruptscommandcode3ŠDC.Wƒ0’Bitmaskforchannelstodisableinterrupts>DLEN_RIO‚EQU„*-DISB_RIO‰LengthofDISABLEINTERRUPTSparameter*3*‚CLOSEcommandparameterblockfortheRIOdriver:)CLSBLK„DC.Wƒ0’ReturnedstatusfromdriverŠDC.WƒCLOSEŽClosecommandcodeCLOSLENƒEQU„*-CLSBLKŠNEXTWBŠPAGE N*******************************************************************************Ì**œMESSAGES¡**Ì*N****************************************************************************** ŠSECTIONMESSAGES 5HEAD†DC.BƒCR,LF,LF,'RIODriverTestProgram',CR,LF,LF HEADE…EQU„*-1ŠNEXTWB+MESS1…DC.BƒCR,LF,LF,'…0=OUTPUTON.',CR,LFMESS1E„EQU„*-1ŠNEXTWB#MESS2…DC.Bƒ'…1=OUTPUTOFF.',CR,LFMESS2E„EQU„*-1ŠNEXTWB=MESS3…DC.Bƒ'…2=PULSEANOUTPUTFORASPECIFIEDTIME.',CR,LFMESS3E„EQU„*-1ŠNEXTWB6MESS4…DC.Bƒ'…3=READTHECURRENTINPUTSTATUS.',CR,LFMESS4E„EQU„*-1ŠNEXTWB0MESS5…DC.Bƒ'…4=ENABLEFORANINTERRUPT.',CR,LFMESS5E„EQU„*-1ŠNEXTWBMESS6…DC.Bƒ'…5=QUIT.',CR,LFMESS6E„EQU„*-1ŠNEXTWB5MESS10„DC.BƒCR,LF,'STATUSOFALLCHANNELS(ASCII)='MESS10EƒEQU„*-1ŠNEXTWB2MESS11„DC.Bƒ'…Numberofthechanneltoconvertˆ>'MESS11EƒEQU„*-1ŠNEXTWB)MESS12„DC.Bƒ'…Enteroneoftheabove...'MESS12EƒEQU„*-1ŠNEXTWB9MESS13„DC.Bƒ'…Time(inmilliseconds)foroutputpulse>'MESS13EƒEQU„*-1ŠNEXTWB2MESS14„DC.BƒCR,LF,'<<>>',CR,LFMESS14EƒEQU„*-1ŠNEXTWB1MESS15„DC.BƒCR,LF,'<<>>',CR,LF,LFMESS15EƒEQU„*-1ŠPAGEŠNEXTWB6BADON…DC.BƒCR,LF,'***STARTOUTPUTONABORTED***--'BADONE„EQU„*-1ŠNEXTWB7BADOFF„DC.BƒCR,LF,'***TURNOUTPUTOFFABORTED***--'BADOFFEƒEQU„*-1ŠNEXTWB:BADPLS„DC.BƒCR,LF,'***STARTOUTPUTPULSEABORTED***--'BADPLSEƒEQU„*-1ŠNEXTWB,BADOPN„DC.BƒCR,LF,'***OPENABORTED***--'BADOPNEƒEQU„*-1ŠNEXTWB8BADEN…DC.BƒCR,LF,'***ENABLEINTERRRUPTABORTED***--'BADENE„EQU„*-1ŠNEXTWB:BADDIS„DC.BƒCR,LF,'***DISABLEINTERRRUPTABORTED***--'BADDISEƒEQU„*-1ŠNEXTWB4BADREADƒDC.BƒCR,LF,'***READSTATUSABORTED***--'BADREADE‚EQU„*-1ŠNEXTWB-BADCLS„DC.BƒCR,LF,'***CLOSEABORTED***--'BADCLSEƒEQU„*-1ŠNEXTWB+STATUSMƒDC.Bƒ'ErrorcodereturnedinD0='STATUSME‚EQU„*-1ŠNEXTWBCRLF†DC.BƒCR,LF CRLFE…EQU„*-1ŠNEXTWBŠPAGE N*******************************************************************************Ì**–PROGRAMƒSECTION™**Ì*N****************************************************************************** ŠSECTIONCODEPROGSTRTŠLEA„STACK(PC),A7.ŠLEA„PBA(PC),A4‰GetProgramBaseAddress(PBA) &ŠOUTPUTHEAD,HEADE‰Displaytheheading N*-----------------------------------------------------------------------------***‰Getthenumberofthechanneltoconvert*N*-----------------------------------------------------------------------------GETCHAN0ŠOUTPUTMESS11,MESS11E…Channeln3 umbertoconvertŠINPUT‚INPUTBUF,INPUTBUF+8ŠLEA„INPUTBUF(PC),A0)ŠBSR„CVT2ConvertASCIIdecimaltobinary(ŠIF.LD0#0OR.LD0#15THEN.S ŒBRAGETCHANŠENDI8ŠMOVE.WD0,OPEN_RIO+6-PBA(A4)Savethechannelnumber...ŠMOVE.WD0,PON_RIO+6-PBA(A4) =ŠLEA„BIT_NUMBER(PC),A0‚Convertthechannelnumber(0-15)into7ŠLSL.B‚#1,D0Žthecorrespondingbitnumber(1,2,4,8...).ŠMOVE.W(A0,D0.W),D08ŠMOVE.WD0,READ_RIO+4-PBA(A4)Savethebitmaskvalue...ŠMOVE.WD0,ENAB_RIO+4-PBA(A4)ŠMOVE.WD0,DISB_RIO+4-PBA(A4)ŠMOVE.WD0,ON_RIO+4-PBA(A4)ŠMOVE.WD0,OFF_RIO+4-PBA(A4) N*-----------------------------------------------------------------------------*3*‰Get„0=OUTPUTON„1=OUTPUTOFFŠ2=PULSEOUTPUT0*3=READSTATUS‚4=ENABLEINTERRUPTSƒ5=QUIT*N*-----------------------------------------------------------------------------GETCLST'ŠOUTPUTMESS1,MESS1E…Putupthemenu...ŠOUTPUTMESS2,MESS2EŠOUTPUTMESS3,MESS3EŠOUTPUTMESS4,MESS4EŠOUTPUTMESS5,MESS5EŠOUTPUTMESS6,MESS6EHGET_CHOICE‚OUTPUTMESS12,MESS12EƒAsktheusertoenteroneoftheabove. +ŠINPUT‚INPUTBUF,INPUTBUF+8GettheirchoiceŠLEA„INPUTBUF(PC),A0)ŠBSR„CVT2ConvertASCIIdecimaltobinary'ŠIF.WD0#0OR.WD0#5THEN.SBRA.SGET_CHOICEŠENDIŠPAGE**‰0=StartoutputONcommand:*ŠIF.BD0#0THEN.S 'ŒBSR.L‚CLOSE_ALLˆGocloseallchannels./ŒOUTPUTMESS14,MESS14Eƒ<<<ƒStartingcommandƒ>>> >ŒMOVE.W#DEFAULT,D0†Usethedefaultconfigurationfortheopen$ŒBSR.L‚OPEN_CHANˆGoopenthechannel ŒLEA„CMRBLK(PC),A02ŒLEA„ON_RIO(PC),A1„StartoutputONparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#NLEN_RIO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1ŒIFTHEN.SŽMOVE.WON_RIO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)4ŽOUTPUTBADON,BADONE…***STARTOUTPUTONABORTED***ŽBRA.L‚SHOW_D0ŒENDI 3ŒOUTPUTMESS15,MESS15Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDIŠPAGE**‰1=TurnoutputOFFcommand:*ŠIF.BD0#1THEN.S 'ŒBSR.L‚CLOSE_ALLˆGocloseallchannels./ŒOUTPUTMESS14,MESS14Eƒ<<<ƒStartingcommandƒ>>> >ŒMOVE.W#DEFAULT,D0†Usethedefaultconfigurationfortheopen$ŒBSR.L‚OPEN_CHANˆGoopenthechannel ŒLEA„CMRBLK(PC),A03ŒLEA„OFF_RIO(PC),A1ƒTurnoutputOFFparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#FLEN_RIO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1ŒIFTHEN.SŽMOVE.WOFF_RIO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)6ŽOUTPUTBADOFF,BADOFFE„***TURNOUTPUTOFFABORTED***ŽBRA.L‚SHOW_D0ŒENDI 3ŒOUTPUTMESS15,MESS15Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDIŠPAGE**‰2=PULSEanoutputcommand:*ŠIF.BD0#2THEN.L3ŒBSR„GET_TIME‰Getthepulseduration(milliseconds)+ŒMOVE.LD3,PON_RIO+8-PBA(A4)Storethetime 'ŒBSR.L‚CLOSE_ALLˆGocloseallchannels./ŒOUTPUTMESS14,MESS14Eƒ<<<ƒStartingcommandƒ>>> 6ŒMOVE.W#DEFAULT,D0†UsetheWAKEUPoptionfortheopen$ŒBSR.L‚OPEN_CHANˆGoopenthechannel ŒLEA„CMRBLK(PC),A06ŒLEA„PON_RIO(PC),A1ƒStartoutputpulseparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#PLEN_RIO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1*7*ƒDRIVERDOESNOTSUPPORTWAKEUPAFTERANOUTPUTPULSE.**‹MOVE.L#19,D0 *‹TRAPƒ#1 ŒIFTHEN.SŽMOVE.WPON_RIO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)9ŽOUTPUTBADPLS,BADPLSEƒ***STARTOUTPUTPULSEABORTED***ŽBRA.L‚SHOW_D0ŒENDI 3ŒOUTPUTMESS15,MESS15E…***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDIŠPAGE* *‰3=Readinputstatuscommand:*ŠIF.BD0#3THEN.L /ŒOUTPUTMESS14,MESS14Eƒ<<<ƒStartingcommandƒ>>> ŒBSR.L‚CLOSE_ALL'ŒMOVE.W#$000E,D0ˆSetforinputchannel$ŒBSR.L‚OPEN_CHANˆGoopenthechannel ŒLEA„CMRBLK(PC),A06ŒLEA„READ_RIO(PC),A1‚ReadinputstatusparameterblockŒMOVE.LA1,$14(A0)ŒMOVE.W#RLEN_RIO,$18(A0)ŒMOVE.L#CMR,D0ŒTRAPƒ#1ŒIFTHEN.SŽMOVE.WREAD_RIO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)4ŽOUTPUTBADREAD,BADREADEƒ***READSTATUSABORTED*4 **ŒENDI ŒCLR.L‚D0<ŒMOVE.WREAD_RIO+4-PBA(A4),D0‚Getthestatusvaluereturned.ŒBSR„BHLCVTConvertittoASCII9ŒMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŒMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytesŒOUTPUTMESS10,MESS10EŒOUTPUTNUMBER,NUMBER+7ŒOUTPUTCRLF,CRLFE 3ŒOUTPUTMESS15,MESS15E…***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDIŠPAGE* *‰4=Enableinterruptscommand:*ŠIF.BD0#4THEN.S /ŒOUTPUTMESS14,MESS14Eƒ<<<ƒStartingcommandƒ>>> ŒBSR.L‚CLOSE_ALL 3ŒMOVE.W#$7F0C,D0ˆEnableinterrupts,WAKEUPoption,8*‡softwaredebounce=508mSec,triggeronpositiveedge.$ŒBSR.L‚OPEN_CHANˆGoopenthechannel *(*‚Doawaituntilthedriverwakesusup*ŒMOVE.L#19,D0ŒTRAPƒ#1 ŒIFTHEN.SŽMOVE.WENAB_RIO(PC),D0ŽMOVE.LD0,STATUS-PBA(A4)6ŽOUTPUTBADEN,BADENE„***ENABLEINTERRUPTSABORTED***ŒENDI 3ŒOUTPUTMESS15,MESS15Eƒ***‚<<>>‚***ŒBRA.LGETCHANGostartover. ŠENDI    **‰5=quitcommand:*ŠIF.BD0#5THEN.S BRA.LEXITŠENDI ŠBRA.LGETCHANGostartover.ŠPAGEM*----------------------------------------------------------------------------*+*‚GETTHETIMEDURATIONFORANOUTPUTPULSE*M*----------------------------------------------------------------------------GET_TIMEŠOUTPUTMESS13,MESS13EŠINPUT‚INPUTBUF,INPUTBUF+8ŠLEA„INPUTBUF(PC),A0 ŠBSR„ASCVAL+ŠIF.LD3#1OR.LD3#$FFFFTHEN.S ŒBRA„GET_TIMEŠENDIŠAND.L‚#$0000FFFF,D3ŠRTS M*----------------------------------------------------------------------------**ƒOPENTHECHANNEL*M*----------------------------------------------------------------------------OPEN_CHANLEA„CMRBLK(PC),A0ŠLEA„OPEN_RIO(PC),A1BŠMOVE.WD0,OPEN_RIO+8-PBA(A4)‚Savetheopenconfigurationoptions.ŠMOVE.LA1,$14(A0)ŠMOVE.W#OLEN_RIO,$18(A0)7ŠMOVE.L#CMR,D0ŒHereweperformanexecutiverequesttoŠTRAPƒ#1‘invokeCMR.ŠIFTHEN.SŒMOVE.LD0,STATUS-PBA(A4)+ŒOUTPUTBADOPN,BADOPNE…***OPENABORTED***ŒBRA.S‚SHOW_D0ŠENDIŠRTS M*----------------------------------------------------------------------------**ƒOUTPUTTHEERRORCODE:*M*----------------------------------------------------------------------------:SHOW_D0ƒMOVE.LSTATUS(PC),D0†GetthestatusvaluereturnedŠBSR„BHLCVTConvertittoASCII9ŠMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŠMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytesŠOUTPUTSTATUSM,STATUSMEŠOUTPUTNUMBER,NUMBER+7ŠOUTPUTCRLF,CRLFE EXIT:ŠBSR.S‚CLOSE_ALL +EXIT_OUT:MOVE.L#15,D0TerminatethistaskŠTRAPƒ#1ŠPAGEN*-----------------------------------------------------------------------------**‚CLOSEALLCHANNEL'SROUTINE:*N*----------------------------------------------------------------------------- CLOSE_ALLŠLEA„CMRBLK(PC),A0ŠLEA„CLSBLK(PC),A1ŠMOVE.LA1,$14(A0)ŠMOVE.W#CLOSLEN,$18(A0)-ŠMOVE.L#CMR,D0ŒTellCMRtoclosethechannelŠTRAPƒ#1ŠIFTHEN.SŒBSR„BHLCVTConvertittoASCII9ŒMOVE.LD2,NUMBER-PBA(A4)‚SavetheupperfourASCIIbytes;ŒMOVE.LD3,NUMBER+4-PBA(A4)SavethelowerfourASCIIbytes,ŒOUTPUTBADCLS,BADCLSE…***CLOSEABORTED***ŒOUTPUTNUMBER,NUMBER+7ŒOUTPUTCRLF,CRLFE&ŒBRA.S‚EXIT_OUT‰Outputtheerrorcode.ŠENDI ŠRTS M*----------------------------------------------------------------------------*B*ƒTABLETOCONVERTTHECHANNELNUMBER(0-15)TOIT'SCORRESPONDING-*ƒBITMAPPEDVALUE(1,2,4,8,....$4000,$8000).*M*----------------------------------------------------------------------------'BIT_NUMBER‚DC.W‚1,2,4,8,$10,$20,$40,$805ŒDC.W‚$0100,$0200,$0400,$0800,$1000,$2000,$4000,$8000 ŠEND„PROGSTRTTESTÿÿÿÿÿ€SEG0ÿÿÿÿÿÿ4 MúÿþOîöB®ŒAîvCîb-I„pNAf*AîCîª-I¤=|*¨p Enter one of the above... Time (in milliseconds) for output pulse > <<< Starting command >>> <<< Command done >>> *** START OUTPUT ON ABORTED *** -- *** TURN OUTPUT OFF ABORTED *** -- *** START OUTPUT PULSE ABORTED *** -- *** OPEN ABORTED *** -- *** ENABLE INTERRRUPT ABORTED *** -- *** DISABLE INTERRRUPT ABORTED *** -- *** READ STATUS ABORTED *** -- *** CLOSE ABORTED *** -- Error code returned in D0 = OúüIúûHAúý)HDAúý)HHAúülNBAúýð)HDAúþ)HHAúüVNBAúûà)H`Aúûà)HdAúü\NBAúûÊaŽ €m €o`º9@’9@¨Aúìã009@²9@¸9@¾9@š9@ Aúü¤)HDAúü³)HHAúûêNBAúü¦)HDAúü³)HHAúûÔNBAúü¦)HDAúüÍ)HHAúû¾NBAúüÀ)HDAúüà)HHAúû¨NBAúüÔ)HDAúüî)HHAúû’NBAúüâ)HDAúüé)HHAúû|NBAúý0)HDAúýF)HHAúûfNBAúúð)H`Aúúð)HdAúûlNBAúúÚaž @m @o`¾ fva˜Aúý4)HDAúýG)HHAúûNB0<aèAúûDCúûf!I1|pACIADRVƒIDNTƒ4,1‡VERSADOSACIATERMINALDRIVERWITHTYPE-AHEAD;ŠTTL„ACIADRV:‚VERSADOSACIATERMINALDRIVERWITHTYPE-AHEAD ŠLLENƒ120J**************************************************************************J***************************************************************************9*‰ACIADRV:‚VERSAdosACIAterminaldriverwithtype-ahead.*8*‰Purpose:‚VERSAdosdevicedrivertohandleasynchronous/*terminals(ofanytype)overtheACIAchipon*thefollowingboards:*’DEBUG(EXORmacs),…MVME110**‰Revisionhistory:*8*12/17/84‚InterruptroutineandRCAroutinemodifiedto1*špreventtheEDITORfromhanging.‚Wemustdetect5*šend-of-breakbeforecheckingthereceivedcharacter4*šforbit7set(garbagecharacteratend-of-break).6*11/21/84‚Modifiedtheinterruptroutine.‚TheSpecial0*šReceiveConditionroutineisexecutednowonly1*šwhentherehasbeenareceiveinterruptandSRC2*šbitsarepending.‚Thiswillpreventtheterminal/*šfromhangingwhenBREAKispressedtologon.1*10/23/84‚AllBSR'stoTERMLIBnowJSR'sincase.*šTERMLIBislocatedmorethan32Kbytesaway.3*‘9/27/84‚Addingdocumentation,INCLUDE9995files,"*šusingTERM_BREAKinSRCroutine.,*‘9/25/84‚RemovedXREFtoBREAKandGET_LEN.5*‘9/21/84‚ChangedPASS19.MPSCDRV.SAtodriveanACIA.3*‘8/30/84‚FixedSPRconcerningSETUP.‚Commentedout(*šthecodethatteststhemodembit.‚Now**šiftheoffhookbitisset,theDTRline&*šissetlow,‚whetherornotthemodem *šbitisset.*9*05/23/84‚ChangedcodethatreferencedthebaudratePIA1*šontheEXORmacstobeexecutedconditionallyif/*šthechanneltypeisa$66ora$67.‚Thiswill(*šallowtheACIADRVtoworkonaVME110.1*šChangedthecodethatresettheACIAtogetthe!*švalueforresetoutoftheCDB.0*šChangedUNSTOProutinetofixbugwhereachar(*šisdestroyedintheUSEXOFF/XONmode.2*šChangedGET_STATroutinetotestCTSbitinstead *šofDCDbit.*»KEG05/23/84ª/³X»?ÃFË6Ó>ÛBãNëGóKûJH <7*08/05/83‚ChangedToDriveAnACIAinsteadofNEC7201*šByTomAngert*7*10/19/82‚Majorrepairssothatinterruptswillnotbe3*šdisabledsolongastoscrewupSDLC.‚Revision1.**‘9/16/82‚InitialreleasebySteveFranck.*J**************************************************************************J**************************************************************************‰PAGE****‚XREF'sfromTERMLIB* ‰XREF†LOG_ERR ‰XREF†RESET‰XREF†TERM_INIT‰XREF†TERM_COMMAND‰XREF†TERM_TBE‰XREF†TERM_BREAK‰XREF†TERM_GOT_CHAR%***†XREF†TERM_UNRDYŠNotusedbyACIA.$***†XREF†MARK_DOWN‹NotusedbyACIA. *?*‚Masksdelineatingallrecognized(REC)andunrecognized(UNR)(*‚attributes(ATT)andparameters(PAR).*C*REC_ATTƒEQU„%1000111111111111‚1bitsrepresentdefinedattributes.D*UNR_ATTƒEQU„$FFFF-REC_ATT†The1'scomplementofthatareundefined. C*REC_PARƒEQU„%0111111111111111‚1bitsrepresentdefinedparameters.D*UNR_PARƒEQU„$FFFF-REC_PAR†The1'scomplementofthatareundefined.***‚Equatefilesincluded:**‰STR*‰TCB*‰CCB*ˆ9995..BAB.EQ*‰IOE*‰NIO*‰LV5#*‰TERMINAL.EQˆEquatesforterminals *‰UTILITY.MC:*‰TERMCCB.EQ‰OffsetsandequatesforCCBDDPforterminals.*ŠPAGE**‚6 ACIAequates:* CREG†EQU„0 SREG†EQU„CREG DREG†EQU„2,RDRFBITƒEQU„0’Receivedataregisterfullbit.TDREBITƒEQU„1’Transmitdataregisteremptybit$DCDBIT„EQU„2’DataCarrierDetectbitCTSBIT„EQU„3’ClearToSendbit'OVRNBITƒEQU„5’Receiveddataoverrunbit**%*‰SPECIALEQUATEFORTHEEXORMACSPIA*0BAUDPIAƒEQU„$FEE001ŒBaudratePIAdeviceaddress(*£AddressofPIAonEXORmacsDebugboard#*£tosetthebaudratefortheACIA****‡PAGEŠNOLIST ŠTTL…STR.EQŠINCLUDE9995.&.STR.EQŠNOLISTŠINCLUDE9995.&.TCB.EQŠNOLISTŠINCLUDE9995.&.CCB.EQŠNOLISTŠINCLUDE9995.&.IOE.EQ‰NOLISTŠINCLUDE9995.&.NIO.EQŠNOLISTŠINCLUDE9995.&.LV5.EQ‰NOLIST‰INCLUDEƒ9995.&.BAB.EQŠLISTŠINCLUDE9995.&.TERMINAL.EQ‰PAGEŠINCLUDE9995.&.UTILITY.MCŠINCLUDE9995.&.TERMCCB.EQŠLIST‰OFFSET„TERMDDP */*‚DevicedependentBackgroundactivationblocks$*‚NonerequiredfortheACIAdriver.**7RESERVE.1XINTENAB‘Valuetoputincontrolregisterto*§enabletransmitinterrupts. 7RESERVE.1XINTDISA‘Valuetoputincontrolregisterto*§disabletransmitinterrupts. 0RESERVE.1XRTSHI“ValuetomakeRTSlinegoHIGH *ƒfortheMPSCdriver.‚CMRautomaticallyallocatesonepageofA*ƒmemory($100bytes)fortheCCB,andourvariableEXTCCBSZwillB*ƒresideintheCMRparametertableatthebeginningofthedriver8*ƒtotellCMRhowmanyextrapagesofmemoryareneeded.**CCBSIZEBEQU‡*PAGESIZEEQU‡$100L1‡SET‡CCBSIZEB+PAGESIZE-1CCBSIZE‚EQU‡L1/PAGESIZEEXTCCBSZEQU‡CCBSIZE-1;ŠTTL„ACIADRV:‚VERSADOSACIATERMINALDRIVERWITHTYPE-AHEADŠPAGEJ***************************************************************************+*‰SERVICEVECTORTABLE,REVISIONINFO,ETC.*@*‰ThistableisexaminedbyCMRwhenthechannelisallocatedtoC*‰determinewheretogoforinterrupts,commands,&initialization.<*‰Itmustalwaysbeattheverytopofthedrivercode.‚Also>*‰includedisaparametertellingthenumberofextrapagesof>*‰memorytoincludeintheCCB,andinformationdescribingthe*‰revisionofthedriver.*L**************************************************************************** ŠSECTION‚0ŠOPT„BRS ACIADRV: *D*‚Servicevectortable.‚NoticethatthesevaluesarerelativetotheC*‚beginningofthedriversothemechanismisposition-independent!*=ŠDC.LƒINTERRUPT-ACIADRV‚Addressofinterruptserviceroutine.9ŠDC.LƒCOMMAND-ACIADRV„Addressofcommandserviceroutine.5ŠDC.LƒINIT-ACIADRV‡Addressofinitializationroutine.ŠDC.Lƒ0’Reserved. **‚OtherCMRparameters.*7ŠDC.BƒEXTCCBSZ‹#ofextrapagesintheCCB.‚TheCCBmay)*§beanysizefrom1to256pages(apage'*§is256bytes):‚ifthisfieldis0,it*§willbe1page,etc.ŠDC.Bƒ0,0,0ŽReserved.ŠDC.Lƒ0,0,0ŽReserved. **‚Revisioninfo:*/ŠDC.Bƒ'121784'‹DateoflastassemblyasMMDDYY.1ŠDC.Bƒ''Spaceindicatesnopatchesto.LOfile.)ŠDC.Bƒ'4'MajorVERSAdosrevisionnumber.*‰PAGE*+*‚JumptableforusebythegenericTERMLIB*‰BRA.L…PUT_CHAR ‰BRA.L…CK_TBE‰BRA.L…DDP_RESET ‰BRA.L…SETUP‰BRA.L…CLOCK_RESET‰BRA.L…GET_STAT‰BRA.L…DDP_STOP‰BRA.L…DDP_UNSTOP‰BRA.L…DDP_BEG_BREAK‰BRA.L…DDP_END_BREAK **‰PAGEJ**************************************************************************J**************************************************************************J****************************************************************************‰INITIALIZATIONROUTINE*>*‰ThisroutineiscalledbyCMRwhenthechannelisallocated.9*‰Itspurposeistosetupthingsforcommandserviceand7*‰interruptservice.‚Themajorfunctionsperformedare:"*Validatethechanneltypefield.+*Getmemoryfortransmit&receivequeues..*Initializeflags,pointers,6 etc.intheCCB.*InitializetheACIA.*@*‰WegotherethroughaJSRfromCMR,andwillexitwithanRTS.>*‰AllregistershavebeensavedbyCMRandmaybeusedfreely.?*‰Entryisatinterruptlevel0,andweareinsupervisormode.**‰Entry:A5=addressofCCB.*'*‰Exitsto:‚CMR(viaRTS)ifallisOK.'*”KILLERifexecwon'tallocatememory.*J**************************************************************************J**************************************************************************J************************************************************************** ŠDS…0 INIT:.‰JSR‡TERM_INIT‹Dothedevice-independentstuff*%%%%%%%%%%%%%%ƒbwn‚8/13/842‰IFƒƒTHEN…SomethingwentwrongwithTERM_INIT.4‰IFƒƒTHEN„Theexeccallfailedandwecannotget!*œthescheduler'sentrypoint!!!ŽTR0$.KILLER‚,‰ELSERTSThechannelisdown!!‰ENDI‰ENDI*?*‚Callguardedforthedevicedependentinitializationroutine.*‰LEA‡DO_INIT(PC),A0‰MOVE.L„#T0GUARD,D0‰TRAP†#0‰RTSŠPAGEJ**************************************************************************J**************************************************************************J****************************************************************************‰COMMANDSERVICEROUTINE*>*‰Wegetenteredherewhentheattachedtask(IOS)invokesCMR?*‰viaaTRAP1withanINITIATEI/Oparameterblocktoprocess.>*‰CMRhasalreadycheckedtheCMRparameterblocktoensureit<*‰resideswithintheaddressspaceoftheattachedtask.‚IOSA*‰hasalreadyvalidatedtheIOCB,exceptforthebufferaddresses *‰therein.*@*‰WegotherethroughaJSRfromCMR,andwillexitwithanRTS.>*‰AllregistershavebeensavedbyCMRandmaybeusedfreely.?*‰Entryisatinterruptlevel0,andweareinsupervisormode.*5*‰Entry:A2=physicaladdressofCMRparameterblock*A5=physicaladdressofCCB*3*‰Exit:‚D0=resultsofparameterblockvalidation:3*•always0inourcase,indicatingitwasOK,since2*•IOSwillnotsendusanyrequestexceptHALTI/O/*•ifwearealreadybusy,andCMRmakesallthe*•otherchecks.*A*‰Note:‚TERMLIBdoesnotrecognizeCMRcommandsforHALT&RESET.B*‰HALTcanstillbeaccomplishedthroughuseoftheHALTI/OIOCB.*J**************************************************************************J**************************************************************************J************************************************************************** COMMAND:‹JSR…TERM_COMMAND‹RTS—returntoCMR.‹PAGEJ**************************************************************************J**************************************************************************J****************************************************************************‰INTERRUPTHANDLINGROUTINE*<*‰ThisroutinecompletesI/Orequestsstartedbythecommand:*‰serviceroutine.‚Itisenteredattheinterruptpriority;*‰levelofinterruptsonthischannel,andisessentiallya9*‰subroutinetothefirstlevelinterrupthandlerinCMR.*:*‰Entry:D0,A0,A1havebeensavedbyCMRandareavailable*A5=addressofCCB*9*‰ExitisalwaysviaRTS,whichtakesusbacktoCMR.‚The3*carrybitisexaminedbyCMRtodeterminewhether7*thedriverhandledtheinterruptorwhetheritshould4*passtheinterruptontothenextguyinthechain*onthatvector:*='Ihandledit'**‰Stack:*(A7)+4...*(A7)ƒlongwordreturnaddress*J**************************************************************************J**************************************************************************J************************************************************************** INTERRUPT:0‰MOVE.L„CCBCHB(A5),A1‡STATUS/CONTROLREGADDRESS$‰MOVE.B„SREG(A1),D0‰GETCOPYOFSREG‰IFTHEN.SIFNOINTERRUPT‹AND…#$FFFE,SR‹CLEARCARRY‹RTS‰ENDI ‰PUSH.L„D1’SAVED1 (‰BTST†#RDRFBIT,D0‰TestReceiveregfull.*‰BNE.S…RCA‘Branc7 hifreceivedacharacter. +‰BTST†#OVRNBIT,D0‰Testforreceiveoverrun.‰BNE.S…SRC‘Branchifoverrun. )‰BTST†#DCDBIT,D0ŠTestforDCDtransition.&‰BNE.S…SRC‘BranchifDCD(don'tcare). -‰BTST†#TDREBIT,D0‰Testtransmitbufferempty.%‰BNE.S…TBE‘Branchifbufferisempty. +‰BRA.S…INT_EXITŒShouldnotgethereanyway.ŠPAGEJ***************************************************************************)*‰TRANSMITBUFFEREMPTYINTERRUPTHANDLER*=*‰TheACIA'stransmitbufferjustbecameempty,soifwehave+*‰morecharacterstosendwecandoitnow.**‰Entry:A0=NOTUSED*A1=addressofACIA*A5=addressofCCB*<*‰Sincethisisnotasubroutine,registersatexitarejust-*‰theentryrequirementsofthenextroutine.*J************************************************************************** TBE:5ŠMOVE.BXINTDISA(A5),CREG(A1)ƒDISABLEXMITINTERRUPTS *%%%%%%%%%%ƒBWN‚9/17/84*F*‚Callthedevice-independentroutinethatdealswithtransparentmode)*‚orinvokestheXMITbackgroundroutine.* ‰JSR‡TERM_TBE ‰BRA‡INT_EXITŠPAGEJ***************************************************************************(*‰RECEIVEDCHARACTERAVAILABLEINTERRUPT*=*‰TheACIAhasjustreceivedacharacter,anditisavailable=*‰forreading.‚Wewilldothatnow,andtheresultwillgoin$*‰thereceivequeueifthere'sroom.**‰Entry:A0=NOTUSED*A1=addressofACIA*A5=addressofCCB*<*‰Sincethisisnotasubroutine,registersatexitarejust-*‰theentryrequirementsofthenextroutine.*J************************************************************************** RCA:.‰MOVEQ…#$74,D1‰TestPARITY,FRAMING,OVERRUNand‰AND.B…D0,D1‹DCDerrors.&‰BNE.S…SRCBranchifoneoftheabove. 8‰MOVE.BDREG(A1),D0ˆGetthecharfromtheACIAandreset ‰TST.B…GOTBREAK(A5) ‰IFTHEN/‹SFˆGOTBREAK(A5)„Clearerroronlastcharflag./‹TST.B…D0ŽIsthisgarbagecharatend-of-break? ‹BLT‡INT_EXIT‰ENDI *%%%%%%%%%%%%‚BWN9/17/84*C*‚CallthedeviceindependentroutinetocheckfortransparentmodeG*‚anddothestufffortransparentmodeorifnotintranparentmodetoG*‚checkforanyspecialcharacterssuchasXON,XOFF,BREAKEQUIVALENT,G*‚orDISCARDOUTPUT.Otherwise,putthecharacterinthereceivequeue.*‰JSR‡TERM_GOT_CHAR ‰BRA‡INT_EXITŠPAGEJ***************************************************************************%*‰SPECIALRECEIVECONDITIONINTERRUPT*:*‰TheACIAdetectedanerrorintheprocessofreceivinga<*‰character.‚Weneedtorecordthisinformationsothatwhen<*‰thecorrespondingdataisrequestedfromthereceivequeue*‰wecanreportanerror.**‰Entry:A0=NOTUSED*A1=addressofACIA*A5=addressofCCB*<*‰Sincethisisnotasubroutine,registersatexitarejust-*‰theentryrequirementsofthenextroutine.*J************************************************************************** #SRC:†EQU„*’A1<--addrofourACIA."*£D0<--ourACIAstatusregister.'‰MOVE.B‚DREG(A1),D1ˆD1CONTENTSOFDREG0‰TST.BƒGOTBREAK(A5)‡TESTERRORONLASTCHARFLAG ‰BNE…INT_EXIT ‰BTST†#4,D0"‰IFTHEN.STESTFRAMINGERROR‹ST…GOTBREAK(A5)†SETERRORFLAG3‹JSR„TERM_BREAKˆCallthedeviceindependentroutine*£totakecareofabreak. ‹BRA„INT_EXIT‰ENDI—* ‰BTSTƒ#6,D0ŽTESTPARITYERROR‰IFTHEN.S1‹PUT_BYTEPAR_FRAM,D0„Logaparity/framingerror;‹JSR„LOG_ERRŠ* ‹BRA„INT_EXIT*¢else(notparityorframing)‰ELSE.S‰BTST†#5,D0‹TESTOVERRUNERROR‰IFTHEN.S*‹PUT_BYTEOVERRUN,D0…Loganoverrunerror.‹JSR„LOG_ERRŠ* ‹BRA„INT_EXIT‰ENDI–*‰ENDI2‰BRA„INT_EXIT‹Exit.MUSTHAVEBEENDCD.DONTCARE.‰NOP‰PAGE*E*‚Nowexitasfromaninterrupt.‚WemayinfacthavebeencalledfromF*‚commandserviceorinitialization,buttheyhadtosetituptolook*‚likeaninterrupt,too.*INT_EXIT:POP.L‚D1‘RestoreD1,7ŠMOVEQ‚#1,D0ŽsetcarrybittotellCMR'wehandledi7 t,' ŠSUBQƒ#2,D0Ž*ŠRTS—andreturn.ŠPAGEO********************************************************************************2*‰ROUTINESTOSETTHECLOCKDIVISORTOx16ANDx64*7*‰NoworkheresinceACIAcannotsettheclockdivisor.*=*‰WemusthaveaCLOCKRESETentrypointforTERMLIB,however.**‰Entry:*‹A1ƒ=*‹A5ƒ=addrofourCCB.**‰Exit:*O******************************************************************************* CLOCK_RESET:ŠRTSŠPAGEK*****************************************************************************!*ROUTINES„CALLED„BY**–TERMLIB**F**********************************************************************‰PAGEL******************************************************************************ˆTRANSMITTHECHARACTER*?*ˆThisisthedevicedependentroutinethatactuallywritesthe*ˆcharactertothedevice.*F*ˆTheoffsettothisroutinemustbeinstalledatthebeginningofthe *ˆdriver.**ˆEntry:„A1=addressofACIA*’A5=addressofCCB*’D0.B=charactertotransmit*ˆInterruptlevelonentry:0*C*ˆExit:…Allregistersarepreserved,includingthestatusregister.<*’Itisimportanttokeeptheinterruptlevelthesameasit*’wasuponentry.*J************************************************************************** PUT_CHAR:‰PUSHƒSR‰INHIBIT1‰MOVE.BD0,DREG(A1)ˆOtherwise,transmitthechar./‰MOVE.BXINTENAB(A5),CREG(A1)‚ENABLEXMITINTS.‰POP„SR‰RTS‰PAGEM******************************************************************************$*ˆCHECKTHEDEVICE'STRANSMITBUFFER*F*ˆThisisadevicedependentroutinewhoseoffsetmustbeinstalledat*ˆthebeginningofthedriver.**ˆEntry:A1=addressofACIA*A5=addressofCCB*ˆInterruptlevelonentry:0**ˆExit:‚Conditioncodes:"*=transmitbuffernotempty*=transmitbufferempty<*ˆItisimportanttokeeptheinterruptlevelthesameasit*ˆwasuponentry.*M*****************************************************************************CK_TBE:A‰BTST.B#TDREBIT,SREG(A1)‚IfACIA'stransmitbufferisnotempty,‰RTS‰PAGEH************************************************************************* *ˆDEVICEDEPENDENTRESETROUTINE*9*ˆThisisthedevice-dependentpartoftheresetroutine.*?*ˆTheoffsettothisroutinemustbeinstalledatthebeginning*ˆofthedriver.**ˆEntry:A5=addrofCCB*ˆInterruptlevelonentry:0*$*ˆExit:‚Allregistersarepreserved.<*ˆItisimportanttokeeptheinterruptlevelthesameasit*ˆwasuponentry.*E********************************************************************* DDP_RESET:*A*‚ACIAdidnothaveanydevicedependentresetstuffintheRESET:*‚routine,whichiswherethisstuffwouldhavecomefrom.* ŠRTS—exit.ŠPAGEJ***************************************************************************@*‰SUBROUTINETOSETUPTHEDEVICEACCORDINGTOTHECONFIGURATION*;*‰Usestheworkingconfiguration(intheCCB)tosetupthe;*‰device,andsomeconfiguration-relatedfieldsintheCCB.*?*‰Theoffsettothisroutinemustbeinstalledatthebeginning*‰ofthedriver.**‰Entry:A5=addressofCCB*‰Interruptlevelonentry:0*$*‰Exit:‚Allregistersarepreserved.<*‰Itisimportanttokeeptheinterruptlevelthesameasit*‰wasuponentry.*J************************************************************************** SETUP:<ŠMOVEM.LD0-D1/A0-A3,-(A7)Savesomeregistersonthestack. ŠPUSHƒSR **‚Firstsetupaddresses.*4ŠLEA„CONFIG(A5),A0†A0<--addrofCCBconfiguration.3ŠMOVE.LCCBCHB(A5),A1†A1<--addrofourACIAport.**‚[4]„x16clockrate,(*‰stopbits&parityfromconfiguration.*)ŠMOVE.Bƒ#1,D0ŒStartwithx16clockinD0. )‰BTSTWƒ#IOABITS,IOSATW(A0)ƒTESTBITS/CHAR‰IFTHEN.SIF8THEN‹OR.Bƒ#$10,D0Œ(8bits/char)>‹BTSTW‚#IOAUSEP,IOSATW(A0)Ifwe'r8 eusingparity,enableit... ‹IF…THEN OR.Bƒ#$08,D09BTSTW‚#IOAPRTY,IOSATW(A0)andifwe'reusingoddparity,IF…THENŠsetitup. OR.Bƒ#$04,D0ENDI‹ELSE.S•8BITSNOPARITY)BTSTW‚#IOASTPB,IOSATW(A0)ƒTESTSTOPBITSIFTHEN.SIF1THEN OR.Wƒ#$04,D0ENDI‹ENDI‰ELSE.S˜ELSE7THEN)‹BTSTW„#IOASTPB,IOSATW(A0)„TESTSTOPBITS‹IFTHEN.SOR.Wƒ#$08,D0IF1‹ENDI&‹BTSTW„#IOAPRTY,IOSATW(A0)ƒTESTPARITY‹IFTHEN.S‘IFODDTHEN OR.W„#$04,D0‹ENDI‰ENDI "*§TransmitterintdisabledDTRlow /ŠOR.B…#$80,D0ŽRecieve,Overrun,DCD‚Int'sEnabled‰INHIBITŠMOVE.BƒD0,(A1)‰POP‡SR9ŠMOVE.BƒD0,XINTDISA(A5)†SAVECONTREG(XMITINTDISABLED) ŠOR.B…#$20,D08ŠMOVE.BƒD0,XINTENAB(A5)…SAVECONTREG(XMITINTENABLED):ŠAND.B„#%10011111,D0„Clearbits5and6forsettingupRTS*ŠOR.B…#%01000000,D0„SetRTSbitforaHIGHŠMOVE.BƒD0,XRTSHI(A5)**‚Setupbaudrate*G‰IF.BCCBTYPE(A5)#$66OR.BCCBTYPE(A5)#$67THEN.SKG052384.‹MOVE.B„IOSBRT(A0),D0‡Theconfiguredbaudrate‹PUT_BYTE‚$F0,D1ŽMask!‹BTST†#0,CCBTYPE(A5)†Asideport?‹IFTHEN.S LSL.B…#4,D0PUT_BYTE‚$0F,D1‹ENDI2‹AND.B…D1,BAUDPIA…Clearoldbaudrate…KEG05/23/842‹OR.B†D0,BAUDPIA…Insertnewbaudrate„KEG05/23/84‰ENDI **‚Restoreregistersandreturn.*8ŠMOVEM.L(A7)+,D0-D1/A0-A3Restoreregistersfromstack.ŠRTSŠPAGEJ****************************************************************************‰GETDEVICESTATUSBYTE*"*‰PreparestheDEVICESTATUSbyte.*8*‰Note:‚thisroutinedoesnotsetthebreakindicatorin*thedevicestatusbyte.*?*‰Theoffsettothisroutinemustbeinstalledatthebeginning*‰ofthedriver.**‰Entry:A5=addressofCCB*‰Interruptlevelonentry:0*&*‰Exit:‚D0.B=thedevicestatusbyte.<*‰Itisimportanttokeeptheinterruptlevelthesameasit*‰wasuponentry.*J************************************************************************** GET_STAT: ŠCLR.B‚D0 ŠPUSH.LA0ŠMOVE.LƒCCBCHB(A5),A00ŠBTST…#CTSBIT,SREG(A0)„TESTCTSBITŒKEG05/23/84ŠIFTHEN.S'ŒBSETƒ#XDSNRB,D0ŠDATASETNOTREADYBITŠENDI ŠPOP.L‚A0 ŠRTS—Return.ŠPAGEM******************************************************************************5*ˆDEVICEDEPENDENTSTUFFFORLOWERINGAHARDWARELINE*ˆTOSTOPTHETRANSMITTER.*?*ˆTheoffsettothisroutinemustbeinstalledatthebeginning*ˆofthedriver.**ˆEntry:‚A1=addressofACIA*A5=addressofCCB3*ˆInterruptlevelonentry:INHIBITEDatourlevel.*$*ˆExit:ƒAllregistersarepreserved.*K*************************************************************************** DDP_STOP:DŠMOVE.BXRTSHI(A5),CREG(A1)MakeRTSgoHIGHtostopthetransmitter*¤KEG05/23/84ŠRTS‰PAGEK****************************************************************************$*ˆDEVICEDEPENDENTUNSTOPTHEDEVICE*=*ˆWhenwearenotusingXOFF/XON,weunstopthedeviceinour*ˆowndevicedependentway.*;*ˆWearerunninginbackgroundwhenthisroutineiscalled.*?*ˆTheoffsettothisroutinemustbeinstalledatthebeginning*ˆofthedriver.**ˆEntry:‚A1=addressofACIA*A5=addressoftheCCB3*ˆInterruptlevelonentry:INHIBITEDatourlevel.*$*ˆExit:ƒAllregistersarepreserved.*J************************************************************************** DDP_UNSTOP:CŠMOVE.BXINTENAB(A5),CREG(A1)MakeRTSgoLOWtoenabletransmitter*¦KEG05/23/84ŠRTSŠPAGEK****************************************************************************&*ˆDEVICEDEPENDENTBEGINBREAKROUTINE*?*ˆTheoffsettothisroutinemustbeinstalledatthebeginning*ˆofthedriver.**ˆEntry:‚A1=addrofACIA*A5=addrofCCB3*ˆInterruptlevelonentry:INHIBITEDatourlevel.*$*ˆExit:ƒAllregistersarepreserved.*E********************************************************************* DDP_BEG_BR8 EAK:‰SAVEƒD08‰MOVE.BXINTDISA(A5),D0„D0<--imageofACIACONTROLREG,‰OR.Bƒ#$60,D0ŒAddbitstosendbreaksignal.‰MOVE.BD0,CREG(A1)ˆ* ‰RESTORED0‰RTS‰PAGEK****************************************************************************$*ˆDEVICEDEPENDENTENDBREAKROUTINE*?*ˆTheoffsettothisroutinemustbeinstalledatthebeginning*ˆofthedriver.**ˆEntry:‚A1=addrofACIA*A5=addrofCCB3*ˆInterruptlevelonentry:INHIBITEDatourlevel.*$*ˆExit:ƒAllregistersarepreserved.*L**************************************************************************** DDP_END_BREAK:.‰MOVE.B‚XINTENAB(A5),CREG(A1)ƒENABLEXMITINT.‰RTS‰PAGEI***************************************************************************“BACKGROUND**šAND**‘CALL__GUARDED**–ROUTINES**•(DEVICE-DEPENDENT)*E*********************************************************************ŠPAGEO*********************************************************************************‰FINISHOFFTHEINITIALIZATION*A*‰Theinitializationroutinehasgonearoundresettingeverything@*‰itcan,buttheroutinesRESETandSETUPshouldonlybecalled>*‰fromwithinthebackground.‚Soheinvokedthisroutinetodo *‰itforhim.**‰Entry:*A5=addressofCCB.*O******************************************************************************* DO_INIT:**‚Inhibitinterrupts*‰PUSH†SR‰INHIBIT*)*‚GetaddressofstartofdriverintoCCB*‰LEA‡ACIADRV(PC),A4‰MOVE.L„A4,DRV_ADDR(A5)*0*‚NowactuallydotheminimumsetupontheACIA.*.ŠMOVE.LCCBCHB(A5),A1†A1<--addrofourACIA.4ŠMOVE.BCCBRESV(A5),CREG(A1)ResetourACIAchannel. ŠJSR„RESETŽReseteverything.ŠBSR.L‚DDP_RESET5ŠBSR.L‚SETUPŽSetuptheACIAaccordingtotheconfig.**‚Enableinterruptsnow.*‰POP‡SR‰RTS‰PAGE*********************** *‚PATCHSPACE***********************ŠDS.Wƒ30ŠEND  ééé-‰PAGEš#######################################‰TTL‡COMMANDHANDLER *ƒForchangessee: *ˆRESETCNT:*ˆL0650*œK.E.ROEHRMAN„10/20/83*œRWMŽ11/17/83 *œPJDŽ9/18/84*C*ˆ11/7/84‚AddedasubroutineCHK_FLOPPYandsomecodetocheckthat7*‘sectorspertrack,bytespersector,anddatadensity8*‘valueswereconsistentforeithera51/4"floppyora+*‘8"floppy.‚Ifnot,returnerrorcode$47.*<*ˆ2/18/85‚AddedcodetolimitprecompensationvalueforRWIN**‘diskcontrollerto$FF.‚SeelabelCD030.*=*ˆ2/25/85‚Addedcodetousecylinders-mediaforallharddiskéé9 ééé -$7,94:<3D<L6T4\=d1l6t:|<„9Œ5”2œ;¤:¬2´6¼6Ä1Ì3Ô0Ü5ä3ì.ô6ü"*‘configurations.‚SeelabelCD010.*O*******************************************************************************O********************************************************************************1*ˆSERVICEVECTORTABLE,PARAMETERS,REVISIONINFO*@*ˆThefirst‚several‚locationsofevery‚I/OdrivermustcontainaB*ˆservicevectortabletocontainthe‚long-wordrelativeaddressesB*ˆofthethreedriversubroutinesthatCMRuses.‚TheCMRparameterC*ˆtableimmediatelyfollowstheservicevectortableandincludesaA*ˆfieldtelling‚CMR‚howmanyextrapages‚toallocatefortheCCB.E*ˆTherevisiontableimmediatelyfollowsthetheCMRparametertable.*O*******************************************************************************O******************************************************************************* '‰SECTION‚8–Section8isisarelatively)*¦arbitrarysectiontouse,butitisthe&*¦sectionwherethesystemexpects(by%*¦default)toseecodeforaprogram. * SERVICE VECTOR TABLE * >SERVECT‚DC.L…INTERUPT-SERVECT‡Thisentryintheservicevector(*¦tablecontainstherelativeaddressof&*¦theSASIdriver'sinterrupthandler.(*¦Theinterrupthandlerreceivescontrol&*¦fromCMRwhenCMRwishestopollthe'*¦SASIdrivertoseeiftheSASIdriver(*¦wantstohandlethecurrentinterrupt.'*¦PleasenoticethatthelabelINTERUPT&*¦isintentionallymisspelledtolimit*¦thelengthofthelabel. 7‰DC.L…COMMANDS-SERVECT‡Thisentryintheservicevector(*¦tablecontainstherelativeaddressof&*¦theSASIdriver'scommandprocessor.&*¦CMRcallsthecommandprocessorwhen&*¦CMRhasacommandtoinitiateanI/O *¦transactiononaSASIchannel. 6‰DC.L…INITIAL-SERVECTˆThisentryintheservicevector(*¦tablecontainstherelativeaddressof'*¦theSASIdriver'sinitializationsub-'*¦routine.‚CMRcallstheinitialization'*¦subroutineatchannelallocationtime)*¦togivethedriverachancetoallocate(*¦memoryforvariablesand/ortodoany-'*¦thingthatisnecessarytoinitialize(*¦thechannelandthechanneldevice(s). 7‰DC.L…RESERVED-SERVECT‡Thisentryintheservicevector:RESERVEDEQU†SERVECTŽtableisnotused,butitisreserved'*¦forfutureexpansion.‚Anyfuturecode(*¦thatiscreatedtousethisentrywill(*¦recognizezeroasvaluethatindicates)*¦thattheentryisempty,sowecodethe*¦valuezeroherefornow.-‰PAGEš####################################### * CMR PARAMETER TABLE * 2‰DC.B…EXTCCBSZThisfieldtellsCMRhowmanyextra&*¦page(s),ifany,toallocateforthe%*¦CCBforthisI/Odriver.‚CMRalways(*¦allocatesonemorethanthisnumberof'*¦page(s)becauseonepageofmemoryis&*¦requiredfortheuniversally-defined'*¦CCBvariables.‚Theadditionalpage(s)&*¦thatarespecifiedbythisfieldare'*¦usedexclusivelyfordevic9 e-dependent$*¦variablesthatarerequiredbythe*¦devicedriver. 0‰DC.B…0,0,0’Thesefieldsarereservedforfuture.‰DC.L…0,0,0extensions.‚Weprovidezerovalues%*¦herebecauseanyextensionsthatwe(*¦implementinthefuturewillinterpret%*¦zeroasaninnocuousdefaultvalue. * REVISION TABLE * 0‰DC.B…'02'MM„Thisportionoftherevisiontable3‰DC.B…'25'DD‚containsthedateonwhichthedriver3‰DC.B…'85'YY‚wasassembledforarelease.‚Thedata)*¦isgivenasMMDDYYwithtwodigitseach'*¦forthemonth,theday,andtheyear. .‰DC.B…''”ThisbytecontainsanASCIIblankto%*¦indicatethatthedriver's.LOfile*¦doesn'tcontainanypatches. .‰DC.B…'4'”ThisbytecontainsanASCIIdigitto&*¦indicatethemajorVERSAdosrevision(*¦numberunderwhichthisversionofthe*¦driverwasfirstreleased. -‰PAGEš#######################################O*******************************************************************************O*********************************************************************************ˆINITIALIZATIONROUTINE*B*ˆThis‚subroutineiscalledfromCMR‚whenCMRisinvokedbyataskB*ˆ(normallyIOI)to‚allocateachannel.‚ItspurposeistogivetheD*ˆdriverachancetosetupthingsforcommandserviceandinterrupt-*ˆservice.‚Thebasicfunctionsperformedare:* *’Initializeinternalvariables.-*’ResetandtestSASIcontroller(SASIonly).-*’Readstatusofself-test(WINCHESTERonly).!*’TestofFIFO(WINCHESTERonly).*B*ˆThissubroutineisenteredthroughaJSRfromCMR,andwillexit7*ˆwithanRTS.‚Theprocessorisinthesupervisormode.*%*ˆEntry:„A6=physicaladdressofTCB*’A5=physicaladdressofCCB*!*ˆRegisterusage:ˆ01234567 *œD‚*** *œA‚*…**PP**ˆExitsto:CMRviaRTS*O*******************************************************************************O******************************************************************************* INITIAL: 7‰LEA†SASIIDLE(PC),A0ˆInitializetheinterrupthandler's?‰MOVE.LƒA0,INTSWTCH(A5)†co-routineswitchtopointtotheSASI-'*¦IDLEroutinesowe'llbeprotectedin&*¦casetheSASIcontrollererroneously'*¦generatesaspuriousinterruptbefore%*¦we'veevergiventhecontrollerany"*¦commands.‚Thisstepisn'treally'*¦necessary,butitgivesussomeextra)*¦protectionagainstanerrorthatshould*¦neveroccur. ‰NOLIST*‰IFNE…0–Omitthefollowingcode.‚Itisnow"*¦obsoletebutisworthsavingfor*¦referencepurposes. 7‰MOVE.Wƒ#EXTCCBSZ,A0‹Asktheexecutivetoallocatesome6‰MOVE.Lƒ#T0PAGAL,D0Šmemorythatwecanusefordevice--‰BSR.S„EXECREQŽrelatedvariables.‚Wemustuse)*¦dynamically-allocatedmemoryforallof'*¦ourvariablessowecancodetheSASI#*¦driverasare-entrant,position-#*¦independentroutine.‚A0tellsthe$*¦executivehowmanypages(with256(*¦bytesperpage)wewant,andA6points)*¦totheTCBforthetaskthat'sallocat-"*¦ingthechannel.‚Noticethatthe(*¦MOVE.Winstructionhereclearsthetop'*¦halfofA0,sotheMOVE.Winstruction&*¦effectivelydoesthejobofalonger *¦andslowerMOVE.Linstruction. '*¨TheexecutivereturnscontrolwithA0(*¦containingthephysicaladdressofthe'*¦newly-allocatedmemory,andregisters"*¦D0,D1,D2,andA2haveallbeen *¦destroyed. 6‰MOVE.LƒA0,EXTCCB(A5)ŠSavethephysicaladdressofthe&*¦newly-allocatedmemorybyputtingit#*¦intotheCCB.‚Thenewly-allocated *¦memoryiseffectivelyalinked)*¦extensionoftheCCB,sowerefertoit*¦astheextendedCCBarea. ‰ENDC‰LIST-‰PAGEš####################################### #‰IFNE…DTYPEAssembleifWinchester.WINCHECK8‰MOVE.LƒCCBCHB(A5),A0ˆA0<=channel'smemorymappedI/O.;‰BTST…#BITCB,FLAGS(A0)…Testthereadregisterfornotbusy.5‰BEQ.S„FIPASSDon'tresetortestbufferifnotbusy.+‰MOVE.Bƒ#0,WDCRST(A0)ˆResetthecontroller.CWINI10ƒBTST…#BITCB,FLAGS(A0)…Pollthereadregisterfornot: busy...,‰BNE†WINI10...toindicateendofself-test.1‰BTST…#BITFAULT,FLAGS(A0)‚Testthepass/failbit.!‰BEQ.S„WINI20Continueifpassed..‰SNE.B„SASIDOWN(A5)‰Setthechanneldownflag.‰RTS›ReturntoCMR.WINI20 ‰MOVE.W„#4095,D1Œ4Kbuffer.AFIWRITE‚MOVE.B„D1,DATA0(A0)ˆMovedatabytebybytetothebuffer.‰DBRA†D1,FIWRITEŠ*‰MOVE.W„#4095,D1ŒRestart.BFIREADƒCMP.B…DATA0(A0),D1ˆComparedatabytebybyteinthebuffer.&‰BNE.S…FIERRORBranchuponerroronly.‰DBRA†D1,FIREAD‹*‰BRA.S…FIPASSŽDoneifpassed.5FIERROR‚SNE.B…SASIDOWN(A5)ˆSetthechanneldownflag.‰RTS›ReturntoCMRFIPASS‰ENDC -‰PAGEš#######################################9‰LEA†CCBZERO(A5),A0‰Clearallofthedevice-dependentCCB=‰MOVEQWƒ(CCBZSIZE/4)-1,D0„variablesthatmustbebackgrounded(*¦withzerosatchannel-allocationtime.4L0100„CLR.L„(A0)+Wecleartwowordsatatimeuntil/‰DBRA…D0,L0100we'veclearedallofthedevice-&*¦dependentvariablesthatliebetween$*¦CCBZEROandtheendoftheCCB.‚We)*¦improveourexecutionspeedsomewhatby)*¦clearingtwowordsatatimeinsteadof&*¦clearingonewordatatime.‚Wetake)*¦stepselsewheretoensurethatCCBZSIZE(*¦isamultipleof4andthatCCBZEROis*¦onalong-wordboundary. &*¨Controlnowfallsdirectlyintosub-)*¦routineRESETCNT,whichresetsboththe)*¦SA1403DSASIcontrollerandtheMVME420%*¦SASIPeripheralAdapter.‚Subroutine(*¦RESETCNTalsoteststheMVME420tosee%*¦ifitisfunctional.‚IftheMVME420$*¦isn'tfullyfunctional,subroutine)*¦RESETCNTilluminatestheMVME420'sfail)*¦LEDandsetsthevariableSASIDOWNnon-(*¦zerotoindicatethattheSASIchannel *¦isdown. %*¨SubroutineRESETCNTassumesthatA5'*¦pointstotheCCB,andthesubroutine*¦destroysA3,A4,andD0. !*¨Controlreturnsfromsubroutine'*¦RESETCNTdirectlytotheroutinethat'*¦calledsubroutineINITIAL,sosubrou-'*¦tineRESETCNTiseffectivelyjustthe*¦tailofsubroutineINITIAL.‹{/‰NOLIST˜#######################################*‰IFNE…0–Omitthefollowingcode.‚Itisnow"*¦obsoletebutisworthsavingfor*¦referencepurposes.-‰PAGEš#######################################:‰LEA†POLLSTAT(PC),A0ˆAsktheexecutivetostartactivating9POLLTIMEEQU†1500‘thePOLLSTATroutineonaregularbasis6‰MOVEIAƒPOLLTIME,A1Šatintervalsof1,500milliseconds8ACTIVATEEQU†0<<15starting1,500millisecondsfromnow.6REPEATƒEQU†1<<14TheREPEATflagsaysthatwewantthe7LEVEL1ƒEQU†1<<0‘activationtoberepeatedoverandover?L0010„EQU†REPEAT+LEVEL1ˆinsteadofoccurringjustonce,andthe@‰MOVEQWƒACTIVATE+L0010,D1„LEVEL1parametersaysthattheroutine5‰MOVE.LƒA5,D2shouldalwaysbeactivatedbyaninter-8‰MOVE.Lƒ#T0RQPA,D0‹ruptthatoccursatprioritylevel1.%*¦TheCCBaddressthatweputintoD2'*¦herewillappearinD1everytimethe'*¦POLLSTATroutineisactivated,sothe&*¦POLLSTATroutinewillhavealinkto%*¦thecriticaldatastructurethatit*¦needs. #*¨TheMOVEIAmacrothatweusehere)*¦generatestheshortestinstructionthat'*¦willputtheimmediatevaluePOLLTIME%*¦intoA1.‚SincePOLLTIMEfitsintoa#*¦singlewordasatwo's-complement)*¦value,theMOVEIAmacrowillgeneratea%*¦MOVE.Winstructionknowingthatthe'*¦signextensionatexecutiontimewill&*¦setthetophalfofA1properly.‚The&*¦MOVEIAmacroisgeneral,anditwill(*¦workcorrectlyforanyimmediatevalue*¦thatwehappentouse. $*¨ThePOLLSTATroutinewillpollthe&*¦on-line/off-linestatusofeachdisc$*¦drivethathasbeenactivated,and(*¦we'llsendanunsoliciteddeviceevent%*¦totheattachedtaskifwedetecta$*¦changeinthestatusofadrive.‚A%*¦driveisconsideredtobeactivated'*¦whentheSASIdriverhasreceivedany%*¦validcommandforthedrive,andwe%*¦can'treceiveacommandforadrive"*¦untilafterthechannelhasbeen(*¦attachedbyatask.‚Therefore,weknow)*¦there'llbeanattachedtasktoreceive%*¦anyeventmessagethatthePOLLSTAT*¦routinequeues.:  $*¨Noticethatcontrolnowfallsinto'*¦subroutineEXECREQtomaketheactual(*¦executiverequestthatwejustsetup,#*¦andcontrolnormallyreturnsfrom$*¦subroutineEXECREQdirectlytothe)*¦routinethatcalledsubroutineINITIAL.-‰ENDCš#######################################-‰LISTš####################################### -‰PAGEš#######################################O******************************************************************************** *ˆRESETandTESTSASICONTROLLER*A*ˆThissubroutineresetsboththeSA1403DSASIcontrollerandthe?*ˆMVME420SASIPeripheralAdapter,andteststheMVME420tosee*ˆifitisfunctional.*%*ˆEntry:„A5=physicaladdressofCCB*!*ˆRegisterusage:‰01234567*œDƒ* *œA‰**P**ˆExitsto:CMRviaRTS*O******************************************************************************* RESETCNT: ‰IFEQ…DTYPEAssembleifSASI.5‰MOVE.LƒCCBCHB(A5),A4ŠGetthephysicaladdressofthe:‰LEA†DIAGNOST(A4),A3†channel'smemory-mappedI/Oareainto"*¦A4,andsetupA3toaddressthe$*¦MVME420'sDIAGNOSTregister.‚We'll&*¦accesstheDIAGNOSTregisterseveral'*¦times,soit'sworthwhiletodedicate%*¦anaddressregistertopointtoit. H*‚TheSASIcontrollerfortheDTC520AboarddoesnotwantaresetsinceD*‚aresetwillcauseittorevertbacktothedefaultconfiguration. #*********************************** *‚FOLLOWINGLINECOMMENTEDOUTƒ* *ˆ11/4/83’**›KERƒ**PUTBACKIN•* *ˆ12/16/83‘**›BWNƒ*#*********************************** ?‰MOVE.Bƒ#RESET,CONTROL(A4)…ResettheMVME420andtheSA1403Dby(*¦settingtheRESETbitintheMVME420's#*¦CONTROLregister.‚Inonecasethe'*¦MVME420andtheSA1403Dmayhavejust&*¦beenresetbytheautomaticpower-up)*¦reset,butresettingthemagaininthat&*¦onecasedoesnoharm.‚Resettingthe&*¦MVME420illuminatesitsfailLEDand$*¦alsodisablesitsinterrupt.‚We'll&*¦extinguishthefailLEDlaterifthe)*¦MVME420passesthetestswe'reaboutto(*¦perform,butwe'llleavetheinterrupt&*¦disableduntilwewantaninterrupt. 3‰MOVEQBƒ$55,D0‘Writeadistinctivebitpatterninto4‰MOVE.BƒD0,(A3)ŽtheMVME420'sDIAGNOSTregister,and5‰CMP.B„(A3),D0ŽsettheSASIDOWNflagifwecan'tread5‰SNE.B„SASIDOWN(A5)‰backthesamebitpatternthatwe%*¦wrote.‚Ifwereadbackthesamebit$*¦patternthatwewrote,however,we%*¦cleartheSASIDOWNflagtoindicate"*¦that(sofar,atleast)theSASI*¦channelisnotdown. -‰PAGEš#######################################.‰NOT.B„D0•Invertthebitpatternthatwewrote1‰NOT.B„(A3)‘totheDIAGNOSTregisterearlier,and.‰SUB.B„(A3),D0Žchecktoseeifthepatternwas:‰OR.B…D0,SASIDOWN(A5)†invertedproperly.‚Ifitwasn't,set(*¦theSASIDOWNflagtoindicatethatthe"*¦SASIchannelisdefinitelydown. 0‰BNE.S„L0020’IftheMVME420failedeitherofthe$*¦testsabove,returntothecalling&*¦routineandleavetheMVME420'sfail$*¦LEDilluminated.‚Theteststhatwe(*¦performontheMVME420certainlydon't&*¦compriseacomprehensivecheckoutby)*¦anymeans,butthey'llprobablycatcha'*¦surprisingnumberofproblems.‚Inany(*¦case,thechecksthatwemakearecon-)*¦siderablybetterthannochecksatall. ?L0460„EQU†LEDOFF+DSABLINTˆTheMVME420passedourcursorytests,?‰MOVE.Bƒ#L0460,CONTROL(A4)ƒsoextinguishitsfailLED,butkeep&*¦itsinterruptdisabled.‚ThefailLED'*¦wasautomaticallyilluminatedwhenwe%*¦resettheMVME420,andthefailLED'*¦remainedlituntilnow.‚TheMVME420's&*¦interruptwasautomaticallydisabled&*¦byourearlierresetcommand,andwe%*¦wanttokeeptheinterruptdisabled$*¦untilwehaveaspecificreasonto *¦enableit.‰ENDC/L0020„RTS›TheRTSisusedbybothSASIandWIN. .‰PAGEš########################################O*******************************************************************************O******************************************************************; ***************ˆCOMMANDSERVICEROUTINE*C*ˆThissubroutineiscalledfromCMRwhenCMRreceivesacommandtoA*ˆinitiatean‚I/Otransaction‚withadevicethatiscontrolledbyB*ˆthisdriver.‚ThepurposeistoperformthecommontasksthatareB*ˆnecessaryforallcommandroutines,andto‚directcontroltotheA*ˆindividualroutinethatprocessesthe‚givencommand‚throughthe*ˆcommandswitchingtable.*5*ˆEntry:„A2=physicaladdressofCMRparameterblock*’A5=physicaladdressofCCB/*’A6=physicaladdressofTCBofattachedtask*"*ˆRegistersusage:„01234567 *™D‚***…RR*™A‚*RPRRPP*5*ˆExit:…A1=pointertodrive'svariableblockinCCB*’A3=physicaladdressofDCB*’A4=physicaladdressofIOCB*’D5=0*’D6=Channeldevice#*9*ˆExitsto:Theroutinethatprocessesthegivencommand.*O*******************************************************************************O******************************************************************************* CMDSWIT: 1‰DC.W…READCMD-*-4ŒThereadcommandtellstheSASI1‰DC.W…IOREADdrivertoreaddatafromadiscinto *¦memory. 3‰DC.W…WRITECMD-*-4‹ThewritecommandtellstheSASI2‰DC.W…IOWRITdrivertowritedatafrommemorytoa*¦disc. 3‰DC.W…STATCMD-*-4ŒThestatuscommandtellstheSASI4‰DC.W…IOSTATdrivertoreturnthecurrentstatusand *¦configurationofadiscdrive. 5‰DC.W…CONFIG-*-4TheconfigurecommandtellstheSASI4‰DC.W…IOCNFGdrivertochangethecurrentconfigura-*¦tionofadiscdrive. 3‰DC.W…DFCONFIG-*-4‹Thechangedefaultconfiguration4‰DC.W…IOCHDCcommandtellstheSASIdrivertochange%*¦thedefaultconfigurationofadisc*¦drive.-‰PAGEš####################################### 2‰DC.W…FORMAT-*-4TheformatcommandtellstheSASI1‰DC.W…IOFRMTdrivertoformatanentirediscora*¦particulartrackofadisc. &‰DC.W…0–Thiszerosentinelwordinthe'*¦positionofanoffsetvaluemarksthe*¦endoftheswitchingtable. COMMANDS: 6‰MOVE.LƒSP,SAVESP(A5)ŠSavethestackpointersowecan$*¦laterabortatanylevelofnested$*¦subroutinesandeasilyrestorethe%*¦stackenvironmentthatexistedwhen*¦thisroutinebeganexecution.‰NOLIST*‰IFNE…0–Omitthefollowingcode.‚Itisnow *¦obsolete. 6‰TST.B„SASIDOWN(A5)‹IftheSASIchannelisdown(i.e.,/‰BEQ.S„L0620outofservice),tryresettingthe7‰BSR.S„RESETCNTSA1403DSASIcontrollerandtheMVME420(*¦SASIPeripheralAdaptertoseeifthey'*¦willfunctionproperlyafterareset.(*¦SubroutineRESETCNTresetsthedevices)*¦andthenteststheMVME420toseeifit"*¦isfunctional.‚IftheMVME420is(*¦functional,subroutineRESETCNTclears(*¦theSASIDOWNflag.‚SubroutineRESETCNT%*¦assumesthatA5=LOC(CCB),andthe%*¦subroutinedestroysA3,A4,andD0. ‰ENDC‰LIST?L0620„MOVE.LƒXIOCPK(A2),D6ŠGetthephysicaladdressoftheIOCB2‰MOVEQ.L‚#0,D5forthecommandintoA4.‚Subroutine7‰MOVE.WƒXIOPLN(A2),D5ˆLOGPHY1convertsthelogicalIOCB4‰BSR†LOGPHY1Žaddress(inD6)intoaphysicaladdress-‰MOVE.LƒD6,A4forus.‚Wemustcallsubroutine)*¦LOGPHY1withA5containingthephysical(*¦addressoftheCCB,andwemustsetup(*¦D5tospecifythelength(inbytes)of%*¦theIOCB.‚TheCCBTASKAfieldofthe'*¦CCBmustcontainthephysicaladdress(*¦oftheTCBthatcontrolsthetaskthat#*¦ownstheIOCB.‚SubroutineLOGPHY1%*¦returnsthephysicaladdressofthe *¦IOCBinD6. &*¨SubroutineLOGPHY1abortsprocessing$*¦iftheIOCBthatwespecifyisnot'*¦entirelywithinamemorysegmentthat)*¦belongstothetaskthatownstheIOCB.&*¦Thiserrorcanneveroccurinactual%*¦practice,though,becauseahigher-)*¦levelroutinehasalreadyverifiedthat(*¦theIOCBliesentirelywithinamemory'*¦segmentthatbelongstothetaskthat*¦ownstheIOCB. -‰PAGEš#######################################9‰MOVE.LƒXIOUID(A2); ,A3ŠGetthephysicaladdressoftheDCB2‰MOVEQ.L‚#0,D6intoA3,andgetthechanneldevice;‰MOVE.BƒDCBCDV(A3),D6ˆnumberintoD6.‚Thesevaluesindicate&*¦theparticulardevicethatshouldbe*¦accessedbythecommand. 8‰MOVEQBƒISTACDN,D1IftheSASIchannelisdown,goqueue:‰TST.B„SASIDOWN(A5)‰aneventtotheattachedtasktoindi-7‰BNE.S„CMDEXIT2catethatthechannelisoutofservice(*¦fornow.‚Wecan'tprocessanycommands'*¦foranySASIdeviceswhenthechannel(*¦isdownbecausethechannelbeingdown$*¦indicatesthattheSASIPeripheral*¦Adapterisnotfunctional. 5‰LEA†DRVBLK(A5),A1ŠSetupA1topointtothevariable:‰MOVEQWƒDRVBLKSZ,D0Šblockforthediscdrivethatistobe-‰MULU…D6,D0accessedbythecommand.‚Thedisc4‰ADD.L„D0,A1drive'svariableblockisinthedrive-(*¦associatedportionoftheCCB,andthe)*¦particularvariableblockinthedrive-)*¦associatedareaoftheCCBisindicated'*¦bythedrive'schanneldevicenumber.(*¦Thecodeheredependsonthefactthat)*¦thedrive-associatedportionoftheCCB%*¦isorganizedintoparallelvariable)*¦blockswithonevariableblockforeach*¦driveonthechannel.  7‰MOVE.WƒIOSFCT(A4),D0ŠNowpreparetosearchthecommand;‰LEA†CMDSWIT(PC),A0‡switchingtableforthecommandthatis6‰MOVEQBƒISTAIF,D1ŒspecifiedbytheIOSFCTfieldofthe$*¦IOCB.‚WeputtheIOSFCTvalueinto%*¦D0.W,andweputtheaddressofthe(*¦switchingtableintoA0.‚Wealsoputa$*¦statuscodeintoD1.B.‚Thisstatus'*¦codewillbeusedifthegivenIOSFCT%*¦valuedoesn'tcorrespondtoavalid*¦commandcode.  4L0030„MOVE.Wƒ(A0)+,D2Thisloopsearchesthecommand7‰BEQ.S„CMDEXIT2switchingtabletoseeifwecanfinda6‰CMP.W„(A0)+,D0matchfortheIOSFCTvalueinD0.W.‚If4‰BNE.S„L0030wereachtheend-of-tablesentinelword)*¦withoutfindingamatch,wegoqueuean&*¦eventtotelltheattachedtaskthat)*¦we'vereceivedaninvalidcommandcode.&*¦Otherwise,wesetupD2.Wtocontain&*¦theswitchingoffsetfortheroutine!*¦thathandlesthegivencommand.  /‰MOVEQ.L‚#0,D5’ClearD5toprovideaconvenient$*¦initialvaluefortheroutinethat#*¦processesthegivencommand.‚Some)*¦command-processingroutinesmakeuseof*¦thisinitialvalueofD5. 4‰JMP†0(A0,D2.W)Transfercontroltotheroutinethat%*¦processesthegivencommand.‚Please&*¦refertothecommandswitchingtable(*¦andtothesearchingloopabovetosee'*¦howtheoffsetvaluehereisderived. -‰PAGEš#######################################O*********************************************************************************ˆSTATUSCOMMANDROUTINE*G*ˆThecommandserviceprocessorinvokestheSTATCMDroutineinresponseE*ˆtoastatuscommand.‚Itspurpose‚istosetuptheusertask'spara-F*ˆmeterblocktoreflectthe‚drive'scurrentstatusandconfiguration.*6*ˆEntry:„A1=pointertodrive'svariableblockinCCB*’A3=physicaladdressofDCB*’A4=physicaladdressofIOCB*’A5=physicaladdressofCCB/*’A6=physicaladdressofTCBofattachedtask**’D5=03*’D6=Channeldevice#forthediscdrive(DCBCDV)*!*ˆRegisterusage:…01234567 *™D‚*‰***™A‚*P*PPPP*7*ˆExit:…Fallsthroughtocommonexitroutine(CNDEXIT).*O******************************************************************************* STATCMD: :L0170„EQU†CONFGBLK+IOSATWˆSetupA2topointtotheIOSATW5‰LEA†L0170(A1),A2‰fieldoftheconfigureblockinthe%*¦drive'svariableareainthedrive-%*¦associatedportionoftheCCB.‚That&*¦configureblockcontainsthedrive's'*¦currentconfiguration,andthat'sthe)*¦configurationthatwewanttoreturnto*¦theusertask. 1‰BSR.S„STATCONFSubroutineSTATCONFsetsupA0to'*¦pointtotheIOSATMfieldoftheuser%*¦task'sstatusparameterblock.‚Sub-&*¦routineSTATCONFalsodeterminesthe$*¦drive'sdevicestatusandsetsthe#*¦firstgroupoffieldsintheuser *¦task< 'sstatusparameterblock. "*¨SubroutineSTATCONFdestroysthe'*¦valuesofregistersD6andD5,andit(*¦usestheinputvaluesofregistersA1,*¦A2,A4,A5,andA6. -‰PAGEš#######################################7L0110„EQU†IOATM<<16ŽSettheIOSATMfieldandtheIOSPRM:‰MOVE.Lƒ#L0110+IOPRM,(A0)+ƒfieldintheusertask'sstatus%*¦parameterblock.‚Thevaluesthatwe(*¦returntotheusertaskforthesemask%*¦fieldscontainallofthemaskbits"*¦thataresignificanttotheSASI&*¦driver.‚NoticethatweadvanceA0to'*¦pointtotheIOSATWfieldoftheuser *¦task'sstatusparameterblock.  7L0120„EQU†IOSDLN-IOSATWŠThecodebelowassumesthatthe6L0121„EQU†L0120/2Žconfigureblockcontainsanintegral8L0122„EQU†L0121*2Žnumberofwords(asitalwaysshould).9‰IFNE…L0120-L0122ŠIfthisassumptionisnottrue,wewant/‰FAIL…0”[****ERROR****ERROR****ERROR****],‰ENDCštogenerateanassemblyerrortoalert'*¦thecurrentmaintenanceprogrammerto&*¦theproblem.‚Theinstructionthatis$*¦normallyskippedheregeneratesan*¦assemblyerror. 7‰MOVEQWƒL0121-1,D0Thisloopcopiesthedrive'scurrent)*¦configurationvaluesfromtheconfigure@L0130„MOVE.Wƒ(A2)+,(A0)+Šblockinthedrive'sareaofthedrive-3‰DBRA…D0,L0130associatedportionoftheCCBtothe(*¦usertask'sstatusparameterblockone)*¦wordatatimeinsteadofonebyteata*¦timeforimprovedspeed. "*¨Controlfallsfromhereintothe!*¦commandprocessor'scommonexit *¦routine. -‰PAGEš#######################################O*********************************************************************************ˆCOMMONEXITROUTINE*B*ˆTheCMDEXIT‚routineisa‚commonexitroutinethatisusedbytheC*ˆmanydifferentpathsthroughthecommandserviceroutine.‚ControlC*ˆcomestooneofthreeentrypointsbelowtoterminateprocessing.*%*ˆEntry:„A3=physicaladdressofDCB*’A4=physicaladdressofIOCB*’A5=physicaladdressofCCB3*’A6=physicaladdressofTCBoftheattachedtask**D1.B=IOSSTAstatusvalue*!*ˆRegisterusage:…01234567*™D‚R* *™AˆPPPP**ˆExit:…ReturntoCMRviaRTS*O******************************************************************************* CMDEXIT: ;CMDEXIT1MOVEQBƒISTAOK,D1ŽControlreachesthispointinthe'*¦commandprocessorwhenwe'vefinished)*¦processingacommandwithnoerrorsand$*¦wewanttoqueueanI/Ocompletion(*¦eventtonotifytheattachedtaskthat)*¦theprocessingforthecommandhasbeen&*¦completedwithnoerrors.‚Thestatus&*¦valuethatwepickuphereindicates$*¦thatnoerrorshavebeendetected. -‰PAGEš#######################################6CMDEXIT2BSR†QEVENTTControlreachesthispointinthe'*¦commandprocessorwhenwe'vefinished%*¦processingacommandandwewantto)*¦queueanI/Ocompletioneventtonotify'*¦theattachedtaskthattheprocessing%*¦forthecommandhasbeencompleted.$*¦Thestatusvalueforthecompleted'*¦commandisinD1.Bwhencontrolcomes*¦here. #*¨Thisroutinecannotbeusedfora'*¦commandwhoseprocessingiscompleted(*¦underinterruptcontrolbecauseevents&*¦mustbequeueddirrerentlywhenthey'*¦arequeuedfromaninterrupthandler.(*¦Thisroutineisusedonlywhenwewant$*¦toqueueaneventfromthecommand'*¦serviceroutine,whichisnotinvoked*¦underinterruptcontrol. BCMDEXIT3MOVE.LƒSAVESP(A5),SPŠRestorethestackpointer,andclear4‰MOVEQ„#0,D0D0toindicatethatthecommandservice(‰RTS›routinehasoperatedproperly.‚Then$*¦returncontroltotheroutinethat$*¦calledsubroutineCOMMANDS.‚Notice(*¦thatwecanusethisreturnroutineto(*¦abortprocessingfromanylevelwithin(*¦thecommandserviceroutinebecausewe(*¦restorethestackpointertothevalue'*¦ithadwhensubroutineCOMMANDSbegan*¦executionatitsmainlevel. #*¨Ourhandlingofthestackpointer'*¦appearstoeliminatere-entrancy,but(*¦theSASIdriverisstillre-entrantin'< *¦thenecessarycontextbecausesubrou-%*¦tineCOMMANDScanneverbecalleda'*¦secondtimeforthesameSASIchannel(*¦untilwereturncontrolfromthefirst'*¦calltotheattachedtask.‚Subroutine)*¦COMMANDScanbecalledre-entrantlyfor#*¦anotherSASIchannelbecauseeach$*¦channelhasitsownCCB.‚Also,the'*¦SASIinterrupthandlercanbeinvoked%*¦whilesubroutineCOMMANDSisinthe*¦middleofitsexecution. -‰PAGEš#######################################O******************************************************************************** *ˆSTATUS/CONFIGURECOMMONCHORES*F*ˆThesubroutineSTATCONFperformsfunctionsthatarecommontostatus?*ˆcommands,configurecommands,anddefaultconfigurecommands.*6*ˆEntry:„A1=pointertodrive'svariableblockinCCB<*’A2=IOSATWfieldindrive'sconfigureblockofCCBorDCB*’A4=physicaladdressofIOCB*’A5=physicaladdressofCCB*!*ˆRegisterusage:…01234567*™DŒ** *™A‚*P…PP*&*ˆExit:…Returntothecallingroutine.*O******************************************************************************* STATCONF: ;‰MOVE.LƒIOSDBP(A4),D6ŠGetthephysicaladdressofthefirst9‰MOVE.Lƒ#IOSDLN,D5‹locationoftheusertask'sconfigure/4‰BSR†LOGPHY1ŽstatusparameterblockintobothD6and9STATCON1MOVE.LƒD6,A0A0.‚SubroutineLOGPHY1convertsthe'*¦logicaladdress(passedinD6)ofthe(*¦user'sparameterblockintoaphysical"*¦address.‚Wemustcallsubroutine)*¦LOGPHY1withA5containingthephysical(*¦addressoftheCCB,andwemustsetup(*¦D5tospecifythelength(inbytes)of'*¦theconfigure/statusparameterblock.$*¦TheCCBTASKAfieldoftheCCBmust)*¦containthephysicaladdressoftheTCB&*¦thatcontrolsthetaskthatownsthe#*¦configure/statusparameterblock.)*¦SubroutineLOGPHY1returnsthephysical'*¦addressoftheparameterblockinD6. &*¨SubroutineLOGPHY1abortsprocessing(*¦andreportsanerroriftheconfigure/(*¦statusparameterblockthatwespecify)*¦isnotentirelywithinamemorysegment)*¦thatbelongstothetaskthatallegedly*¦ownstheparameterblock. *Â(Continued)-‰PAGEš#######################################%*¨TheSTATCON1entrypointtosubrou-(*¦tineSTATCONFisaspecialentrypoint'*¦thatcanbeusedtosavetimewhenD6#*¦alreadypointstotheusertask's#*¦configure/statusparameterblock. 8‰TST.B„MOUNTED(A1)ŒIfthediscisnotcurrentlymounted,/‰SEQ.B„(A0)‘wesettheXDSNRBbitoftheIOSDST9‰AND.B„#1<L0250„EQU†CONFGBLK+IOSRTO†block.‚Theuserisn'tallowedtosetC‰MOVE.LƒL0240(A3),L0250(A1)‚orchangethesevalueswithaconfigure'*¦command,sowealwaysusethedefault%*¦values.‚Weneedtoputthesevalues&*¦intothecurrentconfigurationblock$*¦nowsowe'llhavetherightvalues)*¦therewhenwecopythemintotheuser's'*¦configureparameterblock.‚Also,this%*¦codesetsthesefieldsproperlyfor*¦subsequentstatuscommands. -‰PAGEš#######################################6L0260„EQU†1< susedbythe‚configure(CONFIG)anddefaultF*ˆconfigure(DFCONFIG)routines.‚Itspurposeistodomostofthework*ˆforbothofthem.*B*ˆEntry:„A0=pointertocurrentfieldofusertask'sconfigurepb;*’A1=pointertodrive'sconfigurationblockinCCBorDCB5*’A2=physicaladdressofIOSATWfieldinCCBorDCB*’A3=physicaladdressofDCB*’A4=physicaladdressofIOCB*’A5=physicaladdressofCCB/*’A6=physicaladdressofTCBofattachedtask*.*D1.W=MaskofbitsnotrecognizedinIOSPRM *D5.L=05*D6.L=Channeldevice#forthediscdrive(DCBCDV)*!*ˆRegisterusage:…01234567*™D‚*****PP*™A‚***PPPP*6*ˆExit:…Branchestocommonexitfordefaultconfigure.:*’Branchestocommonexitforconfigure-rigid(SASIonly).4*’BranchestoCNFGFLOProutineforconfigure-floppy.9*’BranchestoCNFGFLOProutineforconfigure-driveand/or$*”configure-media(WINCHESTERonly).*O******************************************************************************* CONFGCOM: 7‰MOVEM.L‚D6/D5,-(SP)ŒSaveD6andD5sowecanusethose%*¦registersasworkingregisters.‚The&*¦savedvalueofD6equalsDCBCDV,the&*¦channeldevicenumber,andthesaved#*¦valueofD5isaflagtoindicate&*¦whetherwe'reprocessingaconfigure)*¦commandoradefaultconfigurecommand. &*¨NoticethattheoriginalvalueofD5'*¦isnowthetopvalueonthestack,so*¦wecaneasilyaccessit. -‰PAGEš#######################################1‰BSR.S„STATCONFSubroutineSTATCONFsetsupD6to$*¦pointtothefirstlocationofthe(*¦usertask'sconfigureparameterblock,(*¦anditalsosetsupA0topointtothe&*¦IOSATMfieldoftheusertask'scon-'*¦figureparameterblock.‚Additionally,$*¦subroutineSTATCONFdeterminesthe$*¦drive'sdevicestatusandsetsthe#*¦firstgroupoffieldsintheuser#*¦task'sconfigureparameterblock. '*¨SubroutineSTATCONFdestroysregister%*¦D5,anditusestheinputvaluesof*¦registersA1,A2,A4,andA5. ,‰MOVE.Wƒ(A0)+,D0Copytheusertask'sIOSATM6‰MOVE.Wƒ(A0)+,D2(attribute-mask)fieldintoD0.W,and4L1‡SET†IOSATMgettheusertask'sIOSPRM(parameter-0L1‡SET†IOSPRMmask)fieldintoD2.W.‚Thesemasks%*¦indicatewhichattributesandwhich#*¦parameterfieldstheusertaskis'*¦specifyingintheconfigureparameter"*¦block.‚NoticetheuseoftheSET&*¦instructionstogenerateconcordance'*¦entriesforthefieldsthatweaccess*¦here.-‰PAGEš####################################### 0CONERR40EQU†$40”Iftheusertask'sIOSPRMfield:‰MOVEQBƒCONERR40,D3Šcontainsanybitsthatarenotallowed0‰AND.W„D2,D1fortheIOSPRMfield,abortwithan3‰BNE.S„CNERROR1errorreport.‚Ifweaborthere,the(*¦errorcodeinD3.Bwillbereturnedto&*¦theusertaskintheIOSDSTfieldof *¦theconfigureparameterblock. 0CONERR41EQU†$41”Iftheusertask'sIOSATMfield:‰MOVEQBƒCONERR41,D3Šcontainsanybitsthatarenotallowed7‰MOVEQWƒIOATMNOT,D1ŠfortheIOSATMfield,abortwithan0‰AND.W„D0,D1errorreport.‚Ifweaborthere,the6‰BNE.S„CNERROR1errorcodeinD3.Bwillbereturnedto&*¦theusertaskintheIOSDSTfieldof *¦theconfigureparameterblock. #*¨Ifwedon'taborthere,weendup(*¦withD1.W=0.‚We'lltakeadvantageof'*¦thatinitialD1.Wvaluelaterwhenwe *¦useD1.Wasanindexregister. #*¨NoticethatweuseaMOVEQWmacro%*¦here.‚ThisMOVEQWmacrogeneratesa(*¦one-wordMOVEQinstructionbecausethe)*¦currentvalueofIOATMNOTfitswithina&*¦singlebyte.‚However,IOATMNOTcould&*¦expandtorequireafullwordinthe%*¦future.‚Ifthathappens,theMOVEQW%*¦macrowillautomaticallygeneratea&*¦two-wordMOVE.Winstruction,andthe!*¦codeherewillcontinuetowork *¦properly.-‰PAGEš#######################################6‰TAS.B„ACTIVE(A1)Ifthecommandthatwe'reprocessing.‰BNE.S„L0810isthefirstconfigureordef> ault:‰MOVEQ.L‚#$FFFFFFFF,D0ˆconfigurecommandreceivedforthis<‰MOVEQ.L‚#$FFFFFFFF,D2ˆdiscsincesysteminitialization,set'*¦allbitsofD0andD2.‚Thesesettings)*¦forD0andD2willcauseustocopyall)*¦attributeandparameterfieldsfromthe'*¦usertask'sconfigureparameterblock(*¦intothedisc'scurrentconfiguration.(*¦ThisspecialcaseallowsIOStosetup%*¦thedisc'sinitialconfigurationto%*¦includeeventhedisc-configuration'*¦fieldsthatarenotrecognizedbythe*¦SASIdriver. 4L0810„AND.W„D0,(A0)SettheIOSATWfieldintheuser/‰NOT.W„D0“task'sconfigureblocktoreflectthe7‰AND.W„(A2)+,D0finalattributesthatwillbeineffect1‰OR.W…D0,(A0)Žwiththeproposedconfiguration.‚We3L1‡SET†IOSATWcomputethisfinalattributevalueby'*¦combiningtheattributebitsthatthe)*¦usertaskisspecifyingwiththevalues&*¦oftheremainingattributebitsfrom(*¦theexistingconfiguration.‚TheIOSATM&*¦valuefromtheusertask'sconfigure'*¦parameterblocktellswhichattribute'*¦bitstheusertaskisspecifying,and(*¦theotherattributebitscomefromthe*¦existingconfiguration. "*¨NoticetheuseoftheSETpseudo'*¦instructiontogenerateaconcordance)*¦entryfortheIOSATWfieldthatisused*¦andmodifiedhere.-‰PAGEš#######################################O*********************************************************************************ˆCommentedout12/16/83ˆBWN2*ˆThistestontheattributeswordisunnecessary.:*ˆIftheconfigurationisforarigiddisk,thenwedonot0*ˆlookatthefloppydiskattributebitsanyway.A*ˆAlso,therigidbitattributeisnolongerthemostsignificant6*ˆbitfortheSASIdriver.(Bit9isnowsignificant.)*7**CONERR42EQU†$42”If(1)thefinalattributesindicat;**‡MOVEQBƒCONERR42,D3Šthatthediscisarigiddiscand(2):**‡MOVEQWƒIOATM,D0theyalsospecifyanyattribute(s)that8**‡AND.W„(A0)+,D0applyonlytofloppydiscs,abortwith?**‡CMP.W„#1<*‚willreflectthetotalconfigurationthatisbeingproposed. F*ˆRecallthatD1.W=0fromabove.? ‚WealsohaveD2.W=IOSPRMfromtheH*‚usertask'sconfigureparameter‚block,‚orelsewe‚have‚D2.W=$FFFF‚ifK*‚we'reprocessing‚thefirst‚configurecommandordefaultconfigurecommandI*‚thathas‚been‚processedforthis‚discsincesystem-initialization‚time.L*‚Additionally,wehave‚A0=LOC(IOSREC)intheusertask'sconfigureparam-I*‚eterblock,‚andwe‚have‚A2=LOC(IOSREC)‚intheconfigureblockthatis*‚beingupdated. 1‰BRA.S„L0310’Branchintotheloopthatmergesthe#*¦parametervalues.‚We'lluseD1.W,%*¦whichequalszerofromabove,asan$*¦indexintotheCONFGLENtable.‚The$*¦CONFGLENtablecontainsaone-byte'*¦entryforeachparametervalueinthe&*¦configureblock,andthevalueofan(*¦entryisN-1whereNisthelength(in'*¦bytes)ofthecorrespondingparameter'*¦field.‚Theendofthetableismarked*¦bya-1sentinelvalue. %*¨Wecouldeasilyrearrangesomecode%*¦toeliminatethebranchinstruction&*¦thatisusedhere,buttheresulting*¦codewouldlosesomeclarity. -‰PAGEš#######################################O*********************************************************************************ˆCONFIGURATION-LENGTHTABLE*F*ˆThis‚tabledefinesthelengthofeachparameterfieldinaconfigureF*ˆblockforadiscdrive.‚ThereisoneentryintheCONFGLENtableforE*ˆeach‚parameterfieldina‚configureblock,andthevalueofatableD*ˆentryis‚N-1whereNis‚thelength(inbytes)‚ofthecorresponding*ˆparameterfield.*O******************************************************************************* CONFGLEN: +‰DC.B…IOSRSZ-IOSREC-1†Length(IOSREC)-1.“{+‰DC.B…IOSWTO-IOSRSZ-1†Length(IOSRSZ)-1.“{+‰DC.B…IOSRTO-IOSWTO-1†Length(IOSWTO)-1.“{+‰DC.B…IOSSPT-IOSRTO-1†Length(IOSRTO)-1.“{+‰DC.B…IOSHDS-IOSSPT-1†Length(IOSSPT)-1.“{+‰DC.B…IOSTRK-IOSHDS-1†Length(IOSHDS)-1.“{+‰DC.B…IOSILV-IOSTRK-1†Length(IOSTRK)-1.“{+‰DC.B…IOSSOF-IOSILV-1†Length(IOSILV)-1.“{+‰DC.B…IOSPSM-IOSSOF-1†Length(IOSSOF)-1.“{+‰DC.B…IOSSHD-IOSPSM-1†Length(IOSPSM)-1.“{,‰DC.B…IOSTRKD-IOSSHD-1…Length(IOSPSD)-1.“{.‰DC.B…IOSPCOM-IOSTRKD-1„Length(IOSTRKD)-1.’{.‰DC.B…IOSSPTD-IOSPCOM-1„Length(IOSPCOM)-1.’{.‰DC.B…IOSSRTD-IOSSPTD-1„Length(IOSSPTD)-1.’{,‰DC.B…IOSEWCC-IOSSRTD-1„Length(IOSSRTD)-1.+‰DC.B…IOSECC-IOSEWCC-1…Length(IOSEWCC)-1.*‰DC.B…IOSDRSV-IOSECC-1…Length(IOSECC)-1.&‰DC.B…-1“End-of-tablesentinelbyte.‹{ '‰DS.W†0•Thisstatementensuresthatthe'*¦locationcounterisalignedtoaword%*¦boundaryeveniftheCONFGLENtable%*¦happenstocontainanoddnumberof*¦bytes.-‰PAGEš#######################################*G*ˆThisloop,whichisenteredatL0310,processestheparameterfields.* 2L0280„ROR.W„#1,D2’BringthenextbitoftheIOSPRM&*¦fieldintobit15ofD2wherewecan*¦easilytestit. 0L0290„TST.W„D2•Iftheparameter-maskbitisset,2‰BMI.S„L0300theuserisspecifyingthisparameter3‰MOVE.Bƒ(A2),(A0)Œvalue.‚Otherwise,theuserisnot>L0300„CMP.B„(A2)+,(A0)+Šspecifyingthisparametervalue,sowe3‰DBRA…D0,L0290copytheparameterfromtheexisting$*¦configurationintotheusertask's&*¦configureparameterblock.‚Thisloop$*¦processesonebyteatatimeuntil$*¦we'veprocessedallbyte(s)ofthe%*¦currentparameterfield.‚Noticethe)*¦useoftheCMP.Binstructiontoadvance*¦bothaddressregisters. /‰ADDQ.Wƒ#1,D1’AdvanceD1.Wtoindextothenext$*¦byteoftheCONFGLENtable.‚Recall)*¦thatwehadD1.W=0whencontrolfirst*¦enteredthisloop. DL0310„MOVE.BƒCONFGLEN(PC,D1.W),D0ƒGetthenextentryoftheCONFGLEN,‰EXT.W„D0“tableintoD0.W.‚ThisvalueisN-14‰BGE.S„L0280whereNisthenumberofbyte(s)inthe%*¦nextparameterfield.‚Ifwehaven't#*¦reachedthenegativeend-of-table&*¦sentinelentry,loopbacktoprocess*¦thenextparameterfield. &*¨NoticethatA0pointstotheIOSDRSV$*¦fieldoftheusertask'sconfigure(*¦parameterblockwhencontrolfallsout'*¦ofthisloop.‚Similarly,A2poin? tsto$*¦theIOSDRSVfieldoftheconfigure%*¦blockfortheconfigurationthatis*¦beingupdated.-‰PAGEš#######################################G*ˆNowwewanttochecktheproposedconfigurationtoseeifitcontainsK*‚anyinvalid‚orinconsistentconfigurationvalues.‚Ifitdoes,we'llabort#*‚withanappropriateerrorreport. 6CONERR43EQU†$43”TheinterleavefactorforaSASIdisc9‰MOVEQBƒCONERR43,D3Šmustbeintherange1through16.‚If;L0320„EQU†IOSILV-IOSDRSV‡theIOSILVparameterisn'tinthis:‰MOVE.BƒL0320(A0),D0‰range,abortwithanerrorreport.‚If2‰SUB.B„#1,D0weaborthere,theerrorcodeinD3.B1‰LSR.B„#4,D0willbereturnedtotheusertaskin7CNERROR1BNE†CONERRORtheIOSDSTfieldoftheconfigure*¦parameterblock. !*¨Theinstructionthatislabeled%*¦CNERROR1isusedbyothercodeasa&*¦steppingstonesotheothercodecan&*¦gettoCONERRORwithouttheuseofa&*¦BNE.Linstructionintheothercode. 3CONERR44EQU†$44”TheSASIdrivercontainscodethat;‰MOVEQBƒCONERR44,D3Šassumesthatthelogicalsectorsizeis&*¦anonzeromultipleofLCDSCTSZwhere>L0325„EQU†IOSPSM-IOSDRSV‡LCDSCTSZisdefinedtobethelargest9‰MOVE.WƒL0325(A0),D0‰commondivisorofallpossiblevalid5‰BEQ.S„CNERROR2sectorsizes.‚Herewechecktoverify'*¦thatthelogicalsectorsize(IOSPSM)#*¦isnonzero.‚Ifweaborthere,the(*¦errorcodeinD3.Bwillbereturnedto&*¦theusertaskintheIOSDSTfieldof *¦theconfigureparameterblock. ;‰MOVEQ.L‚#VDOSRSZ>>2,D1‰NowwegettheVersadosrecordsize3‰ASL.L„#2,D1intoD1.L,andwesettheIOSRECfield?L0326„EQU†IOSREC-IOSDRSV‡oftheconfigureparameterblockequal;‰MOVE.WƒD1,L0326(A0)‰totheVersadosrecordsize.‚Wesavea)*¦wordofmemoryherebytakingadvantage&*¦ofthefactthattheVersadosrecord *¦sizeisevenlydivisibleby4. 8L0327„EQU†VDOSRSZ>>2IftheVersadosrecordsizeisever9L0328„EQU†L0327<<2changedsothatitisn'tamultipleof6‰IFNE…VDOSRSZ-L0328ˆ4,wewanttogenerateanassembly/‰FAIL…0”[****ERROR****ERROR****ERROR****]-‰ENDCšerrortoalerttheconfusedmaintenance'*¦programmertotheproblemthatarises(*¦here.‚Theinstructionthatisnormally$*¦skippedheregeneratesanassembly)*¦erroriftheVersadosrecordsizeisn't*¦amultipleof4.-‰PAGEš#######################################.‰DIVU…D0,D1’Werequirethatthelogicalsector*‰SWAP…D1“size(inD0.W)evenlydividesthe(*¦Versadosrecordsize(inD1)sowecan)*¦translateanintegralnumberoflogical(*¦sector(s)intoaVersadosrecord.‚Here(*¦wegettheremainderfromthedivision(*¦intoD1.W,andwesavethequotientin*¦thetophalfofD1. >‰AND.W„#(1<‰BTSTW„#IOARDISC,LC000(A0)‚logicalsectors.Determinerigidor1‰BNE.S„LC010floppyfromthe#IOARDISCbitofthe *%%%%%%%%%%%%%%%%%%%ƒ11/7/84‚BWN*B*„Checktomakesurethatthebytespersector,sectorspertrack,:*„anddatadensityvaluesareconsistentfor51/4"and8":*„diskettes.‚Ifnot,gotoCONERRORwithaerrorcode$47.**CONERR47EQU‡$47‰MOVEQB„CONERR47,D3‰BSR‡CHK_FLOPPY ‰BNE‡CONERROR‰MOVEQB„CONERR46,D3*L*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ééééé4‰ADDQ.Lƒ#1,D5attributesword.‚Iffloppy,setD5=1=‰BTSTW„#IOADSIDE,LC000(A0)‚forasingle-sideddisc.‚Determine0‰BEQ.S„L0845theactualnumberofsidesfromthe1‰ADDQ…#1,D5#IOADSIDEbitoftheattributesword.)‰BRA.S„L0845Ifdouble-sided,setD5=2.LC010;L0840„EQU†IOSHDS-IOSDRSV‰Wehavearigiddisc,socalculate)‰MOVE.BƒL0840(A0),D5‰thenumberofheads. 4L0845„MULU…D5,D2’Computethetotalnumberoflogicalí24‰BEQ.S„L0870subtractIOSSPT/2fromthetotalnumber2‰SUB.L„D0,D2oflogicalsectorstoaccountforthe>CNERROR3BLS.L„CONERRORfactthatthesectorsintrackzeroof'*¦adouble-densityfloppydiscareonly%*¦halfaslargeasnormalsectors.‚We)*¦nowhavethetotalcapacityofthedisc)*¦intermsoffull-sizedlogicalsectors.&*¦Ifthetotalcapacityofthediscin(*¦termsoffull-sizedlogicalsectorsis#*¦zeroorless,wereportanerror. !*¨Theinstructionthatislabeled%*¦CNERROR3isusedbyothercodeasa&*¦steppingstonesotheothercodecan&*¦gettoCONERRORwithouttheuseofa&*¦BLS.Linstructionintheothercode. 5L0870„MOVE.LƒD2,D0’Wewanttodividethedisc'stotal0‰CLR.W„D2“sectorcount(inD2)byVDOSRSZ/IOSPSM)‰SWAP…D2“(inD1)toobtainthetotaldisc/‰DIVU…D1,D2capacitytermsofVersadosrecords.>L0880„EQU†IOSRSZ-IOSDRSV‡Unfortunately,theresultingquotient:‰MOVE.WƒD2,L0880(A0)‰canbea32-bitnumber,andthe680002‰MOVE.WƒD0,D2islimitedto16-bitquotients.‚This1‰DIVU…D1,D2codeperformsthedivisiontoyielda8‰MOVE.WƒD2,L0880+2(A0)‡32-bitquotient,andwestorethe%*¦resultintotheIOSRSZfieldofthe(*¦usertask'sconfigureparameterblock.%*¦Wesimplydiscardtheremainder(if$*¦any),sotheusercan'taccessany$*¦partialVersadosrecordthatmight*¦existattheendofthedisc. *Â(Continued)-‰PAGEš#######################################%*¨Weperformthedivisionanalogously)*¦tothewayapersondoeslongdivision.)*¦Thedifferenceisthatweuseabaseof#*¦65,536insteadofbase10.‚Divide)*¦faultcan'toccuronthefirstdivision)*¦becausewereducethedividendtoa16-&*¦bitnumber.‚Dividefaultcan'toccur$*¦ontheseconddivisionbecausethe)*¦remainderinthetophalfofD2mustbe*¦lessthanthedivisor. 1‰IFEQ…VDOSRSZToguaranteethatdividefaultdoes/‰FAIL…0”[****ERROR****ERROR****ERROR****],‰ENDCšnotoccur,wemustassurethatVDOSRSZ"*¦isnonzero.‚Azerovalueforthe'*¦Versadosrecordsizeispreposterous,'*¦butweincludethistestforabsolute!*¦safety.‚Theinstructionthatis(*¦normallyomittedherewillgeneratean$*¦assemblyerrorifsomeonetriesto'*¦definetheVersadosrecordsizetobe*¦zero.-‰PAGEš#######################################G*ˆFinally,we'rereadytocopytheproposedconfigurationfromtheuserI*‚task's‚configure‚parameterblockintotheconfigureblockthatisbeing *‚updated.  @‰MOVEQWƒIOSDRSV-IOSATW-1,D0„Allparametersandattributesinthe=L0330„MOVE.Bƒ-(A0),-(A2)Šproposedconfigurationarevalid,so3‰DBRA…D0,L0330copytheproposedconfigurationinto#*¦theconfigureblockthatisbeing#*¦updated.‚Foraconfigurecommand,&*¦we'reupdatingthecurrentconfiguA re'*¦blockinthedrive'sareaoftheCCB,%*¦andforadefaultconfigurecommand&*¦we'reupdatingthedefaultconfigure'*¦blockinthedrive'sDCB.‚Noticethat)*¦wecopytheIOSATWfieldandallofthe)*¦parameterfields,butwedon'tcopythe%*¦maskfieldsbecausethemaskfields(*¦aren'treallypartofthetotaldevice*¦configuration. $*¨Attheconclusionofthisstep,A2#*¦pointstotheIOSATWfieldofthe'*¦configureblockthat'sbeingupdated,&*¦soA2issetproperlyforustocall*¦subroutineSTATCON1. /‰TST.L„(SP)“Recallthatthevalueontopofthe0‰BEQ.S„L0830stackiszeroifwe'reperforminga(*¦defaultconfigurecommand.‚Weskipthe$*¦nextsectionofcodeforadefault&*¦configurecommand,andweexecuteit)*¦onlyforanordinaryconfigurecommand.-‰PAGEš#######################################D*ˆThis‚section‚ofcode‚isexecutedonlyforaconfigurecommand,not"*‚foradefaultconfigurecommand.  :‰MOVE.WƒD1,SCTPVREC(A1)ˆSetSCTPVREC<--VDOSRSZ/IOSPSMto(*¦indicatethenumberoflogicalsectors'*¦inaVersadosrecord.‚Recallthatthe(*¦desiredvaluewascomputedearlierand%*¦waskeptinD1.‚Weneedtoknowhow'*¦manylogicalsector(s)thereareina)*¦Versadosrecordsowecanmakethedisc(*¦appeartocontainVersadosrecords.‚We"*¦don'twanttosetSCTPVRECfora#*¦defaultconfigurecommandbecause%*¦SCTPVRECiseffectivelypartofthe)*¦drive'scurrentconfiguration,notpart'*¦ofthedrive'sdefaultconfiguration. 7‰MOVE.WƒIOSOPT(A4),D0ŠIftheentireIOSOPTfieldofthe2‰BNE.S„L0820IOCBiszero,settheMOUNTEDflagto8‰ST.B…MOUNTED(A1)Šindicatethatthediscisnowmounted.(*¦AconfigurecommandwithazeroIOSOPT(*¦fieldisdefinedtobeaconfigureand*¦mountcommand. =L0820„ROL.W„#15-IOPDMNTB,D0ˆIftheIOPDMNTBbitoftheIOSOPT0‰BPL.S„L0830fieldoftheIOCBisset,clearthe9‰CLR.B„MOUNTED(A1)ŠMOUNTEDflagtoindicatethatthedisc(*¦isnowdismounted.‚Aconfigurecommand(*¦withthisoptionbitsetisdefinedto&*¦beaconfigureanddismountcommand. 5‰ST.B…DCBCCF(A3)Inthecaseofadismountcommandwe(*¦settheDCBCCFflaginthedrive'sDCB'*¦toindicatethattheoperatingsystem(*¦shouldreturnthedrivetoitsdefault*¦configuration.-‰PAGEš#######################################@*ˆControl‚converges‚here‚for‚both‚configure‚commands‚anddefault*‚configurecommands.  6L0830„BSR†STATCON1WecallsubroutineSTATCON1hereto)*¦updatetheIOSDST(device-status)field'*¦andtheIOSDTP(device-type)fieldin%*¦theusertask'sconfigureparameter'*¦block.‚Thedevice-statusfieldshould'*¦reflectthedisc'smounted/dismounted&*¦status,whichmayhavejustchanged,"*¦andthedevice-typefieldshould(*¦reflectthedevicetypethatisspeci-#*¦fiedbytheattributewordinthe%*¦configurationthatwejustchanged. '*¨NoticethatwestillhaveD6pointing(*¦totheusertask'sconfigureparameter)*¦blockwhenwecallsubroutineSTATCON1,'*¦andalsonoticethatwehaveregister(*¦A2pointingtotheIOSATWfieldofthe'*¦configureblockthat'sbeingupdated.!*¦RecallthatsubroutineSTATCON1(*¦destroysD5,buttheoriginalvalueof*¦D5isstillonthestack. #‰IFNE…DTYPEAssembleifWinchester."‰MOVEM.L‚(SP)+,D5/D6ŠRestoreRegs.1‰TST.L„D5“DoesD5containa0foradef-donfcmd?/‰BEQ†CMDEXIT1Doneifitdoes...branchtoexit.‰ENDC ‰IFEQ…DTYPEAssembleifSASI.8‰MOVEM.L‚(SP)+,D5/D6ŒRestoreD5andD6,whichweresaved&*¦atthebeginningofthisroutine.‚We'*¦nowhaveD5=0ifwe'reprocessinga)*¦defaultconfigurecommand,orD5=1if'*¦we'reprocessingaconfigurecommand.'*¦WealsohaveD6=DCBCDV,thechannel%*¦devicenumberofthedevicethatis*¦beingconfigured. (*****************************************¦**ˆTHEFOLLOWINGCOMMENTEDOUTƒ**¡KER‚*(**************************************** 2*ˆAND.B„D5,D4’D5=0ifwe'reprocessingadefault1*ˆBEQ†CMDEXIT1configuA recommand,andD4.B=0if$*¦we'reconfiguringarigiddisc.‚In)*¦eithercase,we'refinishedandweneed(*¦togoqueueanI/Ocompletioneventto*¦theattachedtask. !*¨Ifwe'reprocessingaconfigure(*¦commandthatconfiguresafloppydisc,(*¦wehaveD5=1andD4.B=$FF.‚Inthis$*¦case,wewanttosetupavariable#*¦blocktodescribeadefine-format&*¦commandsequencethatcanbesentto%*¦theSASIcontrollerunderinterrupt"*¦control.‚WemustinformtheSASI(*¦controllerifwechangethedensityor'*¦thenumberofsidesonafloppydisc. .**********************************************-*MODFORDTC520ASASICONTROLLER‚11/16/83**(*Modifiedforbothcontrollers…12/12/83*(*Typeofdisk…D4.B†BitIOASIZEofIOATW)*------------…-----…--------------------**Hardƒ8"Š0Šset*Floppy8"‰$FF‰set*Hardƒ51/4"†0Šclear*Floppy51/4"…$FF‰clear*.**********************************************  ‰TST.B…D5’TESTFORDEFAULT‰BEQ‡CMDEXIT1ŒDONEIFDEFAULTF***********************************************************************Ä*3*ˆModifiedforbothtypesofcontrollers12/12/83**Ä*F***********************************************************************=* If bit IOASIZE (9) of the attribute word (pointed to by A2)@* is 0, then we are dealing with a 5 1/4" disk and the following* code will be executed.6* Otherwise we are dealing with an 8" disk, so we will * go to MOD3*%‰BTSTW…#IOASIZE,(A2)‡IOASIZEbitset?'‰BNE‡MOD3Ifyes,gotoMOD3--it's8"*F********************************************************************** *‰LEA‡DTCCMD(A5),A0‡POINTTOCOMMANDPACKET#‰CLR.B…DTCFLAG(A5)‰ARMLOOPCOUNTER"‰TST.B…D4’TESTFORRIGIDORFLOPPY‰BNE.S…L0650AŽBRAFORFLOPPY;‰MOVE.L„#$C2000000,(A0)+„INITTOACLASS6,OPCODE2COMMAND(‰MOVE.W„#0,(A0)+ŒFORDTC520ACONTROLLER STVALUE‚EQU‡$0B3C0000 3‰MOVE.L„#STVALUE,D3‰GETSTEPVALUEDEFAULTSINTOD3 EQHEADS‚EQU‡IOSHDS+CONFGBLK -‰ADD.B…EQHEADS(A1),D3†SET#OFHEADS(BYTE4)‰SUBQ†#$1,D3Ž#OFHEADS-1**ˆB15•B0*ˆ-------------------------*‚D3„!…!…!…!…!*ˆ------------------------- *‹^…^…^…^*‹!…!…!…!---------(#HEADS)-1"*‹!…!…!---------------$0„STEPMODE)*‹!…!---------------------$3CƒSTEPPERIOD2*‹!---------------------------$0BƒSTEPPULSEWIDTH*0*ˆTHISTAKESCAREOF#HEADSANDTHESTEPVALUES*1‰MOVE.L„D3,(A0)+ŒMOVEDATATORAM(1STLONGWORD)*EQTRK„EQU‡IOSTRK+CONFGBLK *‰MOVE.W„EQTRK(A1),D3ˆGETTOTAL#CYLINDERS#‰MOVE.W„D3,D2SAVELOWERWORDIND2$‰AND.L…#$0000FFFF,D3‡MASKUPPERWORD(‰SWAP†D3’TOTAL#CYLINDERSINUPPERWORD,‰LSL.W…#7,D2DIVIDEBY2ANDPLACEINBYTE2‰ADD.W…D2,D3MOVEITINTOD3%‰AND.B…#0,D3MAKESURELASTBYTEIS0**ˆB15•B0*ˆ-------------------------*‚D3„!…!…!…!…!*ˆ------------------------- *‹^…^…^…^&*‹!…!…!…!---------SETTO0ˆ(TYPE/SEEK)0*‹!…!…!---------------(#CYLINDERS)/2(PRE-COMP)/*‹!…!---------------------#CYLINDERS…(LOBYTE)3*‹!---------------------------#CYLINDERS…(HIBYTE)*0*ˆTHISTAKESCAREOF#CYLINDERS&PRECOMPVALUE*‰MOVE.L„D3,(A0)+ŒSAVEINMEMORY ‰MOVE.W„#0,D3GET0,‰MOVE.W„D3,(A0)+ŒCLEARLAST2BYTESOFBLOCK 1‰LEA‡DTCCMD(A5),A0‡GETPOINTERTOPARAMETERBLOCK‰MOVE.B„D6,D3GETLUNFIELD‰LSL.B…#5,D3SHIFTLUNFIELD-‰MOVE.B„D3,1(A0)ŒPLACELUNINPARAMETERBLOCK  ‰MOVEQ.Lƒ#0,D3CLEARD3‰MOVEQ.Lƒ#0,D4CLEARD4 ‰BRA‡CNFGFLOP-‰PAGEš#######################################7L0650AƒMOVE.L„#$C0000000,(A0)+„CLASS6,OPCODE0COMMAND‰MOVE.W„#0,(A0)+ŒINTODTCCMD 0STVAL1ƒEQU‡$17060015‹FORMICROPOLIS1115-6DRIVE !‰MOVE.L„#STVAL1,D0ŠSETUPDTCDATA **ˆB15•B0*ˆ-------------------------*‚D0„!…!…!…!…!*ˆ------------------------- *‹^…^…^…^'*‹!…!…!…!---------HEADSETTLETIME15mS8*‹!…!…!---------------MAXCYLINDERADDRESSSETTO0HERE,*‹!…!---------------------STEPINTERVAL„6mS4*‹!---------------------------STEPPULSEWIDTH1B 7uS*4*ˆTHISTAKESCAREOF#CYLINDERS&TIMINGPARAMETERS* '‰MOVE.W„EQTRK(A1),D3ˆGET#OFCYLINDERS-‰AND.L…#$FFFF00FF,D0‡MAKESUREFIELDISCLEAR-‰AND.L…#$0000FFFF,D3‡MAKESUREFIELDISCLEAR‰LSL.W…#8,D3PUT#INBYTE1(‰ADD.L…D3,D0PUTINMAXCYLINDERADDRESS‰MOVE.L„D0,(A0)+ŒPUTINDTCDATA 0STVAL2ƒEQU‡$CD000B80‹FORMICROPOLIS1115-6DRIVE -‰MOVE.L„#STVAL2,(A0)+‡NOMODIFICATIONSPASSED **ˆB15•B0*ˆ-------------------------*‚D0„!…!…!…!…!*ˆ------------------------- *‹^…^…^…^(*‹!…!…!…!---------DRIVEIDENTIFIER-$803*‹!…!…!---------------DELAYAFTERWRITEDE-ASSERTED7*‹!…!---------------------VALIDDATAAFTERDRIVESELECT:*‹!---------------------------VALIDDATAAFTERHEADSELECT*0*ˆTHISTAKESCAREOFADDTIONALTIMINGPARAMETERS* -‰MOVE.W„#0,(A0)+ŒLAST2BYTES0BYDEFINITION 6‰LEA‡DTCCMD(A5),A0‡NOWGOBACKANDFIXDENSITY&SIDES BYTE5„EQU‡5“LASTBYTEINDTCCMD!EQCNFGƒEQU‡IOSATW+CONFGBLK…IOSATW *‰MOVE.B„BYTE5(A0),D0ˆGETFIELDINQUESTION ‰MOVE.W„EQCNFG(A1),D3‡GETIOSATW+‰BTST†#IOATDEN,D3‰SINGLEORDOUBLEDENSITY?‰BEQ.S…MOD1BRAIFSINGLE%‰OR.B†#6,D0THESEBITSARESETFOR2D-MOD1…BTST†#IOADSIDE,D3ˆSINGLEORDOUBLESIDED‰BEQ.S…MOD2BRAIFSINGLE‰OR.B†#1,D0THISBITSETFOR2S&MOD2…MOVE.B„D0,BYTE5(A0)ˆREPLACEFIELD ‰MOVE.B„D6,D3GETLUNFIELD‰LSL.B…#5,D3SHIFTLUNFIELD(‰MOVE.B„D3,1(A0)ŒPLACELUNINDATAFIELD ‰MOVEQ.Lƒ#0,D3CLEARD3‰MOVEQ.Lƒ#0,D4CLEARD4‰BRA.S…CNFGFLOP 2* THE FOLLOWING CODE IS NOT NOW USED. RWM 11/17/83*E* The following code will be used for the 8" SASI drive. BWN 12/12/83*'* We get to MOD3 if we have an 8" SASI.=* If D4.B = 0 then it's a hard disk, so we can go to CMDEXIT1B* If D4.B = $FF then it's a floppy so we have a little work to do.* MOD3…EQU‡* ‰TST.B…D4 ‰BEQ‡CMDEXIT1K****************************************************************************0*ƒModifiedforthe1403EScontroller1/10/84ƒBWN**ƒTrackformatbyte:*!*ˆ00ˆSingledensity,singlesided *ˆ01ˆSingledensity,doublesided *ˆ06ˆDoubledensity,singlesided *ˆ07ˆDoubledensity,doublesided** ‰CLR.L…D4 L1‡SET‡IOSATW/‰MOVE.W„(A2),D0GettheattributeswordintoD0"‰BTST†#IOADDEN,D0‰Doubledensity?‰IF‚‚THEN.S˜Ifso,"“BSET†#CMDDDEN,D4‰setbits1and2“BSET†#CMDDDEN2,D4‰ENDI ‰BTST†#IOADSIDE,D0ˆDoublesided?‰IFƒƒTHEN.S#“BSET†#CMDDSIDE,D4ˆIfso,setbit0‰ENDI4‰MOVEQ.Lƒ#0,D3ClearD3forconfigurefloppyroutine7‰BRA.S…CNFGFLOPŒBranchtotheconfigurefloppyroutine.*M******************************************************************************'*‚Thefollowingcodeisnolongerused.*<‰MOVEQ.L‚#1<‰ADDQ.Wƒ#1<*’D2=DesiredCTRLCODEvalue(forSASIconfigure-floppyonly)+*’D5=0forread,writeorformatcommand;*•=1foraconfigurecommand3*’D6=Channeldevice#forthediscdrive(DCBCDV)*!*ˆRegisterusage:…01234567*™D‚********™A‚******P*2*ˆExit:…Branchestocommonexitroutine(CMDEXIT).*O******************************************************************************* READCMD: @‰MOVEQ.L‚#READFUNC-WRTFUNC,D5ƒControlentersatthisentrypoint(*¦whenwe'vereceivedareadcommand.‚We$*¦setupD5.Lsoitwillcontainthe#*¦value+2whencontrolreachesthe(*¦commoncommand-processingroutinethat&*¦isusedforread,write,format,and&*¦configure-floppycommands.‚Thevalue'*¦+2meansthatareadcommandisbeing *¦processed. >WRITECMDSUB.L„#-WRTFUNC,D5‹Controlentersatthisentrypoint&*¦whenwe'vereceivedawritecommand.$*¦WesetD5.Lsoitwillcontainthe&*¦value-1whencontrolfallsintothe(*¦commoncommand-processingroutinethat&*¦isusedforread,write,format,and&*¦configure-floppycommands.‚Thevalue&*¦-1indicatesthatawritecommandis*¦beingprocessed. -‰PAGEš#######################################.FORMATƒEQU†*–Controlcomestothisentrypoint'*¦whenwe'vereceivedaformatcommand.(*¦WeleaveD5.Lalonebecauseitalready&*¦containsthevaluezero,whichindi-&*¦catesthataformatcommandisbeing *¦processed. D*ˆThefirstpart‚ofthisroutineisusedforread,‚write,‚andformat6*‚commands,butitisnotusedforconfigurecommands.  4‰MOVEQBƒCTRLDFLT,D4ŒSetD4.Btoprovidethestandard$*¦defaultCTRLCODEvalueforaread,(*¦write,orformatcommand.‚ThestanC dard'*¦defaultCTRLCODEvaluetellstheSASI)*¦controllertoperformautomaticretries&*¦andautomaticdataerrorcorrection. 7‰MOVE.LƒIOSRRN(A4),D3ŠGetthespecifiedVersadosrecord'*¦numberfromtheusertask'sIOCBinto(*¦D3.‚Noticethatthenumberwegethere(*¦isaVersadosrecordnumber,andwe'll%*¦laterneedtotranslatethatnumber(*¦intoalogicalsectornumber.‚Versados)*¦recordsdon'tnecessarilycorrespondto(*¦logicalsectorsonaone-to-onebasis. 8‰MOVEQBƒISTADNM,D1Ifthediscthatisbeingaccessedis6‰TST.B„MOUNTED(A1)Šnotmounted,rejectthecommandand3‰BEQ†CMDEXIT2returnanerrorcodetoindicatethat#*¦thediscisnotmounted.‚Wedon't&*¦allowtheusertoaccessthediscif"*¦thediscisn'tmounted.‚Ifwe're"*¦performingaconfigureandmount$*¦command,thedischasalreadybeen%*¦mountedbythetimecontrolreaches(*¦thispoint.‚Ifthediscisn'tmounted,(*¦theusercanemploytheVersadosmount*¦commandtomountit. 3CNFGFLOPEQU†*–Controlcomestothisentrypointto)*¦completetheprocessingforaconfigure'*¦commandthatconfiguresafloppy-disc'*¦drive.‚WeleaveD5.Lalonebecauseit&*¦alreadycontainsthevalue+1,which%*¦indicatesthattheprocessingfora#*¦configure-floppycommandisbeing%*¦completed.‚Wealsohavethedesired)*¦CTRLCODEvalueinD4whencontrolcomes)*¦tothisentrypoint,andwehaveD3=0#*¦uponentrytothisentrypointto(*¦provideadummyVersadosrecordnumber%*¦thatwillpassallvaliditychecks. "*¨Controlfallsfromhereintothe(*¦commoncommand-processingroutinethat&*¦isusedforread,write,format,and*¦configure-floppycommands. )‰IFNE…DTYPEAssembleifWinchesterdriver-‰PAGEš#######################################,‰MOVEQ„#0,D4UseD4toholdthecontrolcode5L0652„EQU†CONFGBLK+IOSATW†ReadoptionfieldinIOSATW‰MOVE.WƒL0652(A1),D0‰Getit ‰BTST…#IOATDEN,D0ŠTrackdensity?&‰BEQ.S„STAG10Leaveaszeroforsingle%‰BSET…#CTD,D4ŽSetthatbitfordouble $STAG10ƒBTST…#IOAFRMT,D0ŠFormattype?(‰BNE.S„STAG20LeaveaszeroforIBM-type,‰BSET…#CSN,D4ŽSetthatbitforMotorolatype *STAG20ƒBTST…#IOADDEN,D0ŠRecordingdensity?+‰BEQ.S„STAG30Leaveaszeroforsingle(FM)+‰BSET…#CMF,D4ŽSetthatbitfordouble(MFM) STAG30ƒBTST…#IOADSIDE,D0‰Sides?&‰BEQ.S„STAG35Leaveaszeroforsingle%‰BSET…#CDS,D4ŽSetthatbitfordouble STAG35ƒEQU†*”Labelforbranch3STAG40ƒEQU†CONFGBLK+IOSPSM†Readcurrentrecordsize‰MOVE.WƒSTAG40(A1),D0ˆGetit#‰MOVEQ„#0,D1Clearworkingregister2STAG45ƒSUB.W„#128,D0ŽSubtractoutmin.recordsize,‰BEQ.S„STAG50SizefoundwhenD0equalszero‰ADD.B„#1,D1Incrementcounter‰BRA†STAG45Andtryagain,STAG50ƒLSL.B„#3,D1Positionsectorsizecode‰OR.B…D1,D4Setthosebits %‰BCLR…#CDM,D4ŽClearno-DMAbitalways*‰BSET…#CIE,D4ŽSetcommandinterruptenable‰ENDC -‰PAGEš#######################################F*ˆThispointmarksthebeginningof‚thecommoncommand-processingrou-K*‚tinethatisusedforread,‚write,‚format,andconfigure-floppycommands.M*‚ControlfallsintothisroutinefromabovewithD5settoindicatethetypeK*‚ofcommandthatisbeingprocessed.ƒWehaveD5.L=+2forareadcommand,J*‚D5.L=+1‚foraconfigure-floppycommand,‚D5.L=0‚foraformatcommand,$*‚andD5.L=-1forawritecommand. A*ˆWe‚alsohave‚D4.B‚containingthe‚desired‚CTRLCODE‚valuefortheL*‚commandthatisbeingprocessed,‚andwehaveD3containingtheappropriate)*‚Versadosrecordnumberforthecommand. 5‰LEA†IOPKTEND(A1),A2ˆPointA2tothewordimmediately$*¦followingthelastwordoftheI/O#*¦packetinthedrive'sareaofthe&*¦drive-associatedportionoftheCCB."*¦We'lluseA2withauto-decrement&*¦addressingtofillintheI/Opacket%*¦valuesthatdescribetheI/Otrans-!*¦actionthatisbeingrequested. &*¨[******Warning******]‚Weuseauto-&*¦decrementaddressinginthisroutine'*¦insteadofreferringtofieldsinthe)*¦I/C Opacketbytheirnames,sotheorder(*¦inwhichthefieldsofthedrive'sI/O(*¦packetaredefinedmustnotbealtered)*¦withoutfirstconsideringthisroutine. =‰MOVE.LƒCCBTASKA(A5),A0ˆPointA0totheTCBthatcontrolsthe%*¦taskthatownstheIOCBfortheI/O%*¦commandthatisbeingprocessed.‚If(*¦thecommandthatisbeingprocessedis&*¦anordinarycommandthatrequiresan)*¦I/Obuffer,thetaskthatownstheIOCB*¦alsoownstheI/Obuffer.-‰PAGEš#######################################<‰MOVE.WƒIOSOPT(A4),-(A2)‡CopytheI/Ooptionsfieldfromthe3L1‡SET†IOOPTSIOCBintotheI/Opacket.‚Ifthesign0‰BPL.S„L0360bitoftheIOSOPTfieldisset,the&*¦IOCBincludesanIOSTSKfieldandan(*¦IOSSESfield.‚Thesefieldscanbeused&*¦byasystemtasktospecifythetask)*¦thatownstheI/Obufferwhenthattask)*¦isn'tthesametaskthatownstheIOCB.'*¦TheIOSTSKfieldandtheIOSSESfield(*¦shouldneverbeincludedwithaformat'*¦commandoraconfigure-floppycommand(*¦becauseneitheraformatcommandnora%*¦configure-floppycommandhasanI/O *¦buffer. '*¨NoticetheuseoftheSETinstruction)*¦togenerateaconcordanceentryforthe *¦IOOPTSfieldthatissethere. '*¨WecopyfieldsfromtheIOCBintothe'*¦I/Opacketfortwoimportantreasons.&*¦(1)‚Wewantthefieldstobequickly&*¦accessibletotheinterrupthandler.'*¦(2)‚ThetaskthatownstheIOCBmight)*¦continueexecutionwhiletheI/Otrans-&*¦actionisbeingdoneunderinterrupt)*¦control,andthetaskmightchangesome%*¦ofthevaluesintheIOCB.‚Sincewe)*¦can'ttrusttheintegrityofthefields(*¦intheIOCB,wemakeourowncopiesof&*¦theonesweneed.‚Thustheinterrupt&*¦handlerwon'trunamokbyusingIOCB'*¦valuesthatcouldcapriciouslychange*¦atrandomtimes.-‰PAGEš#######################################H*************************************************************************/*ˆBWN2/28/84‰Codeaddedforalternatesectors. *ˆPJD9/19/847*ˆHerewechecktheoptionsfieldforaformatcommand.>*ˆIftheoptionsfieldisnotcorrect,weabortwithaISTAIOP*ˆerrormessage.*3**‡TST.B…D5ˆAtthistime,D5holdstheI/Ofunction+*œcode.‚Ifnon-zero,wedon'thaveaformat$*œcommand,sowecanskipthistest.**‡BNE.S…L03655**‡MOVE.W„IOOPTS(A1),D0‡GettheoptionsfieldintoD0!**‡CMP.W…#IOPDSK,D0ŠFormatdisk? **‡BEQ.S…L0365Yes,passestest."**‡CMP.W…#IOPTRK,D0ŠFormattrack? **‡BEQ.S…L0365Yes,passestest.&**‡CMP.W…#IOPBAD,D0ŠFormattrackbad? **‡BEQ.S…L0365Yes,passestest.**ˆWehaveabadoptionsfield.*-**‡MOVE.B„#ISTAIOP,D1‰PuterrorcodeintoD1,**‡BRA‡CMDEXIT2Œandabort.*L0365*A*ˆDecidedtocommentthisout.Ifneitherformattracknorformat<*ˆtrackbadarechosen,thecommanddefaultstoformatdisk.*O******************************************************************************* -‰PAGEš#######################################B*ˆThis‚sectionof‚code‚isexecutedonly‚when‚theIOCBincludestheI*‚optionalIOSTSKandIOSSESfields.„Thesefieldsdesignatethe‚taskthatL*‚owns‚theI/ObufferwhenthetaskthatownstheIOCBisasystemtaskthat*‚doesn'towntheI/Obuffer.  6‰LEA†IOSTSK(A4),A0ŠWeneedtogetapointertotheTCB5‰MOVE.LƒA1,-(SP)thatcontrolsthetaskthatownsthe7‰MOVE.Lƒ#T0GETTCB,D0‰I/Obuffer.‚TheT0GETTCBexecutive/‰TRAP…#EXECrequestusesA0asapointertothe4‰BRA.S„L0350IOSTSK/IOSSESpacket,anditreturnsA0)*¦withapointertotheTCBthatcontrols"*¦thespecifiedtask.‚TheT0GETTCB(*¦executiverequestdestroysA1,D0,D1,)*¦andD2,butwepreservethevalueofA1$*¦bysavingitonthestack.‚Control%*¦returnsfromtheT0GETTCBexecutive(*¦requesttotheinstructionimmediately&*¦followingtheTRAPinstructionifno*¦errorsaredetected. 4L0340„BRA†BADBUFADControlreturnsfromtheT0GETTCB(*¦executiverequesttothispointifthe'*¦specifiedtaskdoesn'texist.‚Inthis%D *¦case,wereportanerrorindicating$*¦thatthespecificationfortheI/O%*¦bufferisbad.‚Noticethatwedon't(*¦needtocleanupthestackbecausethe*¦errorroutinecleansitup. '*¨Controlmaybranchtothispointfrom(*¦belowinoneormorecasestomakethe*¦samekindoferrorreport. 8L0350„MOVE.Lƒ(SP)+,A1RestoreA1topointtothedrive's)*¦areaofthedrive-associatedportionof *¦theCCB.-‰PAGEš#######################################D*ˆWhencontrolreachesthispoint,theregistersaresetasfollows: #*‚A6ƒ=LOC(TCBofattachedtask).©{*‚A5ƒ=LOC(CCB).º{*‚A4ƒ=LOC(IOCB).¹{*‚A3ƒ=LOC(DCB).º{)*‚A2ƒ=LOC(IOOPTSfieldofI/OPacket).£{J*‚A1ƒ=LOC(DiscDrive'svariableblockindrive-associatedareaofCCB).‚{K*‚A0ƒ=LOC(TCBoftaskthatownstheI/Obuffer)ifthereisanI/Obuffer.D*‡=LOC(TCBoftaskthatownstheIOCB)ifthereisnoI/Obuffer.…{ <*‚D6.B=DCBCDV,ChannelDeviceNumberforthediscdrive.’{A*‚D5.L=IOFUNCT,I/Ofunctioncode.‚+2=read,+1=configure,Œ{*¦0=format,-1=write.{8*‚D4.B=CTRLCODE,control-codevalueforthecommand.–{;*‚D3.L=IOSRRN(orzeroforaconfigure-floppycommand).“{*‚D2ƒ=Scratch.»{*‚D1ƒ=Scratch.»{*‚D0ƒ=Scratch.  :L0360„MOVE.BƒD6,-(A2)CopythedrivenumberfromD6.Binto6‰MOVE.BƒD5,-(A2)theDRIVENUMfieldoftheI/Opacket,6‰MOVE.BƒD4,-(A2)copythefunctionflagfromD5.Binto4L1‡SET†DRIVENUMtheIOFUNCTfieldoftheI/Opacket,2L1‡SET†IOFUNCTŽandcopythecontrolcodefromD4.B2L1‡SET†CTRLCODEintotheCTRLCODEfieldoftheI/O#*¦packet.‚NoticetheuseoftheSET&*¦instructionstogenerateconcordance'*¦entriesforthefieldsthatwemodify*¦here. $*¨Theinterrupthandlercouldeasily(*¦determinethedrivenumberforitself,$*¦butweimprovespeedbymakingthe(*¦drivenumberdirectlyavailableinthe(*¦I/Opacket.‚TheIOFUNCTfieldcontains!*¦+2forareadcommand,+1fora#*¦configure-floppycommand,0fora#*¦formatcommand,or-1forawrite&*¦command.‚Finally,theCTRLCODEfield'*¦containsthestandarddefaultcontrol#*¦codeforaread,write,orformat(*¦command,anditcontainsthespecified%*¦controlcodeforaconfigure-floppy *¦command.-‰PAGEš#######################################M*******************************************************************************ˆBWN2/13/84‰PJD‚9/19/84***ˆForalternatesectorscommandforRWIN1:B*ˆOffsetIOSALT=IOSSADholdsthesectornumberforthe‚alternateC*ˆsector,andwewanttosaveitinIOBUFLOC=IOALTSEC,sowewill@*ˆputIOSSADintoD6alittleearlier,thenskipovertheLOGPHY *ˆroutine.*‰MOVE.L„IOSSAD(A4),D6**K*************************************************************************** 1‰ASR.L„#1,D5’Ifwe'reprocessingaformatcommand4‰BEQ.S„L0370oraconfigure-floppycommand,clearD5&*¦andskipthesectionthatdetermines'*¦theaddressandthelengthoftheI/O&*¦buffer.‚ThereisnoI/Obufferfora&*¦formatcommandoraconfigure-floppy'*¦command.‚ThezerothatwegetintoD5%*¦herewillbeusedlatertoindicate(*¦thatthebufferlengthforaformator#*¦configure-floppycommandiszero. %*¨Controlfallsthroughhereifwe're&*¦processingareadcommandorawrite *¦command. O*********************************************************************************ˆBWN‚2/13/84ˆPJD‚9/19/84*A*ˆJustcommentingoutthatIOSSADmoveintoD6thatwedidabove.*<***†MOVE.LƒIOSSAD(A4),D6ŠGetthephysicaladdressoftheI/O*L****************************************************************************<‰MOVE.LƒIOSEAD(A4),D5ˆbufferintoD6,andgetthelength(in.‰SUB.L„D6,D5bytes)oftheI/ObufferintoD5.4‰ADD.L„#1,D5SubroutineLOGPHYrequiresthebuffer's0‰BSR†LOGPHYlogicaladdressanditslengthinD6&*¦andD5asinputs,andthesubroutine(*¦alsoassumesthatA0pointstotheTCB&*¦thatcontrolsthetaskthatownsthe#*¦I/Obuffer.‚RecallthatwesetA0(*¦earlier.‚SubroutineLOGPHYreturnsthe)D *¦buffer'sphysicaladdressinD6,andit *¦preservestheotherregisters. %*¨IfthespecifiedI/Obufferdoesn't$*¦residewithinthespecifiedtask's'*¦memoryarea,subroutineLOGPHYaborts"*¦withanerrorreport.‚Subroutine)*¦LOGPHYalsoabortswithanerrorreport(*¦ifthebufferlengthiszerooranodd *¦number.-‰PAGEš#######################################>*ˆControl‚converges‚at‚this‚point‚for‚read,‚write,‚format,‚andB*‚configure-floppycommands.‚Theregistersarenowsetasfollows: #*‚A6ƒ=LOC(TCBofattachedtask).©{*‚A5ƒ=LOC(CCB).º{*‚A4ƒ=LOC(IOCB).¹{*‚A3ƒ=LOC(DCB).º{+*‚A2ƒ=LOC(CTRLCODEfieldofI/OPacket).¡{J*‚A1ƒ=LOC(DiscDrive'svariableblockindrive-associatedareaofCCB).‚{K*‚A0ƒ=LOC(TCBoftaskthatownstheI/Obuffer)ifthereisanI/Obuffer.D*‡=LOC(TCBoftaskthatownstheIOCB)ifthereisnoI/Obuffer.…{ 5*‚D6.L=LOC(I/OBuffer)ifthereisanI/Obuffer.™{<*‰Alternatesectornumberifthisisa"formattrackasbad"*‰command.Otherwise,garbage.J*‚D5.L=Length(I/OBuffer)intermsofbytesifthereisanI/Obuffer.„{J*‚D4ƒ=Scratch.‚TobeusedtocomputeIOSECTOR,thelogicalsectornumber.;*‚D3.L=IOSRRN(orzeroforaconfigure-floppycommand).“{G*‚D2ƒ=Scratch.‚TobeusedtocomputeIOSCTCNT,thecountofsectors.„{*‚D1ƒ=Scratch.»{*‚D0ƒ=Scratch.  1L0370„EQU†*–Dividethebuffersize(inD5)bytheM*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>* *ˆBWN‡3/2/84*"‰IFNE†DTYPEAssembleifWinchester**<*ˆWewanttofindtheaddressofthelastbyteintheuser's!*ˆbufferandsaveitinIOBUFEND.6*ˆThiswillenableustodoublecheckthatwewillnot8*ˆread‚pasttheendofthebuffer,whichcouldbenasty.***‰MOVE.L„D5,D4D4<---LengthofI/Obuffer.‰ADD.L…D6,D4D4<---Startingaddress+length!‰SUBQ.L„#1,D4—-1=endingaddress‰MOVE.L„D4,IOBUFEND(A1)***‰ENDCC*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>?L0380„EQU†CONFGBLK+IOSREC†Versadosrecordsize.‚Thequotientin<‰DIVU.WƒL0380(A1),D5‰D5.WtellsushowmanyVersadosrecords'*¦weneedtoprocess,andtheremainder&*¦inthetophalfofD5shouldbezero)*¦becausewedon'tallowanyI/Otransfer"*¦thatinvolvesapartialVersados *¦record. '*¨Wedon'tneedtoworryaboutdividing#*¦byzeroherebecausetheVersados$*¦recordsizeisanonzeroconstant.(*¦Furthermore,weknowthattheVersados)*¦recordsizeinthedisc'sconfiguration&*¦blockisvalidbecausewe'vealready"*¦checkedtomakesurethediscis$*¦mounted,andthediscismarkedas)*¦beingmountedonlyatthecompletionof)*¦asuccessfulconfigure/mountoperation. &*¨Ifanoutrageouslylargebuffersize)*¦causesdividefault,thetophalfofD5'*¦willendupwithanonzerovalue;and)*¦we'llcheckforthaterrormomentarily. &*¨Foraformatcommandoraconfigure-&*¦floppycommandwehaveD5=0,sowe&*¦getazeroquotienttoindicatethat(*¦thereisnodatatransferforaformat(*¦commandoraconfigure-floppycommand.-‰PAGEš#######################################1‰MOVEQ.L‚#0,D2’MovethecountofVersadosrecords2‰MOVE.WƒD5,D2intoD2,andreportabuffer-address4‰CMP.L„D5,D2errorifthetophalfofD5isnonzero.1‰BNE.S„L0340ThetophalfofD5canbenonzeroin$*¦oneoftwoways.‚Eitherthebuffer(*¦sizeisn'tanintegralmultipleofthe#*¦Versadosrecordsize,orelsethe)*¦buffersizeissolargethatitexceeds)*¦thecapacityof65,535Versadosrecords$*¦(i.e.,16,776,960bytes).‚Withthe)*¦presentleveloftechnologythereisno'*¦needtoallowasingleI/Ocommandto(*¦specifyatransferofmorethan65,535*¦Versadosrecords. '*¨D2nowcontainsacountofthenumber&*¦ofVersadosrecordstobeprocessed.)*¦We'lllaterneedtoconvertthatnumber"*¦intoacountoflogicalsectors. ;L0890„EQU†CONFGBLK+IOSRSZˆNowchecktoseeifthespecified6‰MOVE.LƒL0890(A1),D0‰VersadosrecoE rdnumber(inD3)is2‰SUB.L„D3,D0beyondtheendofthedisc,andabort/‰BLS.S„L0730withanerrorreportifitis.‚The#*¦userhasaseriousproblemifthe)*¦specifiedstartingrecordisbeyondthe%*¦endofthedisc.‚RecallthatIOSRSZ(*¦specifiesthetotalnumberofVersados'*¦recordsavailableontheentiredisc.&*¦Sincetherecordnumberofthefirst&*¦recordiszero,therecordnumberof)*¦thelastVersadosrecordonthediscis *¦IOSRSZ-1. #*¨Foraconfigure-floppycommandwe)*¦haveD3=0,sotheerrorcheckthatwe(*¦makeheredegeneratesintoaNOPfora*¦configure-floppycommand. '*¨NoticethatwenowhaveD0.Lequalto)*¦thenumberofVersadosrecordsthatare$*¦availablefromthestartingrecord*¦throughtheendofthedisc.-‰PAGEš#######################################7‰MOVEQBƒISTAOK,D1ŽInitializeD1.Btocontainthestatus1‰CMP.L„D0,D2codethatisusedwheneverythingis4‰BLS.S„L0900OK,andthenchecktoseeiftherecord&*¦countexceedsthenumberofVersados(*¦recordsthatareavailablebetweenthe$*¦startingrecordandtheendofthe#*¦disc.‚RecallthatD2containsthe)*¦specifiedcountofVersadosrecordsfor'*¦theI/OtransferandthatD0contains&*¦acountoftheVersadosrecordsthat(*¦areavailablefromthestartingrecord%*¦throughtheendofthedisc.‚D2=0&*¦foraformatcommandoraconfigure-*¦floppycommand. 8‰MOVEQBƒISTAEOV,D1TheproposedI/Otransfergoesbeyond)*¦theendofthedisc,sogettheend-of-(*¦volumeerrorcodeintoD1.B.‚We'lluse'*¦thaterrorcodeasthestatusthatwe)*¦returntotheuserifwedon'truninto%*¦anothererrorthatismoreserious. %*¨ThereareroutinesinVersadosthat(*¦dependonustoreturnthisparticular(*¦errorcodewhenanI/Otransferstarts'*¦atalegalVersadosrecordnumberbut%*¦extendsbeyondtheendofthedisc.'*¦Forexample,theutilityprogramthat)*¦initializesadisckeepswritingtothe)*¦discuntilitreceivesthiserrorcode. .‰MOVE.WƒD0,D2’ChangetherecordcountinD2to$*¦equalthetotalnumberofVersados%*¦recordsthatareavailablefromthe(*¦startingrecordthroughtheendofthe(*¦disc.‚We'lldoasmuchofthetransfer)*¦aspossible,andwe'lltruncateitwhen*¦wereachtheendofthedisc. '*¨WeknowthatthevalueinD0willfit&*¦intoa16-bitfieldbecausewefound'*¦abovethatD0waslessthanD2andwe&*¦alreadyknewthatthetophalfofD2 *¦waszero.-‰PAGEš#######################################6L0900„MOVE.BƒD1,-(A2)SettheEOVFLAGfieldoftheI/O(*¦packet.‚Thevaluethatweputintothe$*¦EOVFLAGfieldiseithertheISTAOK)*¦statuscodeortheISTAEOVstatuscode.'*¦WeusetheISTAEOVstatuscodeifthe(*¦I/Otransferasitwasspecifiedwould'*¦havegonebeyondtheendofthedisc.%*¦Otherwise,weusetheISTAOKstatus!*¦code.‚Ifwedon'tencounterany)*¦seriouserrorsduringtheI/Otransfer,)*¦we'llreturnthevaluefromtheEOVFLAG'*¦fieldoftheI/Opacketasthestatus*¦codeforthetransaction. 7‰MOVE.WƒSCTPVREC(A1),D0ˆGetthenumberofsector(s)per2‰MULU.WƒD0,D2VersadosrecordintoD0,andconvert'*¦thecountofVersadosrecords(inD2)%*¦intoacountoflogicalsectors.‚D2'*¦nowtellsushowmanylogicalsectors%*¦toprocess.‚Theuseofthemultiply)*¦instructionhereiscorrectbecausethe'*¦countofVersadosrecordsinD2wasa%*¦16-bitnumber,nota32-bitnumber.(*¦Theresultingcountoflogicalsectors*¦inD2isa32-bitnumber. 0‰MOVEQ.L‚#0,D4’HerewesetD4<--D3*SCTPVRECto'*¦starttheconversionofthespecified7L0680„ADD.L„D3,D4Versadosrecordnumberintoalogical-‰BCS.S„L0730sectornumber.‚We'reeffectively3‰SUB.W„#1,D0multiplyingtheVersadosrecordnumber4‰BHI.S„L0680bythenumberoflogicalsector(s)ina&*¦singleVersadosrecord,butwecan't(*¦useamultiplyinstructionbecausethe$*¦Versadosrecordnumberisa32-bit'*¦unsignednumber,nota16-bitnumber.)*¦IftheresulE tingvalueinD3exceeds32&*¦bits,weabortwithanerrorbecause *¦theIOSRRNvalueistoolarge. '*¨RecallthatD3containsthespecified$*¦Versadosrecordnumberforaread,(*¦write,orformatcommand.‚D3=0fora*¦configure-floppycommand.-‰PAGEš#######################################?L0690„EQU†CONFGBLK+IOSATWˆIfthediscthatisbeingaccessedis9‰MOVE.WƒL0690(A1),D0‰notadouble-densityfloppydisc,D4;‰ROR.W„#IOADDEN+1,D0ˆnowcontainsthelogicalsectornumber.‰BCC.S„L0750thatcorrespondstothespecified%*¦Versadosrecordnumber.‚Ifthedisc)*¦isn'tadouble-densitydisc,therefore,(*¦wecanskiptherestoftheconversion *¦routine. @L0700„EQU†IOARDISC-IOADDEN‡Ifthediscthatisbeingaccessedis6‰ROR.W„#L0700,D0Œarigiddisc,wecanskiptherestof1‰BCS.S„L0750theconversionroutine.‚Arigiddisc(*¦isalwaysrecordedatthesamedensity*¦throughoutthedisc. "*¨Actually,thistestisredundant#*¦becauseweonlypresentlysupport&*¦double-densityrigidSASIdiscs,but'*¦thistestmaybecomeimportantinthe *¦future. 2‰MOVEQ.L‚#0,D0’We'redealingwithadouble-density:L0710„EQU†CONFGBLK+IOSSPT†floppydisc,andtrackzeroofa9‰MOVE.BƒL0710(A1),D0‰double-densityfloppydiscisalways3‰LSR.B„#1,D0recordedwithsingledensity.‚Register)*¦D4.Lcontainsthelogicalsectornumber%*¦thatwouldbecorrectiftrackzero(*¦wererecordedwithdoubledensitylike&*¦alloftheothertracks,butwemust)*¦applyacorrectiontoD4toaccountfor(*¦thefactthattrackzeroisdifferent.#*¦Westartbygettingthenumberof'*¦sectorspertrackintoD0.L,andthen)*¦wedividethatnumberbytwotoaccount(*¦forthefactthattwosectorsintrack%*¦zeroareequaltoonesectorinany*¦othertrack. 2‰CMP.L„D0,D4’Ifthestartinglogicalsectornumber4‰BHS.S„L0740isbeyondtheendoftrackzero,goadd(*¦IOSSPT/2toittocorrectforthefact)*¦thatthesectorsintrackzeroareonly%*¦halfsectors.‚Allofthesectorsin)*¦trackzerowerecountedasfullsectors$*¦intheoriginalcomputationofthe*¦logicalsectornumber.-‰PAGEš#######################################2‰SUB.L„D4,D0’Thestartinglogicalsectornumberis/‰ASL.W„#1,D4somewherewithintrackzero,sowe'*¦multiplyD4bytwotoaccountforthe)*¦factthatthesectorsintrackzeroare%*¦onlyhalfsectors.‚Thesectorsthat%*¦precedethestartinglogicalsector(*¦numberwereoriginallycountedasfull)*¦sectors,butthey'reonlyhalfsectors.'*¦Overflowisnotpossibleherebecause(*¦thevalueofD4hasalreadybeenfound#*¦tobelessthanaone-bytevalue. $*¨BesidesadjustingD4here,wealso)*¦setD0equaltothenumberoffull(not(*¦half)sectorsintrackzerobeyondthe*¦specifiedstartingsector. 0‰CMP.L„D0,D2’RecallthatD2.Lcontainsthecount/‰BHI.S„L0720offullsectorsfortheentireI/O2‰MOVE.LƒD2,D0transfer.‚IftheentireI/Otransfer'*¦willbewithintrackzero,weneedto5L0720„ADD.L„D0,D2doublethesectorcount.‚IftheI/O3‰BCC.S„L0755transferwillextendbeyondtheendof'*¦trackzero,however,wemustincrease(*¦thesectorcountbythenumberoffull(*¦sectorsthatwillbeaccessedintrack(*¦zero.‚Ineithercase,wechecktomake'*¦surethatoverflowdoesn'toccurwhen*¦weadjustthesectorcount. '*¨NoticethatD0.Lnowcontainsacount)*¦ofthenumberoffullsectorsthatwill(*¦beaccessedintrackzero.‚Thisnumber(*¦isequaltohalfofthenumberofhalf(*¦sectorsthatwillbeaccessedintrack*¦zero. L0756„CMP.B„#CNFGFUNC,IOFUNCT(A1)Isthisaconfigurecommand?&‰BNE.S„L0757Brancharoundifitisn't#‰MOVEQ.L‚#0,D2Clearsaveregisters‰MOVEQ.L‚#0,D4* =CD010„EQU†CONFGBLK+IOSTRKD…Readtheno.ofcylindersondrive éé=‰BTSTW„#IOARDISC,CONFGBLK+IOSATW(A1)‚Determinethedisktype:‰IF‡THENŒIffloppy,7‰MOVE.WƒCD010(A1),D4‰Usetheno.ofcylindersondrive.‰ELSEšIfhard,A‰MOVE.WƒCONFGBLK+IOSTRK(A1),D4‚Usetheno.ofcylindersonmedia.‰ENDI $‰SUBQ…#1,D4Maxcyl=no.ofcyl-1 8CD020„EQU†CONFGBLK+IOSHDS†Readtheno.ofheadsondrive‰MOVE.BƒCD020(A1),D2‰*(‰SUBQ…#1,D2Maxheads=no.ofheads-1#‰LSL.W„#8,D2Positioninbits13-15‰LSL.W„#5,D2* ‰OR.W…D2,D4Addtosaveregister 9CD030„EQU†CONFGBLK+IOSPCOM…Readtheprecompensationvalue‰MOVE.WƒCD030(A1),D2‰*I* Limit precompensation to max allowed by RWIN disk controller - 02/18/851‰CMP.W„#$FF,D2ŽThereisonlyone-bytetoholdtheF ééééé.‰IFTHEN’precompensationcylindernumber!5ŠMOVE.W‚#$FF,D2ŽIftheuserhasaskedformore,limit‰ENDIšittoone-byteanyway.L0757‰ENDC -‰PAGEš#######################################?L0390„REG†A4/A3/A0/D6/D5/D4/D2ƒNowwemakeexcellentuseofthe<‰MOVEM.L‚L0390,-(A2)ŠMOVEMinstructiontosetseveralfields$*¦oftheI/Opacketatonetime.‚Theéééééé'*¦registershavebeensetuptoprovide*¦thefollowingcorrespondence. ,L1‡SET†IOCBPTR‡.†A4=IOCBPTR‚=LOC(IOCB).Œ{+L1‡SET†DCBPNTR‡.†A3=DCBPNTR‚=LOC(DCB).{9L1‡SET†IOBUFTCB†.†A0=IOBUFTCB=LOC(TCBofI/OBuffer).9L1‡SET†IOBUFPTR†(c)(1)D6=IOBUFPTR=LOC(I/OBuffer).†{9L1‡SET†IOBUFLOC†(c)(1)D5=IOBUFLOC=LOC(I/OBuffer).†{>L1‡SET†IOSECTOR†(a)(2)D4=IOSECTOR=LogicalSectorNumber.{:L1‡SET†IOSCTCNT†(b)(3)D2=IOSCTCNT=CountofSectors.…{ #*¨Notes:‚(1)D6andD5bothcontain#*¦garbageforaformatcommandora$*¦configure-floppycommand,butboth$*¦registerscontainthesamegarbage(*¦value.‚(2)D4=0forconfigure-floppy'*¦commandtoprovideaharmlesslogical(*¦sectornumberthatpassesalllegality!*¦checksG .‚(3)D2=0foraformat'*¦commandoraconfigure-floppycommand'*¦toindicatethatnodatasectorswill*¦betransferred.#*¨FortheWINCHESTERdriver:‚(a)D4(*¦containstheMAXHDandMAXCYLvalues *¦foraconfigure-drivecommand.%*¦(b)‚D2containstheprecompensation&*¦valueforaconfigure-drivecommand.  '*¦(c)IOBUFLOC(=IOALTSEC)andIOBUFPTR**¦bothcontainthealternatesectornumber%*¦ifthisisa"formatsectorasbad" *¦command.*"*¨NoticetheuseoftheSETpseudo%*¦insructionstogenerateconcordance'*¦entriesforthefieldsthatwemodify*¦here.-‰PAGEš#######################################2‰MOVE.WƒD0,-(A2)SettheHALFSCTSfieldoftheI/O4L1‡SET†HALFSCTSpacket,andsimultaneouslyclearthe5L1‡SET†NOFINISHNOFINISHflag.‚RecallthatD0wasset(*¦uptocontainacountofthenumberof'*¦halfsectorsthatwillbeaccessedin&*¦theI/Otransfer.‚HALFSCTSisalways'*¦zerounlesstheI/Otransferinvolves'*¦trackzeroofadouble-densityfloppy(*¦disc.‚TheupperbytesofD0arealways)*¦zero,andweusethatfacttoclearthe'*¦NOFINISHflagwhilewe'restoringthe*¦HALFSCTSvalue. "*¨NoticetheuseoftheSETpseudo&*¦instructionstogenerateconcordance'*¦entriesforthefieldsthatwemodify*¦here.-‰PAGEš#######################################M*******************************************************************************#‰IFNE†DTYPEAssembleifWinchester.***ˆBWN2/13/84‰PJD‚9/19/84*;*ˆHerewefindthecodeforimplementingalternatesectors.B*ˆNoticethatweareputtingitafterthe"excellentuseofMOVEM"4*ˆtofillthedrive'svariableblock,becauseweare*ˆgoingtoblowawayD0andD1.*.*ˆAnothernoteforthemaintenanceprogrammer:A*ˆWatchoutfortheuseofA2aboveandbeverycarefulwhereyou0*ˆaddanyfieldstothedrive'svariablepacket.*D*ˆIfwehavea"formatthissectorbad"commandthenD6containsthe7*ˆsectornumberforthetrackofthealternatesectors.H*ˆAtthispointwewillconvertthatnumberintoalogicalsectornumber$*ˆjustaswasdoneabove‚forIOSRRN.**+‰CMP.B…#FMTFUNC,IOFUNCT(A1)ŠFormatcommand?$‰BNE.S…NOT_ALT—Brancharoundifnot.-‰CMP.W…#IOPBAD,IOOPTS(A1)ŒFormatbadcommand?$‰BNE.S…NOT_ALT—Brancharoundifnot.*?*ˆThealternatesectorscommandonlyworksfortherigiddisks,>*ˆsowewillcheckhereifwehavearigiddiskandabortwith*ˆanerrormessageifnot.*"‰MOVEQB„ISTAIF,D1•Ifthisisnota/‰MOVE.W„CONFGBLK+IOSATW(A1),D0ˆrigiddisk,then'‰BTSTW…#IOARDISC,D0’abortwithanerror‰BEQ.L…CMDEXIT2–message. **3*ˆRecallthatthealternatesectornumberisinD6.***°Ifthissectornumber5‰MOVE.L„CONFGBLK+IOSRSZ(A1),D0ˆgoesbeyondtheendof&‰MOVEQB„ISTARR,D1•thedisk,thenabort#‰SUB.L…D6,D0™withanerrormessage.‰BLS.L…CMDEXIT2**@*ˆConverttheVersadosrecordnumber‚inD6intoalogicalsector5*ˆnumberinD3,thenmoveintoIOALTSECandIOBUFPTR.**/‰MOVE.W„SCTPVREC(A1),D0…SetD3<---D6*SCTPVREC/‰MOVEQ.Lƒ#0,D3bysuccessiveadds,sinceIOSALT‰MOVEQB„ISTARR,D1#‰REPEAT˜ismaybemorethan16bits.-ADD.LƒD6,D3Abortifresultexceeds32bits.BCS.LƒCMDEXIT2 SUBQ.W‚#1,D0 ‰UNTIL.S‚,‰MOVE.L„D3,IOALTSEC(A1)…GetitintoIOALTSEC>‰MOVE.L„D3,IOBUFPTR(A1)…AlsogetitintoIOBUFPTRsotheywill*¦bethesame.*>*ˆWearegoingtocheckthatthetrackofthealternatesector;*ˆisnotthesameasthetrackofthebadsector.‚Ifitis,7*ˆthecontrollerwouldmakethebadtrackinaccessible,$*ˆandwecertainlydon'twantthat!*B*ˆWhilewearedoingthiserrorchecking,wewillstorethevalues)*ˆforlateruseintheinterruptƒroutine.*A*ˆThesubroutineLSN2CHStakesalogicalsectornumberinD0,and?*ˆreturnsthecylindernumberinD0.W,theheadnumberinD1.B,1*ˆandthesectornumberwithinthetrackinD2.B.* ‰MOVE.L„D6,D0 ‰BSR‡LSN2CHS‰MOVE.W„D0,ALTCYL(A1)‰MOVE.B„D1,ALTHEAD(A1)*2*ˆRecallthatthesectG ortobemarkedbadisinD4+*ˆLet'sconvertittocylinder,head,sector.* ‰MOVE.L„D4,D0 ‰BSR‡LSN2CHS<‰MOVE.B„D2,BADSEC(A1)‡Itisthesectornumberwithinthebad*¦trackthatweneedtosave.*1‰CLR.L…D2’Wedon'tneedtocomparesectornumbers**¦withinthetrack,andweneedtorestore"*¦D2to0becauseitisgoinginto *¦IOSCTCNT$‰CMP.W…ALTCYL(A1),D0‡Samecylinder?!‰BNE.S…NOT_ALTIfnot,noproblem7‰CMP.B…ALTHEAD(A1),D1†Samecylinderandsameheadmeans#*¦sametrack,andthisisanerror.‰IFƒƒTHEN.S“MOVE.B„#ISTAIF,D1 “BRA‡CMDEXIT2‰ENDI*?*ˆNote:Iexpectthatmostcommandswilltrytomapabadtrack'*ˆtoanothertrackonthesamesurface.?*ˆSocylindernumberswilldiffer,butheadnumberswillbethe*ˆsame.*  NOT_ALT ‰ENDCM*****************************************************************************:‰ADD.B„#1,TCBIOCNT(A0)ˆIncrementtheTCBIOCNTfieldofthe&*¦TCBthatcontrolsthetaskthatowns)*¦theI/Obuffer(ortheIOCBinthecase%*¦ofaformatcommandoraconfigure-(*¦floppycommand).‚TheTCBIOCNTfieldof%*¦atask'sTCBindicateshowmanyI/O!*¦request(s)thetaskhaspending%*¦completionunderinterruptcontrol. 3‰MOVE.WƒSR,-(SP)SavethevalueoftheSR,andthen4‰MOVE.WƒCCBISR(A5),SRˆinhibitinterruptsattheSASI"*¦channel'sinterruptlevel.‚We're$*¦abouttoaltertheIOQUEUE,andwe%*¦don'twanttheinterrupthandlerto(*¦accessthequeuewhilewe'retryingto *¦changeit. 6‰LEA†IOQCNT(A5),A0ŠPutthepointertothedrive'sarea2‰MOVE.Wƒ(A0),D0ŽoftheCCBintothenextavailable;L0670„EQU†IOQUEUE-IOQCNT‡queueentry,andadvancethequeue=‰MOVE.LƒA1,L0670(A0,D0.W)„pointer.‚Wedon'tneedtocheckfor2‰ADD.W„#4,(A0)Žqueueoverflowbecausewecannever&*¦accumulatemorethanonequeueentry'*¦foreachdrive.‚Wealsodon'tneedto(*¦checkforqueuewrap-aroundbecausewe'*¦physicallymovequeueentriesinstead&*¦ofusingwrap-aroundqueuepointers.-‰PAGEš####################################### -‰TST.W„D0•Ifthequeuewasn'temptybeforewe1‰BNE.S„L0410madethelatestentry,theinterrupt$*¦handlerisalreadyactiveandwill)*¦eventuallycompletetheI/Otransaction'*¦thatwe'vejustspecified.‚Otherwise,#*¦weneedtoactivatetheinterrupt *¦handler. 8‰LEA†PROCQUE(PC),A0‰Setuptheco-routineswitchpointer>‰MOVE.LƒA0,INTSWTCH(A5)†totelltheinterrupthandlertostart<‰MOVE.LƒCCBCHB(A5),A0ˆprocessinganewI/Oqueueentry.‚Then4‰BSR†SASIINTŽpointA0totheMVME420'smemory-mapped"*¦I/Oarea,andactivateinterrupt%*¦processingbycallingtheinterrupt#*¦handleronceasasubroutine.‚The%*¦machine'sinterruptlevelisatthe)*¦samelevelthatwouldbepresentduring#*¦anactualinterruptfromtheSASI(*¦channel,sotheinterrupthandlerwill(*¦performcorrectly.‚Weneedtocallthe(*¦interrupthandleronceasasubroutine%*¦toactivateinterruptprocessingif&*¦interruptprocessingisn'tcurrently *¦active. :L0410„MOVE.Wƒ(SP)+,SRRestoretheSR,andtransfercontrol4‰BRA†CMDEXIT3tothecommandprocessor'scommonexit *¦routine.‚Wedon'tqueueanI/O&*¦completioneventyetbecausetheI/O%*¦transactionwillbecompletedlater*¦underinterruptcontrol. -‰PAGEš#######################################O********************************************************************************(*ˆLOGICAL-TO-PHYSICALADDRESSCONVERSION*F*ˆGivenaphysicalTCBaddressandthelogicaladdressandlengthofaE*ˆmemoryarea,subroutine‚LOGPHYcomputesthephysicaladdressoftheE*ˆmemoryarea.‚ItalsocheckstomakesurethatthegivenmemoryareaE*ˆreallybelongstothetask‚thatiscontrolledbythespecifiedTCB.*@*ˆThesubroutine‚has‚twoentrypoints:‚LOGPHY‚isused‚when‚we'reF*ˆdealingwithataskthatownstheTCBandLOGPHY1isusedwhenwe're)*ˆdealingwithataskthatownstheIOCB.*<*ˆEntry:„A5=physicaladdressofCCB(entry@LOGPHY1only);*’D6=logicalH addressofthefirstwordofthememoryarea)*’D5=lengthinbytesofthememoryarea*!*ˆRegisterusage:…01234567 *™D‚PP‡PR *™A‚*P‡P*B*ˆExit:…D6=physicaladdressofthefirstwordofthememoryarea *’Returntothecallingroutine.*O******************************************************************************* =LOGPHY1‚MOVE.LƒCCBTASKA(A5),A0ˆSetA0tocontainthephysical&*¦addressoftheTCBthatcontrolsthe)*¦taskthatownstheIOCBforthecommand(*¦thatiscurrentlybeingprocessed.‚The'*¦memoryareaweseekallegedlybelongs!*¦tothetaskthatownstheIOCB. FLOGPHYƒMOVEM.L‚D0-D5/D7/A0,-(SP)†Savetheworkingregistersbypushing'*¦themontothestack.‚Wedon'tuseall&*¦oftheseregistersdirectly,butthe)*¦T0LOGPHYexecutiveroutinedestroysthe*¦onesthatwedon'tuse. 3‰MOVE.WƒD6,CCR‘Checktoseeifthespecifiedmemory/‰BCS.S„L0040areabeginsatanoddaddress,and&*¦abortifitdoes.‚Wewantthememory#*¦areatostartonawordboundary.)*¦Noticethatwecheckforanoddaddress'*¦bycopyingbit0oftheaddressvalue*¦intotheCbitoftheCCR. /‰TST.L„D5•Abortprocessingifthelengthofthe3‰BEQ.S„L0040specifiedmemoryareaiszero.‚Azero- õ4þ7 5 ? 6 8 &5 .= 6A >$*¦lengthmemoryareaismeaningless. :‰MOVE.LƒTCBTST(A0),A0ŠGetthephysicaladdressoftheTask:‰MOVE.Lƒ#T0LOGPHY,D0‰SegmentTableforthegiventaskinto/‰TRAP…#EXECA0,anduseanexecutiverequestto'*¦performtheconversionfromalogical *¦addresstoaphysicaladdress. -‰PAGEš#######################################2‰BRA.S„L0050’Controlreturnsfromtheexecutiveto'*¦thispointiftheconversionwasgood'*¦andthespecifiedmemoryarearesides'*¦entirelywithinamemorysegmentthat$*¦belongstothespecifiedtask.‚The(*¦physicaladdressofthememoryareais(*¦inD6,sowe'realmostreadytoreturn$*¦controltotheroutinethatcalled*¦subroutineLOGPHY. *‰NOPControlreturnsfromtheexecutiveto)*¦thispointifthespecifiedmemoryarea#*¦ispartiallyinsideandpartially'*¦outsideamemorysegmentthatbelongs(*¦tothespecifiedtask.‚Inthiscasewe*¦wanttoreportanerror. =L0040„MOVEQBƒISTAADD,D1Controlreturnsfromtheexecutiveto4‰BRA†CMDEXIT2thispointif(1)thespecifiedmemory'*¦areaiscompletelyoutsideanymemory'*¦segmentthatbelongstothespecified'*¦taskor(2)thespecifiedmemoryarea!*¦isinamemory-mappedI/Oarea. 8BADBUFADEQU†L0040’Controlalsocomestothispointfrom(*¦severalotherplaces,includingplaces(*¦outsidesubroutineLOGPHY.‚Weusethis$*¦codetoreportanykindofbuffer-#*¦addresserrorthatwecandetect. #*¨Wequeueaneventtotheattached(*¦tasktoindicatethatwehavereceived$*¦abadlogicaladdress,andthenwe'*¦abortprocessingforthecommandthat*¦iscurrentlybeingprocessed. EL0050„MOVEM.L‚(SP)+,D0-D5/D7/A0†Controlreachesthispointwhenwe've*‰RTS›madeasuccessfuladdressconversion.&*¦Werestoretheworkingregistersand(*¦returncontroltothecallingroutine. -‰PAGEš#######################################O*********************************************************************************ˆQUEUEANEVENT*H*ˆSubroutineQEVENTqueuesaneventmessagetothetaskthatisattachedC*ˆtothe‚channel.‚Thereare‚twoentrypoints‚tothesubroutine.‚TheC*ˆQEVENT‚entrypoint‚canbeused‚toqueue‚anevent‚fromthecommandD*ˆprocessor‚tothe‚attachedtask,‚andthe‚QEVENTIentrypointcanbeC*ˆusedto‚queue‚anevent‚fromthe‚interrupthandler‚totheattached@*ˆtask.ƒIneither‚case,it‚queues‚an‚I/Ocompletion‚event‚tothe*ˆattachedtask.*%*ˆEntry:„A3=physicaladdressofDCB*’A4=physicaladdressofIH OCB*’A5=physicaladdressofCCB*$*D1.B=eventstatusandI/Ostatus*!*ˆRegisterusage:…01234567*™D‚*PPPPP *™A‚PPƒPPP*C*ˆExit:…Returnscontroltothecallingroutineforgoodcompletion.&*’InvokesT0KILLERforbadcompletion.*O*******************************************************************************   @QEVENTI‚MOVE.Lƒ#T0QEVNTI,D0‹Thisentrypointisusedtoqueuean0‰BRA.S„QEVENTI/OcompletioneventfromtheSASI)*¦interrupthandlertotheattachedtask.$*¦Thereisoneexecutiverequestfor$*¦queuinganeventfromaninterrupt)*¦handler,andthereisanotherexecutive%*¦requestforqueuinganeventfroma"*¦routinethatisnotaninterrupt'*¦handler.‚Herewegettherequestcode'*¦fortheexecutiverequestthatqueues%*¦aneventfromaninterrupthandler. -‰PAGEš#######################################@QEVENTT‚MOVE.Lƒ#T0QEVNTT,D0‹Thisentrypointisusedtoqueuean$*¦I/OcompletioneventfromtheSASI)*¦commandprocessortotheattachedtask.$*¦Thereisoneexecutiverequestfor$*¦queuinganeventfromaninterrupt)*¦handler,andthereisanotherexecutive%*¦requestforqueuinganeventfroma"*¦routinethatisnotaninterrupt'*¦handler.‚Herewegettherequestcode'*¦fortheexecutiverequestthatqueues(*¦aneventfromaroutinethatisnotan*¦interrupthandler. FQEVENTƒMOVEM.L‚D1-D7/A0-A5,-(SP)†Savetheworkingregistersbypushing'*¦themontothestack.‚Wedon'tuseall&*¦oftheseregistersdirectly,butthe&*¦executiveroutinethatqueuesevents*¦usessomeofthem. 9‰MOVE.BƒD1,IOSSTA(A4)ŠStorethestatuscodeintotheIOCB&*¦whereitcanbeexaminedbythetask#*¦thatoriginallyrequestedtheI/O#*¦transactionwe'vejustcompleted. 6‰MOVEQBƒEVNTCOMP,D2ŒGetthetypecodeforanormalI/O;‰MOVEQBƒEVNTCMSZ,D3ŠcompletioneventintoD2.B,andgetthe#*¦length(inbytes)ofanormalI/O*¦completioneventintoD3.B. 5‰MOVEQBƒEVNTIO,D4ŽGettheeventcodeforanI/Oevent *¦intoD4.B.-‰PAGEš#######################################8‰LINK…A0,#-EVNTMXSZŠReserveenoughroomonthestackfor5‰MOVE.LƒA0,A1thelargestpossibleeventmessage,and(*¦setupA1asatemporarystackpointer'*¦forpointingintotheeventareathat#*¦we'vejustreservedonthestack.)*¦We'lluseA1asaworkingregister,and(*¦we'llpreserveA0.‚Weneedtopreserve(*¦A0sowecanrestorethestackpointer%*¦afterwe'refinishedwiththeevent%*¦area.‚Thestackisnoworganizedas *¦follows. *²|‚AvailableStack„|ƒ{*²|---------------------|ƒ{*¦SP------->|‚EventArea‰|ƒ{ *²|Š.Š|ƒ{ *²|Š.Š|ƒ{ *²|Š.Š|ƒ{*²|---------------------|ƒ{ *¦A0,A1--->|‚OldA0Value‡|ƒ{*²|---------------------|ƒ{*²|‚WorkingRegisters‚|ƒ{ *²|Š.Š|ƒ{ *²|Š.Š|ƒ{ *²|Š.Š|ƒ{*²|---------------------|ƒ{ *¨We'regoingtobuildtheevent(*¦messageintheeventareathatwejust&*¦createdonthestack,andthenwe'll!*¦copytheeventmessageintothe'*¦registersforqueuingtotheattached%*¦task.‚Byusingthestackasanarea$*¦forbuildingtheeventmessage,we&*¦assurethatthissubroutineisfully%*¦re-entrant.‚Thissubroutinemustbe$*¦fullyre-entrantbecauseitcanbe(*¦executedfromboththecommandservice$*¦routineandtheinterrupthandler. '*¨Noticethattheapproachwetakehere)*¦willworkproperlyforaneventmessage*¦ofanypossiblelength. &*¨Nowwemuststartbuildingtheevent(*¦message(fromendtobeginning)inthe*¦eventareaofthestack.-‰PAGEš#######################################5‰MOVE.BƒD1,-(A1)Storethestatusbyteintotheevent1‰CLR.B„-(A1)area,andclearthenextbyte.‚There'*¦aretwobytesfortheeventstatusin%*¦theeventmessage,butoneofthose'*¦bytesmustalwaysbezero.‚We'vejust(*¦filledtheEVNTSTATfieldoftheevent *¦message. 6‰MOVE.LƒA3,-(A1)StorethephysicaladdressoftheDCB%*¦intotheEVNTDCBfieldoftheevent*¦area. =‰MOVE.BƒCCBKEY(A5),-(A1)‡CopytheI keyvaluethatwassupplied'*¦bytheattachedtaskintotheEVNTKEY*¦fieldoftheeventarea. 6‰MOVE.BƒD2,-(A1)StorethetypecodeintotheEVNTTYPE*¦fieldoftheeventarea. ;‰MOVE.LƒCCBSVVC(A5),D5‰Iftheattachedtaskhasn'tsupplied4‰BEQ.S„L0060aneventserviceaddressforI/Oevents&*¦fromthischannel,omittheEVNTSVAD*¦fieldoftheevent. 1‰ADD.B„#EVNTSVSZ,D3‹Otherwise,adjustD3.B,which6‰MOVE.LƒD5,-(A1)containstheeventlength,toaccount8‰MOVEQBƒEVNTIOSA,D4ŠfortheaddedlengthoftheEVNTSVAD)*¦field,andputtheserviceaddressinto'*¦theEVNTSVADfieldoftheeventarea.(*¦Also,changetheeventcodeinD4.Bto)*¦indicatethatwehaveanI/Oeventwith*¦aserviceaddressincluded. 3L0060„MOVE.BƒD4,-(A1)Storetheeventcodeintothe#*¦EVNTCODEfieldoftheeventarea. 5‰CMP.B„CCBASQL(A5),D3‰Iftheeventmessagewe'vejust4‰BLS.S„L0070constructedintheeventareaislarger:‰MOVE.BƒCCBASQL(A5),D3‡thanthelargesteventtheattached)*¦taskispreparedtoreceive,changethe&*¦eventlengthinD3.Btotruncatethe%*¦eventmessagetothemaximumlength#*¦thatthetaskcanaccommodate.‚In&*¦actualpracticewe'llnevertruncate&*¦anyeventsherebecausetheattached&*¦taskwillbeIOS,whichissetupto(*¦receivethelongesteventmessagethat*¦wecouldeversend. 5L0070„MOVE.BƒD3,-(A1)Storetheeventlengthintothe$*¦EVNTLENfieldoftheeventareato*¦completetheeventmessage.-‰PAGEš#######################################9‰MOVEM.L‚(A1),D2-D6Nowgettheeventfromtheeventarea'*¦intotheregisters.‚Wepickupenough)*¦registervaluesheretoaccommodatethe'*¦longestpossibleeventbecausethat's'*¦easierthanitwouldbetotrytoget)*¦therightnumberofregistervaluesfor#*¦theeventthatwehappentohave.$*¦We'resafeinaccessingbeyondthe(*¦actualeventareainthestackbecause(*¦weknowthereismemorywherewesaved*¦theworkingregisters. .‰UNLK…A0•Restorethestackpointersincewe're)*¦nowfinishedwiththeeventareaofthe*¦stack. ;‰MOVE.LƒCCBRQSTA(A5),A0ˆGetthephysicaladdressoftheTCB1‰BSR.S„EXECREQŽfortheattachedtaskintoA0,and$*¦performtheexecutiverequestthat#*¦queuestheeventmessagefromthe(*¦registerstotheattachedtask.‚Recall(*¦thatD0containstheexecutiverequest%*¦codefortheexecutiverequestthat'*¦queuestheeventmessageproperlyfor%*¦thecurrentenvironment.‚Subroutine'*¦EXECREQkillstheoperatingsystemif)*¦thesystemisunabletoqueuetheevent*¦forsomeunexpectedreason. =‰MOVEM.L‚(SP)+,D1-D7/A0-A5†Restoretheworkingregisters,and+‰RTS›returncontroltothecallingroutine. -‰PAGEš#######################################O*********************************************************************************ˆEXECUTIVE-REQUESTSUBROUTINE*E*ˆThesubroutineEXECREQperformsaTrap-0ExecutiveRequestandthenB*ˆkillsthesystemiftheexecutivedoesnotsuccessfullyrespond.*O******************************************************************************* EXECREQ: 0‰TRAP…#EXEC’Performtheactualexecutiverequest(*¦thatwassetupbeforethissubroutine *¦wascalled. *‰RTSControlreturnsfromtheexecutiveto&*¦thispointiftheexecutivesuccess-)*¦fullyperformedtherequestedfunction.'*¦Inthiscasewereturncontroltothe#*¦routinethataskedustomakethe*¦executiverequest. :‰MOVE.Lƒ#T0KILLER,D0‹Controlreturnsfromtheexecutiveto2‰TRAP…#EXECthispointiftheexecutivewasunable#*¦toperformtherequestedfunction%*¦successfully.‚Thissituationshould'*¦neverariseforanyexecutiverequest)*¦thattheSASIdrivermakesthroughthis$*¦subroutine.‚Ifthissituationdoes(*¦arise,wekillthesystemtobringthe"*¦unexpectedproblemforcefullyto&*¦someone'sattentionforanalysisand *¦resolution.‰PAGEO******************************************************I *************************O*********************************************************************************ˆCHK_FLOPPYROUTINE*&*ˆEnteredasasubroutineofCOMMANDS.B*ˆCheckthatbytespersector,sectorspertrack,anddatadensity*ˆhaveconsistentvalues.*G*ˆWecallthisroutineafterwehavefilledintheuser'sconfigurationF*ˆblockwiththeproposedconfiguration.‚ThatiswhyA0ispointingto,*ˆtheendoftheuser'sconfigurationblock.*B*ˆWhenthisroutineiscalled,wehavealreadydeterminedthatthe"*ˆlogicalsectorsizeisnon-zero.**ˆEntry:(*’A0=endofuser'sconfigurationblock*!*ˆRegisterusage:…01234567 *™D†***ƒ***™A‚Pƒ***’P‚=‚parameterregisters*’R‚=‚returnregisters"*’*‚=‚savedandrestoredregisters*$*ˆExit:…RTSbacktocallingroutine.7*’CONDITIONCODES:noerrorsinthisconfig.check*£anerrorwasfound*O*******************************************************************************O********************************************************************************/*‚TablesusedtocheckthefloppyconfigurationJ*‚TheRWINandSASIcontrollersagreeontheirvaluesfor128bytesectorsN*‚and256bytesector.Howeverthereisadifferenceonthe1024bytesectors,E*‚andadifferenceinwhatissupportedbythedifferentcontrollers.J*‚Fornow,withonly128or256bytessectors,thereisnodifference,and*‚wecanusethesametables.*G************************************************************************$*ƒBYTESPERSECTOR--SINGLEDENSITY*G***********************************************************************-BPS_S„DC.W†128Š128bytes,singledatadensity,‰DC.W†0Œwedonotsupport256singledensity,‰DC.W†0Œwedonotsupport512singledensity-‰DC.W†0Œwedonotsupport1024singledensityG************************************************************************$*ƒBYTESPERSECTOR--DOUBLEDENSITY*G***********************************************************************5BPS_D„DC.W†0ŒRWINdoesnotsupport128doubledensity(‰DC.W†256Š256bytes,doubledatadensity,‰DC.W†0Œwedonotsupport512doubledensity-‰DC.W†0Œwedonotsupport1024doubledensity ƒTHENŽIfdoubledensity,movepntrto*ŽADDQ.Lƒ#BPS_DENS,A2„doubledensitytable.‰ENDI***6‰MOVE.W„IOSPSM-IOSDRSV(A0),D6‰D6<---bytespersector 0‰MOVE.W#C_TBL_SZ-1,D7Searchformatchinbytes)BPS_LOOPCMP.Wƒ(A2)+,D6’persectortable.‰DBEQ„D7,BPS_LOOP,‰BNE…RET“Ifnomatch,returnwithCCR=*'*‚Weareherebecausewefoundamatch.* BPS_FOUND4‰LEA‡SPT5_S(PC),A2‡A2<---‚pntrtosectorpertrack,#*¦5",singledensitytable.(SPT5_S)1‰BTSTW…#IOADDEN,D4‰Ifdoubledensity,pointA2to+‰IFƒƒTHENŽsectorspertrack,5",double,ŽADDQ.Lƒ#SPT_DDEN,A2„densitytable.(SPT5_D)‰ENDI.‰BTSTW…#IOASIZE,D4‰If8"diskette,pointA2to.‰IFƒƒTHENŽthesectorspertrack,8"table,4ŽADDQ.Lƒ#SPT_SIZE,A2„eithersingleordoubledensity*‰ENDIšasfixedupabove.(SPT8_DorSPT8_S)*D*ƒNowthatA2ispointingtothepropertableforsectorspertrack,G*ƒsetupD4to‚point„tothebyteoffsetofourentryfromthebeginning=*ƒofthepropertable,andlet'scheckthesectorspertrack.*‰MOVE.W„#C_TBL_SZ-1,D3 ‰SUB.W…D7,D37‰MOVE.B„IOSSPT-IOSDRSV(A0),D2‰D2<---sectorspertrack‰CMP.B…0(A2,D3.W),D2FRET†MOVEM.Lƒ(A7)+,D2/D3/D4/D6/D7/A2ƒReturnwithCCR=ifmatchfoun‰RTS›andotherwise O*******************************************************************************   -‰PAGEš####################################### ééééééé=/*=/*†DARTDRV.AF=/*I=/* Chain file to assemble SCN2681 SUBORDINATE serial port driver for the$=/* local port on the MVME115 board.=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to DARTDRV.LS=/*=/IFC \1ƒ=ARGDARTDRV.LS=/ENDIF=/*$=ASM DARTDRV.SA,DARTDRV.RO,\1;RZ=140=/*{ Included files are:=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.BAB.EQ=/*ƒJ 9995.&.UTILITY.MC=/*ƒ9995.&.SCN2681.EQ=/*ƒ9995.&.TERMINAL.EQ=/*ƒ9995.&.TERMCCB.EQ=/*}=/*=ENDééééé F*J*=========================================================================*?*‚CodeaddedtoallocatememoryfortablesusedbyRAD1driver.*K*==========================================================================7‰XREF†RAD1TBLƒSYSPARloccontainingaddrofRADtables. ‰XREF†KILLER *ˆBRA‡RADMEM*ˆINCLUDEƒ&.RADDRV.EQ‰INCLUDEƒ&.RADDRV.EQ ‰SECTIONƒ8*ƒfortheDARTdriver.‚CMRautomaticallyallocatesonepageofA*ƒmemory($100bytes)fortheCCB,andourvariableEXTCCBSZwillB*ƒresideintheCMRparametertableatthebeginningofthedriver8*ƒtotellCMRhowmanyextrapagesofmemoryareneeded.**CCBSIZEBEQU‡*PAGESIZEEQU‡$100L1‡SET‡CCBSIZEB+PAGESIZE-1CCBSIZE‚EQU‡L1/PAGESIZEEXTCCBSZEQU‡CCBSIZE-1‰PAGEJ***************************************************************************+*‰SERVICEVECTORTABLE,REVISIONINFO,ETC.*@*‰ThistableisexaminedbyCMRwhenthechannelisallocatedtoC*‰determinewheretogoforinterrupts,commands,&initialization.<*‰Itmustalwaysbeattheverytopofthedrivercode.‚Also>*‰includedisaparametertellingthenumberofextrapagesof>*‰memorytoincludeintheCCB,andinformationdescribingthe*‰revisionofthedriver.*L**************************************************************************** ŠSECTION‚0ŠOPT„BRS DARTDRV: *D*‚Servicevectortable.‚NoticethatthesevaluesarerelativetotheC*‚beginningofthedriversothemechanismisposition-independent!*=ŠDC.LƒINTERRUPT-DARTDRV‚Addressofinterruptserviceroutine.9ŠDC.LƒCOMMAND-DARTDRV„Addressofcommandserviceroutine.5ŠDC.LƒINIT-DARTDRV‡Addressofinitializationroutine.ŠDC.Lƒ0’Reserved. **‚OtherCMRparameters.*7ŠDC.BƒEXTCCBSZ‹#ofextrapagesintheCCB.‚TheCCBmay)*§beanysizefrom1to256pages(apage'*§is256bytes):‚ifthisfieldis0,it*§willbe1page,etc.ŠDC.Bƒ0,0,0ŽReserved.ŠDC.Lƒ0,0,0ŽReserved. **‚Revisioninfo:*/ŠDC.Bƒ'110784'‹DateoflastassemblyasMMDDYY.1ŠDC.Bƒ''Spaceindicatesnopatchesto.LOfile.)ŠDC.Bƒ'4'MajorVERSAdosrevisionnumber.*‰PAGEO********************************************************************************+*ˆJumptableforusebythegenericTERMLIB*O******************************************************************************* ‰BRA.L…PUT_CHAR ‰BRA.L…CK_TBE‰BRA.L…DDP_RESET ‰BRA.L…SETUP‰BRA.L…CLOCK_RESET‰BRA.L…GET_STAT‰BRA.L…DDP_STOP‰BRA.L…DDP_UNSTOP‰BRA.L…DDP_BEG_BREAK‰BRA.L…DDP_END_BREAK‰PAGEJ**************************************************************************J**************************************************************************J***************************************************************************K *‰INITIALIZATIONROUTINE*>*‰ThisroutineiscalledbyCMRwhenthechannelisallocated.9*‰Itspurposeistosetupthingsforcommandserviceand7*‰interruptservice.‚Themajorfunctionsperformedare:*@*‹1.Device-IndependentinitializationinthecalltoTERM_INIT.3*‹2.Device-Dependentinitializationofthedevice.*@*‰WegotherethroughaJSRfromCMR,andwillexitwithanRTS.>*‰AllregistershavebeensavedbyCMRandmaybeusedfreely.?*‰Entryisatinterruptlevel0,andweareinsupervisormode.**‰Entry:…A5=addressofCCB.*6*‰Calls:…TERM_INITingenericterminaldriverTERMLIB.*'*‰Exitsto:‚CMR(viaRTS)ifallisOK.'*”KILLERifexecwon'tallocatememory,.*•orcan'tgetbackgroundroutineentrypoint.*J**************************************************************************J**************************************************************************J**************************************************************************ŠDS…0INIT:*>*‚Performthedevice-independentinitializationbycallingthe'*‚genericroutineTERM_INITinTERMLIB.*.‰JSR‡TERM_INIT‹Dothedevice-independentstuff2‰IFƒƒTHEN…SomethingwentwrongwithTERM_INIT.4‰IFƒƒTHEN„Theexeccallfailedandwecannotget!*œthescheduler'sentrypoint!!!ŽTR0$.KILLER‚,‰ELSERTSThechannelisdown!!‰ENDI‰ENDI*;*‚Performtheminimumdevice-dependentinitializationusing@*‚callguardedtotheEXECforaroutineresidentinbackground.*5‰LEA‡DO_INIT(PC),A0†Device-dependentroutineaddress.-‰MOVE.L„#T0GUARD,D0‰CallguardedtotheEXEC.‰TRAP†#0‰RTS‰PAGEJ**************************************************************************J**************************************************************************J****************************************************************************‰COMMANDSERVICEROUTINE*>*‰Wegetenteredherewhentheattachedtask(IOS)invokesCMR?*‰viaaTRAP1withanINITIATEI/Oparameterblocktoprocess.>*‰CMRhasalreadycheckedtheCMRparameterblocktoensureit<*‰resideswithintheaddressspaceoftheattachedtask.‚IOSA*‰hasalreadyvalidatedtheIOCB,exceptforthebufferaddresses *‰therein.*@*‰WegotherethroughaJSRfromCMR,andwillexitwithanRTS.>*‰AllregistershavebeensavedbyCMRandmaybeusedfreely.?*‰Entryisatinterruptlevel0,andweareinsupervisormode.*5*‰Entry:A2=physicaladdressofCMRparameterblock*A5=physicaladdressofCCB*9*‰Calls:TERM_COMMANDingenericterminaldriverTERMLIB.*3*‰Exit:‚D0=resultsofparameterblockvalidation:3*•always0inourcase,indicatingitwasOK,since2*•IOSwillnotsendusanyrequestexceptHALTI/O/*•ifwearealreadybusy,andCMRmakesallthe*•otherchecks.**J**************************************************************************J**************************************************************************J************************************************************************** COMMAND: *,*‚Performanydevice-dependentstuffhere...*9‰ST.BƒTBE_FLAG(A5)‹Settheflagtoindicatebufferempty.*I*‚Performthedevice-independentcommandhandlerbycallingTERM_COMMAND.* %ŠJSR…TERM_COMMAND†PerformthecommandŠRTS—returntoCMR.ŠPAGEJ**************************************************************************J**************************************************************************J****************************************************************************‰INTERRUPTHANDLINGROUTINE*<*‰ThisroutinecompletesI/Orequestsstartedbythecommand:*‰serviceroutine.‚Itisenteredattheinterruptpriority;*‰levelofinterruptsonthischannel,andisessentiallya9*‰subroutinetothefirstlevelinterrupthandlerinCMR.=*‰Remember,however,thatthisisasubordinatedriver--hence=*‰theinterruptwasfieldedfirstbythesupervisorusedwith(*‰whatevertypeofboardwe'rehandling.*L 5*‰Entry:A0=addressofthesupervisordriver'sCCB.*A5=addressofourCCB.3*D1=CopyofInterruptStatusRegisterfrom2681.*"*D0,A0,A1havebeensavedbyCMR.-*D1‡hasbeensavedbythesupervisordriver.*D0,A1„areavailabletouse.8*A0‡mustbereturnedtothesupervisorwiththeaddress*šofthesupervisor'sCCB.4*D1‡mustbereturnedtothesupervisorwiththebit(*špatternofinterruptslefttoservice.*>*‰Exit:‚alwaysviaRTS,whichtakesusbacktothesupervisor.**‰Stack:*(A7)+8... *(A7)+4longwordreturnaddress6*(A7)ƒlongwordsavedcontentsofD1(mustberestored*—beforeexittoCMR)*J**************************************************************************J**************************************************************************J************************************************************************** INTERRUPT: *‚NOTE:*?*‚ThisdriverrequiresasupervisordriversinceithandlestheA*‚SCN2681.‚ThesupervisordriverwrittenforusewiththisoneisC*‚DARTSPR,whichbranchestotheappropriatelongwordinthistableC*‚dependingoninterrupttype.‚ThesupervisorwillnotpasscontrolA*‚tothisdriverunlessthereisinfactaninterruptonmyport.**‚ENTRYPOINTS:*%ŠBRA.S‚RCACharacterreceivedforme.ŠNOP'ŠBRA.S‚TBEMytransmitbufferisready.ŠNOP-ŠBRA.L‚BCIChangeinBREAKstatusonmyport.ŠNOP&ŠBRA.L‚IP2InputPort2Statuschange.ŠPAGEJ***************************************************************************)*‰TRANSMITBUFFEREMPTYINTERRUPTHANDLER*@*‰TheSCN2681'stransmitbufferjustbecameempty,soifwehave+*‰morecharacterstosendwecandoitnow.*5*‰Entry:A0=addressofthesupervisordriver'sCCB.*A5=addressofCCB7*D1=copyofInterruptStatusRegisterfromthe2681.*9*‰Calls:TERM_TBEinthegenericterminaldriverTERMLIB.*<*‰Sincethisisnotasubroutine,registersatexitarejust-*‰theentryrequirementsofthenextroutine.*ééééééééL ééééééééééééééééM ééééééééééééééééM ééééééééééééééééN ééééééééééééééééN ééééééééééééééééO ééééééééééééééééO éééééééééééééééé