IMD 1.17: 25/11/2014 13:02:15 82VKXBVERDOS D* BT19:0 68K VERSADOS/RMS68K OBJECT 4.5 (DS,DD 96 tpi 5.1/4" DISK) REVISED: 04/22/86 DISK 19 OF 24  BT19 82VKXBVERDOS 0420±j-ˆ/@˜8 <¨5°=¸8À3È<Ð5Ø=à>èOð^øQI9 H* I/O HANDLER DATA AREA *************************************************CCBFLG„DS.B„2ŒFlags(CCBERAD1‚DS.B„4ŒErrordebugsaveaddress2CCBQVER1‚DS.B„4ŒEventqueueingerrordebugaddress7CCBCCB„DS.B„4ŒPhysicaladdressofcommandpacket(IOCB)CCBTASKB‚DS.B„4ŒBuffertaskTCB-CCBPKT„DS.B„18‹Eventworkarea(commandtour)0CCBCPKTƒDS.B„18‹Eventworkarea(interrupttour)(CCBPTR„DS.B„4ŒPhysicaladdressofbufferCCBLEN„DS.B„4ŒLengthofbuffer0CCBPTR1ƒDS.B„4ŒPhysicaladdressof2ndarybuffer&CCBLEN1ƒDS.B„4ŒLengthof2ndarybuffer*CCBCID„DS.B„4ŒCMRparameterblockid(DCB)CCBCOPTƒDS.B„2ŒIOCBoptions#CCBCFIGƒDS.B„$26ŠConfigurationdata**‰56bytesremain*9*‰CCBFLGDEFINITIONS:if‚CCBFLG.Bifnot0theRIOmodule$*fortheCCBcannotbeusedforthe*followingreasons:*9*‰CCBFLG.B=$FA=CCBallocationexceeded#ofspecified/*šdevices-noroominRIOtableforthemodule!*’=$FC=noRIOTBLwasallocated/*’=$F5=noroominRIOTBLforthisRIOmodule*™(incorrecttableallocation)**‰PAGE ‰SECTION8 ‰XREFRIOTBLJ******************************************************************************‚RIOSERVICEVECTORTABLE***L*****************************************************************************RIODVR:#*ˆDC.L†RIOINTŽinterruptsvcaddress!*ˆDC.L†RIOCMDŽcommandsvcaddress)*ˆDC.L†RIOINITinitializationsvcaddress**?*Below are the new offset form of service pointers, for new CMR**(‰DC.L†RIOINT-RIODVR†interruptsvcoffset*‰DC.L†RIOCMD-RIODVR†commandserviceoffset.‰DC.L†RIOINIT-RIODVR…initializationsvcoffset‰DC.L†0‰Reserved‰DC.B†0“numberofextrapages‰DC.B†0,0,0reserved‰DC.L†0,0,0reserved 3*ƒ---ƒ---…CONFIGURATIONCONTROLINFORMATION…---ƒ---ŠSPC1$‰DC.B…'032983'ƒdateoflastassembly'‰DC.B†''‡spacemeansnopatchesin.LO#‰DC.B†'4'‡majorVersadosrevision#‰PAGEJ****************************************************************************‰COMMANDTABLE&JUMPTABLE*:*‰Theseareusedbythecommandserviceroutinetojumpto.*‰theappropriateroutinetohandleacommand.*J***************************************************************************CMDTBL:ŠDC.WƒROPENŽOPENcommand.ŠDC.WƒRCLOSECLOSEcommand.ŠDC.WƒROUTONRELAYONcommand. ŠDC.WƒROUTOFFŒRELAYOFFcommand.ŠDC.WƒRSTATŽSTATUScommand.'ŠDC.WƒRENABLENABLEINTERRUPTScommand.(ŠDC.WƒRDSABLDISABLEINTERRUPTScommand."ŠDC.WƒRPLSOŽPULSEDOUTPUTcommand.=NUMCMDSƒEQU„(*-CMDTBL)/2‡Thenumberofcommandsinthetable.*9JMPTBL:ƒDC.WƒOPEN-*Biasestothecorrespondingroutines. ŠDC.WƒCLOSE-* ŠDC.WƒOUTON-*ŠDC.WƒOUTOFF-* ŠDC.WƒSTAT-*ŠDC.WƒENABLE-*ŠDC.WƒDSABLE-* ŠDC.WƒPLSO-**7JMPOFF„EQU„JMPTBL-CMDTBL†Offsetbetweenthetwotables.ŠPAGEJ****************************************************************************+*ˆRIODRIVERINITIALIZATIONSERVICEROUTINE*>*ˆThedriverisenteredhereforeachCCBallocated.‚Morethan:*ˆoneCCBmaybeallocatedforeachRIOmodule.‚OneCCBis>*ˆallocatedforeachinterruptleveltheboardisjumperedto.?*ˆThisroutinecheckstoseeifthereisroomintheRIOTBLfor=*ˆthedeviceID.‚ItsavesthedeviceIDandthememorymapped>*ˆI/OaddressofthedevicethetheRIOTBL.‚Itinitializesthe5*ˆinputPIAofthedeviceifnotalreadyinitialized.B*ˆThisroutinealsocheckstoseeiftheRIOLEDison,indicating<*ˆanI/Ochannelresetwasissuedorapower-up.Ifon,thisA*ˆroutineturnsitoff.Theon/offindicatorisbit#7ofTSTREG.*:*ˆAnerrorcodeissavedintheCCBifthisCCBallocation=*ˆexceedsthemaximumnumberofCCB'sspecifiedduringSYSGEN9*ˆ(SYSGENparameterNRIO),ifnoRIOTBLexistsornoroom*ˆinthetableforthismodule.*$*ˆEntry:‚allregistersareavailable*A5=CCBaddress*I**************************************************************************RIOINIT:ŠPUSHPOINT‘savepointers3ŠMOVE.LƒCCBCHB(A5),A0„getmemorymappedI/Oaddress$ŠMOVE.LRIOTBL,A1ŠgetRIOTBLaddress ŠCMP.L‚#0,A1Žisthereone?&ŠBNE.S‚RIOINIT1‹branchifhaveatable8ŠMOVE.B#RIONTBL,CCBFLG(A5)setnotableerrorconditionŠBRARIOINEX1gotoerrorreturnRIOINIT5‚TST.L‚(A1,D3)Œlookforanentryslottosavethisguy5ŠBMI.S‚RIOINIT6‹branchifthisslotisempty-useit/ŠADD.W‚#PIALNG,D3‰notempty,bumptonextentry"ŠSUB.B‚#1,D4Ždecrementthecounter(ŠBNE.S‚RIOINIT5‹branchifmoretosearch4ŠBRA„RIOEXTER‹errorifgothere-noroomforthemap>RIOINIT6‚MOVE.LD2,(A1,D3)‰savethismemorymappedI/Oaddress*E*The input pia ios used exclusively for all input, and is initialized1* to all inputs and muist remain so for all time.*N*The output pia (PIA 2) is used exclusively for all output, and is initializedL*toallinputs.‚Onanychannelwhichisalloctedforoutput,onlytheoutputD*Piawillbesetforoutput.‚Whenthischannelisde-allocated,theH*correspondingoutputPIAbitmustbere-initializedforinput.‚FailureM* to follow this policy will result in impropper operation of input channels.*.ŠMOVE.L‚#0,D0write0toallpiacontrolreg'sŠBSR.SƒRIO.WCR‹doitBŠMOVE.B‚#0,PIA1ADR(A0)„clearalldatadirectionregs(setforinpu!ŠMOVE.B‚#0,PIA1BDR(A0)„clearnext!ŠMOVE.B‚#0,PIA2ADR(A0)„clearnext!ŠMOVE.B‚#0,PIA2BDR(A0)„clearlast2ŠMOVE.B‚#4,D0setcontrolregsfordataregaccess ,ŠBSR.SƒRIO.WCR‹writesaredonebysubroutine&ŠBSR.SƒRIO.CLR‹goclearallinterrupts **‰turnofftheLED*1RIOEXIT1‚CLR.B‚CCBFLG(A5)‰setforgoodallocation3ŠMOVE.LCCBCHB(A5),A1†getmemorymappedI/Oaddress,ŠMOVE.BTSTREG(A1),D1†readthetestregister$ŠBPL.S‚RIOINEX1‹returnifLEDisoff%ŠBCLRƒ#LEDSTA,D1‰cleartheLEDonbit&ŠMOVE.BD1,TSTREG(A1)†turntheLEDoff'RIOINEX1:POP_POINT‘recallallpointersŠRTS**‚SubroutinesusedbyRIOINIT:*DRIO.WCR‚EQU*ƒwritesdatainlsbyteofD0toallpiacontrolreg`s.‰MOVE.B‚D0,PIA1ACR(A0)‰MOVE.B‚D0,PIA1BCR(A0)‰MOVE.B‚D0,PIA2ACR(A0)‰MOVE.B‚D0,PIA2BCR(A0)‰RTS›endRIOWCR**RIO.CLRƒEQU*ƒclearanypendinginterrupts*‰MOVE.B‚PIA1ADR(A0),D0‰MOVE.B‚PIA1BDR(A0),D0‰MOVE.B‚PIA2ADR(A0),D0‰MOVE.B‚PIA2BDR(A0),D0‰RTS›endRIOCLRŠPAGEJ***************************************************************************$*‰RIODRIVERCOMMANDSERVICEROUTINE*6*‹PARAMETERADDRESSANDBOUNDARYCHECKSHAVEBEENMADE**ƒEntry:‚JSRFROMCMRHANDLER.*‹A2-PHYSICALADDRESSOFCMRPARAMETERBLOCK*‹A5-PHYSICALADDRESSOFCCB*5*ƒExit:‚RTS-PARAMETERBLOCKVALIDATIONSTATUSIND0**ƒREGISTERSUSED:ƒ01234567 *”D******** *”A**P**PP*"*”A3=RIOPARAMETERBLOCKADDRESS*”A6=REQUESTORTCBADDRESS**ƒEXECROUTINESCALLED:‚QEVENTI**ƒCODEISRE-ENTRANT***** J***************************************************************************RIOCMD:*)*‰ConvertlogicalPBaddresstophysical.* ŠCLR.L‚D5;ŠMOVE.LXIOCPK(A2),D6†SetupaddressofRIOparameterblock:ŠMOVE.WXIOPLN(A2),D5†SetuplengthofRIOparameterblock+ŠMOVE.LCCBTASKA(A5),A1„SetupTCBpointer.&ŠBSR„IOHADRCK‹Callconversionroutine.ŠBRA.S‚CMD010Goodreturn.ŠNOP—Badlengthreturn. ŠCLR.L‚D0;ŠMOVE.B#RTCDPBLK,D0‡SetupinvalidparameterblockaddressŠBRARIOCEX2gotoerrorexit*!*‰seeifpassedtheinitializeok*CMD010„CLR.L‚D02ŠMOVE.LƒD6,A3ŒStagephys.addr.opfRIOpara.blk.4ŠTST.B‚CCBFLG(A5)‰errorcodesetinCCBduringINIT?/ŠBEQ.S‚CMD020branchifnoerrorcode,continue$ŠMOVE.BCCBFLG(A5),D0†seterrorcode%CMDSRTRƒBRA.S‚RIOCEX2Œgotoerrorexit CMD020„EQU**,*‰getRIOTBLaddressintoA4forcommanduse* ŠMOVE.LRIOTBL,A4ŠRIOTBLaddress)ŠCMP.L‚#'!RIO',(A4)‡reallyistheRIOTBL?,ŠBEQ.S‚CMD030branchifreallyistheRIOTBL4ŠMOVE.B#RIONTBL,D0ˆseterrorreturncode-notableŠBRA.S‚CMDSRTRŒandreturn**‰findRIO-IDinRIOTBL*‰A1=entryaddress*0CMD030„MOVE.LXIOCID(A2),D0†getspecifiedRIO-ID(ŠMOVE.BRIONMAX(A4),D1…max#ofRIO-ID's$ŠMOVE.L#RIONTRY,D2ˆbumppastheader"FNDRIO10‚CMP.L‚(A4,D2),D0‰amatch?!ŠBEQ.S‚FNDRIO20‹branchifamatch&ŠADD.W‚#RIOIDLNG,D2‡bumptonextentry1ŠSUB.L‚#1,D1Ždecrementnumberofentriestocheck&ŠBNE.S‚FNDRIO10‹branchifmoreentries.ŠMOVE.W#RIONID,D0‰error-RIO-IDnotintable3ŠBRA„CMDSRTRŒreturntoCMRwitherrorconditionset+FNDRIO20‚MOVE.LA4,A1ŽbassaddressoftableŠADD.L‚D2,A1Žaddressofentry*(*‰Findthecommandinthecommandtable.*-ŠMOVEQ‚#NUMCMDS-1,D0†Setuptheloopcounter./ŠLEA„CMDTBL,A0ŠA0<--addressofcommandtable.+ŠMOVE.WCMDCOD(A3),D6†getRIOcommandcode.8CMDSRCHƒCMP.W‚(A0)+,D6‹Searchthetableforthecommand.ŠDBEQƒD0,CMDSRCH‰*3ŠBNE.S‚CMDERRIfwefoundthecommandinthetable,8ŠADD.L‚#JMPOFF-2,A0‡getthecorrespondingentryfromthe5ŠMOVE.W(A0),D0Œjumptableandjumptotheroutineto"ŠJMP„(A0,D0.W)Šhandlethecommand.DCMDERR„MOVE.B#RIOINVD,D1ˆdidn'tfindcommandcode-exitwitherrorŠSPC1RIOCEX2:;ŠMOVE.WƒD0,CMDSTA(A3)‡writeerrorcodetousersRIOparablRIOCEX1:ŠRTSŠPAGEL*****************************************************************************‰OPENCOMMANDA*‰Thiscommandassignsthelogicalconnectionbetweenausertask:*‰andspecifiedchannelswithinanRIOmodule.16channels?*‰maximummaybespecifiedinoneopencommand.InterruptlevelB*‰ofthechannelsaretakenfromtheCCB.Theinterruptslevelsof4*‰inputchannels0-7mustmatchthefollowingorder:-*‰channels0-1musthavesameinterruptlevel-*‰channels2-3musthavesameinterruptlevel-*‰channels4-5musthavesameinterruptlevel-*‰channels6-7musthavesameinterruptlevelD*‰Itisokforallthesechannelstohavethesameinterruptlevels.*#*‰RIOOPENcommand‚parameterblock: *DS.W‚1„returnedcommandstatus*DS.W‚1„commandcode(01)*DS.W‚1„#ofchannelstoopen*DS.W‚1„1stchannelnumber*DS.W‚1„channelconfiguration*’.*DS.W‚1„nthchannelnumber*DS.W‚1„channelconfiguration**‰configurationbyte:*bit0=1outputchannel*•=0inputchannel*bit1=1disableinterrupt*•=0enableinterrupt"*bit2=1interruptonrisingedge*•=0interruptonfallingedge)*bit3=1wake-uptaskoninputinterrupt,*•=0queueeventtotaskonintputinterrupt8*Œbits8-14=‚debounceinterval.‚0=nodebounce,otherwise-*˜debouncetimeisvaluetimes4milliseconds$*bit15=1usedefaultconfiguration *•=0usespecifiedconfiguration**‰Defaultconfiguration:*channels0-7’channels8-15*------------’-------------*inputchannel‘outputchannel*interruptenabled*interruptonfallingedge*queueeventoninterruptB*‰Whendefaultconfigurationisspecified,theactualconfiguation9*‰issavedinRIOTBL.ThetaskTCBaddressisalsosaved.*)*‚Entry:A1=addressofRIO-IDinRIOTBL %*‰A2=addressofCMRparameterblock%*‰A3=addressofRIOparameterblock*‰A4=addressofRIOTBL*‰A5=addressofCCB*‰A6=addressofusersTCB**‚Calls:CLRPIAM,SETPIA,DOPIA*L**************************************************************************** PAGE*OPEN:*‰seeifchannelalreadyopened* ŠPUSHPOINT‘savealladdressregsŠALLOCATEƒCHCONFIG4ŠBSRCLRPIAMclear(to$FF)thePIAmapforthisRIOŠCLR.L‚D7‘channelcounter:ŠCMP.W‚#RIONID,D0‰anerrorreturnedfromclearingthemap?'ŠBEQ„OPNOIDbranchifanerrorreturned$ŠCLR.L‚D2‘channeloffsetintoRIOTBL)ŠCLR.L‚D1‘offsetintoRIOparameterblock1ŠMOVE.WCMDCHN(A3),D0†get#ofchannelsspecified-ŠBLE„OPNINCbranchifnegativeorzero,error2ŠCMP.W‚#16,D0cannotspecifymorethan16channels,ŠBGT„OPNINCbranchifgreaterthan16,errorGOPEN10„MOVE.WNUMCHAN(A3,D1),D2‚getchannelnumberfromRIOparam.blk.ŠMOVE.WD2,D5Žsaveit0ŠMULUƒ#CHANLNG,D2ˆgetchanneloffsetintoRIOTBLŠADD.L‚#4,D2ŽbumppastRIO-ID+ŠTST.W‚(A1,D2)Œthischannelalreadyopened?+ŠBPL„OPNOPNbranchifalreadyopened,errorŠADD.L‚#1,D7Žcountthischannel@ŠMOVE.WCHNCNFG(A3,D1),D3‚getconfigurationfromRIOparam.blk.-ŠSTORE„D3,CHCONFIG†savechannelconfiguration*ŠBMI.S‚OPEN60branchifdefaultsspecifiedŠBTSTƒ#0,D3Žoutputchannel?&ŠBNE.S‚OPEN70branchifoutputchannel**‰setthischannelforinput* ŠMOVE.WD3,D4Žsaveconfiguration"ŠCMP.B‚#8,D5Žseeifchannel#8-153ŠBGE.S‚OPEN50branchifchannel8-15,nointerrupts3ŠMOVE.BCCBPPRIO(A5),D4„getintrruptlevelfromCCBŠASL.L‚#4,D4Žgetintobits4-6$ŠOR.WƒD4,D3Žsavetheinterruptlevel*6*‰checktoseethatinterruptlevelsofchannelsmatch*,OPEN20„MOVE.BD5,D6ŽsavethischannelnumberŠBTSTƒ#0,D5Žoddchannel?*ŠBNE.S‚OPEN30branchifoddchannelnumber*ŠADD.B‚#1,D6Ževen-getchannelnumber+1ŠBRA.S‚OPEN40andcontinue/OPEN30„SUB.B‚#1,D6Žodd-getchannelnumber-15OPEN40„MULUƒ#CHANLNG,D6ˆgetchanneloffsetintotableŠADD.L‚#4,D6ŽbumppastRIO-ID#ŠTST.W‚(A1,D6)Œthischannelopened?"ŠBMI.S‚OPEN50branchifnotopened9ŠMOVE.WRIOCNIF(A1,D6),D6‚getotherchannelconfigurationŠSPC2ŠBTSTƒ#0,D6Žaninputchannel?,ŠBNE.S‚OPEN50branchifnotaninputchannel$ŠASR.L‚#4,D6Žgetintoloworderbits**‰goodconfiguration0*‰saveTCBaddressandconfigurationinformation* OPEN50„EQU†*.ŠLOAD…D3,CHCONFIG†recallchannelconfiguration+ŠBSR„SETPIAgosetPIAmapforthischannel5ŠCMP.W‚#RIONID,D0‰anerrorfoundduringthesavemap?*ŠBEQ.S‚OPNERRbranchifanerrorwasfound6ŠMOVE.WD3,RIOCNIF(A1,D2)‚saveconfigurationinRIOTBL)ŠMOVE.LA6,RIOTCB(A1,D2)ƒsaveTCBaddress4ŠADD.W‚#OPNTRY,D1‰bumptonextRIOparam.blk.entry3ŠSUB.W‚#1,D0Ždecrementnumberofchannelsspecified)ŠBGT„OPEN10branchifmorechannelstodo,ŠBSR„DOPIAŽgosetthePIAhardwareregisters!ŠCMP.W‚#RIONID,D0‰anerrorfound?7ŠBEQ.S‚OPNERRbranchifanerrorwasfound-don'topenŠCLR.L‚D0‘setforgoodreturnŠBRA.S‚OPNXITgoreturntoCMR**‰defaultconfigurationset*%OPEN60„CMP.W‚#7,D5Žseeifchannel0-7!ŠBLE.S‚OPEN80branchifmaybe0-7!ŠCMP.W‚#16,D5seeifchannel8-16-ŠBGT.S‚OPNCNŽbranchifgreaterthan16,error**‰outputchannel*,OPEN70„MOVE.W#1,D3ŽsetoutputconfigurationŠBRA.S‚OPEN50gosaveit**‰inputconfigurationspecified*-OPEN80„TST.W‚D5‘mustbechannel#0orgreater)ŠBLT.S‚OPNCNŽbranchiflessthan0,errorŠCLR.W‚D3‘setfordefaults/ŠMOVE.BCCBPPRIO(A5),D3„getCCBinterruptlevelŠASL.L‚#4,D3Žputintobits4-6ŠBRA.S‚OPEN20gosaveit**‰openerrorshere*;OPNINT„MOVE.W#RIOIINT,D0ˆsetinvalidinterruptlevelerror.ŠBRA.S‚OPNERRgo'de-open'anyopenedchannels>OPNCN…MOVE.W#RIOICNS,D0ˆsetillegalchannel#specifiederror.ŠBRA.S‚OPNERRgo'de-open'anyopenedchannels8OPNINC„MOVE.W#RIOINC,D0‰setinvalid#ofchannelserrorŠBRA.S„OPNXIT‹exit;OPNOID„MOVE.W#RIONID,D0‰setRIOmodulenotallocatederrorŠBRA.S‚OPNXITgoreturntoCMR 9OPNOPN„MOVE.W#RIOPND,D0‰setchannelalreadyopenederror*)*‰resetanyopenedchannelstonotopened*%OPNERR„TST.W‚D7‘anychannelstoundo?3ŠBEQ.S‚OPNXITbranchifnonetoundo,returntoCMR&ŠMOVE.W#$FFFF,D3Šset'un-opened'codeŠCLR.L‚D1‘clearforuse6OPNERR10‚MOVE.WNUMCHAN(A3,D1),D2‚getachannelnumber$ŠMULUƒ#CHANLNG,D2ˆgetchanneloffsetŠADD.L‚#4,D2Žbumppastheaders*ŠMOVE.WD3,(A1,D2)‰setthisentryunopened-ŠADD.W‚#OPNTRY,D1‰bumptonextchannelnumberŠSUB.W‚#1,D7Ždecrementcounter&ŠBGT.S‚OPNERR10‹branchifmoretoundo** Fall into exit* OPNXIT EQU * ŠADD.L„#8,A7ŒdeallocateCHCONFIGŠPOP_POINT‘restoreallpointers ŠBRANRMEXITŠPAGEK*****************************************************************************‰SETPIA*7*‰BuildthePIAmapentriesforthespecifiedchannels.*‰Builds1entrypercall*‰MapisinRIOTBL.**‰Entry:A4ƒ=RIOTBLaddress*D3.W=channelconfiguration*D5.B=channelnumber*7*‰Exit:‚D0.W=RIONIDifmapentrynotfound,otherwise*—D0unchanged *‰Uses:D4,D6*‰Entrypoint=SETPIA*‰Exitpoint‚=SETPIART**L******************************************************************************‰findmapentry* SETPIA EQU *ŠPUSHPOINT‘saveallpointersŠMOVE.LD7,-(A7)‹saveD75ŠMOVE.WRIOPIA(A4),D7†getoffsettostartofPIAmaps.ŠMOVE.BRIONAL(A4),D6†get#ofRIO'Sallocated3ŠMOVE.LCCBCHB(A5),D4†getmemorymappedI/Oaddress=SETPIAFD‚CMP.L‚PIADDR(A4,D7),D4ƒfindthematchingI/OaddressŠBEQ.S‚SETPIA00‹branchiffound$ŠADD.W‚#PIALNG,D7‰bumptonextentryŠSUB.B‚#1,D6Ždecrementcounter0ŠBNE.S‚SETPIAFD‹branchifmoreentriestosearch>ŠMOVE.W#RIONID,D0‰setforfatalerror-thisshouldn'thappen ŠBRA.S„SETPIART‰returntocaller**‰determinechannelnumber*SETPIA00‚CLR.L‚D6‘clearforuse/ŠMOVE.BD5,D6ŽcopychannelnumbertoworkspaceŠCMP.B‚#7,D5Žchannel0-7?ŠBLE.S‚SETPIA20‹branchif0-7**‰channel8-15*/ŠSUB.B‚#8,D6Žgetbit#offsetofchannelnumberŠBTSTƒ#0,D3Žanoutputchannel?0ŠBNE.S‚SETPIA10‹branchifyes,anoutputchannel**‰channel8-15asinputchannel*%ŠBCLRƒD6,DODR815(A4,D7)‚setforinput ŠBRA.S‚SETPIART‹returntocaller* *‰channel8-15asoutputchannel*SETPIA10 EQU *0ŠBSET…D6,DODR815(A4,D7)ƒsetddrimageforoutput ŠBRA.S‚SETPIART‹returntocaller* *‰channel0-7*%SETPIA20‚BTSTƒ#0,D3Žaninputchannel?,ŠBEQ.S‚SETPIA30‹branchifyes,inputchannel**‰CHANNEL0-7asoutputchannel*/ŠBSETƒD5,DODR07(A4,D7)ƒsetddrimageforoutput#SETPIART‚MOVE.L(A7)+,D7‹restoreD7ŠPOP_POINT‘restoreallpointersŠRTS—returntocaller**‰channel0-7asinputchannel*SETPIA30‚EQU*$ŠBCLRƒD5,DODR07(A4,D7)ƒsetforinput1ŠBSR„NEWSETPŒinitPIAcontrolregsforinterrupts ŠBRA†SETPIARTŠPAGED********************************************************************&*ˆNEWSETPisinterruptsetupforPIA's&*ˆNEWSETPinitializesonePIApercall** Private subroutine for SETPIA** Table driven pia setup::*‚PIAICMSK‚isatableofPIAinterruptcontrolmaskwords.N*‚TheLSbyteisAND'edwithmapentry,andtheMSbyteisOR'dwithmapentry‰SPC3PIAICMSK EQU *-‰DC.W†$05FD…enablefallingirqonevenport#‰DC.W†$04FE…disableeven‰DC.W†$07FF…enablerising‰even‰DC.W†$04FE…disableevenA*----------------------------------------------------------------‰DC.W†$0CEF…enablefallingˆodd‰DC.W†$04F7…disableodd‰DC.W†$1CFF…enablerising‰odd‰DC.W†$04F7…disableoddŠSPC3)PIAMGOFFEQU*‚IRQcontrolimageoffsets:‰DC.B†2‰DC.B†3‰DC.B†0‰DC.B†1‰SPC3NEWSETP:ŠSPC1L*Generate index into table of interrupt control masks based on configuration * and even / odd channel number:(*Configurations are between 00X and 11X.**On entry (data input:)%*ˆD3.W‚containschannelconfiguration*ˆD5.B‚containschannelnumber%*ˆD7„containsoffsettoPIAmapstart**‰PUSHALL–saveall ‰CLR.L…D0/‰MOVE.B„D3,D0…getIRQconfig.toworkingregD0 +‰AND.B…#$0004,D0‚selectIRQconfigdatabit‰TST.B…D0ˆsetupforbranches7‰BMI.S…SETPIA33‚branchondefaultconfigurationrequest8‰BEQ.S…SETPIA32‚branchonfallingedgeirqconfiguration‰CMP.B…#4,D0…risingedgeirq?7‰BEQ.S…SETPIA32‚branchonrisingedgeirqconfiguration1‰MOVE.L„#2,D0…onallotherconfig.'s,disableirq6SETPIA32ƒEQU‚*ƒnowdetermineeven/oddchannelnumber"‰BTST†#0,D5…evenoroddchannel#?(‰BEQ.S…SETPIA31‚branchonevenchannel#"‰ADD‡#8,D0…add8foroddchannel##SETPIA31ŠEQU*…rejoinmainsequence ‰CLR.L…D18‰MOVE.W„PIAICMSK(PC,D0),D1‚fetchcontrolwordfromtable)‰MOVE.L„D3,D0…getnewcopyofconfigdata5‰AND.L…#$00000008,D0‚selectwakeup/queeventdatabit ‰MOVE.L„#21,D4„setupshiftcount2‰LSL.L…D4,D0„positionwakeup/queventbitinbit24‰SPC1)‰AND.L…#$0000FF00,D3‡selectdebouncedata1‰LSL.L…#8,D3…positiondebouncedatainbits16-23‰OR.L†D3,D1…adddebouncedata-‰OR.L†D0,D1…addwakeup/queventdataatbit248‰BSR‡WRITMAPƒwritetheinterruptcontroldatatoPIAmap7SETPIA33‚EQU‚*‚branchherefornochangeinirqsetting‰POPALL˜restoreregistervalues‰RTS‰PAGEWRITMAP:#*ˆWritesinterruptdatatoPIAmap.*ˆInputparameterstoWRITMAP:*ˆD5ƒchannel# *ˆD7ƒoffsettostartofPIAmaps$*ˆA4ƒRIOTBLaddressforcurrentuser;*ˆD1.LPIAcontrolmaskword(bits16-23aredebouncedata)!*¤(bit24iswakeup/queventbit).*>*ˆTranslateschannelnumbertoPIAregisterimagemapaddress,4*ˆthenmodifysthemapimagebasedondatainD1.L.2*ˆNowtranslatechannelnumberintoPIAmapoffset* ‰CLR.L…D0/‰MOVE.B„D5,D0…putchannel#intoworkingregD0"‰LSR.B…#1,D0…dividechannel#by2*;*‡PIAchannelindexnowinD0;nowaddoffsetfromPIAMGOFF*‡(piaimageoffsettable)*;‰ADD.B…PIAMGOFF(PC,D0),D7‚addoffsettochannelIRQcontrol$‰ADD.B…#8,D7…bumptoregisterimages**ˆD7containsoffsettoPIAmap*.‰AND.B…D1,(A4,D7)‚modifyPIAcontrolregimage0‰LSR.L…#8,D1…bringORbyteintoworkingposition-‰OR.B†D1,(A4,D7)‚modifyPIAcontrolregimage.‰LSR.L…#8,D1…bringdebouncedataintoposition/‰OR.B†D1,-1(A4,D7)‚adddebouncedatatoPIAmap*‰LSR.L…#1,D1‡bringwakeup/quebittobit7(‰AND.B…#$80,D1Šselectwakeup/queventbit.‰OR.B†D1,(A4,D7)„addwakeup/quebittoPIAmap‰RTS‰PAGED*********************************************************************:*‰DOPIA‚Copytheinterruptcontroldataanddatadirection3*informationfromthePIAregisterimages(inmap)*tothePIAregisters.*A*‚ThePIAmustnotbeallowedtogenerateaninterruptduringtheE*‚initializationprocessbecausetheCMRandRIOtableshavenotbeen@*‚setup.‚Toenforcethis,allinteruptsaredisabledduringthe@*‚codesectionwherethePIAcontrolreg.'sareset,andthePIA*‚interruptflagsarecleared.**ˆENTRYPARAMETERS:*A4=addressofRIOTBL*A5=addressofCCB***‰Exit:‚D0.W=RIONIDifPIAmapnotfound*D0.W=0ifnoerrorsfound**‰Uses:A0,D1,D6,D7**D*********************************************************************;*‚CLRIRQisanANDmaskusedtoclearPIAIRQcontrolbits.*"CLRIRQƒEQU‡$E4‡clearsbits0,1,3,4*** DOPIA EQU *ŠPUSHPOINT’saveallpointers!ŠMOVE.LD7,-(A7)‹saveregisterD7,ŠMOVE.WRIOPIA(A4),D7†getoffsettoPIAmaps$ŠMOVE.BRIONAL(A4),D6†get#ofRIO'S3ŠMOVE.LCCBCHB(A5),D1†getmemorymappedI/Oaddress>DOPIA10ƒCMP.L‚PIADDR(A4,D7),D1ƒlookforamatching‚I/Oaddress(ŠBEQ.S‚DOPIA20Œbranchiffoundtheentry(ŠADD.W‚#PIALNG,D7‰bumptonextmapentry"ŠSUB.B‚#1,D6Ždecrementthecounter/ŠBNE.S‚DOPIA10Œbranchifmoreentriestosearch9ŠMOVE.W#RIONID,D0‰setforfatalerror(shouldn'thappen) ŠBRADOPIAXbranchtoexitpoint**‰D7containsoffsettoPIAmap(*‰setdirectionregisterofchannels0-7**ˆMASKALLINTERRUPTS* DOPIA20 EQU *0ŠMOVE.WƒSR,D6Œsavepresentinterruptmaskstatus!ŠOR‡#$0700,SRˆmaskallinterrupts***‰Setdirectionregisterforchannel0-7 3*‰NewlycreatedOUTPUTchannelsmustbesettoOFF.4*‰Todothis,ORnewchannelsbitmapwithdatareg.<*‰(thereislogicalinversion)betweenPIAandfinaloutput.*ŠCLR†D2foruseŠCLR†D1foruse6ŠMOVE.LPIADDR(A4,D7),A0ƒgetmemorymappedI/Oaddress,ŠBSET…#2,PIA2ADR(A0)ƒsetfordataregaccess-ŠMOVE.BƒPIA2ADR(A0),D4ƒgetolddataregvalue+ŠNOT†D4convertdataformattoconventional'ŠBCLR…#2,PIA2ACR(A0)ƒsetforDDRaccess;ŠMOVE.BƒPIA2ADR(A0),D2ƒgetacopyofolddatadirectionreg-ŠAND†D2,D4ŒselectonchannelsthatareoutputŠNOT†D24ŠMOVE.BƒDODR07(A4,D7),D1„getthenewoutputchannelsŠAND†D2,D1Œfindnewchannels:ŠMOVE.BPIA2ADR(A0),D0…readchannel0-7directionregister9ŠOR.BƒDODR07(A4,D7),D0ƒaddinthenewsettinginformation8ŠMOVE.BD0,PIA2ADR(A0)…storeintothedirectionregister,ŠBSETƒ#2,PIA2ACR(A0)…setforoutputfunction4ŠOR.B„D1,PIA2ADR(A0)„setnewOUTPUTchannelsforOFF'ŠNOT…D4converttoinverteddataformat/ŠAND.B„D4,PIA2ADR(A0)ƒaddinolddataregvalue*-*‰Setdirectionregisterforchannels8-16.*>*‰NewlycreatedOUTPUTchannelsmustbesetOFF.‚Todothis,OR>*‰newchannelsbitmaskwithdataregister(thereisalogical3*‰inversionbetweenPIAoutputsandfinaloutputs).*ŠCLR†D2foruseŠCLR†D1foruse,ŠBSET…#2,PIA2BDR(A0)ƒsetfordataregaccess-ŠMOVE.BƒPIA2BDR(A0),D4†getolddataregvalue+ŠNOT†D4convertdatatoconventionalformat'ŠBCLR…#2,PIA2BCR(A0)†setforDDRaccess7ŠMOVE.BƒPIA2BDR(A0),D2†getacopyofolddirectionreg.-ŠAND†D2,D4ŒselectonchannelsthatareoutputŠNOT†D20ŠMOVE.BƒDODR815(A4,D7),D1ƒgetnewdirectionreg.%ŠAND†D2,D1Œselectnewoutputchannels;ŠMOVE.BPIA2BDR(A0),D0…readchannel8-15directionregister:ŠOR.BƒDODR815(A4,D7),D0‚addinthenewsettinginformation8ŠMOVE.BD0,PIA2BDR(A0)…storeintothedirectionregister,ŠBSETƒ#2,PIA2BCR(A0)…setforoutputfunction0ŠOR.BƒD1,PIA2BDR(A0)…setnewoutputchannelsoff'ŠNOT†D4convertdatatoinvertedformat1ŠAND.B„D4,PIA2BDR(A0)ƒreplaceolddataregvalues **ˆClearallPIAinterrupts*‰TST.B…PIA1ADR(A0)‰clearPIA1A‰TST.B…PIA1BDR(A0)‰clearPIA1B‰TST.B…PIA2ADR(A0)‰clearPIA2A‰TST.B…PIA2BDR(A0)‰clearPIA2B*#* Set channels 4-5 IRQ control bits*6ŠMOVE.BPIA2ACR(A0),D0…get0-7outputcontrolregister)ŠAND.B„#CLRIRQ,D0‡negateIRQcontrolbits;ŠOR.BƒOCR07(A4,D7),D0„addchannel4-5interruptinformation*ŠMOVE.BD0,PIA2ACR(A0)…writethenewstuff*,*‰setinterruptinformationforchannels6-7*<ŠMOVE.BPIA2BCR(A0),D0…getchan8-15outputcontrolregister(ŠAND.B„#CLRIRQ,D0‡clearIRQcontrolbits<ŠOR.BƒOCR815(A4,D7),D0ƒsetchannel6-7interruptinformation*ŠMOVE.BD0,PIA2BCR(A0)…writethenewstuff*,*‰setinterruptinformationforchannels0-1*:ŠMOVE.BPIA1ACR(A0),D0…getchan0-7inputcontrolregister(ŠAND.B„#CLRIRQ,D0‡clearIRQcontrolbits;ŠOR.BƒICR07(A4,D7),D0„setchannel0-1interruptinformation*ŠMOVE.BD0,PIA1ACR(A0)…writethenewstuff*,*‰setinterruptinformationforchannels2-3*>ŠMOVE.BPIA1BCR(A0),D0…getchannel8-15inputcontrolregister(ŠAND.B„#CLRIRQ,D0‡clearIRQcontrolbits<ŠOR.BƒICR815(A4,D7),D0ƒsetchannel2-3interruptinformation*ŠMOVE.BD0,PIA1BCR(A0)…writethenewstuffŠCLR.L‚D0‘setforgoodreturn**ˆrestoreinterruptlevel*6ŠMOVE.WƒD6,SRŒreturninterruptmaskstopreviousvalueDOPIAXEQU*˜exitsequenceŠMOVE.Lƒ(A7)+,D7‰restoreD7ŠPOP_POINT‘recallallpointersŠRTS—returntocallerŠPAGEL*****************************************************************************6*‰CLRPIAMƒClearoutthePIAmapforthismemorymapped*“I/Oaddress.*&*‰Entry:A1=RIO-IDaddressinRIOTBL%*A2=addressofCMRparameterblock%*A3=addressofRIOparameterblock*A4=addressofRIOTBL*A5=addressofCCB*A6=addressofusersTCB**‰Uses:‚D4,D6,D7*%*‰Exit:‚D0=RIONIDifanerrorfound**D0=contentsonentryifnoerrorfound* L*****************************************************************************3CLRPIAMƒMOVE.WRIOPIA(A4),D7†getoffsettoPIAmaps.ŠMOVE.BRIONAL(A4),D6†get#ofRIO'Sallocated3ŠMOVE.LCCBCHB(A5),D4†getmemorymappedI/OaddressDCLRPIAM1‚CMP.L‚PIADDR(A4,D7),D4ƒlookformatchingmem.map.I/OaddrŠBEQ.S‚CLRPIAM2‹branchiffound$ŠADD.W‚#PIALNG,D7‰bumptonextentryŠSUB.B‚#1,D6Ždecrementcounter0ŠBNE.S‚CLRPIAM1‹branchifmoreentriestosearch#ŠMOVE.W#RIONID,D0‰seterrorreturnŠRTS—returntocaller*CLRPIAM2‚CLR.L‚DODR07(A4,D7)†clearthemap ŠCLR.L‚OCR07(A4,D7)‡andtherestŠRTS—returntocallerŠPAGEL******************************************************************************‚CLOSECOMMAND*A*‚CloseallconnectionswiththisusertaskandhisopenchannelsB*‚forthisRIOmodule.Thechannelsareputbacktothepre-opened4*‚state.AllI/Oonthisuser'schannelsisstopped.*$*‚RIOCLOSECOMMANDparameterblock: *‰DS.Wƒ1ƒreturnedcommandstatus*‰DS.Wƒ1ƒcommandcode02*)*‚Entry:A1=addressofRIO-IDinRIOTBL%*‰A2=addressofCMRparameterblock%*‰A3=addressofRIOparameterblock*‰A4=addressofRIOTBL*‰A5=addressofCCB*‰A6=addressofusersTCB**‚Calls:STOPPIA*L*****************************************************************************CLOSE:+ŠMOVE.L#4,D1ŽbumppastRIO-IDinthetable!ŠCLR.L‚D2‘useforchannelcounter5CLOSE10ƒCMP.L‚RIOTCB(A1,D1),A6ƒchannelforthisuser?*ŠBNE.S‚CLOSE20Œbranchifnotforthisuser3ŠMOVE.WRIOCNIF(A1,D1),D0‚getchannelconfiguration4ŠBSR„STOPPIAŒgostopI/OonthischannelD2=chan#?ŠMOVE.W#$FFFF,RIOTCB(A1,D1)setthischannelentrytonotused5CLOSE20ƒADD.L‚#CHANLNG,D1ˆpointtonextchannelentryŠADD.L‚#1,D2Žcountthischannel$ŠCMP.L‚#16,D2searchedallchannels?&ŠBNE.S‚CLOSE10ŒbranchifmorechannelsŠCLR.L‚D0‘setfornoerrorsŠBRA„NRMEXITŒandreturntoCMRŠPAGED*********************************************************************4*‚STOPPIAƒdeactivateI/Oonspecifiedchannelnumber*&*‚Entry:A1=RIO-IDaddressinRIOTBL%*‰A2=addressofCMRparameterblock%*‰A3=addressofRIOparameterblock*‰A4=addressofRIOTBL*‰A5=addressofCCB*‰A6=addressofusersTCB**‰D0.W=channelconfiguration%*‰D2.L=channelnumbertodeactivate* *‚Uses:‚D0,A0*L*****************************************************************************:STOPPIAƒMOVE.LCCBCHB(A5),A0†getmemorymappedI/OaddressŠCMP.B‚#8,D2Žchannel8-15?&ŠBGE.S‚STOPIA60‹branchifchannel8-15* *‰channel0-7*5ŠBCLRƒ#2,PIA2ACR(A0)…selectoutputdirectionregister/ŠBCLRƒD2,PIA2ADR(A0)…setthischannelforinput0ŠBSETƒ#2,PIA2ACR(A0)…selectoutputdataregister,ŠBCLRƒD2,PIA2ADR(A0)…deactivatethischannelŠBTSTƒ#0,D0Žinputchannel?,ŠBNE.S‚STOPIART‹branchifno,outputchannel*/*‰inputchannel-determineifusinginterrupts* ŠBTSTƒ#1,D0Žinterruptsdisabled?"ŠBNE.S‚STOPIART‹branchifdisabled-ŠBTSTƒ#0,D2Žseeifoddorevenchannelnumber,ŠBNE.S‚STOPIA10‹branchifoddchannelnumber7ŠMOVE.B#1,D0Ževenchan-disableinterruptsbit#is0ŠBRA.S‚STOPIA20‹andcontinue>STOPIA10MOVE.B#4,D0oddchan-disableinterruptsbit#is3.STOPIA20CMP.B‚#1,D2getactualchannelnumber)ŠBGT.S‚STOPIA30‹branchifnotchannel0-15ŠBCLRƒD0,PIA1ACR(A0)…disableinterrupts-channel0-1STOPIART‚RTS—returntocaller.STOPIA30‚CMP.B‚#3,D2Žseeifchannelnumber2-3!ŠBGT.S‚STOPIA40‹branchifnot2-33ŠBCLRƒD0,PIA1BCR(A0)…disableinterruptschannel2-3ŠBRA.S‚STOPIART‹andreturn.STOPIA40‚CMP.B‚#5,D2Žseeifchannelnumber4-5!ŠBGT.S‚STOPIA50‹branchifnot4-53ŠBCLRƒD0,PIA2ACR(A0)…disableinterruptschannel4-5ŠBRA.S‚STOPIART‹andreturn;STOPIA50‚BCLRƒD0,PIA2BCR(A0)…disableinterruptschannel6-7ŠBRA.S‚STOPIART‹andreturnŠPAGE**‰channel8-15*(STOPIA60‚MOVE.LD2,D0Žgetchannelnumber!ŠSUB.L‚#8,D0Žmake0-7typenumber5ŠBCLRƒ#2,PIA2BCR(A0)…selectoutputdirectionregister"ŠBCLRƒD0,PIA2BDR(A0)…setforinput 0ŠBSETƒ#2,PIA2BCR(A0)…selectoutputdataregister,ŠBCLRƒD0,PIA2BDR(A0)…deactivatethischannelŠRTS—returntocallerŠPAGEF************************************************************************‰OUTON-TURNONRELAYCOMMAND;*‰Thiscommandactivatesrelaysforspecifiedchannelsthat9*‰havepreviouslybeenopenedforoutputbythesametask<*‰requestingthisactivation.‚Theparameterblockischecked9*‰forerrorsbeforeanyrelayisactivated.‚Nochannelis!*‰activatedifanerrorisfound.9*‰AllchannelswithinaPIAareactivatedsumultaneously.>*‰Outonreadsthepiadataregistertofindthecurrentstate.*%*‰RIOOUTPUTcommandparameterblock: *‰DS.Wƒ1ƒreturnedcommandstatus*‰DS.Wƒ1ƒcommandcode034*‰DS.Wƒ1ƒbitmaskcontainingchannel#'stoactivate*)*‚Entry:A1=addressofRIO-IDinRIOTBL%*‰A2=addressofCMRparameterblock%*‰A3=addressofRIOparameterblock*‰A4=addressofRIOTBL*‰A5=addressofCCB*‰A6=addressofusersTCB**‚Calls:DOOUT**L*****************************************************************************OUTON:ŠPUSHPOINT‘saveallpointers3ŠCLR.L‚D3‘flagtockpara.blk.beforedoingoutput.OUTON10ƒMOVE.L#4,D1ŽbumppastRIO-IDintable!ŠCLR.L‚D2‘useforchannelcounterŠCLR.L‚D0‘clearforuse+ŠMOVE.WCMDCHN(A3),D0†getchannelstostart8ŠMOVE.WƒCMDCHN(A3),D3„copyONrequesttocheckregister.)OUTON20ƒBTSTƒD2,D0Žactivatethischannel?0ŠBEQ.S‚OUTON30Œbranchifno-checknextchannel5ŠCMP.L‚RIOTCB(A1,D1),A6ƒchannelbelongetothisuser?"ŠBNE.S‚OUTONERŒbranchifno,error3ŠMOVE.WRIOCNIF(A1,D1),D4‚getchannelconfigurationŠBTST‚#0,D4anoutputchannel?+ŠBEQ.S‚OUTONER1‹branchifnotoutput,error.ŠBCLRƒD2,D3Žnegatecheckflagforthischannel$ŠTST„D3‘isallofparameterchecked?(ŠBNE.S‚OUTON30Œbranchifnotallchecked5ŠBSR„DOOUTŽgoodparameterblock-goactivatechannelŠBRA.S‚OUTONEXŒnormalexit/OUTON30ƒADD.L‚#1,D2Žbumptonextchannelnumber-ŠADD.L‚#CHANLNG,D1ˆbumptonextchannelentry'ŠCMP.L‚#16,D2checkedallthechannels?/ŠBNE.S‚OUTON20Œbranchifmorechannelstocheck*<*Fall into invalid command for error return (error in OUTON)*AOUTONERƒMOVE.W#RIOICU,D0‰setinvalidcommandforthisusererrorŠBRA.S‚OUTONRTŒandreturn?OUTONER1‚MOVE.W#RIOICC,D0‰setinvalidcommandforthischannelŠBRA.S‚OUTONRTŒandreturn$OUTONEXƒCLR.L‚D0‘setforgoodreturn%OUTONRTƒPOP_POINT‘recallallpointersŠBRA„NRMEXITŒgoreturntoCMR‰PAGE** DOOUT…EQU„***A*DOOUT talks directly to the PIA data reg.s and turns on outputs.**‰OnentrytoDOOUT:8*‰D0contains(16bit)bitmaskfordesiredONchannels.<*‰A5containsaddressofCCBfromwhichI/Obaseaddrisob.*-“MOVE.L„A2,-(A7)ŒsaveaddressofCMRparablk*“MOVE.L„CCBCHB(A5),A2‡getI/Obaseaddress#“NOT‡D0’logicinversioninRIOckts*“AND.B…D0,PIA2ADR(A2)†turnonchannels0-7%“LSR.W…#8,D0selectdataforch.8-15+“AND.B…D0,PIA2BDR(A2)†turnonchannels8-15-“MOVE.L„(A7)+,A2ŒrestoreaddrofCMRparablk“RTS‰PAGEM******************************************************************************"*‰OUTOFF-TURNOFFRELAYSCOMMAND=*‰Thiscommanddeactivatesrelaysforspecifiedchannelsthat9*‰havepreviouslybeenopenedforoutputbythesametask<*‰requestingthisactivation.‚Theparameterblockischecked;*‰forerrorsbeforeanyrelayisdeactivated.‚Nochannelis#*‰deactivatedifanerrorisfound.*)*‰RIOOUTPUTOFFcommandparameterblock: *‰DS.Wƒ1ƒreturnedcommandstatus*‰DS.Wƒ1ƒcommandcode044*‰DS.Wƒ1ƒbitmaskcontainingchannel#'stoactivate*)*‚Entry:A1=addressofRIO-IDinRIOTBL%*‰A2=addressofCMRparameterblock%*‰A3=addressofRIOparameterblock*‰A4=addressofRIOTBL*‰A5=addressofCCB*‰A6=addressofusersTCB**‚Calls:DOOFF*L*****************************************************************************OUTOFF:ŠPUSHPOINT‘saveallpointers 2ŠCLR.L‚D3‘flagtockpara.blk.beforestopoutput.OUTOF10ƒMOVE.L#4,D1ŽbumppastRIO-IDintable!ŠCLR.L‚D2‘useforchannelcounterŠCLR.L‚D0‘clearforuse+ŠMOVE.WCMDCHN(A3),D0†getchannelstostart0ŠMOVE.WƒD0,D3Œcopychan.toturnofftoworkreg+OUTOF20ƒBTSTƒD2,D0Ždeactivatethischannel?0ŠBEQ.S‚OUTOF30Œbranchifno-checknextchannel5ŠCMP.L‚RIOTCB(A1,D1),A6ƒchannelbelongstothisuser? ŠBNE„OUTONERŒbranchifno,error3ŠMOVE.WRIOCNIF(A1,D1),D4‚getchannelconfigurationŠBTST‚#0,D4anoutputchannel?)ŠBEQ„OUTONER1‹branchifnotoutput,error.ŠBCLR…D2,D3Œnegatecheckflagforthischannel$ŠTST„D3‘isallofparameterchecked?(ŠBNE.S‚OUTOF30Œbranchifnotallchecked3ŠBSR„DOOFFŽgoodpara.block-godeactivatechannelŠBRA.S„OUTOFFXŠnormalexit/OUTOF30ƒADD.L‚#1,D2Žbumptonextchannelnumber-ŠADD.L‚#CHANLNG,D1ˆbumptonextchannelentry'ŠCMP.L‚#16,D2checkedallthechannels?/ŠBNE.S‚OUTOF20Œbranchifmorechannelstocheck ŠBRA†OUTONEROUTOFFXEQU*šnormalexitŠPOP_POINT‘recallallpointersŠCLR.L„D0signalnoerrorsŠBRANRMEXITnormalexit‰PAGE*** DOOFF…EQU**B*DOOFF‚talksdirectlytothePIAoutputregsandturnsoffoutputs*G* On entry: D0 has bit map of channels to turn off (a 1 means turn off)*‹A5hasaddressofuserCCB*:*‰DOOFFiscalledbyOUTOFFandpulsedoutputdeactivation*/ŠMOVE.LƒA2,-(A7)ŒsaveaddressofCMRparablock3ŠMOVE.LƒCCBCHB(A5),A2‡getmemorymappedI/Oaddress*D*‚ThereisalogicalinversionbetweenPIAoutputsandfinaloutputs**ŠOR.B…D0,PIA2ADR(A2)†turnoffselected0-71ŠLSR.W„#8,D0selectinformationforchannels8-15+ŠOR.B…D0,PIA2BDR(A2)†turnoffselected8-152ŠMOVE.Lƒ(A7)+,A2ŒrestoreaddressofCMRparablockŠRTSŠPAGEM******************************************************************************!*‰STAT-GETINPUTSTATUSCOMMAND;*‰Thiscommandreadsthestatusofspecifiedinputchannels=*‰thatdonothaveinterruptsenabled.‚Thechannelsmusthave>*‰previouslybeenopenedforinputbythisuser.‚Theparameter>*‰blockischeckedforerrorsbeforeanyinputstatusisread.A*‰Theusersparameterblockismodifiedtosignalactivechannels<*‰bysettingthecorrespondingbitinthebit-maskword.The;*‰correspondingbitnumberofinactivechannelsiscleared.**.*‰AllchannelsinaPIAsidearereadatonce.*+*‰RIOINPUTSTATUScommandparameterblock: *‰DS.Wƒ1ƒreturnedcommandstatus*‰DS.Wƒ1ƒcommandcode05<*‰DS.Wƒ1ƒbitmaskcontainingchannelsnumberstoreadstatus$*”(thisisalsothereturnedfield)*)*‚Entry:A1=addressofRIO-IDinRIOTBL%*‰A2=addressofCMRparameterblock%*‰A3=addressofRIOparameterblock*‰A4=addressofRIOTBL*‰A5=addressofCCB*‰A6=addressofusersTCB**‚Calls:GTSTAT*M******************************************************************************STAT:ŠPUSHPOINT‘saveallpointers(ŠCLR.L‚D5‘useforreturnedstatusvalues2ŠCLR.L‚D3‘flagtockpara.blk.beforereadstatus.STAT10„MOVE.L#4,D1ŽbumppastRIO-IDinRIOTBLŠCLR.L‚D2‘channelcounterŠCLR.L‚D0‘clearforuse;ŠMOVE.WCMDCHN(A3),D0†getchannelnumberstoreadstatuson3ŠMOVE.WD0,D3Žcopychanactivationreq.bitpattern/STAT20„BTSTƒD2,D0Žreadstatusforthischannel?ŠBEQ.S‚STAT40branchifno5ŠCMP.L‚RIOTCB(A1,D1),A6ƒchannelbelongstothisuser?1ŠBNE„OUTONERŒbranchifno-returnwitherrorset3ŠMOVE.WRIOCNIF(A1,D1),D4‚getchannelconfigurationŠBTSTƒ#0,D4Žaninputchannel?9ŠBNE„OUTONER1‹branchifnotinput-returnwitherrorset'ŠCMP.B‚#8,D2Žseeifchannelnumber8-156ŠBGE.S‚STAT30branchif8-15-donotcheckinterrupts,ŠBTSTƒ#1,D4Žischan1-7,setforinterrupts?2ŠBEQ„OUTONER1‹branchifsetforinterrupts-error6STAT30„BCLRƒD2,D3Žclractivationflagforthischannel*ŠTST„D3‘finishedcheckingparameterblock?1ŠBNE.S‚STAT40branchifnotfinishedcheckingyet.ŠBSR„GTSTATgoreadstatusandsaveinREG.D5!ŠBRA.S‚STAT50gotoprocedureexit 3STAT40„ADD.L‚#CHANLNG,D1ˆbumptonextchannelentry(ŠADD.L‚#1,D2Žbumptonextchannelnumber#ŠCMP.L‚#16,D2checkedallchannels?,ŠBRA„STAT20branchtochannelchecksequenceXX‚(stampcoupling)?*‚Returnparameters:‚none(sideeffects;writestoPIActlreg)* DOENBL EQU *3‰LEA‡ENBLIRQ(PC),A1†getaddressofenable_irqtable 3‰BSR‡MODIFYPIAŒmodifyPIAcontrolregIRQ1ctlbits‰RTS‰PAGE *MODIFYPIA**†It'sfunctionsare:0*ˆa.TowriteinterruptcontroldatatoPIAmaps=*ˆb.TowriteinterruptcontroldatatoPIAcontrolregisters*>*‹ItperformsthesetwofunctionsbeinvokingWRITMAP&DOPIA.+*‹ItDOESNOTMODIFYDEBOUNCECONTROLDATA.***ˆInputparameters:/*’A1„addressofenable/disableconstanttable*’D2„channel#*’A4„RIOTBLaddress*’D1„XXX>*ˆOutputparameters:‚none(sideeffects;writesPIAregisters)*MODIFYPIA EQU * ‰CLR.L…D7‰MOVE.L„D2,D5ˆsetupchannel#2‰MOVE.W„RIOPIA(A4),D7‡getoffsettouser'sPIAmap ‰BTST†#0,D2…evenoroddchannel?"‰BNE.S…MODF1…branchonoddchannel-‰MOVE.W„(A1),D1ƒgetevenchannelcontrolmask ‰BRA.S…MODF2 MODF1 EQU ***ˆstagecodeforWRITMAP*1‰MOVE.W„2(A1),D1‚getoddchannelIRQcontrolmask MODF2 EQU *2‰BSR‡WRITMAPƒwritethenewinterruptstatustomap,‰BSR‡DOPIA…writethenewcontroldatatoPIA‰RTS‰SPC10*ENBLIRQEQU*†tableforusebyDOENBLonly@*‚MSbyteisOR'edwithcontroldata,LSbyteisAND'edwithit.%‰DC.W†$01FF…enableirqevenchannel#$‰DC.W†$08FF…enableIRQoddchannel#;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ŠPAGEM******************************************************************************%*ˆDSABLE-DISABLEINTERRUPTSCOMMAND>*‰Thiscommanddisablesinterruptsforthespecifiedchannels.<*‰Thechannelsmusthavebeenopenedforinputbythisuser,?*‰mustbechannels0-7only,andmustcurrentlyhaveinterrupts;*‰enabled.‚Theparameterblockischeckedforerrorsbefore>*‰anyinterruptsaredisabled.Nochannelsaredisabledifany*‰errorisfound.*1*‰RIODISABLEINTERRUPTScommandparameterblock: *‰DS.Wƒ1ƒreturnedcommandstatus*‰DS.Wƒ1ƒcommandcode07B*‰DS.Wƒ1ƒbitmaskcontainingchannelnumberstodisableinterrupts*)*‚Entry:A1=addressofRIO-IDinRIOTBL%*‰A2=addressofCMRparameterblock%*‰A3=addressofRIOparameterblock*‰A4=addressofRIOTBL*‰A5=addressofCCB*‰A6=addressofusersTCB**‚Calls:DODSABL*M*****************************************************************************DSABLE:ŠPUSHPOINT‘saveallpointers7DSABL10ƒMOVE.L#4,D1ŽsetD1tochanconfig.entry(row)!ŠCLR.L‚D2‘useforchannelcounter1ŠCLR.L‚D0‘clearforuseaschannelactiv.bitmap4ŠMOVE.WCMDCHN(A3),D0†getchannelactivationbitmap+ŠCMP.W‚#$FF,D0Œcannotspecifychannels8-153ŠBGT„ENABLERŒbranchif8-15-returnwitherrorset(DSABL20ƒBTSTƒD2,D0Ždisablethischannel?)ŠBEQ.S‚DSABL30Œbranchifnotthischannel-ŠCMP.L‚RIOTCB(A1,D1),A6ƒbelongstothisuser?0ŠBNE„OUTONERŒbranchifno,returnwitherrorset3ŠMOVE.WRIOCNIF(A1,D1),D4‚getchannelconfigurationŠBTSTƒ#0,D4Žaninputchannel?8ŠBNE„OUTONER1‹branchinnotinput,returnwitherrorsetŠBTSTƒ#1,D4Žinterruptsenabled?1ŠBNE„OUTONER1‹branchifno,returnwitherrorset/ŠBSET…#1,D4Œdisableinterruptsforthischannel>ŠMOVE.WƒD4,RIOCNIF(A1,D1)ƒstoreoutirqdatainconfig.RIOTBLŠPUSHALL“saveallregs!ŠBSR„DODSABLŒgodoactualdisableŠPOPALL”restoreall(DSABL30ƒADD.L‚#1,D2Žbumptonextchannel-ŠADD.L‚#CHANLNG,D1ˆbumptonextchannelentry"ŠCMP.L‚#8,D2Žcheckedallchannels?&ŠBNE.S‚DSABL20Œbranchifmorechannels)ŠBRA†ENABLOKŠreturnwithstatus=noerrsŠPAGE**.*DODSABL is a local subroutine for DSABLE only**ƒInputparameters**’D2.W‚channel#*’A4„RIOTBLaddress*?*‚Returnparameters:‚none(sideeffects;writestoPIActlreg)* DODSABL EQU *3‰LEA‡DSBLIRQ(PC),A1†getaddressofenable_irqtable3‰BSR‡MODIFYPIAŒmodifyPIAcontrolregIRQ1ctlbits‰RTS*** DSBLIRQ‚EQU‡*.‰DC.W†$00FE…disableIRQonevenchannelnumber%‰DC.W†$00F7…disableIRQoddchannel#;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - -‰PAGEM*******************************************************************************ˆPLSO-PULSEDOUTPUTCOMMAND* )*‚Entry:A1=addressofRIO-IDinRIOTBL%*‰A2=addressofCMRparameterblock%*‰A3=addressofRIOparameterblock*‰A4=addressofRIOTBL*‰A5=addressofCCB*‰A6=addressofusersTCB***‰ExitstoNRMEXIT***Parameter block format for pulsed output:*0*RIO parameter block (pointed to by A3 on entry)* *ˆDS.W†1‰returnedcommandstatus*ˆDS.W†1‰commandcode*ˆDS.W†1‰numberofchannels<*ƒ---ƒ---ƒ---ƒparametersforindividualchannelsƒ---ƒ---ƒ---*ˆDS.W†1‰firstchannelnumber,*ˆDS.L†1‰numberofmillisecondsforpulseon*ˆ.*ˆ.*ˆDS.W†1‰nthchannelnumber5*ˆDS.L†1‰numberofmillisecondsfornthchannelpulse*7* EACH CHANNEL IS ACTIVATED IN TURN (NON-SYNCHRONOUSLY)**M***************************************************************************** PLSO:*@*ƒPulsed_Out(IN:LISTOFchannelactivationrequest,pulsetimes;*ˆOUT:errorcode)>‰ALLOCATECHANID,RIOPARBK†allocatechannelid&RIOparablock3‰STORE…A3,RIOPARBK‰saveRIOparameterblockaddress**†Initiatepulsedoutput*!‰CLR.L…D6’clearworkingregisters ‰CLR.L…D3’. ‰CLR.L…D2’. ‰CLR.L…D0’.*$*ˆgetnumberofchannelstoactivate*<‰MOVE.W„CMDCHN(A3),D0‡getnumberofchan'sfromRIOparablk**‡WHILEchannelcount>0*PLSO1:$‰TST.W…D0’loopon#ofchan.'stodo ‰BEQ‡PLSOX**ˆDO**‡getfirstchannelnumber* ‰CLR.L…D5‰MOVE.W„NUMCHAN(A3,D6),D5$‰STORE…D5,CHANID‹savechannelnumber*G* Channel ID will consist of user CCB address + chan number in LS byte.*+‰MOVE.L„A5,D7copyuser'sCCBaddresstoD75‰ADD.L…D7,CHANID(A7)‡CHANIDnowhascompletechan.ID"‰MOVE.L„D5,D7copychannel#toD7,‰BSR‡BIN_BITconvertbinarytobitmapinD5*)*‚IFchannelbelongstocurrentuserTHEN*6‰MULU†#CHANLNG,D7‰computeoffsettonthchaninRIOTBL%‰ADD‡#4,D7bumptouserTCBinRIOTBL-‰CMP.L…RIOTCB(A1,D7),A6„compareTCBaddresses1‰BNE.S…PLSOER1branchonchannelnotcurrentuser**ˆDO'*ˆGetchannelconfigurationfromRIOTBL*8‰MOVE.W„RIOCNIF(A1,D7),D3ƒgetchannelconfigfromRIOTBL*&*‚IFchannelisanoutputchannelTHEN* ‰BTST†#0,D3.‰BEQ.S…PLSOER2ƒbranchonnotanoutputchannel**„DO2*…GetpulsetimefromRIOcommmandparameterblock*‰MOVE.L„CHNCNFG(A3),D3*%*„IFpulsetime>pulse_min_timeTHEN*'‰BEQ.S…PLSOER3ƒbranchonpulsetime=0**„DO-*†requestperiodicactivation(thischannel#)*2‰LEA‡PLSOFF(PC),A0‡pointtopulseturnoffroutine%‰CLR.L…D1’setrequestfor1timeonly6‰MOVE.B„CCBPPRIO(A5),D1…setact.prioritysameastask/‰LOAD†D2,CHANID‹setupchannelIDtogotoPLSOFF'‰MOVE.L„D3,A1setupactivationinterval‰PUSHALL"‰TR0$.RQPA˜passrequestforwakeup*)*‚Ifnoerrinperiodicact.requestTHEN*‰BRA.S…RQPAOKŽgoodreturn(‰BRA.S…PLSOER4errinperiodicact.req.**†DO*RQPAOK:‰POPALL(‰PUSHALL—amoreelegantwaytodothis?*"*ˆactivate_this_channel(channel#)*$‰MOVE.L„D5,D0passbitmasktoDOOUT ‰BSR‡DOOUT‰POPALL**†END*ƒEND*ƒdecrementchannelcount* ‰SUB‡#1,D0**END* ‰BRA‡PLSO1**ˆErrorhandling*PLSOER1‚CLR.L…D00‰MOVE.B„#RIOICNS,D0‰channelnotforcurrentuser ‰BRA.S…PLSOX1PLSOER2: ‰CLR.L…D00‰MOVE.B„#RIOICC,D0Šchannelnotanoutputchannel ‰BRA.S…PLSOX1PLSOER3:"‰CLR.L…D0’requestedpulsetime=03‰MOVE.B„#RIOCNFG,D0‰return'badconfiguration'code ‰BRA.S…PLSOX1PLSOER4:‰POPALL ‰CLR.L…D0+‰MOVE.B„RIOBSY,D0‹periodicactivationerror ‰BRA.S…PLSOX1Žreturndevicebusy‰SPC2** Pulsed output good exit point*;PLSOX„LOAD†A3,RIOPARBK‰restoreRIOparablockaddresstoA3‰CLR.L…D0ˆsetfornormalreturnPLSOX1: ‰ADD.L…#12,A7*‰BRA†NRMEXIT„gotonormalcommonexitpoint‰PAGE**‡PULSEDOUTPUTDEACTIVATION:**ˆPulsedoutputde-activation.!*ˆEnteredbyperiodicactivation. *ƒOnentry:?*ˆD1containschannelIDcomposedofuser'sCCBaddressinM.S.8*ˆ3bytes,andchannelnumber(0-15)inleastsig.byte.*PLSOFF:‰PUSHALL&‰MOVE.B„D1,D5savecombinedchannelID  ‰AND.B…#0,D1recoverCCBaddress+‰MOVE.L„D1,A5stageCCBaddressfor'DOOFF'+‰AND.L…#$000000FF,D5‡recoverchannelnumber,‰BSR‡BIN_BITconvertchan#tobitmapinD5"‰MOVE.L„D5,D0stagedataforDOOFF‰BSR‡DOOFFturnoffchannel‰POPALL‰RTE‰PAGEBIN_BIT:*$* Binary to bit-map conversion in D5*J*Produces a 1 in D5 corresponding to the value in D5 (in binary) up to 15.@*ˆForinput>15binarytheresultantpatterninD5isundefined*‰ALLOCATE‚BITMAP‰CLR.L…BITMAP(A7)‰ADD.W…#1,BITMAP(A7) LOOP…SET‡* ‰TST.W…D5‰BEQ‡BINBITXexitonbitfound‰ROL.W…BITMAP(A7) ‰SUB‡#1,D5 ‰BRA‡LOOP BINBITXŒEQU‡*‰MOVE.W„BITMAP(A7),D5‰DEALOC„BITMAP‰RTSŠPAGEO******************************************************************************** *ˆNORMALEXIT*,*‚Entry:A2=addressofCMRparameterblock%*‰A3=addressofRIOparameterblock*‰A5=addressofCCB*‰A6=addressofusersTCB*‰D0=RIOerrorcode*I**************************************************************************NRMEXIT:>ŠMOVE.WD0,CMDSTA(A3)†setreturnstatusinRIOparameterblockŠRTS—returntoCMRŠPAGEJ****************************************************************************ˆKILR(KILLER)*4*“Routinecalledtohandleunrecoverableconditions.**K****************************************************************************KILR: ‰TR0$.KILLERŠPAGEF***********************************************************************B* SUBROUTINE TO CHECK ADDRESS BOUNDARIES TO SEE IF ENTIRELY WITHIN*ƒCALLINGTASKSADDRESSSPACE.*#*ENTRY:ƒD5‚-NO.OFBYTESTOCHECK*ŠD6‚-68000ADDRESS(LOGICAL)*ŠA1‚-TCBADDRESS*** EXEC ROUTINE#* REGISTERS USED: D0-D1,D3,D6/A0-A1**7*EXIT:„D6-PHYSICALADDRESSOFBUFFERBASE(IFLEGAL)*ŠRETURNTOPC„FORGOODADDRESS*”PC+2‚FORBADLENGTH*”PC+4‚FORBADADDRESS*F*********************************************************************** IOHADRCK:%ŠBTSTƒ#0,D6‘Mustbeonworkboundary.)ŠBNE.S‚IOHADR4Branchifbadbufferbase.ŠTST.L‚D5”Lengthcan'tbezero.2ŠBEQ.S‚IOHADR8Don'tgotologphywithzerocount. IOHADR2ƒEQU„*1ŠMOVE.LTCBTST(A1),A0‰Addressoftaskseg.table. ŠTR0$.LOGPHY.ŠBRA.S‚IOHADR8Branchforgoodaddressreturn.0ŠBRA.S‚IOHADR6Branchforbadbytecountreturn.(ŠTST.L‚D5”Wasanentrypointerreturned.#ŠBEQ.S‚IOHADR4Branchifno-ERROR)ŠTST.B‚7(A0,D5)ŽIsthisanMMIOsegment?ŠBNE.S‚IOHADR8Yes,OK.3IOHADR4ƒADD.L‚#2,(A7)AdjustPCforinvalidreturn.3IOHADR6ƒADD.L‚#2,(A7)AdjustPCforinvalidreturn.IOHADR8ƒRTSšReturn.ŠPAGEI***************************************************************************ˆGETTCBROUTINE*)*’ENTRY:A0=POINTERTOTASKANDSESSION***’EXECROUTINE*’REGISTERSUSED:D0-D1/A0-A1***’EXIT:A0=TCBADRESS**˜RETURNTOPC„FORGOODTASKSPECIFICATION!*¢PC+2‚FORBADTASKSPECIFICATION**J***************************************************************************GETTCB: ŠTR0$.GETTCB&ŠBRA.S„GETT10ŽGoodtaskspecification.ŠNOPšBadtaskspecification.&ŠADD.L„#2,(A7)Badtaskspecification.GETT10„RTSšReturn.ŠPAGEJ**************************************************************************** INTERRUPT SSERVICE ROUTINE*?*ƒPURPOSE:‚HANDLETHERIOINTERRUPTSANDNOTIFYTHEUSEROFTHE5*INTERRUPTS.‚OPERATESATHARDWAREINTERRUPTPRIORITY*LEVEL.*1*ƒENTRY:‚JSR‚FROMINTERRUPTHANDLERROUTINE-CMR*‹A0-WORKREGISTER *‹A1=SELF*‹A5=ADDRESSOFCCB*‹D0=WORKREGISTER*5*ƒEXIT:‚RTS-BACKTOINTERRUPTHANDLERROUTINE-CMR*C*ŠInterrupthandlermustpruservealldatareg.'s&addressreg.'s.***ƒREGISTERSUSED:ƒ01234567 *”D******** *”A*****P****ƒEXECROUTINESCALLED:‚QEVENTI**ƒCODEISRE-ENTRANT**?*‚Debounceoninterruptadded9/13/82.‚Debounceis0to512ms,9*‚encodedinbits8-14ofthechannelconfigurationword.I*‚Thescalefactorfordebouncetimeis4mspercountinch.config.wd.* F*---------------------------------------------------------------------*RIOINT:*<* Find RIO TABLE module (board) name which matches CCB name:*-ˆMOVEM.L„A0-A6/D1-D7,-(A7)„saveallexceptD0:ˆALLOCATEƒRIOTADR,CHANUM,CLAIMCHKƒallocatelocalvariables/ˆCLR.L†CLAIMCHK(A7)…clearinterruptclaimcheck-ˆMOVE.L…RIOTBL,A2‰getaddressofRIOTBLtoA2 ˆCLR.L…D76ˆMOVE.B„RIONMAX(A2),D7…getmaxnumberofRIOID'stoD7#ˆMOVE.L„CCBMNEM(A5),D0…getccbname2IOHI011EQU*‚findmatchingRIOIDloopentrypoint*ˆMOVE.L„RIOID(A2),D3‡getRIOIDforstaging'ŠCMP.LƒD3,D0ŽdoesCCBnamematchRIOID?#ŠBEQ.SƒIOHI020Œbranchonnamematch,ŠADDA.W‚RIOOFST,A2‰addoffsettonextRIOTBL#ŠSUB.Bƒ#1,D7ŽtestforendofRIOTBL*ŠBMI…IOHIPXŠbranchtoexitifidnotfound ŠBRAIOHI011 IOHI020ƒEQU**F*‚Foundmatchingnames,nowgetnumberofinterruptingchannel(toD2)2*‚andclearhardwareinterruptflaginPIAdevice.*%‰STORE…A2,RIOTADRŠsaveRIOTBLaddress,‰MOVE.L„#$0C010000,D2‡initparafieldsinD2)‰BSR‡IOHICLRclrirq&getint.channel#+‰STORE…D2,CHANUM‹savechan.#&returncode*>* Compute address of field in RIOTBL having user's TCB address* ŠCLR.L„D4!ŠMOVE.BƒD2,D4getchannel‚toD4.B)ŠCMP.B„#8,D4channelmustbe<8orerror'ŠBEQ.S„IOHIPXŒexitonchannelnotfound1ŠADD.L„#1,CLAIMCHK(A7)ƒmarkinterruptacknowledge2ŠMULU…#6,D4pointtodatafieldassocwithchannel5ŠADD†#RIONTRY,D4‡addoffsetto1stchanneldatafieldŠADD†#4,D4addinsizeofRIOID-ŠMOVE.LƒRIOTBL,A2‰getaddressofRIOTBLtoA26ŠMOVE.L‚RIOTCB(A2,D4),A6„A6nowhasuser'sTCBaddress*"*IF channel requires debounce THEN*3ŠMOVE.WƒRIOCNIF(A2,D4),D0ƒgetchannelconfiguration(ŠAND†#$7F00,D0‹selectdebouncetimedata…IF.L†ŠTHEN*„DO;*ˆRequestperiodicactivation(CCB_adr,chan_#,debounce_time)6*ˆGeneratechannelID=CCBaddress+channel#toD2:**‰MOVE.L„A5,D7copyboardCCBaddresstoD7‰ADD.B…D2,D7addchannelnumber/‰MOVE.L„D7,D2stagechannelIDforperiod.act..‰LEA‡DEBOUNCE(PC),A0…pointtodebounceroutine!‰CLR.L…D1’request1periodicact.1‰MOVE.B„CCBPPRIO(A5),D1…setprioritysameastask&‰LSR‡#8,D0positiondebouncetimedata-‰MULU†#4,D0multiplybydebouncedelayfactor ‰MOVE.L„#0,A1*‰MOVE.W„D0,A1stagetimeforperiodicact..‰LINK†A6,#-(ALLREGS+4)…addsomeextraroom(4)*I* NOTE: LINK has reserved space on the stack for all registers + 4 words.A*‡NowIcandoMOVEM.Ltothestackwithoutautoincorautodec.B*‡andaslongasIgetbackA6unchanged,UNLINKA6willtakecare+*‡ofadjustingthestackpointercorrectly.*.‰MOVEM.LƒA0-A6/D0-D7,(A7)„saveallreg.values ‰TR0$.RQPA*/*‡IFnoerrorreturnedfromper.act.req.THEN*,‰BRA.S…DBACTOKgoodreturnfromper.act.req.+‰BRA.S…DBACTNGbadreturnfromper.act.req.*‡DO*DBACTOK‚EQU‡*‰Debounceact.req.returnok**ŠDisableIRQonthischannel.%*ŽStageargumentsforcalltoDODSABL*0‰MOVEM.Lƒ(A7),A0-A6/D0-D7„recallregistervalues.‰MOVE.L„RIOTADR+4(A6),A4„recallRIOTBLaddress#‰AND‡#$000000FF,D2‡selectchannel#+‰BSR‡DODSABLdisableIRQ.note:ck'9/15/82*DBACTNG„EQU…*‰debounceact.req.returnNG*ˆENDƒdisableIRQ0‰MOVEM.Lƒ(A7),A0-A6/D0-D7„recallregistervalues‰UNLK„A6*…END†debouncesetupsequence†ELSE**…hereifnodebouncerequired*.‰LOAD†D2,CHANUM‹recallchannel#&returncode‰BSR‡NOTIFYUSR†ENDI$IOHIPX„EQU*‡'RIOINT'procedureexit+‰LOAD‚D0,CLAIMCHKŒgetinterruptclaimcheck#‰ADD‡#16,A7Žreleaselocalvariables0‰MOVEM.Lƒ(A7)+,A0-A6/D1-D7ƒrestoreallexceptD0+‰TST.L…D0’doesRIODRVclaimthisinterrupt?‰IF.L‚THEN(‰ORˆ#1,SRsignalCMR'interrupthandled'‰ELSE2‰AND‡#$FFFE,SR‹signalCMR'interruptnotfromRIO'‰ENDI‹RTS…PAGE NOTIFYUSR:*A*ˆnotifyuserbymeansofqueeventorwakeupasspecifiedinthe*ˆchannelconfigurationword.**„INPUTPARAMETERS:'*’A2:AddressofchannelnameinRIOTBL;*’D4:Offsetfromchannelnametochanneldatafield(base) *™inRIOTBL.*’A5:AddressofchannelCCB.  'A;!4)L1*’A6:User'sTCBaddress#*’D2:$0C01**@ŠMOVE.WƒRIOCNIF(A2,D4),D0getchannelconfigurationfromchannel *¤configurationtableinRIOTBL.)ŠBTST…#3,D0determine:wake-uporq-event ‰IF…‰THEN**ˆDO*ˆEnqueueevent;datastaging:*$*ƒD2=$0C01 *ƒD3=RIOID*ƒD4=MemmappedI/Oaddress*ƒA6=User'sTCBaddress*8ŒMOVE.LƒCCBCHB(A5),D4…getmem.mappedI/OaddressstagedŒBSRQUEVENTenqueuetheeventŒRTS˜andreturntocaller*‰ELSE*DO%ŒMOVE.LƒA6,A0ŽstageusersTCBaddress#ŒTR0$.WAKEUP,issuewakeuptouser*ENDŒENDIŒRTS™returntocaller‰PAGE=*‚IOHICLRdeterminesiftheinterruptisforthisRIOmodule.E*‚IftheinterruptisnotforthischannelD2contains'8'onreturn.C*‚IftheinterruptisforthisRIOmodule,theinterruptingchannelI*‚numberisreturnedinD2‚TheinterruptinthePIAisclearedherealso.**‚Inputparameters:%*’A5:PointstotheI/Obaseaddress.*‚Outputparameters:(*’D2:Containsinterruptchannelnumber.* IOHICLR EQU *0ŠMOVE.LCCBCHB(A5),A0ˆgetI/ObaseaddresstoA08ŠBTST.Bƒ#0,PIA1ACR(A0)…ischannel#0setforinterrupts?/ŠBEQ.S„IOHIO01Œbranchifnotset-checkchan18ŠBTST.Bƒ#7,PIA1ACR(A0)…setforinterrupt-isthereone?(ŠBNE†IOHI021ŒbranchonIRQfoundonch0$IOHIO01ƒADD#1,D2“bumpchannelcount5ŠBTST.Bƒ#3,PIA1ACR(A0)…ischan.1setforinterrupts?/ŠBEQ.S„IOHIO02Œbranchifnotset-checkchan28ŠBTST.Bƒ#6,PIA1ACR(A0)…setforinterrupt-isthereone?*ŠBNE.SIOHI021branchonIRQfoundonch1$IOHIO02ƒADD#1,D2“bumpchannelcount4ŠBTST.B‚#0,PIA1BCR(A0)†ischan2setforinterrupts?*ŠBEQ.SƒIOHIO03branchifno-checkchan38ŠBTST.Bƒ#7,PIA1BCR(A0)…setforinterrupt-isthereone?*ŠBNE.S„IOHI022ŒbranchonIRQfoundonch2$IOHIO03ƒADD‚#1,D2’bumpchannelcount4ŠBTST.B‚#3,PIA1BCR(A0)†ischan3setforinterrupts?*ŠBEQ.SƒIOHIO04branchifno-checkchan48ŠBTST.B‚#6,PIA1BCR(A0)†setforinterrupt-isthereone?*ŠBNE.S‚IOHI022ŽbranchonIRQfoundonch3&IOHIO04ƒADD#1,D2“bumpchannelcounter4ŠBTST.Bƒ#0,PIA2ACR(A0)…ischan4setforinterrupts?*ŠBEQ.S„IOHIO05Œbranchifno-checkchan58ŠBTST.Bƒ#7,PIA2ACR(A0)…setforinterrupt-isthereone?*ŠBNE.SIOHI023branchonIRQfoundonch4&IOHIO05ƒADD#1,D2“bumpchannelcounter4ŠBTST.B‚#3,PIA2ACR(A0)†ischan5setforinterrupts?-ŠBEQ.SƒIOHIO06branchifno-gocheckchan68ŠBTST.B‚#6,PIA2ACR(A0)†setforinterrupt-isthereone?*ŠBNE.SIOHI023branchonIRQfound‚onch5&IOHIO06ƒADD#1,D2“bumpchannelcounter4ŠBTST.B‚#0,PIA2BCR(A0)†ischan6setforinterrupts?-ŠBEQ.S„IOHIO07Œbranchifno-gocheckchan78ŠBTST.B‚#7,PIA2BCR(A0)†setforinterrupt-isthereone?*ŠBNE.SIOHI024branchonIRQfound‚onch6&IOHIO07ƒADD#1,D2“bumpchannelcounter4ŠBTST.B‚#3,PIA2BCR(A0)†ischan7setforinterrupts?2ŠBEQ.SƒIOHIONObranchifno-thisinternotforme8ŠBTST.B‚#6,PIA2BCR(A0)†setforinterrupt-isthereone?*ŠBNE.SIOHI024branchonIRQfound‚onch77IOHIONOƒADD#1,D2“setchan#=8=interruptnotforme ŠRTS™returntointerrupthandler5IOHI021ƒTST.B„PIA1ADR(A0)ˆreadingdataregclearsIRQŠRTS™andreturn-IOHI022ƒTST.BƒPIA1BDR(A0)‰cleartheinterruptŠRTS™andreturn(IOHI023ƒTST.BƒPIA2ADR(A0)‰clearIRQflagŠRTS™andreturn(IOHI024ƒTST.BƒPIA2BDR(A0)‰clearIRQflag‰RTSšandreturn‹PAGE'*‹DEBOUNCE-interruptdebounceroutine3*‹Controlreturnsherewhentheperiodicactivation*‹requesttimeexpires.*ƒInputparameters:**’D1:CCBaddress+channel#(inlsbyte)* DEBOUNCE:‰PUSHALLsaveallregisters*F*‚IF(((channelconfig=risingedgeIRQ)AND(channelstate=up))ORH*†((channelconfig=fallingedgeIRQ)AND(channelstate=down)))THEN*0*…Computeoffsetfort  hischannelintheRIOTBL:*5‰MOVE.L„#$0C010000,D2‡setupdatafiledsforNOTIFYUSR!‰CLR.L…D3’clearworkingregisters ‰CLR.L…D4’. ‰CLR.L…D6’.%‰MOVE.B„D1,D4extractchannel#toD46‰MOVE.B„D4,D2completestageofchandatatoNOTIFYUSR*‰MOVE.B„D4,D3savecopyofchannel#inD35‰MULU†#6,D4pointtodatafieldforchannelinRIOTBL7‰ADD‡#RIONTRY+RIOCNIF,D4addoffsetto1stchanneldata*'*ˆGetchannelI/OaddressbasefromCCB*'‰AND‡#$FFFFFF00,D1‡clearlsbyteinCCB#‰MOVE.L„D1,A5putCCBaddressonA5*‰MOVE.L„CCBCHB(A5),A1‡getI/Obaseaddress*+*ˆFindRIOTBLdatasectionforthischannel*+‰MOVE.L„RIOTBL,A2‹getaddressoftheRIOTBL ‰CLR.L…D70‰MOVE.L„CCBMNEM(A5),D0†getchannelnamefromCCB1‰MOVE.B„RIONMAX(A2),D6†getmaxnumberofRIOTBL's LOOP…SET‡*.‰MOVE.L„RIOID(A2),D5ˆgetchannelnamefromCCB%‰CMP.L…D5,D0channelname=CCBname? ‰BEQ.S…FOUND13‰ADD.W…RIOOFST,A2ŠbumptonextRIOID(channelname)!‰SUB‡#1,D6decrementloopcounter*‰BEQ.S…DBERRerrifchannelnamenotfound ‰BRALOOPFOUND1:/‰MOVE.L„RIOTCB(A2,D4),A6†getuser'sTCBaddress3‰BTST†#2,RIOCNIF+1(A2,D4)ƒconfig=risingedgeIRQ? ‰IF…‡THEN*%* DO if set for rising edge interrupt*-‰BTST†D3,PIA1ADR(A1)†channelstatus=hinow? IF‚ƒTHEN*9*‰DO‚notifyuserifstillonrisingedge-goodinterrupt*ŒPUSHALL”saveallregsŒBSR„NOTIFYUSRŒPOPALL•restorallregs**‰END„ofinterruptonrisingedgesequenceˆENDIˆELSE*?*„Elsethechannelconfigurationisforfallingedgeinterrupt.!*†DO‚seeifstillonfallingedge*-‰BTST†D3,PIA1ADR(A1)†channelstatus=lonow? †IF‚ƒTHEN*5*†Channelstatus=lo‚-notifyuserofgoodinterrupt*†DO‰PUSHALL‰BSRNOTIFYUSR‰POPALL"*†END‚offallingedgeIRQsequence‡ENDI**‚ENDƒofdebouncesequence*ƒENDI*"*ˆEnableIRQondebouncedchannel:***BEGINstageparametersforcalltoDOENBL*%‰AND.L…#$000000FF,D2‡selectchannel#&‰MOVE.L„A2,A4getRIOTBLaddresstoA4)‰CLR.L…D1’setdebouncedatafieldtonull.‰BSRDOENBL”invokeroutinetoenableinterrupt*END*/DBERREQU*‚debounceerr;riotblnamenotfound+‰POPALLŽrestoreallregistersbeforereturn‰RTE›returntoO.S.‰PAGE*H*‚QUEVENT‚enqueue'seventtodrivingtaskusingdatastagedinregisters *‹asfollows:**‹A6=user'sTCBaddress&*‹D2=$0C01*‹D3=RIOID‚(modulename)*‹D4=memmappedI/Oaddress** QUEVENT EQU *‹PUSHALL”pushallregs"‹MOVE.L…A6,A0Žstageuser'saddress ‹TR0$.QEVNTI)‹BRA.SƒQUEVNTOKŒgoodreturnforqueevent'‹BRA.SƒQUEVNTERŒbadreturnfromqueventQUEVNTOK EQU *‹POPALL•restoreallregs‹RTS QUEVNTER:(‹BRAQUEVNTOKputabreakherefordebug*‰ENDNNNN  NFTRIO…IDNTƒ1,0RIOsubroutines**‰FORTRANcallablesubroutines*‰forRIOdrivercalls*$*‰CALLRIOCMD(rio_id,param_blk_addr)*‰whereRIOCMDmaybe:*)*‰CALLRIOPEN(rio_id,param_blk_addr)…open**‰CALLRIOCLS(rio_id,param_blk_addr)…close3*‰CALLRIOOUT(rio_id,param_blk_addr)…outputlatched/*‰CALLRIOOFF(rio_id,param_blk_addr)…outputoff+*‰CALLRIOSTA(rio_id,param_blk_addr)…status6*‰CALLRIOENB(rio_id,param_blk_addr)„enableinterrupts7*‰CALLRIODSB(rio_id,param_blk_addr)„disableinterrupts2*‰CALLRIOPLS(rio_id,param_blk_addr)„outputpulsed*,*‰Allargumentsforthecallsareidentical.7*‰Thecontentsoftheparam_blkforeachcallisunique*‰tothecall.*6*‰Allthecommandsubroutinescallacommonsubroutine3*‰RIOSETtobuildtheinitiateI/Oparameterblock.**‰STACKFORALLCALLS:*7*‰deepeststack:(stackaddressstaysatRIOSETreturn)0*˜commandcodeƒ2bytes(initiateI/Oparam.blk) *˜n/aŒ2bytes*˜rio_id‰4bytes *˜n/aŒ4bytes *˜n/aŒ4bytes *˜n/aŒ4bytes,*˜commandaddrƒ4bytes(riocommandaddress)**˜commandlng„2bytes(riocommandlength)-*˜RIOSETreturn‚4bytesdeepeststackaddress *˜A34bytes *˜A24bytes *˜A14bytes *˜D04bytes*‰entrystack:ƒreturn‰4bytes*˜^param_blk_adr4bytes*˜^rio-idˆ4bytes* ŠSECTION9!ŠXDEFƒRIOPEN,RIOCLS,RIOOUT,RIOOFF!ŠXDEFƒRIOSTA,RIOENB,RIODSB,RIOPLS*$*‰CALLRIOPEN(rio_id,param_blk_addr)*‰openandconfigurechannels*1RIOPEN„MOVEM.LD0/A1-A3,-(A7)„savesomeregisters3ŠBSR„RIOSETset-uptheinitiateI/Oparameterblock)ŠMOVE.L#1,(A2)ŒsettheopencommandcodeRIOPN00ƒCLR.L‚D0‘clearforuse'ŠMOVE.W4(A2),D0‹getnumberofchannelsŠASL.L‚#2,D0Žmultiplyby4.RIOPN05ƒADD.L‚#6,D0Žaddinthe6byteoverhead-RIOPN10ƒMOVE.WD0,(A1)Œsetthecommandlength-ŠMOVE.LA3,A0ŽTRAP#1parameterblockaddress#ŠMOVE.L#60,D0CMRdirectivenumberŠTRAPƒ#1‘callRMS68K'ŠMOVE.WD0,(A2)Œsetthereturnedstatus)ŠMOVEM.L(A7)+,D0/A1-A3„restoreregisters!ŠMOVE.L(A7)+,A0‹putreturninA09AB8J ŠLEA„8(A7),A7‹cleanupthestackŠJMP„(A0)returntouser*$*‰CALLRIOCLS(rio_id,param_blk_addr)"*‰closeallchannelsforthisuser*1RIOCLS„MOVEM.LD0/A1-A3,-(A7)„savesomeregisters5ŠBSR.S‚RIOSETset-uptheinitiateI/Oparameterblock*ŠMOVE.L#2,(A2)Œsettheclosecommandcode&ŠMOVE.W#4,D0ŽRIOclosecommandlengthŠBRA„RIOPN10ŒgodotheCMRcall*$*‰CALLRIOOUT(rio_id,param_blk_addr)'*‰activateoutputonrequestedchannels*1RIOOUT„MOVEM.LD0/A1-A3,-(A7)„savesomeregisters5ŠBSR.S‚RIOSETset-uptheinitiateI/Oparameterblock+ŠMOVE.L#3,(A2)Œsettheoutputcommandcode*RIOUT10ƒMOVE.Wƒ#6,D0ŒsetupcommandlengthŠBRA„RIOPN10ŒgodotheCMRcall*$*‰CALLRIOOFF(rio_id,param_blk_addr))*‰deactivateoutputonspecifiedchannels*1RIOOFF„MOVEM.LD0/A1-A3,-(A7)„savesomeregisters5ŠBSR.S‚RIOSETset-uptheinitiateI/Oparameterblock/ŠMOVE.L#4,(A2)Œsettheoutputoffcommandcode4ŠBRA„RIOUT10Œgosetcommandlength&dotheCMRcall*$*‰CALLRIOSTA(rio_id,param_blk_addr))*‰readinputstatusonspecifiedchannels*1RIOSTA„MOVEM.LD0/A1-A3,-(A7)„savesomeregisters5ŠBSR.S‚RIOSETset-uptheinitiateI/Oparameterblock+ŠMOVE.L#5,(A2)Œsetthestatuscommandcode4ŠBRA„RIOUT10Œgosetcommandlength&dotheCMRcall*$*‰CALLRIOENB(rio_id,param_blk_addr).*‰enableinterrptsonspecifiedinputchannels*1RIOENB„MOVEM.LD0/A1-A3,-(A7)„savesomeregisters5ŠBSR.S‚RIOSETset-uptheinitiateI/Oparameterblock+ŠMOVE.L#6,(A2)Œsettheenablecommandcode  4ŠBRA„RIOUT10Œgosetcommandlength&dotheCMRcall*$*‰CALLRIODSB(rio_id,param_blk_addr)0*‰disableinterruptsonspecifiedinputchannels*1RIODSB„MOVEM.LD0/A1-A3,-(A7)„savesomeregisters5ŠBSR.S‚RIOSETset-uptheinitiateI/Oparameterblock,ŠMOVE.L#7,(A2)Œsetthedisablecommandcode4ŠBRA„RIOUT10Œgosetcommandlength&dotheCMRcall*$*‰CALLRIOPLS(rio_id,param_blk_addr)>*‰activateoutputforx#ofmillisecondsonspecifiedchannels*1RIOPLS„MOVEM.LD0/A1-A3,-(A7)„savesomeregisters5ŠBSR.S‚RIOSETset-uptheinitiateI/Oparameterblock2ŠMOVE.L#8,(A2)ŒsetthepulsedoutputcommandcodeŠCLR.L‚D0‘clearforuse,ŠMOVE.W4(A2),D0‹getspecified#ofchannelsŠASL.L‚#2,D0Žmultiplyby6ŠADD.W‚4(A2),D04ŠBRA„RIOPN05Œgosetcommandlength&dotheCMRcallŠPAGE*4*‰RIOSETsetuptheCMRinitiateI/Oparameterblock,*‰returns:ƒA1=addressforRIOcommandlength(*”A2=RIOcommandparameterblockaddress)*”A3=initiateI/Oparameterblockaddress*(RIOSET„CLR.W‚-2(A7)clearcommandlength-ŠLEA„-2(A7),A1Šsaveaddressofcommandlength$ŠMOVE.L24(A7),A0Šgetparam_blk_addr%ŠMOVE.LA0,-6(A7)Šsaveparam_blk_addr,ŠMOVE.LA0,A2Žsaveparam_blk_addrforreturnŠCLR.L‚-10(A7)ŒnotusedŠCLR.L‚-14(A7)ŒnotusedŠCLR.L‚-18(A7)ŒnotusedŠMOVE.L28(A7),A0Šget^rio_idŠMOVE.L(A0),-22(A7)‡getrio_idŠCLR.W‚-24(A7)Œnotused0ŠMOVE.W#$0700,-26(A7)…initiateI/Ocommandcode4ŠLEA„-26(A7),A3‰initiateI/OparameterblockaddressŠRTS—returntocallerŠENDNNN'M600DRV TEST600 AF^^  TEST600 LFgg  TEST600 LOh  TEST600 SA||J‚  =/*=/*†M600DRV.TEST600.AF=/*,=/*†TEST600testprogramassemblychainfile=/*-=/*†Defaultargument01isM600DRV.TEST600.LS=/*=/IFC \1ƒ=ARGM600DRV.TEST600.LS=/ENDIF=/*4=ASM M600DRV.TEST600.SA,M600DRV.TEST600.RO,\1;RZ=100=/*{ Included files are:=/*ƒ--none--=/*}=/*=END  NNNNNNV=/*=/*†M600DRV.TEST600.LF=/*G=/*†ThischainfilewillgeneratetheTEST600testprogramloadmodule.=/*5=/*†Thecommandlinewillacceptargumentsasfollows=/*7=/*‹Argument01ˆ\1=Outputfilelinklistingordevice=/*D=/*†Thefollowingshowsthelinkchainsequence.‚InthisexampletheF=/*†printerwaschosenasArgument1,however,theusercouldifheso2=/*†desiredhaverequestedanoutputlistingfile.=/*!=/*=CHAINM600DRV.TEST600.LF#PR=/*-=/*†Defaultargument01isM600DRV.TEST600.LL=/*=/IFC \1ƒ=ARGM600DRV.TEST600.LL=/ENDIF=/*"=LINK ,M600DRV.TEST600.LO,\1;HAMIXSEG SEG0:0,1,8,14 $000000ATTRIBUTES D PINPUT M600DRV.TEST600.ROLIB 0.&.UTILIB.ROEND=/*=ENDNNNNN_  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*‚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.+*£AnemptycharacterstringfieldpassedtotB}:…J>•IA¥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‹Thisisthestorageareafortheinput*£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_DADC.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„PROGSTRTNNNNN'M605DRV TEST605 AFÑÑ  TEST605 LFÚÚ  TEST605 LOÛ‰  TEST605 SAmmWû   =/*=/*†M605DRV.TEST605.AF=/*,=/*†TEST605testprogramassemblychainfile=/*-=/*†Defaultargument01isM605DRV.TEST605.LS=/*=/IFC \1ƒ=ARGM605DRV.TEST605.LS=/ENDIF=/*4=ASM M605DRV.TEST605.SA,M605DRV.TEST605.RO,\1;RZ=100=/*{ Included files are:=/*ƒ--none--=/*}=/*=ENDNNNNNNÉ=/*=/*†M605DRV.TEST605.LF=/*G=/*†ThischainfilewillgeneratetheTEST605testprogramloadmodule.=/*5=/*†Thecommandlinewillacceptargumentsasfollows=/*7=/*‹Argument01ˆ\1=Outputfilelinklistingordevice=/*D=/*†Thefollowingshowsthelinkchainsequence.‚InthisexampletheF=/*†printerwaschosenasArgument1,however,theusercouldifheso2=/*†desiredhaverequestedanoutputlistingfile.=/*!=/*=CHAINM605DRV.TEST605.LF#PR=/*-=/*†Defaultargument01isM605DRV.TEST605.LL=/*=/IFC \1ƒ=ARGM605DRV.TEST605.LL=/ENDIF=/*"=LINK ,M605DRV.TEST605.LO,\1;HAMIXSEG SEG0:0,1,8,14 $000000ATTRIBUTES D PINPUT M605DRV.TEST605.ROLIB 0.&.UTILIB.ROEND=/*=ENDNNN NNÒTESTƒˆÿÿÿÿÿ€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;*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)‚>e6nAv:~;†LŽC–TžF¦D®E¶^=*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.**‰MVME605DriverTestProgram**&*Œ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,*£thisfunctioninA0produces azerobinary'*£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.‚Section1isarelatively*£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**£thatwillbeusedtofigurethesawtooth *£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)+‰Storethedelay inthetable/Ž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.‚ThevalueinD0tellsthe)*£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(A 0)Š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„PROGSTRT'M610DRV INTSTASMAFÊÊ  TEST610 AFÓÓ  INPTST LFÜÜ  TEST610 LFåå  INPTST LOæ6  TEST610 LO  INPTST PF//  INPTST SA88Ò  INTSTASMSAII'M  TEST610 SArrF[  =/*=/*†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=/*}=/*=ENDNNNN NNÂ=/*=/*†M610DRV.TEST610.AF=/*,=/*†TEST610testprogramassemblychainfile=/*-=/*†Defaultargument01isM610DRV.TEST610.LS=/*=/IFC \1ƒ=ARGM610DRV.TEST610.LS=/ENDIF=/*4=ASM M610DRV.TEST610.SA,M610DRV.TEST610.RO,\1;RZ=100=/*{ Included files are:=/*ƒ--none--=/*}=/*=ENDNNNNNNË=/*=/*†M610DRV.INPTST.LF=/*/=/* Link chain file to create M610DRV.INPTST.LO=/*:=/* If no output argument is specified for the listing the0=/* chain file will default to M610DRV.INPTST.LL=/*=/IFC \1ƒ=ARGM610DRV.INPTST.LL=/ENDIF=/* =LINK ,M610DRV.INPTST.LO,\1;HIMXSEG CODE(RL):0-9SEG SEG2(L):15INPUT M610DRV.INPTST.ROINPUT M610DRV.INTSTASM.ROLIBƒ0.&.PASVMDOS.ROLIBƒ0.&.PDOLRLIB.ROLIBƒ0.&.PASCALIB.RO TASK‚INP0ATTR‚P PRIO‚$7F,$7FEND=/*=ENDNN NNNNÔ=/*=/*†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=/*=ENDNNNNNÝ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 4gˆ`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*Nu HçùÀ./ 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(NNNupþ`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='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’elsenum:=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>=10 0k9h,Œ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. *‰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=phy sicaladdressoptionŠ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„2AHJIR9ZBbB=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†DefaulttointerruptASRŠ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ƒ$100SegmentlengthŠ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„28 INT020„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ŠENDN*******************************************************************************Ì**Ì*#*—MVME610orMVME620‚TestProgram•**Ì**Ì*N********************************************************************************6* This program was written 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-StartingaddressofASCIIj>s:{DƒB‹G“F›F£S«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ŠN EXTWBMESS6…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.LGETCHANGostart over. Š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„PROGSTRTN'M615DRV TEST615 AF¿¿  TESTAC AFÈÈ  TEST615 LFÑÑ  TESTAC LFÚÚ  TEST615 LOÛ  TESTAC LOç  TEST615 SAP¿  TESTAC SAaa‰¨  =/*=/*†M615DRV.TEST615.AF=/*,=/*†TEST615testprogramassemblychainfile=/*-=/*†Defaultargument01isM615DRV.TEST615.LS=/*=/IFC \1ƒ=ARGM615DRV.TEST615.LS=/ENDIF=/*4=ASM M615DRV.TEST615.SA,M615DRV.TEST615.RO,\1;RZ=100=/*{ I ncluded files are:=/*ƒ--none--=/*}=/*=ENDNNNNNN·=/*=/*†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--=/*}=/*=ENDNNNNNN À=/*=/*†M615DRV.TEST615.LF=/*G=/*†ThischainfilewillgeneratetheTEST615testprogramloadmodule.=/*5=/*†Thecommandlinewillacceptargumentsasfollows=/*7=/*‹Argument01ˆ\1=Outputfilelinklistingordevice=/*D=/*†Thefollowingshowsthelinkchainsequence.‚InthisexampletheF=/*†printerwaschosenasArgument1,however,theusercouldifheso2=/*†desiredhaverequestedanoutputlistingfile.=/*!=/*=CHAINM615DRV.TEST615.LF#PR=/*-=/*†Defaultargument01isM615DRV.TEST615.LL=/*=/IFC \1ƒ=ARGM615DRV.TEST615.LL=/ENDIF=/*=/*"=LINK ,M615DRV.TEST615.LO,\1;HAMIXSEG SEG0:0,1,8,14 $000000ATTRIBUTES D PINPUT M615DRV.TEST615.ROLIB 0.&.UTILIB.ROEND=/*=ENDNNNNNÉ=/*=/*†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=/*=ENDNNNN NNÒTEST8ÿÿÿÿÿ€SEG0 ÿÿÿÿ ÿÿÿÿÿACO1€ MVME615 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| 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‹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’Bitmask! forchannelstoturnon(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Š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_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)ŠM" OVE.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„PROGSTRTNNNNNN# NB*„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. Y/bPjPrPzV‚\Š\’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‰MOV# E.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‡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‰T$ RAP†#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‡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‡FAU% LT6‰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,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‰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„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* STATCMD‚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†'**********ACOUTPUTTESTPROGRA' M******'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&OCë¶üDüCüOü1Bk07|2'|º~`(+ºØ„BsH.R«ºS‡lÿîBkV7|XBkZ7|\Bk^Bk`7|bBkdBkf7|hBkjBkl7|n'|º~`(+ºØ„BsHjR«ºS‡lÿî7|¦7|¨7|ª7|¬7|®7|?°7|²7|ÿ´7|’7|”7|–7|˜7|š7| œ7|@ž7|€ 7|ÿ¢7|€¤CèdpNB™QÈÿü1|ÊCúô!IˆPèÒzN¬ CèdpNB™QÈÿü1|ÊCúÐ!IˆPèÒzN¬ CèdpNB™QÈÿü1|ÊCú*!Iˆ/ Hk¶Hx/<PèÒzN¬ Þü *_`8&, ***** DC OUTPUT MODULE TEST PROGRAM ****** CèdpNB™QÈÿü1|ÊCú8!IˆPèÒzN¬ CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `& HçœYOHk¶?|HkVp"<‡³N¬Þü Lß90+VHÀk gf`CèdpNB™QÈÿü1|ÊCú*!Iˆ/ Hk¶Hx/<PèÒzN¬ Þü *_` & NON-EXISTANT TASK - ` ÒCèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `2&+ OPEN & OUTPUT TO EACH CHANNEL INDIVIDUALLY'|º~` 7|4 +ºS€7@60+¤HÀ7@8HçœYOHk¶?|Hk0p"<‡dÖN¬Þü Lß9€0+0HÀk gD`CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `& CALL OPEN - ERROR(+ºØ„„03HHÀ7@^HçœYOHk¶?|HkZp"<‡aN¬Þü Lß9€0+ZHÀk gD`CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `& CALL OUT - ERRORHç˜p"<Ô (N¬L߀(+ºØ„„03HHÀ7@jHçœYOHk¶?|Hkfp"<‡yáN¬Þü Lß9€0+jHÀ(+ºØ„„23HHÁk g"`HçœUOHkºp"<""fïN¬\OLß9€(+ºØ„„03HHÀ7@dHçœYOHk¶?|Hk`p"<‡^¶N¬Þü Lß9€HçœYOHk¶?|HkVp"<‡³N¬Þü Lß9€R«ºS‡lýÞCèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `6&/ OPEN & OUTPUT TO EACH CHANNEL UNTIL ALL ARE ON'|º~` 7|4 +ºS€7@60+¤HÀ7@8HçœYOHk¶?|Hk0p"<‡dÖN¬Þü Lß9€(+ºØ„„03HHÀ7@^HçœYOHk¶?|HkZp"<‡aN¬Þü Lß9€Hç˜p"<Ô (N¬L߀(+ºØ„„¤03HHÀ7@jHçœYOHk¶?|Hkfp"<‡yáN¬Þü Lß9€0+jHÀ(+ºØ„„¤23HHÁk g(`HçœUO +ºS€+/ p"<""fïN¬\OLß9€R«ºS‡lþÞCèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `.&( CLOSE CHANNELS, OUTPUTS SHOULD TURN OFFHç˜p"<Ô (N¬LßHçœYOHk¶?|HkVp"<‡³N¬Þü Lß9Hç˜p"<Ô (N¬LßCèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `*&# TURN ON ALL OUTPUTS, THEN TURN OFF7|4B«¾'|º~`0(+ºØ„ +¾7€H. +ºR€(Ø„HsH.0+¤HÀ"_2€R«¾T«ºS‡lÿÎHçœYOHk¶?|Hk0p"<‡dÖN¬Þü Lß90+¢HÀ7@^HçœYOHk¶?|HkZp"<‡aN¬Þü Lß9Hç˜p"<Ô (N¬Lß0+¢HÀ7@dHçœYOHk¶?|Hk`p"<‡^¶N¬Þü Lß9HçœYOHk¶?|HkVp"<‡³N¬Þü Lß9CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ ` & PULSE EACH OUTPUT IN TURN'|º~`²7|4 +ºS€7@60+¤HÀ7@8HçœYOHk¶?|Hk0p"<‡dÖN¬Þü Lß9€7|p +ºS€7@rBkt7|ôvHçœYOHk¶?|Hklp"<‡eóN¬Þü Lß9€Hç˜p"<Ô (N¬L߀Hç˜p"<Ô (N¬L߀R«ºS‡lÿLHçœYOHk¶?|HkVp"<‡³N¬Þü Lß9CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `(&" TRY COMMANDS WITH CHANNELS CLOSEDHçœYOHk¶?|HkVp"<‡³N¬Þü Lß90+VHÀk^g`VCèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `*&# CALL CLOSE AND CHANNELS CLOSED--OK`BCèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `& CALL CLOSE - ERROR7|^HçœYOHk¶?|HkZp"<‡aN¬Þü Lß90+ZHÀk gZ`CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `*&# CALL OUT AND CHANNELS CLOSED--OK`@CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `& CALL OUT - ERROR7|dHçœYOHk¶?|Hk`p"<‡^¶N¬Þü Lß90+`HÀk gZ`CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `*&# CALL OFF AND CHANNELS CLOSED--OK`@CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `& CALL OFF - ERROR7|jHçœYOHk¶?|+ Hkfp"<‡yáN¬Þü Lß90+fHÀk gZ`CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `*&# CALL STATUS AND CHANNELS CLOSED-OK`BCèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `& CALL STATUS - ERROR7|p7|rBkt7| vHçœYOHk¶?|Hklp"<‡eóN¬Þü Lß90+lHÀk gZ`CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `*&# CALL PULSE AND CHANNELS CLOSED--OK`BCèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `& CALL PULSE - ERROR7|47|60+¤HÀ7@8HçœYOHk¶?|Hk0p"<‡dÖN¬Þü Lß9CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `(&! TRY CALL OPEN AND ALREADY OPENED7|47|60+¤HÀ7@8HçœYOHk¶?|Hk0p"<‡dÖN¬Þü Lß90+0HÀk gZ`CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `*&# CALL OPEN AND CHANNELS ARE OPEN-OK`@CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `& CALL OPEN - ERRORCèdpNB™QÈÿü1|ÊCúò!IˆPèÒzN¬ CèdpNB™QÈÿü1|ÊCú!IˆPèÒzN¬ `*&#********* TEST COMPLETED **********CèdpNB™QÈÿü1|ÊCúñ !IˆPèÒzN¬ rzCë¶N¬aDCO2"_rN¬N¬XWÀH€HÀfCë¶üDüCüOü2`ïRNìNì"<hCûþNVCèdpNB™QÈÿü1|ÊCú,!Iˆ/ "nHQHx/<PèÒzN¬ Þü *_`& STATUS ERROR-BIT N^Nu"<BCûþNVÿè&O'|~d`"'|,<^`R«S†lÿøR«S‡lÿÜN^NuHç€pa‚$¼B€0*å€\€2€ KpŠ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(Dynamic)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.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_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‚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Œ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„PROGSTRTB*„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-‚trysopeninginvalidchannelnumbersandverifies3*’errors.(ZEROchannels,morethaneightchannels,"*’channel#9,sametwochannels).:*ˆTEST11-‚openschannelandtrysinvalidcommands(0,6,*’7,>8)andverifieserrors..  °/¹PÁPÉPÑVÙ\á\éUñWùPY ZYR!R)W1b9=*ˆ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‡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ŽDELAYS/ OOPERATORCANSEECHANNEL‰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‡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’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,D0Ž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‡continueonfor0 ward‰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„0 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 ‰B1 SR.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‡251 0ms‰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†'‚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„CHANNEL2 S„-‚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)†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('TRYCOMMANDSWITHCHANNELSCLOSED')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,OF3 F)†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†ENDNNNNC:C ********************************************************C†SUBROUTINEDELAY C–DELAYAPPROXIMATELYONESECOND†DO30J=1,100†DO20K=1,350 20„CONTINUE 30„CONTINUE†RETURN†ENDNNNNN3 NNb C:C ********************************************************C†SUBROUTINEERRPR1(I)†WRITE(6,10)I#10„FORMAT('STATUSERROR-BIT',I1)†RETURN†ENDNNNNNNNk'RIODRV TESTE AF€€  TESTRIO AF‰‰  TESTE LF’’   TESTRIO LF››  TESTE LOœ  TESTRIO LO¥  TESTE SAºº  TESTRIO SAÛÛW  4 =/*=/*†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--=/*}=/*=ENDNNNNNNx=/*=/*†RIODRV.TESTRIO.AF=/*,=/*†TESTRIOtestprogramassemblychainfile=/*,=/*†Defaultargument01isRIODRV.TESTRIO.LS=/*=/IFC \1ƒ=ARGRIODRV.TESTRIO.LS=/ENDIF=/*2=ASM RIODRV.TESTRIO.SA,RIODRV.TESTRIO.RO,\1;RZ=100=/*{ Included files are:=/*ƒ--none--=/*}=/*=ENDNNNNN4 N=/*=/*†RIODRV.TESTE.LF=/*=/*=/IFC \1ƒ=ARGRIODRV.TESTE.LL=/ENDIF=/*=LINK ,RIODRV.TESTE.LO,\1;MIXHS SEG SEG0:0 $0INPUT RIODRV.TESTE.ROEND=/*=ENDNNNNNNNŠ=/*=/*†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=/*=ENDNN5 NNN“TESTÿÿÿÿÿ€SEG0ÿÿÿÿÿÿÿÿÿ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|p= 20 THENŠCMP.L‚#20,EVE6 NTCNT-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²m»WÃTËŠ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#Š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,0CHAN10INPUTOPNLNG„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*‚RIOparameterbl6 ockforENABLEINTERRUPTSonchannel1* 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.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 ŠENDTESTNNNNNNNN*******************************************************************************Ì**Ì**™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'*£UTILIB7 .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ÓBÜ;ä?ìGôIü7O CWX$B"*«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. 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ŠD8 C.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_RIO‚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ƒEQ8 U„*-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…ChannelnumbertoconvertŠ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)Sto9 rethetime 'Œ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***Œ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*-------------------------------------------------------------------9 ----------**‚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„PROGSTRTä' ACIADRV AF88  DISKLIB AFAA  æDRVLIB AFJJ$  EPCIDRV AFSS  IPCDRV AF\\  M300DRV AFee  M319DRV AFnn  M320DRV AFww  æM331DRV AF€€  M360DRV AF‰‰  M420DRV AF’’  M435DRV AF››  MFPDRV AF¤¤  MPCCDRV AF­­  MPSCDRV AF¶¶  MPSCSPR AF¿¿  MPSCSUP AFÈÈ  P050DRV AFÑÑ  P117DRV AFÚÚ  PIADRV AFãã  =/*=/*†ACIADRV.AF=/*-=/* Chain file to assemble ACIA serial driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to ACIADRV.LS=/*=/IFC \1ƒ=ARGACIADRV.LS=/ENDIF=/*$=ASM ACIADRV.SA,ACIADRV.RO,\1;RZ=150=/*{ Included files are:=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.BAB.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.TERMINAL.EQ=/*ƒ9995.&.TERMCCB.EQ=/*}=/*=ENDNNNNN: 0=/*=/*†DISKLIB.AF=/*,=/* Chain file to assemble library for disks=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to DISKLIB.LS=/*=/IFC \1ƒ=ARGDISKLIB.LS=/ENDIF=/*$=ASM DISKLIB.SA,DISKLIB.RO,\1;RZ=150=/*{ Included files are:=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.DISK.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.DISKCCB.EQ=/*ƒ9995.&.DISKMEM.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*}=/*=ENDNNNNN9=/* =/*†DRVLIB.AF=/*<=/* Chain file to assemble DRVLIB.*.SA, driver library files=/*:=/* If no output argument is specified for the listing the(=/* chain file will default to DRVLIB.LS=/*=/IFC \1ƒ=ARGDRVLIB.LS=/ENDIF=/*.=ASM DRVLIB.LOGPHY.SA,DRVLIB.LOGPHY.RO,\1;Z=75=/*{ Included files are:=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.STR.EQ=/*}=/*=/*/=ASM DRVLIB.QEVENT.SA,DRVLIB.QEVENT.RO,\1;GZ=75=/*{ Included files are:=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.UTILITY.MC=/*}=/*=/*1=ASM DRVLIB.SETTIME.SA,DRVLIB.SETTIME.RO,\1;GZ=75=/*{ Included files are:=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.CCB.EQ=/*}=/*=ENDNNN: NNB%=/*=/*†EPCIDRV.AF=/**=/* Chain file to assemble SIG 2661 driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to EPCIDRV.LS=/*=/IFC \1ƒ=ARGEPCIDRV.LS=/ENDIF=/*$=ASM EPCIDRV.SA,EPCIDRV.RO,\1;RZ=150=/*{ Included files are:=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.BAB.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.&.SIG2661.EQ=/*ƒ9995.&.TERMINAL.EQ=/*ƒ9995.&.TERMCCB.EQ=/*}=/*=ENDNNNNNK=/* =/*†IPCDRV.AF=/*)=/* Chain file to assemble the IPC driver=/*:=/* If no output argument is specified for the listing the(=/* chain file will default to IPCDRV.LS=/*=/IFC \1ƒ=ARGIPCDRV.LS=/ENDIF=/*"=ASM IPCDRV.SA,IPCDRV.RO,\1;RZ=160=/*{ Included files are:=/*ƒ9995.&.TRACE.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.&.DUALPORT.MC=/*ƒ9995.&.UTILITY.MC=/*}=/*=ENDN; NNNNT=/*=/*†M300DRV.AF=/*.=/* Chain file to assemble the IEEE-488 driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to M300DRV.LS=/*=/IFC \1ƒ=ARGM300DRV.LS=/ENDIF=/*&=ASM M300DRV.SA,M300DRV.RO,\1;-WRZ=180=/*{ Included files are:=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.DUALPORT.MC=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.M300DRV.EQ=/*ƒM300TABL.AI=/*ƒM300INIT.AI=/*ƒM300INTR.AI=/*ƒM300CMND.AI=/*}=/*=ENDNNNNN]=/*=/*†M319DRV.AF=/*J=/* Chain file to assemble the MVME319/MVME315 disk/tape controller driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to M319DRV.LS=/*=/IFC \1ƒ=ARGM319DRV.LS=/ENDIF=/*$=ASM M319DRV.SA,M319DRV.RO,\1;RZ=180=/*{ Included files are:=/*ƒ9995.&.DUALPORT.MC=/*ƒ9995.&.TRACE.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.KILL.; MC=/*ƒ9995.&.KILLDRV.EQ=/*}=/*=ENDNNNNNf=/*=/*†M320DRV.AF=/*==/* Chain file to assemble the MVME320 disk controller driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to M320DRV.LS=/*=/IFC \1ƒ=ARGM320DRV.LS=/ENDIF=/*&=ASM M320DRV.SA,M320DRV.RO,\1;-WRZ=186=/*{ Included files are:=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.DUALPORT.MC=/*ƒ9995.&.DISK.EQ=/*ƒ9995.&.DISKCCB.EQ=/*ƒ9995.&.DISKMEM.EQ=/*}=/*=ENDNNNNNo< =/*=/*†M331DRV.AF=/*F=/* Chain file to assemble the MVME331 communication controller driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to M331DRV.LS=/*=/IFC \1ƒ=ARGM331DRV.LS=/ENDIF=/*$=ASM M331DRV.SA,M331DRV.RO,\1;RZ=180=/*{ Included files are:=/*ƒ9995.&.DUALPORT.MC=/*ƒ9995.&.TRACE.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*}=/*=ENDNNNNNx=/*=/*†M360DRV.AF=/*,=/* Chain file to assemble the VME360 DRIVER=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to M360DRV.LS=/*=/IFC \1ƒ=ARGM360DRV.LS=/ENDIF=/*$=ASM M360DRV.SA,M360DRV.RO,\1;RZ=130=/*{ Included files are:=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.DUALPORT.MC=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995..DISK.EQ=/*ƒ9995..DISKCCB.EQ=/*ƒ9995..DISKMEM.EQ=/*}=/*=ENDNNNN< N=/*=/*†M420DRV.AF=/*/=/* Chain file to assemble VME420 (SASI) driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to M420DRV.LS=/*=/IFC \1ƒ=ARGM420DRV.LS=/ENDIF=/*$=ASM M420DRV.SA,M420DRV.RO,\1;RZ=186=/*{ Included files are:=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.DISK.EQ=/*ƒ9995.&.DISKCCB.EQ=/*ƒ9995.&.DISKMEM.EQ=/*}=/*=ENDNNNNNNŠ=/*=/*†M435DRV.AF=/*.=/* Chain file to assemble the MAG tape driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to M435DRV.LS=/*=/IFC \1ƒ=ARGM435DRV.LS=/ENDIF=/*&=ASM M435DRV.SA,M435DRV.RO,\1;-WRZ=150=/*{ Included files are:=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*}=/*=ENDNNN= NNN“=/* =/*†MFPDRV.AF=/*H=/* Chain file to assemble MK68910 serial port driver for local ports on=/* VME120 and VME133 boards.=/*:=/* If no output argument is specified for the listing the(=/* chain file will default to MFPDRV.LS=/*=/IFC \1ƒ=ARGMFPDRV.LS=/ENDIF=/*"=ASM MFPDRV.SA,MFPDRV.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=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.&.TERMINAL.EQ=/*ƒ9995.&.TERMCCB.EQ=/*ƒ9999.MK68901.MK68901.EQ=/*}=/*=ENDNNNNNœ=/*=/*†MPCCDRV.AF=/*G=/* Chain file to assemble R68560 serial port driver for the local port*=/* on the VME050 system controller board.=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to MPCCDRV.LS=/*=/IFC \1ƒ=ARGMPCCDRV.LS=/ENDIF=/*$=ASM MPCCDRV.SA,MPCCDRV.RO,\1;RZ=145=/*{ Included files are:=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.BAB.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.&.TERMINAL.EQ=/*ƒ9995.&.TERMCCB.EQ=/*}=/*=END= NNNNN¥=/*=/*†MPSCDRV.AF=/*6=/* Chain file to assemble NEC 7201 subordinate driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to MPSCDRV.LS=/*=/IFC \1ƒ=ARGMPSCDRV.LS=/ENDIF=/*$=ASM MPSCDRV.SA,MPSCDRV.RO,\1;RZ=150=/*{ Included files are:=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.BAB.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.MVME400.EQ=/*ƒ9995.&.NEC7201.EQ=/*ƒ9995.&.TERMINAL.EQ=/*ƒ9995.&.TERMCCB.EQ=/*}=/*=ENDNNNNN®=/*=/*†MPSCSPR.AF=/*K=/* Chain file to assemble NEC 7201 supervisor driver for the MVME400 board=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to MPSCSPR.LS=/*=/IFC \1ƒ=ARGMPSCSPR.LS=/EN> DIF=/*$=ASM MPSCSPR.SA,MPSCSPR.RO,\1;RZ=106=/*{ Included files are:=/*ƒ9995.&.NEC7201.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*}=/*=ENDNNNNNN·=/*=/*†MPSCSUP.AF=/*B=/* Chain file to assemble NEC 7201 supervisor driver for the VM03=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to MPSCSUP.LS=/*=/IFC \1ƒ=ARGMPSCSUP.LS=/ENDIF=/*$=ASM MPSCSUP.SA,MPSCSUP.RO,\1;RZ=106=/*{ Included files are:=/*ƒ9995.&.NEC7201.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*}=/*=ENDNNNNNN> À=/*=/*†P050DRV.AF=/*?=/* Chain file to assemble printer driver for the MVME050 board=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to P050DRV.LS=/*=/IFC \1ƒ=ARGP050DRV.LS=/ENDIF=/*$=ASM P050DRV.SA,P050DRV.RO,\1;RZ=146=/*{ Included files are:=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.PRNT.EQ=/*ƒ9995.&.PRNTCCB.EQ=/*}=/*=ENDNNNNNÉ=/*=/*†P117DRV.AF=/*C=/* Chain file to assemble the printer driver for the MVME117 board=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to P117DRV.LS=/*=/IFC \1ƒ=ARGP117DRV.LS=/ENDIF=/*$=ASM P117DRV.SA,P117DRV.RO,\1;RZ=146=/*{ Included files are:=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.PRNT.EQ=/*ƒ9995.&.PRNTCCB.EQ=/*}=/*=ENDNNN? NNÒ=/* =/*†PIADRV.AF=/*8=/* Chain file to assemble the printer driver for a PIA.=/*:=/* If no output argument is specified for the listing the(=/* chain file will default to PIADRV.LS=/*=/IFC \1ƒ=ARGPIADRV.LS=/ENDIF=/*"=ASM PIADRV.SA,PIADRV.RO,\1;RZ=146=/*{ Included files are:=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.PRNT.EQ=/*ƒ9995.&.PRNTCCB.EQ=/*}=/*=ENDNNNNNNÛ' PRNTLIB AFðð  RWINDRV AFùù  SCCDRV AF  SCSIDRV AF    SIODRV AF  TERMLIB AF  VM22DRV AF&&  M300CMNDAI//1k  M300INITAIppì  300INTRAI‘ ‚g 4  ? =/*=/*†PRNTLIB.AF=/*,=/* Chain file to assemble library for disks=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to PRNTLIB.LS=/*=/IFC \1ƒ=ARGPRNTLIB.LS=/ENDIF=/*$=ASM PRNTLIB.SA,PRNTLIB.RO,\1;RZ=150=/*{ Included files are:=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.PRNT.EQ=/*ƒ9995.&.PRNTCCB.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*}=/*=ENDNNNNNè=/*=/*†RWINDRV.AF=/*&=/* Chain file to the RWIN disk driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to RWINDRV.LS=/*=/IFC \1ƒ=ARGRWINDRV.LS=/ENDIF=/*$=ASM RWINDRV.SA,RWINDRV.RO,\1;RZ=150=/*{ Included files are:=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.DISK.EQ=/*ƒ9995.&.DISKCCB.EQ=/*ƒ9995.&.DISKMEM.EQ=/*}=/*=ENDNNNNN@ Nñ=/* =/*†SCCDRV.AF=/*F=/* Chain file to assemble Z8530 serial port driver for the local port$=/* on the VME117 and VME133 boards.=/*:=/* If no output argument is specified for the listing the(=/* chain file will default to SCCDRV.LS=/*=/IFC \1ƒ=ARGSCCDRV.LS=/ENDIF=/*"=ASM SCCDRV.SA,SCCDRV.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=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.&.TERMINAL.EQ=/*ƒ9995.&.TERMCCB.EQ=/*}=/*=ENDNNNNNú=/*=/*†SCSIDRV.AF=/*&=/* Chain file to the SCSI disk driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to SCSIDRV.LS=/*=/IFC \1ƒ=ARGSCSIDRV.LS=/ENDIF=/*$=ASM SCSIDRV.SA,SCSIDRV.RO,\1;RZ=150=/*{ Included files are:=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.&.DISK.EQ=/*ƒ9995.&.DISKCCB.EQ=/*ƒ9995.&.DISKMEM.EQ=/*}=/*=ENDNN@ NNN=/* =/*†SIODRV.AF=/*H=/* Chain file to assemble MK68564 serial port driver for the local port=/* on the VM04 board.=/*:=/* If no output argument is specified for the listing the(=/* chain file will default to SIODRV.LS=/*=/IFC \1ƒ=ARGSIODRV.LS=/ENDIF=/*"=ASM SIODRV.SA,SIODRV.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=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.&.TERMINAL.EQ=/*ƒ9995.&.TERMCCB.EQ=/*}=/*=ENDNNNNN =/*=/*†TERMLIB.AF=/*0=/* Chain file to assemble library for terminals=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to TERMLIB.LS=/*=/IFC \1ƒ=ARGTERMLIB.LS=/ENDIF=/*$=ASM TERMLIB.SA,TERMLIB.RO,\1;RZ=155=/*{ Included files are:=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.TERMINAL.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.TERMCCB.EQ=/*ƒ9995.&.BAB.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*}=/*=ENDA NNNNN=/*=/*†VM22DRV.AF=/*&=/* Chain file to the VM22 disk driver=/*:=/* If no output argument is specified for the listing the)=/* chain file will default to VM22DRV.LS=/*=/IFC \1ƒ=ARGVM22DRV.LS=/ENDIF=/*$=ASM VM22DRV.SA,VM22DRV.RO,\1;RZ=150=/*{ Included files are:=/*ƒ9995.&.TCB.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.&.LV5.EQ=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.NIO.EQ=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.DISK.EQ=/*ƒ9995.&.DISKCCB.EQ=/*ƒ9995.&.DISKMEM.EQ=/*}=/*=ENDNNNNNN0 TTL GPIB DRIVER - COMMAND PROCESSING - MAINLINE PAGE;*************************************************************’GPIBCOMMANDPROCESSOR*8*ƒThefunctionofthecommandprocessoristocoordinate7*ƒandsetupallcommandsandactivityonA theBUS.Upon9*ƒreceptionofacommand,theprocessorwillperformwhat8*ƒbasicvalidationsofparameterblocksandcommandtype7*ƒitcan.WithintheCCBforthischannelisacircular8*ƒqueueareawhichwillcontrolthedispatchofcommands7*ƒtotheBUS.Whenthecommandcanbeexecuted,further6*ƒcommandmodevalidationsaremadeatruntimeandif;*ƒsuccessful,controlwillbepassedtothemenuprocessor.*7*ƒEachcommandismadeupofagroupofsub-commandsor6*ƒmenuitemsandthesemenuitemswillbeexecutedone;*ƒatatimeuntilthecommandmenuiscompletelyprocessed.5*ƒAfterthefirstmenuitemisinitiated,therestof:*ƒthemenuflowwillbehandledbytheinterruptprocessor*ƒportionoftheGPIBdriver.**‰ENTRY:JSRFROMCMRHANDLER=*A2-PhsicalAddressofInitiateI/OParameterBlock(IIPB)9*A5-PhsicalAddressoftheCCBoftherequesteddevice1*A6-PhsicalAddressoftheattachedtask'sTCB*?*‰EXIT:RTS-CommandvalidationreturncodeinD0(always=0)*K****************************************************************************/*ƒPerformsomeofthebasicchecksoftheIOSPB* CMNDGPIB: MOVEQ #0,D5:MOVE.LXIOCPK(A2),D6‡setupaddrofcommandpacket(IOCB)5MOVE.WXIOPLN(A2),D5†setuplengthofcommandpacket3MOVE.LCCBTASKA(A5),A1„setupcaller'sTCBaddress3BSRIOADRCHKŽconvertlogicaltophysicaladdressesBEQ.SCMNDG010Œgoodreturn*5MOVEQ‚#ISTAIP,D1‰setinvalidparmblockerrortoIOSBRACMNDEX1exitprocessor*"CMNDG010MOVE.LD6,A3†A3<==IOSPB MOVE.LXIOUID(A2),A4†A4<==DCB3 BTSTW #GPIBDOWN,BUSACTIV(A5) is this channel down?BEQ.SCMNDG015Žbr=no=MOVEQ#ISTACDN,D1‹returnerror=unrecoverablechannelerror BRA CMNDEXIT*'40:8:@@HP-X<` >CMNDG015CMP.W#IOHALT,IOSFCT(A3)‚isthisanI/OHALTcommand?BEQHALTIObranchifyes**‚Golookup(validate)command*?BSRGETCMDPŽD2=RelativeindexofGPIBfunctionfromIOSCMDTB:BNE.SCMNDEXIT‹br=commandnotfound,returnerrorinD1*8*‚ValidateanybufferaddressesifthiscommandrequiresJ*‚databuffers(D6=Sec./Config.bufferaddr.or0,&D7=Primarybuffer*‚addressor0)*;BSRVALIDATEvalidateanybufferaddresses&commandinfo.@BNE.SCMNDEXIT‹br=errorduringvalidation,returnerrorinD1*A*‚Thecommandisvalidated,performfinalchecksandeitherqueue*ˆorexecutethecommand.* INHIB MOVEQ #0,D3'MOVE.BDCBCDV(A4),D3Œgetdevicenumber>MOVE.WDEVQBSY(A5),D0ŠD0<==currentbitmapofbusydev#'s.BTSTD3,D0”isdevicebusy?6BNE.SCMNDG120’branch=yes,returndevicebusyerror*9*‚ChecktoseeifthereisanyI/OinprogressontheBUS*'MOVE.LQHEAD(A5),D1Šisthequeuebusy? CMP.L QTAIL(A5),D1BEQ.SCMNDG100branchifno*=*‚TheGPIBisbusysoqueuethiscommandforfutureexecution*!BSRPSHGPIBQ‘pushentryonqueue>BEQ.SCMNDG120ERROR,queueisfull,returndevicebusyerror4MOVE.WDEVQBSY(A5),D0‡markthedeviceasbeingbusy BSET D3,D0.MOVE.WD0,DEVQBSY(A5)‡restorebusymaptoCCBBRA.SCMNDOK‘exit*A*‚SincethequeueisnotbusythecommandmaybeexecutedatthisG*‚timesovalidatethatthebusisinthepropermodeforthiscommand.*MCMNDG100MOVEM.LD3-D7,-(A7)ƒSaveprimaryandsecondarybufaddr'sandlength1BSRVALOPER‹checkmodeandoperationalabilities/MOVEM.L(A7)+,D3-D7‚restoreaddr'sandlengthsTST.BD1anyerrors?BNE.SCMNDEXIT†branchiferror*/BSRPSHGPIBQ’pushcurrentcommandonthequeue!BEQ.SCMNDG120error,queuefull%BSRBUILDMENU‘buildmenuforcommandBEQ.SCMNDG110BR‚=continue*&BSRPOPGPIBQ“elseremovequeueentry,5MOVEQ#ISTADRVE,D1Œsetdriverrun-timeerrorstatus,#BRA.SCMNDEXITandexitwitherror*B =CMNDG110MOVE.WDEVQBSY(A5),D0Šgetbusydevicenumberbitmap"BSETD3,D0”setdevicenumberbusy%MOVE.WD0,DEVQBSY(A5)‰updatebitmap*B*‚StartexecutionofthecurrentcommandsincetheBUSisnotbusy*9MOVE.LCCBCHB(A5),A1‰setbaseaddressofGPIBCregisters"BSRPROCMENU‘initiateI/OonmenuBRA.SCMNDOKjustexit*4CMNDG120MOVEQ#ISTADB,D1…setdevicebusyerrorcode*CCMNDEXIT MOVE.B D1,IOSSTA(A3) save error code in IOSPB status field2CMNDEX1‚MOVE.B#XPSNRM,D4„seteventtypetonormal"BSRQEVENT“queuetheeventtoIOS*=*‚Usethisentrypointwhennoeventistobesent.Theevent*‚willbesentatalatertime.*(CMNDOKUNMASK‚setinterruptmasktozeroMOVEQ#0,D0ƒsetreturnO.K. RTS  PAGE**’HALTI/OTOADEVICE*?*ˆTheHaltI/OprocessorwillhaltI/Otothespecifieddevice.&*ˆThereareseveralcasestoconsider:3*’1.AhaltdirectedtotheBUSwhileacontroller,8*’2.AhaltdirectedtotheBUSwhileaTalker/Listener,!*’3.Ahaltdirectedtoadevice.*?*ˆInthefirstcase,anyoperationinprogress,allqueuedI/O,5*ˆandanySRQpollinginprogresswillbeterminated!*;*ˆInthesecondcase,thehaltis(implied)directedtothe@*ˆcurrentI/Oinprogress.‚Thatoperationwillbeabortedimmed- *ˆiately.*<*ˆInthethirdcase,thequeueissearchedforthespecified;*ˆI/Ocommand.‚Iffound,thecommandismarked'halted'and:*ˆwillberemovedfromthequeuewhenitsturncomes,else#*ˆanerrorwillbereturnedtoIOS.**HALTIO:1INHIB—don'tallowthisprocesstobeinterrupted=*>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 10/28/85 REV 4.5 >>>>>>>>>>>>>1MOVE.LQTAIL(A5),A6‰getpointertocurrententry(CMPA.LQHEAD(A5),A6‰isthequeueempty?3BEQ.S‚HALT40YES,sendbackinvalidcommandstatus:CLR.B‚IOSSTA(A3)‹sendgoodcompletionstatusforHALTI/O=*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*+MOVE.BDCBCDV(A4),D0ˆgetthedevicenumber)BNE.SHALT50br=haltabussabledevice*BEQ.SHALT50br=no,treathalttoBUSinT/Lmodeasdevice*:*ˆHaltcommandistotheBUSanditisinControllermode.9*ˆTerminateanySRQpolling,currentI/O,andqueuedI/O.*  BSR HLTALL'BNE.SHALT40br=invalidhaltcommand*(HALT30BRA.LCMNDOKŠsetO.K.haltstatus*&HALT35MOVEQ#XPSHLT,D4†seteventtype4BSRQEVENT’sendhaltcommandacknowledgementtoIOS BRA CMNDOK*?*>>>>>>>>>>>>>>>>>>>>>>>10/28/85‚REV4.5>>>>>>>>>>>>>>>>>>>>>8HALT40MOVE.W#ISTAIF,D1†setinvalidhaltcommandstatus5MOVE.BD1,IOSSTA(A3)†updateHALTI/OParameterblockA*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> BRA.S HALT35*6*ˆHaltI/OtoaspecificdeviceortheBUSinT/Lmode*=HALT50BSRHLTCMDŒhaltcurrentcommandonqueue(ifpossible)BNE.SHALT40br=error BRA.S HALT30 2‰TTLGPIBDRIVER-COMMANDPROCESSING(VALIDATION)‰PAGEB********************************************************************–VALIDATEGPIBCOMMAND*<*ˆThissectionwillvalidatetherequiredbufferaddressand4*ˆcommandparameters.Iftheaddressesarevalidthe<*ˆlogicaladdresseswillbeconvertedtophysicaladdresses.*)*“ENTER:ƒD2.W-relativeindexofCommand*œA1-TCBaddress*œA2-IIPBpointer*œA3-IOSparamterblock*œA4-addressofDCB*œA6-addressofTCB**“EXIT:„IFƒD1=0ƒTHEN *¦Commandhasbeenvalidatedand*¡D4=primarybufferlength*¡D5=secondarybufferlength-*¡D6=physicalsecondary/config.bufferaddr&*¡D7=physicalprimarybufferaddress*¦or)*¡D4=primarybufferlengthnotrequired+*¡D5=secondarybufferlengthnotrequired,*¡D6=0ifsec./config.buffernotrequired'*¡D7=0ifprimarybuffernotrequired*œELSED1=errorcode*!*ŽRegisterUsage:„01234567*žD‚*RPƒRRRR *žA‚**ƒPPƒP*E********************************************************************** VALIDATE:B BLEA.LVALPARTB(PC),A0ƒgetbaseaddrofvalidationparametertable@MOVE.W0(A0,D2.W),D0„getvalidationparametersforthiscommand MOVEQ #0,D63MOVE.LD6,D7Œclearbufferaddressreturnregisters)MOVE.LD6,D4‹clearbufferlengthprimary+MOVE.LD6,D5‹clearbufferlengthsecondary4MOVEQ#ISTAADD,D1ˆpresetinvalidaddresserrorcode5BTST.L#BVALPBUF,D0…validateprimarybufferaddress?BEQ.SVALID010‰branchifno*#*ƒValidatePrimarybufferaddresses*.MOVE.LIOSSAD(A3),D6…getbufferstartaddress,MOVE.LIOSEAD(A3),D5„getbufferendaddress+SUB.LD6,D5isendaddressVALID020BTST#BVALCBUF,D0‚validateconfigurationbufferaddr?BEQ.SVALID030branchifno*'*‚Validateconfigurationbufferaddress*;MOVE.LIOSDBP(A3),D6ˆgetlogicalconfigurationbufferaddr MOVEQ #0,D5FMOVE.WIOSVARL+DCBDEV(A4),D5„includelengthofvariablearea(ifany)4ADD.L#IOSILN,D5Œaddinrestofconfigurationblock*3*‚Convertconfigurationlogicaladdresstophysical*9BSR.SIOADRCHKconvertaddr,D6=Config.bufferaddressBNE.SVALIDRTbranchiferror**ƒBuffervalidationcomplete**ˆValidateCommandRequirements* VALID030:NNC :BTST#BVALBDEV,D0commandvalidonlyforbussabledevice?,BEQ.SVALID125br=no,continuevalidation< CMP.B #XDSGDEV,IOSDTP+DCBDEV(A4) is this a bussable device?BEQ.SVALID125br=O.K.!?MOVEQ‚#ISTAIVCB,D1‹elsesetinvalidcommandforBUSerrorcode BRA.S VALIDRT*IVALID125BTST#BVALSCTL,D0‚doescommandrequiresystemcontrollercapab.?BEQ.SVALID130branchifno?MOVEQ‚#ISTAIVCB,D1ˆpre-loadinvalidcommandforBUSerrorcode9LEA.LCONFINFO(A5),A0†getpointertodeviceconfig.area7MOVE.LCNFIGPTR(A0),A0…getpointertoBUSconfig.areaJBTSTW#IOASCTC,IOSATW(A0)‚isBUSconfiguredforsystemcontrollercapab.?;BEQ.SVALIDRTŽbranch=no,error=invalidcommandforBUS*9VALID130BTST#BVALBUS,D0ƒcommandvalidonlyfortheBUS?BEQ.SVALID175branchifno@ CMP.B #XDSGBUS,IOSDTP+DCBDEV(A4) yes, check if this is the BUS!BEQ.SVALID175br=o.k MOVEQ #ISTAIVBD,D1?BRA.SVALIDRTŽelseexitforinvalidcommandtobussabledevice*0VALID175MOVEQ‚#ISTAOK,D1ƒsetreturncode=O.K.*'VALIDRTTST.BD1setreturnstatuscode RTS  PAGE* *ƒIOADRCHK*:*ˆThissubroutinewillchecktheaddressboundariestosee1*…ifentirelywithincallingtasksaddressspace.*&*ˆENTER:‚D5=numberofbytestocheck%*D6=68000bufferaddress(logical)*A1=TCBaddress*8*ˆEXIT:ƒD6=physicaladdressofbufferspace(iflegal)*D1=0ƒnoerror *•ElseƒError**ˆRMS68KROUTINES:TR0$.LOGPHY*!*‹RegisterUsage:ƒ01234567*›DPRPPPPRP*›APPPPPPPP* IOADRCHK:< MOVEM.L A0-A6/D0/D2-D5/D7,-(A7) save all regs for EXEC call'BTST#0,D6‘isbufferonwordboundary?#BNE.SIOHADR6Žbranchonno(error)TST.LD5“islengthzero?$BEQ.SIOHADR6Žbranchifyes(error)*:MOVE.LTCBTST(A1),A0‡A0<==addressoftasksegmenttable TR0$.LOGPHY,Žcallexec‚routine!BRA.SIOHADR8Žgoodbufferreturn7NOP˜blockpartiallyintaskspace(notvalidforGPIB)EIOHADR6MOVEQ‚#ISTAADD,D1‚blockisinMMIOspace(notvalidforGPIB) BRA.S IOHADR9*&IOHADR8MOVEQ#ISTAOK,D1…setreturnOK'IOHADR9 MOVEM.L (A7)+,A0-A6/D0/D2-D5/D7 RTS     NNNNNNNC ! TTL GPIB DRIVER - INITIALIZATION PAGE**„GPIBInitialization*7*ˆTheinitializationprocessorwillperformthreemajor7*ˆfunctions:(1)initializetheMVME300card,(2)reset9*ˆtheTMS9914Achipand(3)resetallsoftwareparameters5*ˆassociatedwiththischannel.Additionally,ashort=*ˆfunctionalitygo/nogotestwillbeperformedtodetermined%*ˆifthechannelisproperlyworking.*"*’ENTER:A5=CCBpointerforGPIB* INITGPIB:2INHIB‰setprocessorpriority(inhibitinterrupts)*CMP.B#XTGBUS,CCBTYPE(A5)ƒvalidGPIBCCB?BNE.SINITG010‚no* caused the interrupt. Also, the hardware configured priority(* level for each level will be the same.*3MOVE.BCCBVECT(A5),D1‡getconfiguredvectornumber.MOVE.BD1,VECTREG0(A1)†TMS9914Avectornumber2MOVE.BD1,VECTREG1(A1)†I/Ocompletevectornumber/MOVE.BD1,VECTREG2(A1)†Buserrorvectornumber MOVE.BD1,VECTREG3(A1)†Notused*?*‚Setuptheconfiguredhardwareprioritylevelandenablethem*>MOVE.BCCBPPRIO(A5),D1†getconfiguredhardwareprioritylevel AND.B#7,D1‘maskprioritylevelOR.B#$18,D1enableinterrupt/MOVE.BD1,CONTREG0(A1)†TMS9914Aprioritylevel3MOVE.BD1,CONTREG1(A1)†I/Ocompleteprioritylevel0MOVE.BD1,CONTREG2(A1)†Buserrorprioritylevel*)*ƒDisablevector3becauseitisnotused*AND.B#$0F,D1clearenablebit/MOVE.BD1,CONTREG3(A1)†disablenotusedvector**„intheGPIBCFIFO.Itismeanttobeusedatinitialization,9*„HALTI/Osequences,oranytimethereisundesireddata*„leftintheFIFO.*-*‡ENTER:A1=BASEADDRESSOFGPIBCREGISTERS*!*‡EXIT:ƒD1=0ƒTHENFIFOISEMPTY*‘ELSED1=ERRORCODE* *ˆRegisterUsage†01234567*™D‚*R*™A*MTFIFO:+MOVE.W#MAXFIFO+1,D1‚D1<==maxloopcount*6MTFIFO10 BTST.B #FIEMP,CNTRSTAT(A1) is the FIFO empty?"BNE.SMTFIFO20ƒyes,taskcomplete?MOVE.BFIFODAT(A1),D0‚readabytefromtheFIFOandthrowaway+DBRAD1,MTFIFO10‚continueuntilFIFOempty‚theboardisfunctional*œElseƒFIFObuffererror.**!*’RegisterUsage:…01234567*£D‚***£A*H************************************************************************ BDGONOGO:$MOVEQ#0,D0‘initializecounter/data*7BDG010 MOVE.B D0,FIFODAT(A1) store next pattern in FIFO$ADD.W‚#1,D0incrementpattern/count.CMP.W#MAXFIFO+1,D0‰MaximumFIFOsizereached0BEQ.SBDRTN1Yes,FIFOisnotgoingfull,Error1BTST.B#FIFUL,CNTRSTAT(A1)‚istheFIFOfullyet?$BEQ.SBDG010no,continueuntilfull*;*‚Atthispoint,theFIFOisfullandthesizeiscontained8*‚inD0.W.‚EmptytheFIFOandcheckthecontentsagainst*‚thedatathatwasinput.*4MOVE.WD0,FIFOSIZ(A5)‡savetheFIFOsizeintheCCBMOVEQ#0,D0‘resetpatternreg*4BDG020‚MOVE.BFIFODAT(A1),D1ƒgetnextcharfromFIFOCMP.B‚D0,D1“sameasinputwas?BNE.SBDRTN1“branchiferrorADD.W#1,D0”incrementpattern.BTST.B#FIEMP,CNTRSTAT(A1)…istheFIFOempty?(BEQ.SBDG020“branchuntilFIFOisempty+MOVEQ#ISTAOK,D1indicateeverythingisOK RTS*$BDRTN1MOVEQ#ISTAHWMF,D1‡FIFOerror RTSœexit   D N. TTL GPIB DRIVER - INTERRUPT PROCESSING (MAIN) PAGEG*************************************************************************ƒGPIBINTERRUPTPROCESSOR*<*†Thefollowinginterruptcodeisre-entrantandisdesigned<*†tohandleallinterruptsthatmayoccuronaGPIBchannel.*:*†TodetectallGPIBinterrupts,theMVME300cardusesthe;*†VERSAbusInterruptorModule(VBIM)chiplocatedonboard.B*†TheVBIMiscapableofhandlinguptofoursourcesofinterrupts.<*†Currentlyonlythreesourcesofinterruptsareenabledand;*†theyare:BusErrorInterrupt,I/OCompleteInterruptandB*†TMS9914AInterrupt.Sinceeachchannelcanonlyhaveonevector,;*†thesethreesourcesgeneratethesamevectoranditisup8*†totheinterruptprocessortodeterminethereasonfor*†interruptfromtheVBIM.*9*†NOTE:‚UponentryCMRhassavedregistersA0,A1,andD0.*$*ˆENTER:A5=addressofCCBpointer* INTRGPIB:+MOVE.LCCBCHB(A5),A1‚getptrtoGPIBCregs1MOVEP.LCONTREG0(A1),D0…readallvectorstatus's>AND.L#1<MOVE.LQTAIL(A5),A0„getcurrentqueuepointer(evenifempty)(CMPA.LQHEAD(A5),A0„isthequeueempty?BNE.S‚INTROK3‰br=no.LEA.L‚CONFINFO(A5),A4ƒyes,thequeueisempty,MOVE.LDVDCBPTR(A4),A4ƒsosetA4<=BUSDCB'SUB.L‚A3,A3setupdummyIOSPBaddress BRA.S INTROK4*4INTROK3MOVE.LDCBQOFST(A0),A4ƒA4<==addressofDCB7MOVE.LIPBQOFST(A0),A3ƒA3<==addressofcurrentIOSPB*.*ˆGiveDMAcompleteinterrupthighestpriority*DINTROK4BTST.L#IOCINT,D0‚didanI/Ocomplete(DMA)interruptoccur?BEQ.SINTR100‚yes*, BTST #TMSINT,D0 was it a TMS9914 interrupt? BEQ INTR500 br = yes*'*ˆElseitmustbeaBUSERRORinterrupt*E********************************************************************** *ƒBUSERROR*:*ˆTheBuserrorinterruptisgeneratedbytheMVME300cardB*ˆwheneveraDMAbuserrorconditionoccursduringatransmission.8*ˆIftherewasnoI/Oinprogress,theinterruptwillbe>*ˆconsideredspuriousandwillgenerateanunsolicitedchannel?*ˆinterrupttoIOS.‚IfI/Owasinprogress,thecurrentcommand=*ˆwillbeabortedandahardwaremalfunctionerroreventsent *ˆtoIOS.*6BSET.B#VBIMENAB,CONTREG2(A1)‚enableBuserrorvector(MOVE.LQTAIL(A5),A0‚isI/Oinprogress? CE MPA.L QHEAD(A5),A0BEQINTREXIT‰branchifno*@*ƒIfanSRQwasinprogress,abortallSRQprocessingandsenda$*ƒHardwareMalfunctionerrortoIOS.*B*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<* *ˆ4/24/84ƒbwn*9*ˆMustinhibitTMS9914A‚interrupts‚duringDMAoperations.*ˆMustre-enablehere.*4BSET.B#VBIMENAB,CONTREG0(A1)‚re-enable9914intrps*?*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>. MOVEQ #ISTABUS,D1 indicate hardware bus errorBSRPROCMERR‚processerrorBRAINTREXIT‚normalexit6 TTL GPIB DRIVER - INTERRUPT PROCESSING (DMA COMPLETE) PAGEG*************************************************************************ƒI/OCOMPLETE*:*ˆThisinterruptisgeneratedbytheMVME300cardwhenever>*ˆaDMAWRITEorDMAREADhascompleted.Threemajorfunctions<*ˆareaccomplishedinthissectionandtheyare:(1)I/Opost6*ˆformatting(ifspecified)afteraDMAWRITE/READhas;*ˆcompleted,(2)menuprocessingandinitiationand(3)SRQ *ˆprocessing.*8*ˆForpostI/Oformatting,theusermayspecifyaformatD*ˆroutinestobeexecuteduponcompletingthedesiredDMAoperation.<*ˆTheseroutinesmustbespecifiedatsysgentimeandshould*ˆreporterrors.*<*ˆThemenuprocessingsectionisdesignedtoeitherinitiate;*ˆthenextmenuitemor,ifatendofmenu,toqueueanI/O:*ˆcompletioneventbacktoIOSandinitiateannewmenuif7*ˆthereareotheroperationswaitingontheGPIBqueue.*;*ˆThelastmajorsectionoftheI/Ocompleteportionofthe8*ˆinterrupthandleristohandleprogramflowofservice;*ˆrequestfunctions(SRQ)whenreceivedincontrollermode.?*ˆTheprocessorwillrunstatusmenuestoeachdeviceconnected;*ˆtotheGPIBuntilthedevicerequestingserviceisfound.;*ˆOncefound,anSRQASQeventwillbesentbacktoIOSfor*ˆexamination.*INTR100:5 MOVE.B #1<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>/MOVE.LQTAIL(A5),A0‚currentmenuqueuepointer)CMPA.LQHEAD(A5),A0‚isI/Oinprogress?BEQINTREXIT‰br=no*5BTSTW#CAC_S,BUSACTIV(A5)ƒareweincontrollermode?BEQ.SINTR115br=no*4BTST#LADS_B,ADDRSTAT(A1)ƒis9914inlistenermode?BEQ.SINTR110br=no7MOVE.B#TCS,AUXCMD(A1)†sotakecontrol(synchronously)2MOVE.BDATAIO(A1),D0ˆreadregtogetthingsgoing BRA.S INTR115**ƒAlldataDMAsequencesrequirethelengthofthetransfertoD*ƒbereportedbackintheIOSparameterblockoriginatingthiscall.**>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>**<*‚ChecktoseeifthiswastheINorOUTprocessor.Ifitis8*‚calculatethelengthofthelasttransferbasedonthe=*‚contentsoftheGPIBCmemoryaddressregister(MAR)andtheC*‚typeofI/Ooperationperformed,elsenolengthcalcs.arereq'd.*?MOVE.LMENUCPOS(A5),A0‚getaddressofmenuitemjustcompleted1CMPI.B#OUT,(A0)„wastheOUTprocessorexecuted?BEQ.SINTR150…br=yes*/CMPI.B#IN,(A0)„wastheINprocessorexecuted?1BNE.SINTR200„br=TERMorSEOIprocessfinished*I* Check for the one command that uses the secondary buffer instead of the* primary buffer for data xfer.*GINTR130CMPI.W#IOOWIN,IOSFCT(A3)ƒisthisanoutoutwithinputcommand?BNE.SINTR150ƒbr=noGSUB.LD6,D0‚D0=currentM.A.R.minus(secondary)bufferstartaddress BRA.S INTR160*LINTR150 SUB.L D7,D0 D0 = current M.A.R. minus (primary) buffer start address*;INTR160 MOVE.L D0,IOSLEN(A3) store I/O xfer length in IOSPB*C*ƒChecktoseeifthereisaspecialpostformatterstobeexecuted*CMOVE.LIOSFMTA+DCBDEV(A4),D1‚getpointertouserdefinedformatter1 BEQ.S INTR200 br = no user defined I/O formatter*B*‚ChecktoseewhetherinputoroutputmenuprocessorwasexecutedA*‚andthenseeifthereisauserdefinedpostprocessorforthis *‚device.*@MOVE.W#PST_OFMT,D0ƒD0<==preloadpostoutputformatteroffset5CMPI.B#OUT,(A0)…arewedoing"OUT"menuprocessing?BEQ.SINTR180„branchifyes7MOVE.W#PST_IFMT,D0ƒD0<==postinputformatteroffset*:INTR180MOVE.LD1,A0†A0<==baseaddressofallformatters8TST.L0(A0,D0.W)ƒdiduserdefineapostdataformatter?BEQ.SINTR200ƒbranch=no*+MOVEM.LD1-D7/A0-A6,-(A7)‚saveenvironment.JSR0(A0,D0.W)‚executeuserdefinedformatter MOVEM.L (A7)+,D1-D7/A0-A6,TST.BD0ƒcheckerrorcodefromuserroutine!BEQ.SINTR200‚branchifnoerror*B*‚Anerrorhasbeendetectedintheuser'sinputformatterroutine*-MOVEQ‚#ISTAINFE,D1‚setinputformattererrorBSRPROCMERR‚processerror+ BRA.S INTR250 exit DMA interrupt processor*INTR200:'BSRPROCMENU„processnextmenuitem(s)*INTR250:6 MOVE.W (A7)+,D5 retrieve previous TMS9914 status regs(TST.WD5ˆwasthereapendinginterrupt? BEQ INTREXIT br = no BRA.SINTR510‚elsegohandleit  ; TTL GPIB DRIVER - INTERRUPT PROCESSING (TMS9914 INTERRUPT) PAGEE***********************************************************************ƒTMS9914AINTERRUPTSECTION*<*„Enteringthissectionoftheinterruptprocessorindicates8*„thatoneormoreinterruptconditionsenabledhasbeen;*„received.Readingtheinterruptmaskregsiters(INTR0and9*„INTR1)oftheTMS9914Awillindicatewhichcondition(s) *„occurred.*;*„TheGPIBcanbeinoneandonlyoneofthefourfollowing<*„states:(1)controllermode,(2)talkermode,(3)listener%*„mode,or(4)idlemode.‚Thesemodes@*„arestoredin'BUSACTIV'andmaychangedependingonwhattype=*„ofinterruptoccurred.‚Also,differentactionsmaybetaken?*„dependingonthecurrentstateoftheBUS.‚Allinterruptbits8*„willbecheckedeachtimeaTMS9914Ainterruptoccurs.* INTR500:5MOVEP.WINTR0(A1),D5ƒreadinterruptstatusregisters6AND.W‚TMSMASK(A5),D5ƒD5=validinterruptstatusbitsINTR510:B BSET.B #VBIMENAB,CONTREG0(A1) reset interrupt enable for TMS9914A***0***†MyAddressChange(MAC)checkandprocessing***$BTST#MACBIT,D5†istheMACbitset?BEQ.SINTR600ƒbr=no*I AND.W #$FFFF-(1< BTSTW #SRQPROG,BUSACTIV(A5) USER I/O or SRQ polling sequence?(BNE.SINTR605br=SRQpollingsequenceJ MOVE.B SRQBYTE(A5),IOSSAD-1(A3) else move serial poll byte to user's IOPB-INTR605BSRPROCMENU‰continueprocessingmenu BRA INTR700*+*ˆCheckifwehaveanyTaskI/Oreadytogo*8INTR610MOVE.L#READPEND,D3‚setupforI/Opendingcheck0BSRCHECKIOPgolookfortasklevelI/Opending***0***„ByteOut(BO)interruptcheckandprocessing***)INTR700BTST#BOBIT,D5„istheBObitset? BEQ.S INTR800*9BTSTW#CAC_S,BUSACTIV(A5)ƒistheBUSincontrollermode?BEQ.SINTR750br=no*5*‚Acommandstringmightbeinprogress.‚Sendoutthe"*‚nextcommandbytewithATNtrue.*/TST.LCMDCOUNT(A5)‰falseorlastBOinterrupt?(BEQ.SINTR800Žbranchifyes(ignoreit)*5SUB.L#1,CMDCOUNT(A5)†decrementcommandstringcount5BEQ.SINTR730Žbranchiffinishedwithcommandstring4MOVE.LCMDBFPTR(A5),A0…getptrtonextcommandbyte&MOVE.B(A0)+,D1Œgetnextcommandbyte5MOVE.LA0,CMDBFPTR(A5)…updatecommandbufferpointer%BSRCOMCMD‘outputcommandontheBUSBRA.SINTR800Žcontinue*@*ƒCommandprocessingiscompletefornow.Continuewiththenext=*ƒmenuitemafterthecommandoutmenuitemprocessorforthe*ƒcurrentcommand.*1INTR730BSRPROCMENUˆcontinuewithnextmenuitemBRA.SINTR800Žcontinue*!* We are not the active cntroller*8INTR750MOVE.L#WRITPEND,D3‚setupforpendingI/Ocheck.BSRCHECKIOPcheckforpendingtasklevelI/O***8***†ServiceRequest(SRQ)interruptcheckandprocessing***BINTR800BTST#SRQBIT,D5ƒisadeviceonourBUSrequestingservice?BEQ.SINTR900„br=no*: BSETW #SRQWAIT,BUSACTIV(A5) indicate SRQ intrp processing3MOVE.LQHEAD(A5),D1‡yes,getcurrentqueuepointer'CMP.LQTAIL(A5),D1ˆisthequeueempty?(BNE.SINTR900Žbranchifno,busisbusy*A*‚SincetheGPIBisidle,initiatetheservicerequestprocessing2*‚todeterminewhichdeviceisrequestingservice.*9*ˆFirstbuildadummyqueueentryforstandardprocessing** MOVEM.L A3-A4/D4-D7,-(A7) save intrp regs SUB.L A3,A3 dummy IOSPB address LEA.L CONFINFO(A5),A4L MOVE.L DVDCBPTR(A4),A4 A4 <= to BUS DCB (serial polling is a BUS operation)* LEA.L SRQBYTE(A5),A0 input buffer pointer,MOVEQ#1,D4‚Statusbyteresponselength=1/ MOVE.L A3,D5 dummy length for secondary buffer2 MOVE.L A0,D6 dummy primary buffer address pointer4 MOVE.L A3,D7 dummy secondary buffer address pointer' BSR PSHGPIBQ go put entry on the queue- MOVEM.L (A7)+,A3-A4/D4-D7 restore intrp regs1 BEQ.S INTR900 br = queue full, process SRQ later&BSRPROCMSRQ‚startuptheSRQprocess***<***ƒRemote/LocalChange(RLC)interruptcheckandprocessing***6INTR900BTST#RLCBIT,D5ƒremote/localchangeinterrupt?BEQ.SINTR1000ƒbranchifno*@MOVE.BADDRSTAT(A1),D1‡D1<==‚currentaddressstateofTMS9914A6AND.W#1<*‚bitmaskandchecktoseeifweevenneedtorespondtothis*‚secondaryaddress.*8LEA.LCONFINFO(A5),A0„A0<==ptrtoconfigurationareas?MOVE.LCNFIGPTR(A0),A0ƒA0<==ptrtoconfigurationareaofBUS*=*‚Readthecommandpassthruregistertoobtainthesecondary*‚addressthatisrequired.*DMOVE.BCMDPTHRU(A1),D2†D2=secondaryaddrcontrollerisrequesting$AND.L#SECMASK,D2‹maskaddressbitsAMOVE.LIOSSAMW(A0),D1‡D1<==maskofvalidsecondarywriteaddrsDBTST#TADS_B,ADDRSTAT(A1)ƒAreweinprimarytalkeraddressedstate?BEQ.SINTR1140ŽBranchifno*@MOVE.LIOSSAMR(A0),D1‡D1<==maskofvalidsecondaryreadaddrs*.INTR1140BTST.LD2,D1ˆvalidsecondaryaddress?BNE.SINTR1150branchifyes*(*‚Thisisnotavalidsecondaryaddress.*?MOVE.B#DACR0,AUXCMD(A1)‚releasehdshk&don'tenterLADS/TADSBRA.SINTR1200ƒcontinue*AINTR1150 MOVE.B #DACR1,AUXCMD(A1) release hdshk & enter TADS/LADS4OR.B#1<BRA.SCKIO040gosendeventtouserabouttypeofpendingI/O*&*ˆTaskI/Oispending,checkformatch.*’onoperationtype&G secondaryaddr.ifreq'd*8CKIO010 BTST.B D3,IOPEND(A5) Is it a a matching request?.BEQ.SCKIO030Br=no,abortTaskI/Orequest*C BTST.B #SECONDAR,IOPEND(A5) Is there a secondary address involved?)BEQ.SCKIO050Br=no,gostartthemenu5MOVE.LQTAIL(A5),A0‰getpointertocurrentoperation2MOVE.LIPBQOFST(A0),A0†AO<==I/Oparameterblock9CMP.W#IORSEC,IOSFCT(A0)„Isitasecondaryreadcommand?BEQ.SCKIO015br=yes:CMP.W#IOWSEC,IOSFCT(A0)„Isitssecondarywritecommand?.BNE.SCKIO030br=no,abortpendingtaskI/O*CKIO015 MOVEQ #SECMASK,D1@AND.BIOPEND(A5),D1‰D1=activecontrollerrequestedsec.addr.HCMP.BIOSSAD-1(A0),D1‡isitthesameasrheTask'srequestedsecaddr.?'BEQ.SCKIO050br=yes,startthemenu*.CKIO030BSRHLTCMD‹killthetaskrequestedI/O CKIO050BSETW#BUSIOP,BUSACTIV(A5)ƒsetINTRPlevelI/Opending&BSRPROCMENU‘InitiateI/Oonthemenu* CKIO060 RTS PAGEH**************************************************************************—CANCELPENDINGI/O*;*ˆAneventhasoccurredontheBUSthatforcesustocancel9*ˆanypendingI/Oregardlessofsource.‚Thecauseofthis&*ˆeventwillalsobesenttotheuser.**/*ˆENTER:„A1<==‚baseaddressofGPIBCregisters*’A3<==‚addressofIOSPB*’A4<==‚addressofDCB*’A5<==‚addressofCCB*.*’D5.W<==current9914intrpreg(INTRLEVEL)**’D3.B<==I/Ooperationtype(READ/WRITE)* CANCLIOP:#BSRHLTALL’HaltallI/OontheBUS, MOVE.B #0,IOPEND(A5) cancel any pending I/OHAND.W‚#$FFFF-(1<PROCMENAMOVE.LQTAIL(A5),A6‰A6<==ptrtocurrentqueueentry1BTSTW#HALTED,CSTQOFST(A6)‚wasthismenuHalted?BNEPROCM020br=yesK MOVE.L MENUNPOS(A5),MENUCPOS(A5) update: next item is now the current item6MOVE.LMENUNPOS(A5),A0ƒgetnextmenupositionpointer#MOVE.B(A0)+,D0ƒgetnextmenuitem5MOVE.LA0,MENUNPOS(A5)ƒupdatenextmenuitempointer* *ƒchecktoseeifatendofmenu*CMP.B#END,D0Œendofmenu?BEQ.SPROCM020‹yes* * Initiate I/O on next menu item*;LEA.LMENUCTBL(PC),A0ƒA0<--menufunctioncodejumptable(CMP.B#MENUCLEN,D0‚validfunctioncode?BGTPROCMERB‚branchifno*/AND.W#$FF,D0ƒmasktheoffsetofroutineindex"ASL.W#1,D0…maketablecompatibleAMOVE.W0(A0,D0.W),D0‚relativedistancebetweentableandroutineAMOVEM.LD0/D2-D7/A0-A6,-(A7)‚saveeverythingexceptD1forerror,MOVE.LCCBCHB(A5),A1‚getbaseaddrofGPIBC)JSR0(A0,D0.W)‚initiateI/Oonmenuitem3MOVEM.L(A7)+,D0/D2-D7/A0-A6‚restoreallregisters TST.BD1‚setconditionalreturn2BNE‚PROCMERA‚gotoprocessormenuerrorprocessor*C*…Thesepreviousmenuitemwassuccessfullyinitiated/completed.If;*…themenuitemwasaClassIIorClassIIItype(auxiliary5*…commandorspecialfunctiontype)nointerruptwill9*…begeneratedsocheckthatheretokeepthingsrolling.H *5MOVE.LMENUCPOS(A5),A0ƒgetcurrentmenuitempointer/CMPI.B#AUXTYPE,(A0)‚wasitanauxiliarytype?,BGE.SPROCMENA‚yes,continuewithnextitem*:*‚Thefollowingisaspecialcasecheckforthemenuitems9*„DATAXFRTERM/SEOI.Ifeitherprocessorwasperformedin7*„theimagemodeorperformedinformattedmodewithno>*„EORcharactersenabled,thennointerruptwillbegenerated.*;BCLRW#TERMINT,CSTQOFST(A6)ˆareweexpectinganinterrupt?-BNE.SPROCMENA•br=no,gotonextmenuitem*6PROCMRTNMOVEM.L(A7)+,D2-D7/A1-A6‚restoreenvironment RTS  PAGE*>*‚IthasbeendeterminedthatweareattheendofthecurrentB*‚operationmenuitemtableorthisI/OoperationhasbeenHALTED.*8PROCM020BTSTW#SRQPROG,BUSACTIV(A5)‚isSRQinprogress?BNEPROCM200•yes7MOVEQ‚#ISTAOK,D1setoperationcompletionstatustook PROCM050 MOVEQ #0,D0+MOVE.BDCBCDV(A4),D0‚getthedevicenumber1MOVE.WD1,-(A7)ˆsaveoperationcompletionstatus9MOVE.WDEVQBSY(A5),D1‚D1<==currentdevicebusybitmap(BCLRD0,D1clearthatdevice'sbusybit%MOVE.WD1,DEVQBSY(A5)‚updatebitmapMOVE.W(A7)+,D1ˆrestorestatus: BTSTW #HALTED,CSTQOFST(A6) was this operation terminated?BNE.SPROCM055Žbr=yesH BTSTW #SRQFAIL,CSTQOFST(A6) if an SRQ poll, did the device not respond?BEQ.SPROCM060‰br=O.K.*5PROCM055MOVEQ#ISTATO,D1„elsesettimeouterrorcode*2PROCM060 MOVE.B D1,IOSSTA(A3) save status in IOSPB2MOVE.B#XPSNRM,D4ƒD4<==seteventtypetonormalBSRQEVENT‚sendeventtoIOS/BTSTW#SRQWAIT,BUSACTIV(A5)†isanSRQwaiting?BEQ.SPROCM100”no*7*‚Overlaythecurrentcompletedqueueentry(operation)1*‚withdummySRQprocessinginformationpointers.* LEA.L CONFINFO(A5),A1J MOVE.L DVDCBPTR(A1),DCBQOFST(A6) set to DCB of the BUS for SRQ processing'CLR.WCSTQOFST(A6)ŠInitcommandstatus-CLR.LIPBQOFST(A6)ŠcleardummyIOSPBpointer LEA.L SRQBYTE(A5),A16MOVE.LA1,PBPAOFST(A6)†setdummyinputbufferaddress5MOVE.B#1,PBLNOFST(A6)†setdummyinputbufferlength(CLR.LSBPAOFST(A6)Šnosecondarybuffer!'CLR.WSBLNOFST(A6)Šanditslengthis0 BRA.S PROCSRQA  PAGE*3*ˆENTRYPOINTFORSRQPROCESSINGATINTERRUPTLEVEL*?*‚ThereisanSRQrequestwaitingtobehandledsoinitiatethe@*‚statusmenuforthefirstdevicenumberconnectedtothisCCB.=*‚Also,sendanI/Ocompleteeventbackforpreviousfunction%*‚sincewegototherthingstodonow* PROCMSRQ:+MOVEM.LD2-D7/A1-A6,-(A7)…saveenvironment*>PROCSRQAMOVE.LQTAIL(A5),A6ŠA6<==ptrtocurrentqueueentry2BCLRW#SRQWAIT,BUSACTIV(A5)„takeoutofwaitmode8BSETW#SRQPROG,BUSACTIV(A5)„putinSRQinprogressmode3LEA.LCOND_SP(PC),A0‹A0<==serialpollmenutable+MOVE.LA0,MENU(A5)settopofmenupointer=MOVE.BCSPDEVNM(A5),D0‰getdevicenumberoflastserialpoll>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>(BRA.SPROCM227‘initiateI/OonSRQmenu* PAGE$PROCM100BSRPOPGPIBQƒpopGPIBqueue;BEQPROCMRTN‚branchifqueueisempty(nothingelsetodo)*:*‚Setupthenecessarypointersfromthequeueinformation-*‚andthenbuildthemenuforthenewcommand**MOVE.LQTAIL(A5),A6‚getnewqueuepointer3*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< *ˆ4/24/84ƒbwn#*ˆSetupregistersbeforebranching?MOVE.LIPBQOFST(A6),A3‚A3<==addressofIOSPBfornewcommand=MOVE.LDCBQOFST(A6),A4‚A4<==addressofDCBfornewcommand*6*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>EBTSTW#HALTED,CSTQOFST(A6)‚wasthiscommandentrypreviouslyhalted?BNEPROCM020ƒbranchifyes2*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< *ˆ4/24/84ƒbwn**ƒThesemovesdoneabovenow.*?*MOVE.LIPBQOFST(A6),A3‚A3<==addressofIOSPBfornewcommand=*MOVE.LDCH BQOFST(A6),A4‚A4<==addressofDCBfornewcommand*8*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*(BSRGETCMDP…getpointertonextcommand+BNEPROCM020„BR=invalidcommand,discard4BSRVALOPER…validateoperationalmodeandabilities)BNEPROCM020„Error,invalidcmd,discard(BSRBUILDMEN„buildmenufornewcommandBNEPROCM020„Branchiferror&BRAPROCMENA„initiateI/Oonnewmenu**‚SRQProcessingandDetection*7PROCM200 BTSTW #HALTED,CSTQOFST(A6) SRQ polling halted?&BNE.SPROCM300„br=yes,termpolling+MOVE.BSRQBYTE(A5),D1ƒreadthestatusbyte*.BTST#6,D1ƒisthisdevicerequestingservice? BNE.S PROCM400 branch if yes*A*‚Getnextindexdevicenumberofthenextdevicetoserialpoll.?*‚Thetechniqueusedallowswraparoundsothatnodeviceonthe:*‚BUSwillhaveagreaterpriorityofbeingserialpolled.*1PROCM220MOVE.BCSPDEVNM(A5),D0‚getcurrentindex2ADD.B#1,D0ƒbumpbyonetogetnextdevicenumber+CMPI.B#MAXDEVNM+1,D0ƒendofdevicechain?BNE.SPROCM225‚notyet MOVEQ#1,D0‚resettodevice#1*I*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<* *‡10/9/84…SJF*A*‡Wewillinsertcodeinheretoimplementtheconceptoflooping?*‡twicethroughalldevicesonabustolocatethesourceofan=*‡SRQ.‚ThiswasnecessaryduetodevicespulsingtheSRQline1*‡andthenmissingtrueSRQ'sfromotherdevices.*J*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>EPROCM225MOVE.B‚FSPDEVNM(A5),D2…D2<--device#westartedSRQ'swith(AND.Bƒ#$0F,D2Maskouttheloopcounter5CMP.BƒD0,D2HavewereachedthestartingSRQdevice?BNE.SƒPROCM227ŒNotyet7BSET.B‚#7,FSPDEVNM(A5)…Setthepotemtiallapindicator.BNE.SƒPROCM300ŒBranchifwehavelappedtwice*?PROCM227MOVE.LCCBCHB(A5),A1‚A1<--baseGPIBaddressofboard.BTST.B‚#BUSSRQ,BUSSTAT(A1)ƒisSRQstilltrue?1BEQ.SƒPROCM300Žbranchifnot,exitSRQprocesses =*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<* *10/9/84…sjf*+*ˆThiscodewasreplacedbytheabovelogic*L*PROCM225CMP.BFSPDEVNM(A5),D0‚havewedoneacompleteturnaroundtheBUS?**BEQ.SPROCM300ƒyes,wemayhaveproblems*@*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> *-*‚Checktoseeifthisdevicenumberisvalid**PROCM240ANDI.L#$FF,D0ƒgetridofgarbage4MOVE.BD0,CSPDEVNM(A5)ƒupdatecurrentdevicenumber/ASL.L#3,D0ƒcalcoffsetintoconfiginfotable5LEA.LCONFINFO(A5),A0ƒbaseaddrofconfiginfotable6MOVE.LDVDCBPTR(A0,D0.L),A4ƒgetpointertodeviceDCBJMOVE.LCNFIGPTR(A0,D0.L),A0ƒgetptrtocurrentdeviceconfigurationblock MOVE.L A0,D0 set cond codes:BEQ.SPROCM220ƒbranchifdevicenotpresentorconfiguredF MOVE.L A4,DCBQOFST(A6) save new DCB pointer at current queue locationCBTSTW#IOASPOC,IOSATW(A0)‚doesdevicehaveserialpollcapability?BEQ.SPROCM220ƒbranchifno*>MOVE.LMENU(A5),MENUNPOS(A5)‚resetstatusmenupointertotopBRAPROCMENAƒinitiateI/O*>PROCM300 BCLRW #SRQPROG,BUSACTIV(A5) clear SRQ in progress bit(BRAPROCM100„continuenormalprocessing*.*ƒFoundadeviceonthebusrequestingservice*5PROCM400MOVEQ‚#SRQTYPE,D0‚seteventtypetoSRQtypeBSRSENDUEVS‚sendevent>*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>* *’10/9/84„sjf*5*ˆThislogicisnowperformedaboveaftereachdevice *ˆisqueried.*-*MOVE.LCCBCHB(A5),A1‚getbaseaddrofGPIBC/*BTST.B#BUSSRQ,BUSSTAT(A1)ƒisSRQstillTRUE?7*BEQ.SPROCM300‚no,cleanupandcontinuenormaloper.*>*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> *5*ˆResetthelapindicatorandthefirstdevicepolled5*ˆforthisnextSRQseries.EachtimeanSRQisfound4*ˆwemustlapatleasttwicetocatchdevicesmissed*ˆbytogglingSRQ's.*** MOVEQ #1,D0 set to first device index of configuration blocks*DPROCM520 MOVE.B D0,FSPDEVNM(A5) set start of serial poll index chainABRA.SPROCM227‚startoveragain…***10/9/84sjf‚WASPROCM240*****5*‚ProcessMenuentrypointwhenanerrorhasoccurred#*‚withthereasonfroerrorinD1.B* PROCMERR:+MOVEM.LD2-D7/A1-A6,-(A7)…saveenvironment*>PROCMERAMOVE.LQTAIL(A5),A6ƒA6<==ptrtocurrentqueueentry1 BCLRW #SRQPROG,BUSACTIV(A5) was SRQ in progress?4BEQPROCM050ƒbr=NO,terminateUSERI/Oprocessing-BRAPROCM100ƒelsepopSRQmenuandterminate*:PROCMERBMOVEQ#ISTADRVE,D1‚setdriverrun-timeerrorcode% BRA.S PROCMERA go to error processor 8 TTL GPIB DRIVER - INTERRUPT PROCESSOR (MENU PROCESSORS) PAGEE***********************************************************************’MENUITEMCOMMANDPROCESSES*>*ˆThefollowingroutinesaretheindividualmenuitemroutinesA*…thatwhencombinedmakeupamenuforeachGPIBfunction.TheseE*…menuitemsaredispatchedbythemenuprocessorateitherinterrupt;*…levelorcommandlevel.Allregistershavebeenpreserved?*…beforeenteringexceptforD0andA0whichmayalwaysbeused@*…asworkregisters.Thefollowingregisterdescriptionentryis$*…trueforallmenuitemprocessors:*-*’ENTER:‚A1=BaseAddressofGPIBCregisters%*šA3=AddressofIOSParameterBlock,*šA4=AddressofDeviceControlBlock(DCB)-*šA5=AddressofChannelControlBlock(CCB)1*šA6=AddressofUser'sTaskControlBlock(TCB)* *’EXIT:ƒIfD1=0…THENƒNoerrors*œELSED1=errorcode9*Note:TheINITIOprocessorhassavedallregistersupon)*”entrysoallregistersarefreetouse.*G*********************************************************************** ! TTL CLASS I MENU ITEM PROCESSORS PAGEF************************************************************************ˆCLASSIMENUITEMPROCESSORS*1*’Thisclassofmenuitemsinitiatevarioustypes>*ˆofI/OinbothDMAandnon-DMAmodes.AllclassImenuitems-*ˆwillgenerateaninterruptafterexecution.*F********************************************************************** **ˆPROCESSOR:WriteData*:*ˆPURPOSE:TosetupthewriterequestaccordingtotheIOS0*‘options,setuptheDMAregisters,andthento*‘initiatetheI/O.* WRITDATA:9 MOVEQ #1<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>& MOVE.B D2,UNICMD(A1) initiate the I/O*3WRITD025MOVEQ‚#ISTAOK,D1setreturnstatustoO.K.*WRITDRTNRTS…exitwritedata*<*ˆSpecialprocessingforDMAtransferofonly1byte(either&*ˆdataorterminationchar.sequence).*HWRITD030 BSETW #TERMINT,CSTQOFST(A6) let PROCMENU know no intrp expected‰BRA.SWRITD025Žtakegoodexit**‚WriteFormattedMode;*ˆSinceDMAwriterequestsaretransfereddirectlyfromthe;*ˆusersbuffer,andWriteFormattedEORcharacteristics(if8*ˆenabled)willbesentoutbytheterminationprocessor'*ˆuponcompletionofthisDMAtransfer.*>WRITDFMTMOVE.BWEORFMT(A2),D1‚getEORreqforWriteFormatted2BTST.L#FIXTERM,D1‚fixedlengthtransferenabled?BEQ.SWRITD060„branchifnoF MOVE.W IOSFBWF(A2),D0 yes change transfer length to fixed requirement*G*ƒIfanyoftheCR,LF,orEOScharactersareenabled,EOI(ifenabled);*ƒmustbeheldoffforthistransferandtransmittedbythe*ƒterminationprocessor.*WRITD060 MOVE.B D1,D37 AND.B #1<*„terminateonthehighestpriorityterminatorwithEOShaving:*„thehighestpriorityfollowedbyLFandCRrespectively.*0READ115MOVEQ#0,D2ŠclearDMAoperationregister#BTST.L#EOSTERM,D1ŠisEOSenabled?BEQ.SREADD060branchifno; MOVE.B IOSEOSR(A2),EOSCOMP(A1) yes, set EOS read character+BRA.SREADD080andbypassCR/LFEOSchecks)READD060BTST.L#LFTERM,D1‚isLFenabled?BEQ.SREADD070branchifno1MOVE.B#LF,EOSCOMP(A1)…yes,setLFasterminator'BRA.SREADD080andbypassCREOScheck)READD070BTST.L#CRTERM,D1ƒisCRenabled?6*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< *ˆ4/24/84ƒbwn*=*ˆFixsothatreadwillterminateonfixedlengthdatainput. *ˆInsertedREADD090labelbelow.**BEQ.SREADD020branchifno BEQ.S READD090*?*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>1MOVE.B#CR,EOSCOMP(A1)…yes,setCRasterminator@READD080BSET.L#EOSBIT,D2‚enableEOSdetectionforDMAtransfer2READD090BTST.L#FIXTERM,D1‰fixedlengthtransfer?BEQ.SREADD020branchifno1TST.WD3“diduserreallyspecifyafixedlength?3BEQ.SREADD020br=no,useIOSPBspecifiedlength;CMP.WD0,D3‘compareuser'srealbufferlengthtoDEVICE'S!8BGE.SREADD011Žbr=user'sbuffersize.GE.todevice's4MOVEQ‚#ISTAADD,D1Šbr=hisbufferisnotbigenoughBRA.SREADDRTNŽabort*BREADD011MOVE.WD3,D0ˆsetupDMAfordevice'sfixedlengthrecord!4READD020:BSRSETUPDMA†setupDMAbytecountandMAR+MOVE.B#LON1,AUXCMD(A1)…setupListenmode.BSET.L#DMAWRITE,D2ˆenableDMAwritecommmand6BCLRW#BIBIT,TMSMASK(A5)ƒdisableBIinterruptsonDMA7MOVE.WTMSMASK(A5),D1†resetinterruptmaskonTMS9914A MOVEP.W D1,INTR0(A1)*MOVE.B#GTS,AUXCMD(A1)…lowertheATNlineB*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<* *ˆ4/24/84ƒbwn*9*ˆMustinhibitTMS9914A‚interrupts‚duringDMAoperations.*2BCLR.B#VBIMENAB,CONTREG0(A1)‚disable9914intrps*?*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>&MOVE.BD2,UNICMD(A1)‡initiatetheI/O+MOVEQ‚#ISTAOK,D1ŠsetreturnstatustoO.K.READDRTNRTSexitreaddata PAGE(*ˆPROCESSOR:SendTerminationCharacters*6*ˆPURPOSE:ThisprocessorwillsendtheEORcharacters,*‘inDMAmodetocompletethepreviouswrite*‘formattedtransfer.* SENDTERM:%MOVE.WIOSOPT(A3),D1‚getIOSoptions.AND.W#IOPIMG,D1‚datatransferinimagemode?>BNE.SSENDTRM9ƒbranchifyes(noEOScharactersinthismode)*3BSRGETCNFIGƒgetptrtocurrentconfigurationdataB MOVE.B WEORFMT(A0),D1 get EOR characteristics for Write Formatted$ MOVE.B IOSEOSW(A0),D2 get EOS char.7LEA.LTERMBUF(A5),A0‚A0<==terminationbufferpointer*?*ƒOnceagain,justasinthereadprocessor,theEORcharacters8*ƒmaybemultiplysetandaresoftwarepriorityencoded.>*ƒIfenabled,theCRcharacterwillbesentoutfirstfollowed1*ƒbytheLFcharacterandthentheEOScharacter.** MOVEQ #0,D0 reset EOS string byte counter+BTST.L#CRTERM,D1ƒisCRcharacterenabled?BJ EQ.SSENDTRM2„branchifno0MOVE.B#CR,(A0)+‚storeCRinterminationbufferADDQ.L#1,D0ˆbumpbytecount*3SENDTRM2BTST.L#LFTERM,D1ƒisLFcharacterenabled?BEQ.SSENDTRM4„branchifno?MOVE.B#LF,(A0)+‚yes,storeLFcharacterinterminationbufferADDQ.L#1,D0ˆbumpbytecount*;SENDTRM4BTST.L#EOSTERM,D1‚iswriteEOScharacterenabled?BEQ.SSENDTRM8„branchifno:MOVE.BD2,(A0)+ƒstoreEOScharacterinterminationbufferADDQ.L#1,D0ˆbumpcount*1SENDTRM5 MOVEQ #0,D2 initialize DMA transfer type SUB.LD0,A0‡setstartofbuffer*0*ˆSetupfordataxfer:‰A0<--terminatorstring*¦D0=ƒstringlength*¦D1=ƒEORoptions*¦D2=ƒDMAcommand*,BRAWRITD010†dotheterminatorstringwrite*(SENDTRM8TST.LD0‚anyEOSchar.tosend? BNE.S SENDTRM5*?SENDTRM9 BSETW #TERMINT,CSTQOFST(A6) set no interrupt expected!+MOVEQ‚#ISTAOK,D1setreturnstatustoO.K.)RTS„exitterminationcharacterprocessor  PAGE***ˆPROCESSOR:SendEOI*<*ˆPURPOSE:ƒSendsthelastcharacterofadata(OUT)transfer3*“withtheEOIlineTrue(usesTMS9914EOIcontrol)**SENDEOI:)BSRGETCNFIGgetpointertoconfig.data2MOVE.BWEORFMT(A0),D1‡getWriteFormattedoptions MOVE.W IOSOPT(A3),D0.AND.W#IOPIMG,D0ŒwasdataxferinImagemode?.BEQ.SSENDEOI2Žbr=NO,useFormattedoptions*.MOVE.BWEORIMG(A0),D1‡getWriteImageoptions*ASENDEOI2BTST#EOITERM,D1„doweneedtosendlastchar.withEOI?BEQ.SSENDEOI4Žbr=no,exit*-*ƒSendthelastdatabyteofthestring(DMA)*BMOVE.B#FEOI,AUXCMD(A1)…setTMS9914tosendEOIcoincidentw/data;MOVE.B#$FE,BCNTLSB(A1)…setupBCRto1'scompl.of1byteFMOVE.B#$FF,BCNTMSB(A1)…THEMARISSTILLSETFROMPREVIOUSXFER!!!!!!#MOVEQ#0,D2‘setupfordataoutput(BRAWRITD022godotheoutputoperation*LSENDEOI4 BSETW #TERMINT,CSTQOFST(A6) set no intrp expected flag for PROCMENU>BTSTW#CAC_S,BUSACTIV(A5)ƒNomoreoutputistotakeplace,so?BEQ.SSENDEOI5ŽifweareaController,takecontroloftheBUSHMOVE.B#TCA,AUXCMD(A1)†NOW!causeitwon'tbedoneatnormalintrptime*SENDEOI5 MOVEQ #ISTAOK,D1 RTS ‰PAGE*ˆPROCESSOR:Untalk‚(UNT)*:*ˆPURPOSE:TosendtheuniversalUNTALKcommandoutonthe*‘BUSwiththeATNlinetrue.*SENDUNT:&MOVE.B#UNT_CMD,D1‚setUntalkcommand!BRACOMOUT…sendoutcommandbyte **ˆPROCESSOR:Unlisten‚(UNL)*<*ˆPURPOSE:TosendtheuniversalUNLISTENcommandoutonthe*‘BUSwiththeATNlinetrue.*SENDUNL:(MOVE.B#UNL_CMD,D1‚setUnlistencommand!BRACOMOUT…sendoutcommandbyte *'*ˆPROCESSOR:ListenAddressGroup(LAG)*;*ˆPURPOSE:Tosendtheprimarylistenaddressofthedevice1*‘specifiedintheLUNparameteroftheIOSPBout#*‘ontheBUSwiththeATNlinetrue*SENDLAG:3BSRGETPADDR‚gettheprimaryaddressofthedevice/OR.B#$20,D1ˆconverttoprimarylistenaddress!BRACOMOUT…sendoutcommandbyte *%*ˆPROCESSOR:OtherTalkAddress(OTA)*9*ˆPURPOSE:Tosendtheprimarytalkaddressofthedevice1*‘specifiedintheLUNparameteroftheIOSPBout#*‘ontheBUSwiththeATNlinetrue*SENDOTA:K MOVE.B #TON0,AUXCMD(A1) UNTALK the GPIB, send aux command talk only (cs=0)3BSRGETPADDR‚gettheprimaryaddressofthedevice-OR.B#$40,D1ƒconverttoprimarytalkaddress!BRACOMOUT…sendoutcommandbyte ***ˆPROCESSOR:OtherSecondaryAddress(OSA)*9*ˆPURPOSE:Tosendthesecondaryaddressspecifiedinthe.*‘secondaryaddressparameteroftheIOSPBout$*‘ontheBUSwiththeATNlinetrue.*SENDOSA:5MOVE.BIOSSAD-1(A3),D1‚getdesiredsecondaryaddress AND.B#$1F,D1ƒmaskaddressbits8 OR.B #PPE_CMD,D1 set into secondary address group range!BRACOMOUT…sendoutcommandbyte *,*ˆPROCESSOR:ParallelPollUnconfigure(PPU)*:*ˆPURPOSE:Tosendtheuniversalparallelpollunconfigure1*‘commandoutontheBUSwiththeATNlinetrue.t*SENDPPU:ILEA.LCONFINFO(A5),A0‚A0<==starK tofconfigurationareaforalldevices*;*‚ResetthecurrentparallelpollconfigurationoftheBUS.*0MOVE.LCNFIGPTR(A0),A2‚A2<==cnfigptrforBUS6BSET.B#PPIS,IOSPOLC(A2)‚setParallelPollIdleState> MOVE.B #0,PARLPOLL(A1) clear the GPIBC parallel poll register#MOVE.B#PPU_CMD,D1‚setPPUcommand+BRACOMOUTƒsendthecommandoutontheBUS *'*ˆPROCESSOR:ParallelPollEnable(PPE)*:*ˆPURPOSE:Tosendparallelpollconfigurationinformation3*‘(PPPandSbitssetupinPPEparameterofIOSPB)*‘outontheBUS.*SENDPPE:1MOVE.BIOSSAD-1(A3),D1‚getPPconfigurationinfo"AND.B#$0F,D1†maskPPPandSbits*8*‚Settheparallelpollconfigurationregistertoactive *ˆandsetthenewconfiguration.*9BSRGETCNFIGƒA0<==ptrtoconfigurationareafordevice8MOVE.BD1,IOSPOLC(A0)‚saveindeviceconfigurationarea*3OR.B#PPE_CMD,D1„encodebitstomakeaPPEcommand+BRACOMOUT…sendoutcommandbytetodevice ***ˆPROCESSOR:ParallelPollConfigure(PPC)*8*ˆPURPOSE:Tosendtheuniversalparallelpollconfigure0*‘commandoutontheBUSwiththeATNlinetrue.*SENDPPC:*MOVE.B#PPC_CMD,D1‚setupthePPCcommand!BRACOMOUT…sendoutcommandbyte *(*ˆPROCESSOR:ParallelPollDisable(PPD)*6*ˆPURPOSE:Tosendtheuniversalparallelpolldisable0*‘commandoutontheBUSwiththeATNlinetrue.*SENDPPD:*MOVE.B#PPD_CMD,D1‚setupthePPDcommand!BRACOMOUT…sendoutcommandbyte *%*ˆPROCESSOR:SerialPollEnable(SPE)*3*ˆPURPOSE:Tosendtheuniversalserialpollenable0*‘commandoutontheBUSwiththeATNlinetrue.*SENDSPE:*MOVE.B#SPE_CMD,D1‚setuptheSPEcommand!BRACOMOUT…sendoutcommandbyte *&*ˆPROCESSOR:SerialPollDisable(SPD)*4*ˆPURPOSE:Tosendtheuniversalserialpolldisable0*‘commandoutontheBUSwiththeATNlinetrue.*SENDSPD:*MOVE.B#SPD_CMD,D1‚setuptheSPDcommand!BRACOMOUT…sendoutcommandbyte *$*ˆPROCESSOR:ClearAllDevices(DCL)*5*ˆPURPOSE:Tosendtheuniversaldeviceclearcommand(*‘outontheBUSwiththeATNlinetrue.*SENDDCL:*MOVE.B#DCL_CMD,D1‚setuptheDCLcommand!BRACOMOUT…sendoutcommandbyte * *ˆPROCESSOR:LocalLockout(LLO)*6*ˆPURPOSE:Tosendtheuniversallocallockoutcommand(*‘outontheBUSwiththeATNlinetrue.*SENDLLO:*MOVE.B#LLO_CMD,D1‚setuptheLLOcommand!BRACOMOUT…sendoutcommandbyte **ˆPROCESSOR:TakeControl(TCT)*5*ˆPURPOSE:Tosendtheaddressedtakecontrolcommand(*‘outontheBUSwiththeATNlinetrue.*SENDTCT:*MOVE.B#TCT_CMD,D1‚setuptheTCTcommand!BRACOMOUT…sendoutcommandbyte *)*ˆPROCESSOR:SelectiveDeviceClear(SDC)*7*ˆPURPOSE:Tosendtheaddressedselectivedeviceclear/*‘commandoutontheBUSwiththeATNlinetrue*‘toallcurrentlisteners.*SENDSDC:*MOVE.B#SDC_CMD,D1‚setuptheSDCcommand!BRACOMOUT…sendoutcommandbyte **ˆPROCESSOR:GoToLocal(GTL)*4*ˆPURPOSE:Tosendtheuniversalgotolocalcommand(*‘outontheBUSwiththeATNlinetrue.*SENDGTL:*MOVE.B#GTL_CMD,D1‚setuptheGTLcommand!BRACOMOUT…sendoutcommandbyte *(*ˆPROCESSOR:GroupExecuteTrigger(GET)*6*ˆPURPOSE:Tosendtheuniversalgroupexecutetrigger0*‘commandoutontheBUSwiththeATNlinetrue.*SENDGET:*MOVE.B#GET_CMD,D1‚setuptheGETcommand!BRACOMOUT…sendoutcommandbyte *)*ˆPROCESSOR:ReadSerialPollstatusbyte*0*ˆPURPOSE:ThisprocessorispartoftheCOND_SP)*‘(ConductSerialPoll)menu.Itspurpose+*‘istosetupforByte-Ininterrupt‚toget!*‘thestatusbytedesireddevice.*READSP:)BSRMTFIFO’cleartheFIFO(VME-300bug!)3MOVEM.LD0-D7/A0-A6,-(A7)ƒsaveregsonTrap0call1LEASP_TO(PC),A0ŒsetPATforserialpolltimeout"MOVE.L#1000,A1waitfor1second MOVEQ #0,D1EMOVE.BCCBISR(A5),D1ˆgetintrplevelfromhighbyteofCCBS.R.wordAND.B#$0F,D1maskoffgarbage)MOVE.LA5,D2K setCCBaddressasPATI.D.TR0$.RQPA,‘starttimerBRA.SREADSP1br=timergoing*$ KILL.DRIVER M300INT_ID,T0RQPA,A5,A4 !READSP1 MOVEM.L (A7)+,D0-D7/A0-A6/ BSETW #SPTIMER,BUSACTIV(A5) mark timer running4MOVE.B#LON1,AUXCMD(A1)…setuptoreadSPdatabyte3MOVE.B#GTS,AUXCMD(A1)†DropATNtolethimsendit#MOVEQ#ISTAOK,D1Œsetreturnstatus RTS  PAGE .*ˆSerialPollReadStatusByteTimeoutRoutine*=*ˆIfauserhasrequestedtheserialpollfunction,atimeout=*ˆerrorstatuswillbereturned.‚Elseifthetimeoutoccurred;*ˆasaresultofthedriverpollingadeviceinresponseto<*ˆanSRQinterrupt,theSerialPollstatusbyte(intheCCB)<*ˆwillbesettozeroandthecurrentdevicewillbeskipped*ˆinthepollingsequence.*+SP_TO:ƒMOVEM.LA3-A5,-(A7)‹saveimmed.regs‰MOVE.LD1,A5’setCCBpointer‰MOVE.LQTAIL(A5),A07‰CMPA.LQHEAD(A5),A0‹isthereanoperationinprogress?/‰BEQ.SSP_TO2’br=no,musthavebeencancelled9‰BCLRW#SPTIMER,BUSACTIV(A5)ƒwastimeralreadycancelled?‰BEQ.SSP_TO2’br=yes,ignore*1*ˆSetupregisterstolooklikeVME-300interrupt*"‰MOVE.LDCBQOFST(A0),A4ˆA4<--DCB#‰MOVE.LIPBQOFST(A0),A3ˆA3<--IOPB+‰MOVE.LCCBCHB(A5),A1ŠA1=hardwareaddress<‰MOVE.B#TCS,AUXCMD(A1)ˆtakecontrolofBUSnow,sincethere)‰MOVE.BDATAIO(A1),D1Šisnointrpcoming!)‰BTSTW#SRQPROG,BUSACTIV(A5)ƒSRQpolling?‰BNE.SSP_TO1’br=no,userI/O;‰BSETW#SRQFAIL,CSTQOFST(A0)ƒmarkSRQpollresponsefailure*SP_TO1ƒCLR.BSRQBYTE(A5)resetstatusbyte3‰BSRPROCMENU’andprocessasnormalstatusresponse'SP_TO2ƒMOVEM.L(A7)+,A3-A5‹restoreregs‰RTE*?*ˆRoutinetocancel‚thecurrentlyrunningSerialPollI/Otimer* KILLSPTO:5‰BCLRW#SPTIMER,BUSACTIV(A5)ƒcleartimerrunningflag3‰MOVEM.LD0-D7/A0-A6,-(A7)…saveregsonTrap0call.‰LEASP_TO(PC),A0Žsetupparmstocanceltimer‰SUBA.LA1,A1’interval‰MOVE.LA5,D2’setCCBI.D.1‰MOVE.BCCBISR(A5),D1Šgetintrplevelforrequest#‰AND.L#$0F,D1‘clearexcessgarbage(‰OR.L#$8000,D1options=cancelrequest‰TR0$.RQPA,“gocancel$‰BRA.SKILLSP1‘br=requestaccepted$‰KILL.DRIVERM300INT_ID,T0RQPA,A5,A4*.KILLSP1‚MOVEM.L(A7)+,D0-D7/A0-A6…restoreregs‰RTS  PAGE*1*ˆPROCESSOR:SendAuxiliaryCommandBufferString*4*ˆPURPOSE:Thisgeneralprocessorwillsimplyoutput-*‘whateverisintheusersauxiliarycommand+*‘stringbufferoutontheBUSwiththeATN *‘linetrue.* SENDAUXS:8BSRGETXFRAD‹getphysicalI/Oaddressforthisfunction,MOVE.LD6,A0‹A0<==startingbufferaddress1 MOVE.L D5,CMDCOUNT(A5) set command string length+MOVE.B(A0)+,D1Špreloadfirstcommandbyte?MOVE.LA0,CMDBFPTR(A5)‚setcommandbufferpointertonextbyteBRACOMCMDsendcommand  " TTL CLASS I MENU ITEM SUBROUTINES PAGE**‚TLPROC*&*ˆTALKER/LISTENERWRITE/READPROCESSOR*6*ˆThepurposeofthisroutineistodetermineifitis9*ˆO.K.toinitiatethecurrentRead/Writecommandatthis1*ˆtime.‚Ifnot,thecurrentoperationwillsetup%*ˆaTasklevelI/Ooperationpending.*.*’ENTER:‚D0.B=‚typeofoperation-Read/Write#*šA1=baseaddrofGPIBCregisters'*šA3=addressofIOCBforthisrequest*šA5=addressofCCB*:*’EXIT:‚IFCCthenO.K.toinitiateI/O(D0.b=don'care)*™ELSE(IFCSANDD1=0)2*œTHEN‚taskwaitingforcontrollertomakerequest$*™ELSE(IFCSANDD1.B=errorcode)*œTHENcommandisaborted* *’RegisterUsageƒ01234567 *¡D*R***¡A*TLPROC:5BTSTW#CAC_S,BUSACTIV(A5)„isBUSincontrollermode?+BNE.STLP20‘br=yes,O.K.toinitiateI/O*=BTSTW#BUSIOP,BUSACTIV(A5)ƒisthereINTRPlevelI/Opending?6BNE.STLP10‘br=yes,gocheckformatchingoperation*6MOVE.BD0,IOPEND(A5)ˆelsemarkTasklevelI/OpendingDMOVE.LMENUCPOS(A5),MENUNPOS(A5)‚backupmenupointertore-execute(MOVEQ#ISTAOK,D1Œsetreturncode=O.K. BRA.STLP40‘andexitwithC=1*>TLP10MOVE.BIOPEND(A5),D2ƒD2=INTRPlevelI/Opendingstatus MOVE.B D0,D11AND.BD2,D1‘D1=INTRL P^TASKI/Opendingstatus1BEQ.STLP30‘br=operationtypemismatch-error*/BTST#SECONDAR,D2‹secondaryaddressoperation?*BEQ.STLP20‘br=no,O.K.toinitiateI/O* MOVEQ #SECMASK,D3 MOVE.B IOSSAD-1(A3),D1-AND.BD3,D1‘D1=taskrequestedsec.address0AND.BD2,D3‘D3=INTRPlevelpendingsec.addr.CMP.BD1,D3‘aretheythesame?4BNE.STLP30‘br=no,gokilltaskrequestedcommand*,TLP20BSRMTFIFOO.K.toinit.I/O!LET'SGO'BNE.STLP40‘oops,hardwaremalfunction*6CLR.BIOPEND(A5)ŒclearINTRPlevelI/Opendingstatus/BCLRW#BUSIOP,BUSACTIV(A5)ƒandassociatedflag&MOVEQ#ISTAOK,D1ŒsetreturncodeO.K.ANDI#$FE,CCRclearCarrybit RTS*'TLP30MOVEQ#ISTAIRPI,D1…seterrorcode* TLP40ORI#$01,CCR‹setCarrybit RTS  PAGE* *ƒSETUPDMA*>*‡ThisroutineisusedbytheREADDATA,WRITDATA,andSENDTERM<*„processorstosetupthememoryaddressregister(MAR)andA*„thebytecountregister(BCR)ontheMVME300card.Thesesimply8*„setuptheDMAtransferregistersbutinitiatenoI/O.*-*ˆENTER:‚A1=baseaddressofGPIBCregisters,*A0=bufferaddresstoread/writeto/from."*D0=numberofbytestotransfer*!*ˆRegisterUsage:†01234567*šD‚P*šA‚P* SETUPDMA: MOVE.L D0,-(A7).NOT.WD0…convertbytecountto1'scompliment-MOVE.BD0,BCNTLSB(A1)‚saveLSBofbytecount LSR.W#8,D0‡getnexteigthbits-MOVE.BD0,BCNTMSB(A1)‚saveMSBofbytecount*#MOVE.LA0,D0†D0<==bufferaddressB*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< *ˆ4/24/84ƒbwn*8*ˆTheaddresswegetinD0istheaddressasseenbythe *ˆdriver.4*ˆIfweareusingdualportedram‚ontheVME/10,and5*ˆifthisaddressisinon-boardram,thenitmustbe;*ˆtranslatedtoanon-boardaddressastheMVME300seesit.1*ˆWedothisbyaddingtheRAM_SKEWoffsettothe%*ˆaddress,usingtheGO_OFF_BDmacro.* ‰GO_OFF_BDD0*>*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>%MOVE.BD0,MARLSB(A1)‚saveLSBofMAR LSR.L#8,D0„getnexteightbits%MOVE.BD0,MARISB(A1)‚saveISBofMAR LSR.L#8,D0„getnexteightbits%MOVE.BD0,MARMSB(A1)‚saveMSBofMAR MOVE.L (A7)+,D0 RTS…exit PAGE**‚COMOUT*7*ˆSincecommandsbytes(ATN=true)cannotbesentout=*„inDMAmode,thisprocessorwillsendoutabyteatatime.'*„ItassumesthattheATNlineistrue.*-*ˆENTER:„A1=baseaddressofGPIBCregisters*’A5=addressofCCB *’D1.B=commandbytetobesent*‘ zE ƒD ‹< “: ›8 £: «- ³5 »4 Ã. Ë1 ÓJ ÛM ã? ë:!*ˆRegisterUsage:„01234567*˜D„P‡P*˜A„P*COMOUT:FMOVE.L#1,CMDCOUNT(A5)ƒsetcommandcountto1forinterruptprocessor*C*‚EntryPointusedbytheCommandOut/DataOutandtheCommandOut/*‚DataInprocessors**ƒspaceintheCCBfornewblockandstoringnewconfiguration=*ƒinformation.‚Inactuality,thespaceforallconfigurations<*ƒattachedtothisCCBhavealreadybeenallocatedanditis+*ƒjustamatterofadjustingsomepointers.=*‡SinceIOIisinitiatingthiscall,A1looksliketheuser's?*ƒbufferbutisreallyapointertothedefaultconfigurationof *ƒtheDCB.;*‡TheBUSactivityflag(BUSACTV)issetupatthistimeto$*ƒindicateitsinitialstartupmode.*+MOVE.LA2,-(A7)‚saveaddressofGPIBCregs6LEA.LCONFINFO(A5),A2‚configuration/DCBpointertable MOVEQ #0,D0'MOVE.BDCBCDV(A4),D0‚getdevicenumber"ASL.L#3,D0‡calculatetableindex@MOVE.LNEXTCNFG(A5),A0‚A0<==nextavailableconfigurationarea=MOVE.LA0,CNFIGPTR(A2,D0.L)‚setconfigurationptrfordevice3MOVE.LA4,DVDCBPTR(A2,D0.L)„setDCBptrfordevice*I*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*8*ˆ10/16/84‚SETSERVICEREQUESTWAITINGFLAGTOCATCHANY2*’SRQ'SPENDINGONTHEBUSATTIMEOFBOOT/STARTUP6*’SINCETHATSRQINTERRUPTWILLBELOSTINTHETMS9914$*’ATTIMEOFCHANNELINITIALIZATION.*‰BSETW…#SRQWAIT,BUSACTIV(A5)*I*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>JMOVE.WIOSVARL+DCBDEV(A4),D0„D0<==lengthofvariableconfigurationarea BTST#0,D0…oddnumberofbytes?BEQ.SCDEVA„branchifnoBADDQ#1,D0…allocateinevenbyamountsforaddressingconsistency*KCDEVALEA.LIOSILN(A0,D0.W),A2‚calculatetotallengthofconfigurationareaDMOVE.LA2,NEXTCNFG(A5)ƒupdatenextavailableconfigurationareaptr.MOVE.L(A7)+,A2‚restoreaddressofGPIBCregs*?*ƒThenextcheckwilldetermineiftheGPIBisbeingconfigured4*ƒwithsystemcontrollercapabilities.‚Ifthisisso=*ƒthenthebusinterfacewilltakecontroloftheBUSatthis?*ƒpoint.‚OtherwiseitsmodewillbesetaccordingtothedeviceB*ƒattributesword(IOSATW)passedintheconfigurationdatablock.E*ƒIftheBUSisconfiguredforTalker/Listeneronly,NOOTHERDEVICESI*ƒWILLBEALLOWEDTOBECONFIGUREDATSYSTEMINTIALIZATIONTIME.‚AttemptsG*ƒtoaccessthesedevicesatalatertimewillcauseaDEVICENOTREADY(*ƒerrorconditiontobereturnedbyIOS.*&TST.BDCBCDV(A4)”configuringtheBUS?BNE.SCOMNCNFG”branchifno MOVE.L A1,-(A7)9BSRRESETIO—correctforintrpstoanun-attachedchannel MOVE.L (A7)+,A1ABTSTW#IOASCTC,IOSATW(A1)‰isBUSbeingconfig.withS.C.capab?BEQ.SCOMNCNFG•branchifno*2*ˆElsetestinterfaceforcompatibleconfiguration*:*ˆNOTE!!!‚Thedevicewillbestrippedofsystemcontroller8*ˆcapabilitieswithoutnotifyingthecalleronthefirst9*ˆtimeconfigurationonly.Thisallowsasuccessfulfirst:*ˆtimeconfigurationandwillnotmarkthisdeviceOFFLINE*ˆuponreturn.*.TST.BADDRREG(A2)‘isMVME300cardinSCmode?BPL.SCDEN VB—branchifyes9BCLRW#IOASCTC,IOSATW(A1)‰donotallowS.C.capabilities BRA.S COMNCNFG*>*ˆSoftware&hardwareS.C.configurationsagree,TAKECONTROL!*CDEVB MOVE.L A1,-(A7)#MOVE.LA2,A1•setupA1forSENDIFC&BSRSENDIFC–TakecontrolofBUS,NOW! MOVE.L (A7)+,A1*/*‚Continuewithnormalconfigurationprocessing*"*ˆCheckforunsupportedattributes*MCOMNCNFGMOVE.W#CECUAP,D2ƒpreloadunsupportedattribute/parametererrorcode*3MOVE.W#NVALBATM,D0ƒgetmaskofinvalidattributes8AND.WIOSATM(A1),D0ƒtryingtochangeinvalidattribute?"BNECNFGERR†branchifyes(error)*1MOVE.W#NVALBPRM,D0‚getmaskofvalidparameters8AND.WIOSPRM(A1),D0‚tryingtochangeinvalidparameter?"BNECNFGERR…branchifyes(error)*9*‚Settheattributesintotheuser'sconfigurationbuffer"*‚thathedoesnotwanttochange.*0MOVE.WIOSATM(A1),D0‚D0<==hisattributesmask;AND.WD0,IOSATW(A1)ƒZeroouttheattributesofhisthathe9NOT.WD0Ždoesn'twanttochange,zeroouttheattributes=AND.WIOSATW(A0),D0ƒofminethathedoeswanttochange,and.OR.WD0,IOSATW(A1)„combinetheminhisspace.* *‚Dothesamefortheparameters*3COMN010MOVEQ#0,D0ƒbesureupper16bitsareclearKMOVE.WIOSPRM(A1),D0‚D0<==maskofparametersthathedoeswanttochange7MOVEM.LA0-A2,-(A7)„saveconfigurationblockaddresses4LEA.LIOSREC(A0),A0„A0<==addrof1stparaminCCB@LEA.LIOSREC(A1),A1„A1<==addrof1stparaminuserdatablock2LEA.LPAR_SIZ,A2…A2<==addroftableparamsizes*NXTPARM MOVEQ #0,D11MOVE.B(A2)+,D1‚get#ofbytesinnextparameter%BEQ.SCHKPARM„branchifendoftable*+LSR.W#1,D0…wanttochangenextparameter?BCS.SINCPARMƒbranchifyesASUBQ#1,D1†doesnotwanttochangeitsomoveparameterfromCCB2*totheuser'sbuffersothathewillhaveacopy)MOVPARMMOVE.B(A0)+,(A1)+‚movenextbyte)DBRAD1,MOVPARMƒuntilbytecountexpires'BRA.SNXTPARMƒcheckthenextparameter*?INCPARMADD.LD1,A0‚hedoeswanttochangeitsoleavehiscopy4ADD.LD1,A1‰aloneandjustgotothenextparameter BRA NXTPARM*>*ƒChecktoseeifhe'sdoinganyconfigurationthatisillegal*:CHKPARMMOVEM.L(A7)+,A0-A2‚restoreconfigurationpointers=MOVE.W#CECIPA,D2‚preloadinvalidprimaryaddresserrorcode*2MOVE.BIOSPRMA(A1),D0‚getcurrentprimaryaddress0CMP.B#$1E,D0…valid?(MUSTBE0<=ADDR.<=$1E)BHICNFGERR…branch=‚error*"TST.BDCBCDV(A4)‚isthisthebus?BNE.SCHKPRM2…branchifno*=*‚Checktoseeiftheprimaryaddressconfiguredmatcheswhat-*‚issetontheswitchesoftheMVME300card.*CMOVE.BADDRREG(A2),D1ƒD1<==primaryaddrreadfromboardswitches+NOT.BD1‰usecomplementofswitchregister AND.B#$1F,D1„maskprimaryaddr?CMP.B#$1F,D1„isswitchregister=$1F(INVALIDGPIBADDRESS!)CBNE.SCHKPRM1„BR=no,usehardwareswitchregisterasBUSaddress)MOVE.BD0,D1…elseuseSYSGENBUSaddress*@CHKPRM1MOVE.BD1,ADDRREG(A2)‚setTMS9914Aprimaryaddrregister, MOVE.B D1,IOSPRMA(A1) update config. buffer9BTSTW#IOSPOLCB,IOSPRM(A1)‚localppconfiguringthebus?BEQ.SCHKPRM2ƒbranchifno*=MOVE.BIOSPOLC(A1),D0‚D0<==newparallelpollconfiguration/BMI.SCHKPRM2ƒbr=noconfigurationsetforPP;AND.B#$1F,D0ƒmaskPPP,SandIbits,BUSisinPPSSstate+MOVE.BD0,IOSPOLC(A1)‚saveinusersbuffer+BSRSETPPREG‚setupparallelpollregister*JCHKPRM2ANDI.L#$7FFFFFFF,IOSSAMR(A1)ƒmaskoutbit31ofboththeReadand*‚Theonlythingthatremainsnowissec.addr.validationandD*‚toupdatetheTMS9914AinterruptmaskregistertoenablesecondaryI*‚addressingifvalidsecondaryaddresseswerenewlydefinedfortheBUS.*8OKCNFGTST.LIOSSAMR(A1)‚anysec.Readaddr'sspecified?SNED0“D0=Yes/No3TST.LIOSSAMW(A1)ˆanysec.Writeaddr'sspecified?SNED1“D1=Yes/No$MOVEQ#CECSADR,D2ˆpreseterrorcode$EOR.BD0,D1ŽBothmustbespecified! BNECNFGERRŽelseitisanerror*" TST.B DCBCDV(A4) is this the BUS? BNE.S OKCNFG3 br = noBMOVE.WTMSMASK(A5),D0‚setthecurrentstateofthe9914Amaskreg5 BSET #APTBIT,D0 set up to enable secondary adressing0 TST.L IOSSAMR(A1) any sec read addresses valid?BNE.SOKCNFG2ƒbranchifyes:BCLR#APTBIT,D0ƒelsedisablesecondaryaddressinterrupts5OKCNFG2MOVE.WD0,TMSMASK(A5)‚saveinmaskstatusreg8 MOVEP.W D0,INTR0(A2) update TMS9914A interrupt mask reg*OKCNFG3 MOVEQ #0,D0FMOVE.WIOSVARL+DCBDEV(A4),D0„D0<==lengthofvariableparameterarea@ADD.L#(IOSILN-IOSATW)/2-1,D0ƒaddinrestofconfigurationarea*MOVEM.LA0/A1,-(A7)ƒsavestartofbuffers5LEA.LIOSATW(A0),A0‚setpointerstostartofbuffers LEA.L IOSATW(A1),A1*?OKCNFG5MOVE.W(A1)+,(A0)+‚copyhisvalidatedbuffertotheCCB#DBRAD0,OKCNFG5„configurationarea*5MOVEM.L(A7)+,A0/A1ƒrestorestartofbufferpointers.EXGA0,A1‰setA0=hisbuffer,A1=CCBbuffer5BSR.SSTATYP1…setupstatusandconfigurationheaderFMOVE.B#1,DCBCCF(A4)ƒsetflagindicatingthataCONFIGUREoraCHANGE *®DEFAULTCONFIGURATIONwasdone*A*ˆThistestisperformedatthistimesoaninitialconfigurationC*ˆwilloccurevenifthereisaS.C.switch/sysgenincompatibility.*-TST.BDCBCDV(A4)‚areweconfiguringtheBUS?#BNE.SOKCNFG7‚branch=notthebus*2EXGA0,A1ƒsetA0=CCBbufferandA1=hisbuffer4MOVEQ‚#CECSCE,D2ƒpreloadinvalidS.C.configurationBBTSTW#IOASCTC,IOSATW(A0)‚areweconfiguringforS.C.capability?6 BEQ.S OKCNFG7 branch = no, else test hardware config.9 TST.B ADDRREG(A2) is the MVME300 card switch in SC mode?'BMI.SCNFGERR‚branch=no,gotoerror*0OKCNFG7MOVEQ‚#ISTAOK,D1‚setreturnstatustoOK RTSƒexit*CCNFGERR MOVE.B D2,IOSCEC(A1) save specific configuration error codeBMOVEQ‚#ISTACNF,D1‚setinvalidconfigurationfordeviceerrorcode(RTSƒexitcommonconfigurationprocessor  TTL COMMON SUBROUTINES PAGE**‚STATYP*A*ˆThisroutineisusedbyCONFIGURE,CHANGEDEFAULTCONFIGURATION;*…andREQUESTSTATUSprocessorstostorethecurrentstatus8*…informationinthestandardconfigurationareaheader.*,*ˆENTER:‚A2=baseaddressofGPIBregisters*A4=addressofDCB*A5=addressofCCB*5*ˆEXIT:ƒA0=addressofconfigurationareafordevice*!*‹RegisterUsage:ƒ01234567*›D* *›AR‡PP*STATYP:0BSR.SGETCNFIGƒA0<==currentconfigurationptr*STATYP1: MOVEQ #0,D0"TST.BDCBCDV(A4)‰isthistheBUS?BNE.SSTATYP2Œbr=no'MOVE.BADDRSTAT(A2),D0ƒgetGPIBstatusAND.B#$FE,D0Œmaskoutgarbage*6STATYP2 MOVE.B D0,IOSDST(A0) put dev. status in buffer9 MOVE.B DCBDEV+IOSCTP(A4),IOSCTP(A0) set the channel type8 MOVE.B DCBDEV+IOSDTP(A4),IOSDTP(A0) set the device type/ MOVE.B #IODGPIB,IOSDRC(A0) set the driver code RTSƒexit  PAGE* *„SETPPREG*:*ˆThissubroutinewillsetorclearthedesiredbitofthe?*…parallelpollregisterforwhenaparallelpollisperformed.A*…IfboththeIndividualStatusbitandtheSensebitsareequal,>*…thebitspecifiedwillbesetintheparallelpollregister.8*…otherwisetheO parallelpollregisterwouldbecleared.*;*ˆThePPregwillnotbesetifthesystemisinPPISstate.**,*ˆENTER:‚A0=pointertoconfigurationtable*A5=addressofCCB**ˆEXIT:ƒnoerrorsreturn*!*‹RegisterUsage:ƒ01234567*›D*ƒ**›AƒP* SETPPREG:!MOVE.LA1,-(A7)‚Saveenvironment MOVEQ #0,D23 MOVE.B IOSPOLC(A0),D0 get current PP configuration3BMI.SSETPR025ˆbr=InPPISstate,don'tsetPPreg'BTST#PPSENSE,D0‚isthesensebitset?BNE.SSETPR020‚branchifyes*:*‚Thesensebitisequaltozero,sotheindividualstatus8*‚mustalsobezerotosettheparallelpollstatusto1*2BTST#INDIVST,D0‚istheindividualstatusbitsetBNE.SSETPR015ƒno*$SETPR010AND.L#7,D0‚maskbitnumber'BSETD0,D2‚settoparallelpollstatus*6SETPR015MOVE.LCCBCHB(A5),A1‚A1<==ptrtoGPIBCregs:MOVE.BD2,PARLPOLL(A1)‚storeresultsinParallelpollreg,SETPR025‚MOVE.L(A7)+,A1ƒrestoreenvironment RTS*:*‚Thesensebithasbeendeterminethatitisequaltoone*7SETPR020BTST#INDIVST,D0‚isindividualstatusbitset?BNE.SSETPR010„branchifyesBRA.SSETPR015„no,exit PAGE* *ƒGETCNFIG*5*ˆGetapointertothecurrentconfigurationareafor*…thedesireddevice.**ˆENTER:‚A4=addressofDCB*A5=addressofCCB*5*ˆEXIT:ƒA0=addressofconfigurationareafordevice*!*‹RegisterUsage:ƒ01234567*›D* *›AR‡PP* GETCNFIG: MOVEQ #0,D0IOCB*'*ˆONEXIT:‚D2.WISTABLEOFFSET(INDEX)+*’D1.B&=OPERATIONSTATUS(0=O.K)*8*‚FindthefunctioninthetableofvalidGPIBfunctions*GETCMDP:!ˆMOVEM.LA0/D0/D6,-(A7)saveregs5MOVE.W#NUMCMDS-1,D0ƒnumberofvalidGPIBcommands-14LEA.LIOSCMDTB(PC),A0ƒsetptrtoGPIBcommandtable1MOVE.WIOSFCT(A3),D6ƒpickupfunctionfromIOSPB8MOVEQ‚#ISTAIF,D1ƒsetinvalidcommanderrorjustincase*&GETCMD50CMP.W(A0)+,D6ƒfoundcommand?.DBEQD0,GETCMD50ƒbranchifno,looksomemore*,BNE.SGETCMDX„exitwitherror,endoftable4MOVE.W#NUMCMDS-1,D2ƒcalculaterelativetableindexSUB.WD0,D2‚D2<==tableindex"ASL.W#1,D2‚Calculatewordoffset*0MOVEQ‚#ISTAOK,D1setprocessO.K.returnstatus*GETCMDX TST.B D1 set return condition code$ MOVEM.L (A7)+,A0/D0/D6 restore regs RTS* 6 TTL GPIB DRIVER - COMMON SUBROUTINES (QUEUE HANDLING) PAGE**‚POPGPIBQUEUEENTRY*6*ˆIfI/Oisabortedoranoperationiscompleted,this9*…routinewillpopthatoperationfromtheGPIBqueueand9*…updatethenecessaryqueuepointers.Itisassumedthat:*…thecallerhaspreviouslyinhibitedallinterruptssince*…thisiscriticalprocessing.**’ENTER:ƒA5-addressofCCB*#*’EXIT:ƒIF„THEN‚queueisempty)*œELSE‚queuestillhasatleastoneentry*!*ŽRegisterUsage:ƒ01234567*žD *žA**‡P* POPGPIBQ:1LEA.LGPIBQEND(A5),A0‚A0<==ptrtoendofqueue.MOVE.LQTAIL(A5),A1„getcurrentO queuepointer2CMPA.LQHEAD(A5),A1„isthereanentrytoPOPoff?,BEQ.SPOPG15ŒBR=no,exitwithproper?ADDA.L#GPIBQLEN,A1„advancepointerbylengthofaqueueentryCMPA.LA0,A1…atendofqueue?BNE.SPOPG10ƒno*%* time to wrap around to top of queue*5LEA.LGPIBQ(A5),A1…setqueuepointertotopofqueue*APOPG10MOVE.LA1,QTAIL(A5)ƒupdatecurrentoperationqueuepointer„THENƒnoerrors*•ELSE„queueisfull*!*RegisterUsage:ƒ01234567 * D*‡PPPP* A*PƒPPPP* PSHGPIBQ:!MOVE.LA1,-(A7)ƒsaveenvironment4LEA.LGPIBQEND(A5),A1„A1<==endofGPIBqueuearea4MOVE.LQHEAD(A5),A0†A0<==nextavailablequeueptr*CLR.W‚CSTQOFST(A0)†setentrystatustoOK+MOVE.LA4,DCBQOFST(A0)ƒsaveaddressofDCB6MOVE.LA3,IPBQOFST(A0)ƒsavephysicaladdressofIOSPB?MOVE.LD7,PBPAOFST(A0)ƒsavephysicaladdressofprimarybufferIMOVE.LD6,SBPAOFST(A0)ƒsavephysicaladdressofsecondary/config.buffer2MOVE.WD4,PBLNOFST(A0)ƒsaveprimarybufferlength4MOVE.WD5,SBLNOFST(A0)ƒsavesecondarybufferlength;ADDA.L#GPIBQLEN,A0„incrementbylengthofonequeueentry"CMPA.LA1,A0…timetowraparound?BNE.SPSHQ010„branchifno*0LEA.LGPIBQ(A5),A0‚setptrtotopofqueuearea**PSHQ010CMPA.LQTAIL(A5),A0‚isqueuefull?5BEQ.SPSHQRTN‚yes,butthisshouldnothavehappened4 MOVE.L A0,QHEAD(A5) update next available queue ptr4MOVEQ#1,D0‚setconditioncodeforO.K.return*PSHQRTNMOVE.L(A7)+,A1ƒrestore RTSA TTL GPIB DRIVER - COMMON SUBROUTINES (VALIDATE OPERATIONAL MODE) PAGE**‚VALIDATEOPERATIONALMODE*9*ˆThisroutinewillbecalledatthepointwhenacommand:*ˆisabouttobescheduledforI/Oinitiation.Thepurpose;*ˆistodetermineiftheBUSisinthepropermodeforthis:*ˆcommandandtodetermineiftheBUSordevice(depending:*ˆonwhothiscommandisdirectedto)hasthecapabilities3*ˆ(ifanyarenecessary)toperformthisoperation.*3*’ENTER:‚A3=addressofIOSPBforcurrentfunction*šA4=addressoftheDCB*šA5=addressoftheCCB%*šD2.W=indexofcommandinVALPARTB*NNNNN