IMD 1.17: 11/11/2014 16:18:11 82VKXBVERDOS C* VERSADOS/RMS68K OBJECT 4.4 SN=44880 PHE8520 This is BT19 from another copy of v4.4 object 19 of 22  BT19\82VKXBVERDOS 0420¿5-‚TIMEFLAG(A5)‚inFINDDENS#*’(shouldhavebeenoffsetfromA5)%*ˆ4/4/84„Newboardwithenhancements:4*’(1)Candisableandenableinterruptsattheboard+*–levelbywritingintotheDSCMDregister.***–Usenewmacros,ENABLMTAandINHIBMTAto'*–turntheboardinterruptoninINTRTN0*–andtoturntheboardinterruptoffwhenabout*–togiveacommand.*1*–ReplaceINHIBwhichmasksallinterruptsatthe1*–wholeinterruptlevelwithINHIBMTA,whichonly"*–affectsinterruptsattheboard.*4*–Theonlyexceptioniswhenwearemessingwiththe-*–IOQUEUEinthecommandhandlerandMTADONE.*–Whyisthat,youask?3*–IhopetofindoutwhytheSASIdoesitthisway.*6*’(2)Afterreadingaharderror,areadofthestatus2*–registerwillcleartheinterruptsothereisno*–needtostopthetape.1*–Fortestingpurposes,fornow,iftheinterrupt1*–doesnotgoaway,inoneread,wewillstopthe*–tapeasbefore.*4*’(3)AninterruptisgeneratedwhenDNBSYgetsset.1*–Bit1intheSTAT2registercannowmeanoneof'*–3things:DNBSY,FNBSY,andfilemark.>(40089@=HpPMX9`8hGp;x=€;ˆFA˜B 7¨?°9¸9À9ÈdÐIØBà:èAðAø?Y@ 1*–ForaDNBSYwejustcontinueasifnointerrupt*–ofthattypewerereceived.**ˆ4/12/84ƒBugfix:4*’A1wasnotgettingsetupproperlyforabranchto*’PROCQUEfromMTADONE.6*’Nowweputtheaddressofthedrive'svariableblock*’intoA1beforewebranch.*.*’EndoftapehandlingwasnotrightinMTINT.*’EliminatedaBRA‚MTINT3.*.*’Checkforendoftapeonforwardcommandand6*’beginningoftapeonreversacommandwasnotcorrect*’inPROCQUE(STAT1vs.STAT2)*A*ˆ5/4/84„Sometimeswhenablanktapeismountedonthetransport,2*’wedecideerroneouslythatthetransportdensity *’cannotbechangedinsoftware.3*’Don'tknowatthispointwhythisseemstooccur,/*’possiblysomethingtodowiththetransport?.*’Anyway,don'twanttolockouttheuserfrom0*’selectingatransportdensityforawritefrom.*’loadpoint,sochangethelogicinSELECT2to*’ignoretheCNGDENSflag.*4*’UseBRanchshortwhereverpossibleandaddapatch*’areaattheend.*8*ˆ4/7/84„ReplaceSELECT2callswithSELECTcalls.‚Modify *’SELECT.*5*ˆ5/22/84ƒRewritetheDOWRITEroutineusingWHILE-DO.2*’Addaperiodicactivationcalltotimeoutinthe5*’driverifDOREADtakestoolong.‚Wedothisbecause6*’IOSsendsusatimeoutfortheIOSRTOvalueandthis9*’mustmakedofornotonlyread,butrewind,search,and:*’everythingbutwrite.Wewantashortreadtimeoutbuta1*’longrewindtimeoutsowemustdoitourselves.4*’Thisrequireschangestothe9995..IOE.EQfileand*’anewsysgentotest.*<*ˆ6/15/84ƒIfuserasksforatimeoutwitha0interval,just*’treatasnotimeout.:*’Afteracommandhascompleted,inhibitinterruptsatthe8*’boardandenableinterruptsatthesystemlevel(lower0*’maskby1)sothatwedon'ttieupthesystem.*<*ˆ9/18/84ƒFoundaproblemwhiletestingonVM03.‚Continually3*’gettingtimedoutduringreads.‚Timingdependent.3*’TheproblemwasIwasreadingSTAT1asecondtime4*’intheinterruptserviceroutine,andtherewasan<*’interruptpendingthatgotclearedbutwasneverserviced.*5*’Itispossibleforthefollowingsequencetooccur:8*’HALFFULLinterruptoccurs,ReadSTAT2,‚FNBSYinterrupt4*’occurs,readSTAT1.‚Inthiscasewewillnotgeta*’FNBSYinterrupt.8*’ThereforewhenitistimetocheckforFNBSY,readthe6*’bit4inSTAT1todecideifitisaFNBSYinsteadof*’thebit1inSTAT2.*’ChangesmadeinMTINT.*;*ˆ12/04/84‚Ontapedrivesrunningat100ipsontheVME/10,5*’theREAD2Kroutinewasnotgettingbytesoutofthe0*’FIFOfastenough.‚Speededuptheprimaryloop.1*’Thisreducedthetimebetween4bytereadsfrom4*’25.6microsecondstoabout11microseconds,which*’didthetrick.*7*’OntapedrivesthatdonotconformtothePERTECspec6*’forwhichtheMVME435boardwasdesigned,readingin,*’directmodecorruptedbytesontheVME/10.4*’Asaworkaround,thedrivernowreadsinbuffered4*’modewhentheuserspecifiesabuffersizeof40962*’bytesorless.‚I'mnotsurewhy,butonthetape4*’drivesIusedfortesting,therewillbemorethan6*’4096bytesreadfromtheMVME435whenthetapeblock7*’sizeislargerthan4096,evenwhenwearereadingin-*’bufferedmode.‚Thisisagoodfeature,asa2*’bufferoverflowmessagewillalerttheuserthat6*’theblocksizeonthetapeisindeedlargerthanhis;*’4096bytebuffer.Butmostlyweexpecttheuserknowsthe%*’sizeofthetapeblocksbeingread.*=*ˆ12/7/84ƒWhenauserasksfor0readtriesor0writetries,&*’thedrivershouldchangethe0to1.9*’ThatwasnotbeingdoneintherightplaceinCONFGCOM.*I**************************************************************************(*ˆMODULESCALLEDINTHEMAGTAPEDRIVER:*H*--------------------ƒINITIALIZATIONƒ-----------------------------------*<*INITIAL‚EQU‡*‡InitializesthedevicedependentpartofCCB$*œInitializesMVME435andtapedrive*K*--------------------------------------------------------------------------* H*--------------------ƒCOMMANDSERVICE‚----------------------------------**6*COMMANDSEQU‡*‡DispatchescommandsreceivedfromCMR**STATCMD‚EQU‡*‡Statuscommand.*STATCONFEQU‡*‡Updatesfirst4bytesofIOCB!*DFCONFG‚EQU‡*‡Defaultconfigure*CONFG„EQU‡*‡Configurecommand5*CONFGCOMEQU‡*‡Executescommonconfigurationchores**?*CONERROREQU‡*‡Errorexitforconfigureanddefaultconfigure*1*RDWRTCMDEQU‡*‡Entryforreadandwritecommand@*COMMCMD‚EQU‡*‡EntryforI/Ocommandsotherthanread,write,or*œconfigure&mount2*CONFG2ƒEQU‡*‡Entrypointforconfigureandmount *HALTCMD‚EQU‡*‡HaltI/Ocommand2*LOGPHYƒEQU‡*‡Convertlogicaltophysicaladdress***HALTEXITEQU‡*‡ExitforhaltI/Ocommand$*CMDEXIT‚EQU‡*‡Commandscommonexit;*CMDEXIT1“Entrypointforcommandscompletedwithouterror>*CMDEXIT2EQU‡*‡Entrypointforcommandscompletedwitherror9*CMDEXIT3EQU‡*‡Entrypointforcommandstobecompleted*œunderinterruptcontrol*%*QEVENTT”QueuesI/Ocompletionevent* *EXECREQ‚EQU‡*‡Doestrap0call *KILL_IT‚EQU‡*‡Killsthesystem*&*CMDSWIT‚EQU‡*‡TableusedinCOMMANDS'*CONFGLENEQU‡*‡TableusedinCONFGCOM*K*--------------------------------------------------------------------------*F*-------------------„INTERRUPTSERVICEƒ-------------------------------*%*INTERUPTEQU‡*‡Interpretsinterrupt+*MTINT„EQU‡*‡Dispatchesmagtapeinterrupt***PROCQUE‚EQU‡*‡Processesnextqueueentry'*SELECTƒEQU‡*‡Selectspropertransport-*œRe-selectstransportwithrequesteddensity*œforwritefromloadpoint**DOWRITE‚EQU‡*‡Writetotape<*WRITE2K”Transfer2KbytesfromFIFOtomemory(directmode)3*WRITDATAEQU‡*‡TransferbytesfromFIFOtomemory*>*DOCONFG‚EQU‡*‡Dotheconfigureandmount(interruptcontrol)&*FINDDENSEQU‡*‡Findthetapedensity1*SET_TIME“Dotrap0callforperiodicactivation*œduringFINDDENScommand.2*WAKEUP•Routinethatisactivatedduringperiodic'*œactivationwakeupcallfromFINDDENS.;*WAKEUP2”RoutineforwakeupcallsfromDOREAD,SPACE,ERASE*œSEARCH,andDOREWIND*+*DORDFWD‚EQU‡*‡Dothereadforwardcommand.*READ2K•Transfer2KbytesfromFIFOtomemory*ž(directmode)3*READDATAEQU‡*‡Transferbytesfrom‚FIFOtomemory+*žbufferedmode/endofblockindirectmode*;*STOPTAPE“Afterresetformattercommand,waitforthetape2*žtostop,cleartheformatternotbusyinterrupt.**&*DOREWINDEQU‡*‡Dotherewindcommand*;*DOSFMFWDEQU‡*‡Dothesearchforwardforfilemarkcommand;*DOSFMREVEQU‡*‡Dothesearchreverseforfilemarkcommand+*SEARCH•Commonroutineforsearchfilemark*,*DOSPFWDEQU‡*ˆDothespaceforwardcommand,*DOSPREVEQU‡*ˆDothespacereversecommand2*SPACE–Commonroutineforspaceforward&reverse*-*DOWRTFM‚EQU‡*‡Dothewritefilemarkcommand$*DOERASE‚EQU‡*‡Dotheerasecommand:*FM_ERAS_COMMCommonroutineforeraseandwritefilemark*;*MTADONE‚EQU‡*‡Completecommandprocessingunderinterrupt *œcontrol%*QEVENTI”QueuesI/Ocompletionevent*3*CKRDY–Seeifthetransportisready.Ifnotready,*œimmediately,delayforawhileuntilitis*œorwehaverunoutoftime.*#*IDLELOOPEQU‡*‡Waitforacommand*%*OPTABLE‚EQU‡*‡TableusedinPROCQUE*TRTABLE”TableusedinSELECT*I*------------------------------------------------------------------------F**********************************************************************‰PAGEI***************************************************************************ˆMAGTAPE.MACROS.SA*J*************************************************************************** *ˆMacrosforthemagtapedriver*J******************************************************************************A*<<<<<<<<<<<<<<<<<< COMMENTED OUT 12/2/83 >>>>>>>>>>>>>>>>>>>>>>>*<*ˆItwasdiscoveredthatgettingreadytakessometransports:*ˆlongerthanothers,soweneededatimeouttotestready (*ˆafteradelayofseveralmilliseconds. *ˆAsubroutinedoesthejobnow.****ƒCKRDY„MACRO**?*ˆPutthenotreadyerrorcodeintoD1,andcheckthereadybit=*ˆoftheSTAT1register.‚Ifthetransportisnotready,goto *ˆMTADONE.*****†MOVE.B„#ISTANR,D1***†BTST†#READYB,STAT1(A0)***†BEQ.S‡MTADONE***†ENDM*** CKEOT„MACRO**<*ˆPuttheendofvolume(endoftape)errorcodeintoD1and2*ˆchecktheendoftapebitoftheSTAT1register.**ˆIfweareatendoftape,gotoMTADONE.**‰MOVE.B„#ISTAEOV,D1‰BTST†#EOTB,STAT1(A0)‰BNE.L…MTADONE‰ENDM*** INHIB„MACRO**"*ˆInhibitinterruptsatourlevel.**‰MOVE.W„CCBISR(A5),SR‰ENDM7*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *ˆbwn‡4/4/84*INHIBMTA MACRO*"*ˆInhibitinterruptsattheboard.**‰MOVE.B„#DISABLCD,DSCMD(A0)‰ENDM*/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%* ENABL„MACRO**2*ˆEnableinterruptsbyloweringmaskbyonelevel.**‰MOVE.W„CCBSR(A5),SR‰ENDM*D*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *ˆbwn‡4/4/84*'*ˆEnableinterruptsattheboardlevel.**ENABLMTA MACRO**‰MOVE.B„#ENABLECD,DSCMD(A0)‰ENDM**F*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%**8*ˆCheckfilemarkandifafilemarkwasdetected,putthe)*ˆISTAEOFmessageinD1andgotoMTADONE** CKFM…MACRO‰MOVE.B„#ISTAEOF,D1‰TST.B…SAVEFM(A1)‰BNE.L‡MTADONE‰ENDM***8*ˆCheckforbeginningoftapeandifso,puttheISTABOV!*ˆmessageinD1andgotoMTADONE** CKBOT„MACRO‰MOVE.B„#ISTABOV,D1‰BTST†#LDPNTB,STAT1(A0)‰BNE.L‡MTADONE‰ENDM**6*ˆCKTRDENmacroupdatesthecurrenttransportdensity.8*ˆItrequiresthatA0=addressofmemory-mappedIOarea-*ˆandA1=addressofdrive'svariableblock.** CKTRDEN‚MACRO‰TST.B…STAT1(A0)‰IFˆ†THEN.S“MOVE.B„#XDSD800,TRANDENS(A1)‰ELSE.S“MOVE.B„#XDSD1600,TRANDENS(A1)‰ENDI‰ENDM * *ˆTRACEmacrousedfordebuggingH*ˆIftheTRACEis'ON',thenwheneverthemacroTRACEXXisencountered,7*ˆthecharacters'XX'willbeputintothetracetable.*ˆCall:ƒTRACER1,RTR8*Thiswillputthecharacters'R1'intothetracetable6*thatstartsatRTR_TABLEandisindexedbyRTR_INDEX*andhaslengthRTR_LEN.* TRACE„MACRO‰IFEQ†TRACE-'ON'MOVE.W…D0,-(SP)MOVE.W…#\2_TABLE,D0ADDƒ\2_INDEX(A5),D0MOVE‚#'\1',(A5,D0)ADD.W#2,\2_INDEX(A5)"IF„\2_INDEX(A5)‚‚#\2_LENƒTHEN“CLR„\2_INDEX(A5)ENDIMOVE.W…(SP)+,D0‰ENDC‰ENDM *@*ˆTheCLR_TRmacroisusedtoclearthetracetableofinterest.*ˆCall:CLR_TRƒRTR3*ŽThisclearstheRTR„tablefromoffset0tooffset *ŽRTR_LEN-1.* CLR_TRƒMACRO‰IFEQ†TRACE-'ON'MOVEM.L‰D4/A3,-(SP)LEAƒ\1_TABLE(A5),A3FORƒD4=#1‚TO‚#\1_LENƒDO “CLR.B…(A3)+ENDFCLRƒ\1_INDEX(A5)MOVEM.L‰(SP)+,D4/A3‰ENDC‰ENDM G************************************************************************Í*'*ˆFromtheSASIdriverbyDavidPheanis*C*******************************************************************  2LONGWORDMACRO›Thismacroskipszeroormorebytes'*¦inmemory(ifnecessary)toalignthe)*¦assembler'slocationcountertoalong-&*¦wordboundary.‚Wedefinealong-word)*¦boundarytobealocationwhoseaddress*¦isevenlydivisibleby4. ,‰DS.W…0–First,alignthelocationcounterto"*¦awordboundary.‚Ifthelocation(*¦counterisalreadyonawordboundary,*¦wedon'tchangeit. 0‰IFNE…*/4*4-*Ifthelocationcounterisn'tona-‰DS.W…1”long-wordboundary,advanceitbyone-‰ENDCšwordtoputitonalong-wordboundary. ‰ENDM-‰PAGEš#######################################1MOVEIAƒMACRO›Thismacroisusefulwhenwewantto%*¦putanimmediatevalueintoan"*¦register.‚Iftheimmediatevalue"*¦happenstobesmallenoughtobe#*¦representedcorrectlyina16-bit&*¦two's-complementnumbersystem,this #*¦macrogeneratesatwo-wordMOVE.W)*¦instructionknowingthatsignextension)*¦willoccuratexecutiontimetosetthe'*¦entireregisterproperly.‚Other-(*¦wise,themacrogeneratesathree-word#*¦MOVE.Linstruction.‚Byusingthis'*¦macrowecanbeassuredofgenerating'*¦theshortestcorrectinstruction,and)*¦themacrowillstillfunctioncorrectly#*¦iftheimmediatevaluehappensto&*¦changeasaresultoffutureprogram$*¦modifications.‚TheMOVEIAmacrois*¦invokedasfollows. "*¦[