IMD 1.17: 25/11/2014 13:13:56 82VKXBVERDOS D* BT23:0 68K VERSADOS/RMS68K OBJECT 4.5 (DS,DD 96 tpi 5.1/4" DISK) REVISED: 04/22/86 DISK 23 OF 24  BT23 82VKXBVERDOS 0420²`-`Dh7p7x8€@ˆ<>˜E 0¨8°6¸À<È:Ð]Ø4à7è:ð2øC86 *K***************************************************************************K***************************************************************************K***************************************************************************K***************************************************************************‰PAGE‰OPTCRE,PCS,BRS**‰MISCEQUATES*4DRIVESƒEQU‡12’Totalnumberofdrivesonourchannel. **ƒXREF'SfromDISKLIB*ŠXREF…DISK_INITŠXREF…DISK_COMMANDŠXREF…CHAN_DONE **‚Equatefilesincluded:* *‰INCLUDE‚9995.&.TCB.EQ*‰INCLUDE‚9995.&.CCB.EQ*‰INCLUDE‚9995.&.LV5.EQ*‰INCLUDE‚9995.&.IOE.EQ*‰INCLUDE‚9995.&.NIO.EQ*‰INCLUDE‚9995.&.DISKCCB.EQ*‰INCLUDE‚9995.&.DISKMEM.EQ*‰INCLUDE‚9995.&.DISK.EQ*‰INCLUDE‚9995.&.UTILITY.MC*ŠNOLIST*$*‰Includethestandardequatefiles:*‰INCLUDE‚9995.&.TCB.EQ‰INCLUDE‚9995.&.CCB.EQ‰INCLUDE‚9995.&.LV5.EQ‰INCLUDE‚9995.&.IOE.EQ‰INCLUDE‚9995.&.NIO.EQ‰INCLUDE‚9995.&.UTILITY.MC ‰TTL†DISK.EQ‰LIST‰INCLUDE‚9995.&.DISK.EQ‰TTL†DISKCCB.EQ‰INCLUDE‚9995.&.DISKCCB.EQ‰TTL†VM22DRV.SA‰PAGE/‰OFFSETƒDCCBDDPContinuewithchannel-dependent*¦CCBvariablespace.  M*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%* *%%%Å%%%*B*%%%„Device-dependent,channelrelated,variablesstarthere.‰%%%* *%%%Å%%%**%%%™(CCBSPACE)¡%%%* *%%%Å%%%*M*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*  NN2SAVECAP‚DS.L…1–Weusethisvariableforsavingthe'*¦CommandAddressPointerreturnedfrom(*¦theTrap#1callformemoryallocation)*¦duringinitialization.Thisisthebase"*¦addressfromwhichtheCAPfora'*¦particularcommandwillbedetermined*¦basedontheLUN.  M*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%* *%%%Å%%%*>*%%%„Endofdevicedependent,channelrelated,variables.%%%* *%%%Å%%%**%%%•ENDOFCCBSPACE %%%* *%%%Å%%%*M*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*  3CCBSIZEBEQU†*–CCBSIZEBdefinesthesize(inbytes)(*¦ofacompleteCCBfortheVM22driver. %*¨CCBSIZEdefinesthesize(inpages)?L0080„EQU†CCBSIZEB+PAGESIZE-1‚ofaCCBfortheVM22driver,andBCCBSIZE‚EQU†L0080/PAGESIZE‡EXTCCBSZdefinesthesize(inpages)of*ƒ15‚14‚13‚12ƒ11‚10ƒ9ƒ8„intheparametersmaskarenotusedbyI*‚+---+---+---+---++---+---+---+---+‚theVM22driver,butallofthebits8*‚|‹|ƒ||ƒ|ƒ|ƒ|ƒ|‚thataredefinedforanydiskdriveare;*‚+---+---+---+---++---+---+---+---+‚showninthediagrams.*„^ƒ^ƒ^ƒ^„^ƒ^ƒ^ƒ^*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|ƒ|/*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|ƒ----1=IOSSOFissignificant.*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|1*„|ƒ|ƒ|ƒ|„|ƒ|ƒ--------1=IOSPSMissignificant. *„|ƒ|ƒ|ƒ|„|ƒ|3*„|ƒ|ƒ|ƒ|„|ƒ------------1=IOSSHDissignificant. *„|ƒ|ƒ|ƒ|„|6*„|ƒ|ƒ|ƒ|„----------------1=IOSTRKDissignificant. *„|ƒ|ƒ|ƒ|9*„|ƒ|ƒ|ƒ---------------------1=IOSPCOMissignificant.*„|ƒ|ƒ|D*„|ƒ|ƒ-------------------------1=IOSSPTDisnotusedbytheVM22.*„|ƒ|<*„|ƒ-----------------------------1=IOSSRBissignificant.*„|I*„---------------------------------1=IOSRWCCBisnotusedbytheVM22.* **„7ƒ6ƒ5ƒ4„3ƒ2ƒ1ƒ0$*‚+---+---+---+---++---+---+---+---+*‚|ƒ|ƒ|ƒ|ƒ||ƒ|ƒ|ƒ|ƒ|$*‚+---+---+---+---++---+---+---+---+*„^ƒ^ƒ^ƒ^„^ƒ^ƒ^ƒ^*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|ƒ|/*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|ƒ----1=IOSRECissignificant.*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|1*„|ƒ|ƒ|ƒ|„|ƒ|ƒ--------1=IOSRSZissignificant. *„|ƒ|ƒ|ƒ|„|ƒ|<*„|ƒ|ƒ|ƒ|„|ƒ------------1=IOSWTOisnotusedbytheVM22. *„|ƒ|ƒ|ƒ|„|>*„|ƒ|ƒ|ƒ|„----------------1=IOSRTOisnotusedbytheVM22. *„|ƒ|ƒ|ƒ|8*„|ƒ|ƒ|ƒ---------------------1=IOSSPTissignificant.*„|ƒ|ƒ|:*„|ƒ|ƒ-------------------------1=IOSHDSissignificant.*„|ƒ|<*„|ƒ-----------------------------1=IOSTRKissignificant.*„|>*„---------------------------------1=IOSILVissignificant.‰PAGE*%*ˆATTRIBUTESMASKFORTHEVM22DRIVER* **ƒ15‚14‚13‚12ƒ11‚10ƒ9ƒ8$*‚+---+---+---+---++---+---+---+---+*‚| |$*‚+---+---+---+---++---+---+---+---+*„^ƒ^ƒ^ƒ^„^ƒ^ƒ^ƒ^*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|ƒ|;*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|ƒ----1=Post-read/pre-writeprecompreq'd.*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|=*„|ƒ|ƒ|ƒ|„|ƒ|ƒ--------1=8"floppydisk;0=5-1/4"disk. *„|ƒ|ƒ|ƒ|„|ƒ|8*„|ƒ|ƒ|ƒ|„|ƒ------------1=AlternateSectorCapability *„|ƒ|ƒ|ƒ|„|-*„---------------------------------…Notused.* **„7ƒ6ƒ5ƒ4„3ƒ2ƒ1ƒ0$*‚+---+---+---+---++---+---+---+---+*‚|‹|ƒ||ƒ|ƒ|ƒ|ƒ|$*‚+---+---+---+---++---+---+---+---+*„^ƒ^ƒ^ƒ^„^ƒ^ƒ^ƒ^*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|ƒ|<*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|ƒ----1=Doubledata-density(MFM)onmedia.*„|ƒ|ƒ|ƒ|„|ƒ|ƒ|9*„|ƒ|ƒ|ƒ|„|ƒ|ƒ--------1=Doubletrack-densityonmedia. *„|ƒ|ƒ|ƒ|„|ƒ|6*„|ƒ|ƒ|ƒ|„|ƒ------------1=Double-sidedfloppydisk. *„|ƒ|ƒ|ƒ|„|?*„|ƒ|ƒ|ƒ|„----------------1=IBMformat;0=Motorolaformat. *„|ƒ|ƒ|ƒ|>*„|ƒ|ƒ|ƒ---------------------1=Rigiddisk;0=floppydisk.*„|ƒ|ƒ|G*„|ƒ|ƒ-------------------------1=Doubledata-density(MFM)ondrive.*„|ƒ|D*„|ƒ-----------------------------1=Doubletrack-densityondrive.*„|C*„---------------------------------1=SeekrequiredonSMDdrive. PAGEC*‰ThefollowingsectiondefinesthevariablesthatarecontainedinE*‚theVM22‚commandpacket.‚Each‚individual‚command‚processingroutineK*‚buildsacommandpacketinglobalmemoryasdefinedbythecommand.ThereH*‚are‚five‚interpretationsofthecommandpacketfortheelevencommandsI*‚supportedbytheVM22.‚Theformatofeachcommandpackettypesisshown J*‚inthefollowingdiagrams.‚NotallaresupportedbytheVERSAdosdriver. SPC 2H*ˆTheTYPE0commandpacketisusedfortheReadSectors,WriteSectors,*ˆandCheckSectorscommands.**TYPE0PACKET*BYTE0¤BYTE3;*‰+-------------+-------------+-------------+-------------+.*‡0!‚COMMAND„!COMMANDOPT!…LUN…!‚ADDRMODƒ!;*‰+-------------+-------------+-------------+-------------+0*‡4!‚INTLEVEL‚!‚INTVECTOR!„RETRY„!ƒMISCTRLƒ!;*‰+-------------+-------------+-------------+-------------+&*‡8!ŒSTARTINGLOGICALSECTORNUMBER!;*‰+-------------+-------------+-------------+-------------+&*†12!NUMBEROFSECTORSTOTRANSFER!;*‰+-------------+-------------+-------------+-------------+*†16!•BUFFERADDRESS”!;*‰+-------------+-------------+-------------+-------------+'*†20!ŒPOINTERTONEXTCOMMANDPACKET!;*‰+-------------+-------------+-------------+-------------+**%*‰COMMANDOPTIONS=|CRR|CWV|ƒ|ƒ|‡|‡|* SPC 2A*ˆTheTYPE1commandpacketisusedfortheRecalibrateandCheck4*ˆUnitStatus,andReturnSelf-TestStatuscommands.**TYPE1PACKET*BYTE0¤BYTE3;*‰+-------------+-------------+-------------+-------------+*‡0!‚COMMAND„!!…LUN…!!;*‰+-------------+-------------+-------------+-------------+"*‡4!‚INT.LEVEL!INT.VECTOR!›!;*‰+-------------+-------------+-------------+-------------+*‡8!·!;*‰+-------------+-------------+-------------+-------------+*†12!·!;*‰+-------------+-------------+-------------+-------------+*†16!·!;*‰+-------------+-------------+-------------+-------------+'*†20!ŒPOINTERTONEXTCOMMANDPACKET!;*‰+-------------+-------------+-------------+-------------+* PAGED*ˆTheTYPE2commandpacketisusedfortheSeekTrack,Format-Unit,.*ˆFormat-Track,andFormat-Track-Badcommands.**TYPE2PACKET*BYTE0¤BYTE3;*‰+-------------+-------------+-------------+-------------+0*‡0!‚COMMAND„!COMMANDOPT!…LUN…!*ADDRMOD*‚!;*‰+-------------+-------------+-------------+-------------+2*‡4!‚INTLEVEL‚!‚INTVECTOR!ƒ*RETRY*ƒ!ƒMISCTRLƒ!;*‰+-------------+-------------+-------------+-------------+ *‡8!LOGICALSECTORNUMBER(1)!;*‰+-------------+-------------+-------------+-------------+#*†12!ALTERNATESECTORNUMBER(2)Ž!;*‰+-------------+-------------+-------------+-------------+$*†16!INTERLEAVE(3)!SPIOFFSET(3)!›!;*‰+-------------+-------------+-------------+-------------+'*†20!ŒPOINTERTONEXTCOMMANDPACKET!;*‰+-------------+-------------+-------------+-------------+*-*‰COMMANDOPTIONS=|ƒ|CWV|ƒ|CFMTBAD|ƒ|ƒ|ƒ|ƒ|**‰**=Ignoredbythiscommand**‰(1)=Usedbyformat-trackandseekonly%*‰(2)=Usedbyformat-track-badonly(*‰(3)=Usedbyallformatcommandsonly* SPC 2?*ˆTheTYPE3commmandpacketisusedfortheConfigurecommand.**TYPE3PACKET*BYTE0¤BYTE3;*‰+-------------+-------------+-------------+-------------+0*‡0!‚COMMAND„!*COMMANDOPT*!…LUN…!*ADDRMOD*‚!;*‰+-------------+-------------+-------------+-------------+4*‡4!‚INTLEVEL‚!‚INTVECTOR!ƒ*RETRY*ƒ!‚*MISCTRL*‚!;*‰+-------------+-------------+-------------+-------------+7*‡8!STARTINGHD#!NUMBEROFHDS!‚NUMBEROFCYLINDERS†!;*‰+-------------+-------------+-------------+-------------+7*†12!…WRITE-PRECOMPCYL#„!SECTORS/TRACK!STEPPINGRATE!;*‰+-------------+-------------+-------------+-------------+*†16!·!;*‰+-------------+-------------+-------------+-------------+'*†20!ŒPOINTERTONEXTCOMMANDPACKET!;*‰+-------------+-------------+-------------+-------------+***‰**=Ignoredbythiscommand* PAGE1*ˆThesevariablesdefinetheVM22commandpacket. .‰OFFSETƒ0•ThisOFFSETstatementisincludedso**¦thatthevariablesinthecommand-status#*¦packetwillbedefinedasoffsets'*¦relativetothestartofeachpacket. 6CMDCODE‚DS.B…1•TheCMDCODEfieldofthecommandpacket)*¦containstheopcodethattellstheVM22'*¦controllerwhatoperationtoperform. CMDSTAT‚EQU‡0“CHECKUNITSTATUSCMDRCAL‚EQU‡1“RECALIBRATE CMDFRMU‚EQU‡2“FORMATUNITCMDFRMT‚EQU‡3“FORMATTRACKCMDREAD‚EQU‡4“READSECTORSCMDWRIT‚EQU‡5“WRITESECTORSCMDCHCK‚EQU‡6“CHECKSECTORSCMDSEEK‚EQU‡7“SEEKTRACKCMDCNFG‚EQU‡8“CONFIGUREUNITCMDLOAD‚EQU‡9“DOWNLOAD%CMDREQƒEQU†10“RETURNSELF-TESTSTATUS 2CMDOPTƒDS.B…1–TheCMDOPTfieldofacommandpacket&*¦containsthe8-bitoptionsfieldfor*¦thecommandbeingprocessed. 7CDIAG„EQU†7‘BitequateforCMDOPTtoenablediagnostics*¦0=disablediagnostics*¦1=enablediagnostics -CWV†EQU†6•BitequateforCMDOPTtoenableCRC(*¦0=inhibitread-after-writeCRCcheck'*¦1=enableread-after-writeCRCcheck 1CECC…EQU†5•BitequateforCMDOPTtoreporterrors%*¦0=don'treportcorrectableerrors*¦1=reportcorrectableerrors 5CFMTBAD‚EQU†4”BitequateforCMDOPTtoformatatrack*¦asbad*¦0=don'tformatitasbad(*¦1=formatthetrackasbadandassign*¦thealternatetrackinCMDNST*¦asthealternate ;OPTCDIAGEQU†0<Nonbothsides)*¦1=Motorolaformat .FMF†EQU‡5•BitequateforMISCTRLtodefinethe$*¦recordingmethodofafloppydisk:*¦0=FM‚(singledata-density)*¦1=MFM(doubledata-density)‰PAGE.FDS†EQU‡2•BitequateforMISCTRLtodefinethe#*¦numberofsidesonafloppydisk:*¦0=Single-sided*¦1=Double-sided .FDR†EQU‡1•BitequateforMISCTRLtodefinethe*¦floppydiskdata-rate(size):*¦0=5-1/4"floppydisk*¦1=8"floppydisk -IBS†EQU‡0•BitequateforMISCTRLtodefineif(*¦seekisrequiredwhenaheadswitchis*¦performed(SMDdrivesonly):#*¦0=Drivedoesnotrequireaseek*¦1=Driverequiresaseek -STARTHD‚DS.B†1•TheSTARTHDfieldcontainsthe%*¦startingheadnumberonadrivefor*¦aConfigurecommand. 4NUMHEAD‚DS.B†1•TheNUMHEADfieldcontainsthenumber%*¦ofheadsonadriveforaConfigure *¦command. 2NUMCYLƒDS.W†1•TheNUMCYLfieldcontainsthenumber*¦ofcylindersonadrivefora*¦Configurecommand. 8CMDLSNƒEQU‡STARTHDTheCMDLSNfieldisalong-wordfield)*¦beginningatSTARTHDwhichcontainsthe$*¦startinglogicalsectornumberfor'*¦read,write,checkandseekcommands. -PRECOMP‚DS.W†1•ThePRECOMPfieldcontainsthe&*¦write-precompensationcylindervalue (*¦forthedriveforaConfigurecommand. 8CMDNSTƒEQU‡PRECOMPTheCMDNSTfieldisalong-wordfield)*¦beginningatPRECOMPwhichcontainsthe'*¦numberoflogicalsectorstotransfer%*¦forread,writeandcheckcommands. 4SECTORS‚DS.B†1•TheSECTORSfieldcontainsthenumber&*¦ofphysicalsectorspertrackonthe *¦mediaforaConfigurecommand. 4STEPRATEDS.B†1•TheSTEPRATEfieldcontainsthecode(*¦forthesteppingrateofthedrivefor*¦aConfigurecommand.‰PAGE2ILEAVEƒDS.B†1•TheILEAVEfieldcontainstheinter-#*¦leavefactorforformatcommands. 2SPIRALƒDS.B†1•TheSPIRALfieldcontainsthespiral*¦offsetforformatcommands. &‰DS.B†2•Reservespaceforlong-word... 6CMDBUFƒEQU‡ILEAVETheCMDBUFfieldcontainstheBuffer&*¦Addressfordatatransfersforread,*¦writeandcheckcommands. 2CMDPNTR‚DS.L†1•TheCMDPNTRfieldisthelastlong-'*¦wordinthecommandpacket.‚Itpoints)*¦tothenextcommandpacketwhencommand#*¦chainingisused.‚Otherwise,this*¦fieldmustbezero. 0CMDENDƒEQU†*–ThelabelCMDENDisattachedtothe;CMDLENƒEQU†CMDEND-CMDCODE‡bytethatimmediatelyfollowsthe&*¦commandpacketinmemory,andCMDLEN(*¦specifiesthelength(inbytes)ofthe*¦commandpacket. PAGED*ˆDuringoratthecompletionofacommand,theVM22willconveytheG*‚statusofthe‚commandbywayofa‚StatusPacket.‚ThepacketisplacedE*‚into‚memory‚immediatelyfollowingthe‚commandpacket.‚The‚interruptH*‚generatedforcommand‚completionalsoindicatesthatthestatus‚packet*‚isavailable. SPC 3C*ˆTheCommandStatusPacketisreturnedforallcommandsexceptthe$*ˆ"ReturnSelf-TestStatus"command.**˜COMMANDSTATUSPACKET*BYTE0¤BYTE3;*‰+-------------+-------------+-------------+-------------+<*‡0!STATUSCOMPL.!CMDSTATUS‚!RETRYCOUNT!DRIVESTATUS!;*‰+-------------+-------------+-------------+-------------+%*‡4!CURRENTLOGICALSECTORNUMBER!;*‰+-------------+-------------+-------------+-------------+*‡8!‘CURRENTSECTORCOUNT’!;*‰+-------------+-------------+-------------+-------------+*†12!CURRENTBUFFERADDRESS‘!;*‰+-------------+-------------+-------------+-------------+ SPC 3<*ˆTheSelf-TestStatusPacketisreturnedinresponsetothe$*ˆ"ReturnSelf-TestStatus"command.**™SELF-TESTSTATUSPACKET*BYTE0¤BYTE3;*‰+-------------+-------------+-------------+-------------+7*‡0!STATUSCOMPL.!CMDSTATUS‚!S-TSTATUS‚!ƒF/WREVƒ!;*‰+-------------+-------------+-------------+-------------+=*‡4!LUN0STATUS!LUN1STATUS!LUN2STATUS!LUN3STATUS!;*‰+-------------+-------------+-------------+-------------+=*‡8!LUN4STATUS!LUN5STATUS!LUN6STATUS!LUN7STATUS!;*‰+-------------+-------------+-------------+-------------+>*†12!LUN8STATUS!LUN9STATUS!LUN10STATUS!LUN11STATUS!;*‰+-------------+-------------+-------------+-------------+ PAGE0*ˆThesevariablesdefinetheVM22statuspacket. /S_COMPƒDS.B†1•TheS_COMPfieldwillcontainthe'*¦statuscompletecodeforthecommand.(*¦Thisisthelastbytewrittenintothe)*¦statuspacketandcanbeusedasaflag'*¦for'statuscomplete'wheninterrupts*¦arenotused. =S_CHOMP‚EQU‡S_COMP+CMDLEN‰TheS_CHOMPfieldistheequivalent"*¦totheS_COMPfieldwhencommand*¦chainingisused. 3CMDCOMP‚EQU‡$80“TheS_COMPwillbeequaltoCMDCOMP!*¦atthecompletionofacommand. 2S_STATƒDS.B†1•TheS_STATfieldcontainsthestatus(*¦codeforthecommandjustcompleted.A'*¦successfulcompletionwillstorea00(*¦inthisbyte.Otherwisetheerrorcode*¦willbestoredinthisbyte. 4S_RETRY‚DS.B†1•TheS_RETRYfieldcontainsthenumber%*¦ofretriesrequiredtocompletethe *¦command. 3S_DRIVE‚DS.B†1•TheS_DRIVEfieldcontainsthe8-bit(*¦statusoftheLUNaftercompletingthe*¦command.‚Thebitequatesare*¦definedbelow: 0DRDY…EQU‡7•BitequateforS_DRIVEthatindicates*¦theLUNisreadywhenset. 0DCYL…EQU‡6•BitequateforS_DRIVEthatindicates **¦theLUNreturned"on-cylinder"whenset. /DWP†EQU‡5•BitequateforS_DRIVEthatindicates&*¦theLUNiswrite-protectedwhenset. 6S_SELFƒEQU‡S_RETRYTheS_SELFfieldcontainstheself-&*¦teststatusinresponsetoarequest*¦self-teststatuscommand. 2S_FWREV‚EQU‡S_DRIVETheS_FWREVfieldcontainsthe)*¦firmwarerevisionnumberinresponseto%*¦arequestself-teststatuscommand.‰PAGE1S_LSN„DS.L†1•TheS_LSNfieldcontainsthelogical(*¦sectornumberoftheerrorsectorwhen#*¦anerrorhasoccuredandthenext%*¦logicalsectornumberwhennoerror*¦hasoccured. 3S_CNT„DS.L†1•TheS_CNTfieldcontainsthenumberof(*¦sectorslefttotransferwhenanerror'*¦hasoccuredandiszerowhennoerror*¦hasoccured. 3S_ADDRƒDS.L†1•TheS_ADDRfieldcontainstheaddress(*¦ofthelastbyteread+1orwritten+1(*¦withandwithouterrors.Thisfieldis'*¦usedtodeterminethenumberofbytes(*¦transferredondatatransfercommands. 5S_CADDR‚DS.L†1•TheS_CADDRfieldcontainstheaddress%*¦ofthecommandpacketforwhichthe'*¦erroroccuredforerrorswhencommand)*¦chainingisused.Otherwise,thisfield *¦iszero. 2STATEND‚EQU‡*•ThelabelSTATENDisattachedtotheBPKTLENƒEQU‡STATEND+CMDLEN†bytethatimmediatelyfollowsthestatus8PKTLONG‚EQU‡PKTLEN/4Œpacketinmemory,andspecifiesthe&*¦lengthofonecommand/statuspacket.)*¦PKTLENdefinesthelengthofacommand/$*¦command/statuspacketwhichisthe)*¦lengthreservedforonedriveinglobal'*¦memory.PKTLONGdefinesthelengthin *¦longwords. 6EQ095„EQU‡PKTLEN*DRIVES‰ThelabelPAGESisusedbythe@EQ096„EQU‡EQ095+PAGESIZE-1„initializertoallocateglobalmemory9PAGES„EQU‡EQ096/PAGESIZE†tobeusedfortheVM22command-&*¦statuspackets.Thereare$100bytes'*¦perpageofmemory,andthememoryis(*¦allocatedasanintegralno.ofpages. /TIMEOUT‚EQU‡1000’TheTIMEOUTequatedefinesthe(*¦numberoftimeswe'llreadtheQUEbit)*¦ofthestatusregisterbeforereporting"*¦acontrollererrorifnotready. PAGE/‰OFFSETƒ0–ThisOFFSETblockdefinesthememory-&*¦mappedI/OspaceforaVM22channel.&*¦TheVM22drivercommunicatesthrough*¦thismemory-mappedI/Ospace.************** *ƒBYTE1ƒ*************** 5CONTROL‚DS.B†1*2“TheControlRegisterisaWRITEonly#*¦registerusedtoinitiatecontrol&*¦functionstotheVM22.Belowarethe*¦bitdefintionsforCONTROL. 0CRQUE„EQU‡7•SettingtheCRQUEbittellstheVM22'*¦thatacommandpackethasbeenplaced(*¦inmemoryandisreadytobeexecuted."*¦Thisshouldbesetonlyifitis*¦currentlyzero. 2CRRST„EQU‡6•SettingtheCRRSTbitsetstheVM22to'*¦ahardresetstate.‚Theboardremains'*¦inthisstateuntilCRRSTiscleared. 0CRIST„EQU‡5•WhentheCRISTbitisset,theself-)*¦testisbypassedwhenCRRSTgoesfrom1(*¦to0.‚WhentheCRISTbitisclear,the(*¦self-testisperformedwhenCRRSTgoes*¦from1to0. *CRISF„EQU‡4•SettingtheCRISFbitinhibits(*¦SYSFAILfrombeingsourcedbytheVM22**¦incaseofaself-testdetectedfailure. 4STATUSƒEQU‡CONTROLTheControllerStatusregisteris)*¦aREADonlymappedtothesamelocation%*¦astheWRITEonlyControlRegister.**¦BelowarethebitdefintionsforSTATUS. 1CSQUE„EQU‡7•WhentheCSQUEbitisclear,theVM22(*¦isreadyforaqueuecommand.‚Whenthe$*¦CSQUEbitisset,theVM22hasnot'*¦completedqueuingthelastcommand.‚A**¦commandmaynotbequeueduntilthisbit*¦goestozero. 2CSFLT„EQU‡6•WhentheCSFLTbitisclear,noerrors%*¦weredetectedduringtheself-test.)*¦WhentheCSFLTbitisset,anerrorwas$*¦detectedbytheself-testroutine. 1CSRDY„EQU‡5•WhentheCSRDYbitisclear,theVM22(*¦isperformingtheself-test/initialize'*¦routines.‚Communicationshouldnotbe(*¦attemptedatthistime.WhentheCSRDY!*¦bitisset,theVM22self-test/*¦initializationiscomplete. PAGE*******************‚BYTES3&5ƒ******************* ‰DS.B†1*2“Byte3isreserved. ‰DS.B†1*2“Byte5isreserved. ************** *ƒBYTE7ƒ*************** 1CAAM…DS.B†1*2“TheCommandAccessAddressModifier&*¦istheaddressmodifiercodeusedto(*¦accessthecommandpacketbytheVM22. $*¨Thefollowingisalistofequates*¦usedtodefinetocodes:*BIT16UƒEQU‡$11‘16-bitUserI/O$BIT16SƒEQU‡$15‘16-bitSupervisorI/O BIT24UD‚EQU‡$01‘24-bitUserData#BIT24UP‚EQU‡$02‘24-bitUserProgram&BIT24SD‚EQU‡$05‘24-bitSupervisorData)BIT24SP‚EQU‡$06‘24-bitSupervisorProgram BIT32UD‚EQU‡$F1‘32-bitUserData#BIT32UP‚EQU‡$F2‘32-bitUserProgram&BIT32SD‚EQU‡$F5‘32-bitSupervisorData)BIT32SP‚EQU‡$F6‘32-bitSupervisorProgram ***************************ƒBYTES9,11,13,15‚*************************** )CAP†DS.B†1*2‘CommandAddressPointer-MSB(‰DS.B†1*2‘CommandAddressPointer-Byte2(‰DS.B†1*2‘CommandAddressPointer-Byte1&‰DS.B†1*2‘CommandAddressPointer-LSB‰PAGEO********************************************************************************1*ˆSERVICEVECTORTABLE,PARAMETERS,REVISIONINFO*@*ˆThefirst‚several‚locationsofevery‚I/OdrivermustcontainaB*ˆservicevectortabletocontainthe‚long-wordrelativeaddressesB*ˆofthethreedriversubroutinesthatCMRuses.‚TheCMRparameterC*ˆtableimmediatelyfollowstheservicevectortableandincludesaA*ˆfieldtelling‚CMR‚howmanyextrapages‚toallocatefortheCCB.E*ˆTherevisiontableimmediatelyfollowsthetheCMRparametertable.*O*******************************************************************************O******************************************************************************* ‰SECTION‚0 VM22DRV: *D*‚Servicevectortable.‚NoticethatthesevaluesarerelativetotheC*‚beginningofthedriversothemechanismisposition-independent!* <‰DC.L…INTERUPT-VM22DRV…Addressofinterruptserviceroutine.:‰DC.L…COMMANDS-VM22DRV…Addressofcommandserviceroutine.5‰DC.L…INIT-VM22DRV‰Addressofinitializationroutine.‰DC.L…0”Reserved. **‚OtherCMRparameters.*3‰DC.B…EXTCCBSZ#ofextrapagesintheCCB.‚TheCCB(*§maybeanysizefrom1to256pages(a&*§pageis256bytes):‚ifthisfieldis*§0,itwillbe1page,etc.‰DC.B…0,0,0Reserved.‰DC.L…0,0,0Reserved. **‚Revisioninfo:*/‰DC.B…'021286'DateoflastassemblyasMMDDYY.1‰DC.B…''’Spaceindicatesnopatchesto.LOfile.)‰DC.B…'4'’MajorVERSAdosrevisionnumber.‰PAGEO********************************************************************************7*ˆJumptableforusebythegenericdiskdriverDISKLIB*O******************************************************************************* ‰BRA.L„SET_CNFG‰BRA.L„SET_CODE‰BRA.L„CHK_FLOPPY‰BRA.L„CHK_LSN‰BRA.L„BLD_PACKET‰BRA.L„DISK_START‰BRA.L„CHK_PARAM‰PAGEO*******************************************************************************O*********************************************************************************ˆINITIALIZATIONROUTINE*B*ˆThis‚subroutineiscalledfromCMR‚whenCMRisinvokedbyataskB*ˆ(normallyIOI)to‚allocateachannel.‚ItspurposeistogivetheD*ˆdriverachancetosetupthingsforcommandserviceandinterrupt-*ˆservice.‚Thebasicfunctionsperformedare:*5*ˆ1.‚PutthestartaddressofthedriverintotheCCB*ŒvariableDRV_ADDR.2*ˆ2.‚Putthetotalnumberofdrivesonourchannel!*ŒintotheCCBvariableMAX_DRVS.8*ˆ3.‚Putthesizeinbytesofthedrive'svariableblock!*ŒintotheCCBvariableDRV_SIZE.?*ˆ4.‚Device-IndependentinitializationinthecalltoDISK_INIT"*ŽtoinitializetheCCBvariables.?*ˆ5.‚Device-DependentinitializationinthecalltoDO_INITfor"*Ždevicedependentinitialization.*B*ˆThissubroutineisenteredthroughaJSRfromCMR,andwillexit7*ˆwithanRTS.‚Theprocessorisinthesupervisormode.*%*ˆEntry:„A6=physicaladdressofTCB*’A5=physicaladdressofCCB*5*ˆInterruptlevelis0.‚Registersmaybeusedfreely.*.*ˆRegistersusedinDISK_INIT:…01234567 *¦D‚**¦A‚*‰P**ˆExitsto:CMRviaRTS*O*******************************************************************************O*******************************************************************************ŠPAGEINIT: *)*‚GetaddressofstartofdriverintoCCB*ŠLEA‡VM22DRV(PC),A0ŠMOVE.L„A0,DRV_ADDR(A5)*9*‚GetthenumberofdrivessupportedbytheVM22channel.*ŠMOVE.W„#DRIVES,MAX_DRVS(A5)*5*‚Getthesizeinbytesofthedrive'svariableblock*ŠMOVE.W„#DRVBLKSZ,DRV_SIZE(A5)*>*‚Performthedevice-independentinitializationbycallingthe'*‚genericroutineDISK_INITinDISKLIB.*/‰JSR†DISK_INITŒDothedevice-independentstuff.4‰IF‚‚THEN.SŽSomethingwentwrongwithDISK_INIT.‹RTS™Thechannelisdown!!‰ENDI*8*‚Performanydevice-dependentinitializationinDO_INIT*/‰BSR.L„DO_INITŽDevicedependentinitialization.‰RTS‰PAGEO*******************************************************************************O*********************************************************************************ˆCOMMANDSERVICEROUTINE*C*ˆThissubroutineiscalledfromCMRwhenCMRreceivesacommandtoA*ˆinitiatean‚I/Otransaction‚withadevicethatiscontrolledby?*ˆthisdriver.‚Itsfunctionisto‚processthe‚givencommand‚andB*ˆqueuethecommandtothecontroller.‚Thesefunctionsarehandled%*ˆbythegenericdiskdriverDISKLIB.*5*ˆEntry:„A2=physicaladdressofCMRparameterblock*’A5=physicaladdressofCCB/*’A6=physicaladdressofTCBofattachedtask*5*ˆInterruptlevelis0.‚Registersmaybeusedfreely.*1*ˆRegistersusedbyDISK_COMMAND:†01234567*ªD‚********ªA‚*****P**ˆExitsto:CMRviaRTS*O*******************************************************************************O******************************************************************************* COMMANDS: *,*‚Performanydevice-dependentstuffhere...* =*‚Wehavereceivedacommand,soweknowthereissomeoneout**‚theretotalkto.‚LetDISKLIBhandleit.*&‰JSR†DISK_COMMAND‹Performthecommand.‰RTSReturntoCMR.‰PAGE‰TTL‡VM22INTERRUPTHANDLERO*******************************************************************************O**********************************************************************************ˆVM22INTERRUPTHANDLER*A*ˆThisistheVM22InterruptHandlerRoutine.‚ItiscalledbyCMRB*ˆwhenCMRhas‚receivedaninterruptfortheVM22diskcontroller.A*ˆTheVM22diskcontroller‚isanintelligentperiphialcontrollerA*ˆwhichmaintainsitsownqueueofcommandstobeprocessed.‚ThisB*ˆsimplifiestheworktheinterrupthandlerhastodo,butitalsoF*ˆmeanswedonotimmediatelyknowwhichdevicethecommandcompletionD*ˆinterruptisfor.Itispossibleforthecommandhandlerto'send'?*ˆseveralcommandstothe‚controller‚beforereceiving‚a‚commandC*ˆcompletioninterruptforanyoneofthem.ThisroutinedeterminesA*ˆwhichdevicethe‚commandcompletioninterrupt‚isforbypolling@*ˆthestatusbyteofthe‚statuspacket‚belonging‚to‚eachdevice.C*ˆEachtimeaninterruptisreceived,thestatusbyteofthestatusB*ˆpacketischeckedstartingatthestatuspacketfordrive0.‚TheB*ˆinterruptisclaimed‚whenanon-zerostatusbyteisfoundbeforeB*ˆreachingtheendofthechain.‚Theinterruptisnotclaimedwhen<*ˆtheendisreachedwithoutfindinganon-zerostatusbyte.**O*******************************************************************************O******************************************************************************* PAGE O*********************************************************************************ˆPollingtimecalculations:**‹TimeˆInstruction!*‰-------‡-----------------------*‰12(3/0)‡MOVE.LƒSAVECAP(A5),A0*‰12(3/0)‡MOVE.LƒDVBPTR(A5),A1*‰12(3/0)‡MOVEQ.L‚#0,D0*Š8(2/0)‡MOVE.WƒMAX_DRVS(A5),D0*Š4(1/0)‡SUB.W„#1,D0**Š4(1/0)‡TST.L„CMDPNTR(A0) *‰10(2/0)‡BEQ.S„INT100*Š4(1/0)‡TST.B„S_CHOMP(A0)*Š8(1/0)‡BEQ.S„INT150*Š6(1/0)‡ADDA.Lƒ#CMDLEN,A0*‰10(2/0)‡BNE.S„INT200*Š4(1/0)‡TST.B„S_COMP(A0)*‰10(2/0)‡BNE.S„INT200*Š6(1/0)‡ADDA.Lƒ#PKTLEN,A0*Š6(1/0)‡ADDA.Lƒ#DRVBLKSZ,A1*‰12(2/0)‡DBRA…D0,INT050**K*„TheEXORmacstypicallyrequires3‚waitcyclesforareadcycleand1waitL*„cycleforawritecycle,andthemicroprocessorinastandardEXORmacsrun:*„at8.0megahertzforacycletimeof0.125microseconds.*O******************************************************************************* PAGEO*********************************************************************************ˆINTERRUPTSERVICEROUTINE**ˆEntry:„JSRfromISR*’A5=PhysicaladdressofCCB*!*ˆRegisterusage:…01234567'*™D‚*####=Savedtouseasworking#*™A‚**ƒ##*registersthroughout.**ˆCalls:„CHAN_DONE**ˆExit:…RTStoCMR*O******************************************************************************* INTERUPT: ;‰MOVE.LƒSAVECAP(A5),A0‰PointA0tothefirstcommandpacket<‰MOVE.LƒDVBPTR(A5),A1ˆinthechainofcommand/statuspackets0‰MOVEQ.L‚#0,D0tobepolled.IusuallyuseA2to=‰MOVE.WƒMAX_DRVS(A5),D0†pointtothecommandpacketbutitis3‰SUB.W„#1,D0notoneoftheregisterssavedbyCMR.&*¦PointA1tothefirstdrivevariable*¦block. ?INT050ƒTST.L„CMDPNTR(A0)ŒWemustfindwhichdrivetheinterrupt5‰BEQ.S„INT100wasfor:‚Inthecommandhandler,weset6‰TST.B„S_CHOMP(A0)ŠthebyteS_COMPtozerojustbefore4‰BEQ.S„INT150queueingacommandpackettotheVM22.7‰ADDA.Lƒ#CMDLEN,A0‹Uponcompletionofthecommmand,the3‰BNE.S„INT200VM22placesacommandcompletestatus>INT100ƒTST.B„S_COMP(A0)‹codeintotheS_COMPbyteandproceeds6‰BNE.S„INT200tointerruptus.WescantheS_COMPbyte=INT150ƒADDA.Lƒ#PKTLEN,A0‹ofthestatuspacketuntilS_COMPis:‰ADDA.Lƒ#DRVBLKSZ,A1‰non-zero.Whenwe'vefoundthedrive,8‰DBRA…D0,INT050Œthatisthedrivethecommandcompletion$*¦interruptisfor.Ifwetestevery)*¦statuspacketandhavenotfoundanon-(*¦zeroS_COMPbyte,theinterruptisnot*¦claimedbytheVM22. '*¦A0<--1stpacketwithoutchainingOR*©<--2ndpacketwithchaining.%*¦Thisworkssolongasweaccessthe*¦statuspacketportiononly.**¦A1<--Addressofdrivesvariableblock. )*§Wedependonthestatusbytebeingnon-(*¦zeroastheONLYindicationastowhat**¦drivewe'rereceivingtheinterruptfor.#*¦Whenthedrivehasbeenfound,D0$*¦containsavaluefromwhichwecan(*¦determinethedrivenumber,butisnot*¦equaltothedrivenumber. PAGE*¦THEINTERRUPTISN'TFORME2CLEAR„EQU†0<<0“WereturnwithSR.C=0toindicate8‰AND.B„#CLEAR,CCR‹thattheinterruptisn'tmine.TheRTS‰RTS›istoCMR. *¦THEINTERRUPTISFORME=INT200ƒMOVE.BƒS_COMP(A0),D0ŠSaveandclearthestatusbyteto:‰MOVE.Bƒ#0,S_COMP(A0)ˆindicateI'veacceptedtheinterrupt =EQ600„REG†A4/A3/D3/D2/D1‰A5,A1,A0,andD0havealreadybeen;‰MOVEM.L‚EQ600,-(SP)ŠsavedbyCMR.‚Herewesavetherestof'*¦theregistersthatweneedtouse.‚We(*¦saveonlytheregistersthatwereally%*¦needbecausewedon'twanttowaste(*¦timeorstackspace.‚Time,especially,'*¦isimportantinaninterrupthandler. 8CHKSTAT‚MOVEQ.L‚#0,D2’Wehaveacceptedtheinterruptand7‰MOVE.BƒS_STAT(A0),D2ˆmustcheckstatus.‚Ifthecommand5‰BNE.S„STATERRŽstatusbytereturnedisnotzero,then*¦anerrorhasoccured. 8‰MOVE.BƒEOVFLAG(A1),D1‰ReturntheEOVFLAGvaluefromthe&*¦drivevariableblockforthecurrent**¦commandcompletioninterrupt.TheEOVFLAG'*¦valuethatwegetintoD1.Bherewill#*¦bereturnedtotheuserasanI/O&*¦statuscode.‚IftheI/Otransferwas'*¦truncatedtoavoidrunningbeyondthe(*¦endofthedisk,wereturntheISTAEOV'*¦statuscode.‚Otherwise,wereturnthe)*¦ISTAOKstatuscodetoindicatethatthe!*¦entireoperationwentsmoothly. PAGE@VM22ERR‚MOVE.LƒS_ADDR(A0),D0ŠGetthepointertothenextbytein :‰MOVE.LƒD0,IOBUFPTR(A1)†theI/Obuffer.‚ThisvaluewillbeNNNNNNN#*¦usedtocalculatenumberofbytes*¦transferred.Š**02/12/86‚** ‰JSR†CHAN_DONE >EQ640„REG†D1/D2/D3/A3/A4‡Restoretheregistersthatweresaved;‰MOVEM.L‚(SP)+,EQ640Šatthestartoftheinterruptroutine. 4CARRY„EQU†1<<0“Finally,settheSR.Cbit,andreturn5‰OR.B…#CARRY,CCR‹controltoCMR.‚SettingtheSR.Cbit)‰RTS›indicatesthatwehaveprocessedthe *¦interrupt. !*¨Noticethatwedon'tchangethe(*¦interruptmasklevel,sotheinterrupt$*¦masklevelisthesamelevelasit%*¦waswhentheVM22interrupthandler*¦wasinvoked. CTRLERR‚ST.B…CHANDOWN(A5)‹DowntheVM22channelbysettingthe"*¦variablethatindicatesthatthe#*¦controllerisdown.‚Ifthesystem(*¦triestoaccesstheVM22channelagain#*¦withoutresettingitfirst,we'll%*¦reportanerrorindicatingthatthe$*¦channelisdown.‚Thesystemreally"*¦shouldn'ttrytoaccesstheVM22'*¦channelagainwithoutfirstresetting$*¦thecontroller.‚Evenresettingthe)*¦controllermaynotcorrecttheproblem,'*¦butwe'llletthesystemtryasoften*¦asitwishes. 5‰MOVEQIƒISTACNT,D1SetupD1.Bforreportingastatus4‰BRA†VM22ERRŽcodethatindicatesacontrollererror,%*¦andgoterminateprocessingforthe*¦currentcommand.  PAGE O********************************************************************************=*ˆTABLETOTRANSLATEVM22ERRORCODESTOVERSADOSERRORCODES*O******************************************************************************* %*“---------------‚VERSAdosErrorCode*’|*’|”----‚VM22ErrorCode*’|“|*’|“|%*’V“V†VM22DefinitionandExplanation!*­------------------------------- "ERRCODE‚DC.B…ISTADMA‡$00„Noerror. .‰DC.B…ISTAUNR‡$01„Noindex/sectorpulsesignal)*¦fromthedrive.VERSAdosdoesn'treally)*¦haveanerrorcodetodescribethis,so#*¦wesimplyreportanunrecoverable *¦diskerror. 8‰DC.B…ISTARES‡$02„Notrack000onaRECALIBRATEcommand.* 3‰DC.B…ISTASAˆ$03„Invalidsectornumber-theLSNis*¦outofbounds !‰DC.B…ISTANRˆ$04„Drivenotready.* 2‰DC.B…ISTASEK‡$05„No'ON-CYLINDER'fromthedrive.* &‰DC.B…ISTADME‡$06„IDheadernotfound.* 7‰DC.B…ISTADME‡$07„Datamarknotfound.Thisisreported$*¦asIDnotfoundandnota"DELETED*¦DATAMARKDETECT". 2‰DC.B…ISTAILU‡$08„LUNisgreaterthanmaximumLUN.* 4‰DC.B…ISTAILU‡$09„TheLUNrequestedisalreadybusy.* PAGE ‰DC.B…ISTADMC‡$0A„DMAerror.* '‰DC.B…ISTAICE‡$0B„Undefinederrorcode.* &‰DC.B…ISTAIFˆ$0C„Invalidcommandcode.* 9‰DC.B…ISTATOˆ$0D„H/Werror;timeoutforanunknowncause.* :‰DC.B…ISTAILU‡$0E„InconsistentLUNwithinacommandchain.* (‰DC.B…ISTACFG‡$0F„Illegalconfiguration.* '‰DC.B…ISTAICE‡$10„Undefinederrorcode.'‰DC.B…ISTAICE‡$11„Undefinederrorcode. 7‰DC.B…ISTACRC‡$12„CRCerrororuncorrectableECCerror.* )‰DC.B…ISTACRC‡$13„Correctabledataerror.* (‰DC.B…ISTAWPˆ$14„Writeprotecteddevice.* -‰DC.B…ISTAUNR‡$15„Harddiskcontrollerfault.* /‰DC.B…ISTAUNR‡$16„Floppydiskcontrollerfault.* -‰DC.B…ISTACNF‡$17„Invalidfloppydiskformat.* +‰DC.B…ISTACFG‡$18„Drive/Mediaincompatible.* '‰DC.B…ISTAICE‡$19„Undefinederrorcode.'‰DC.B…ISTAICE‡$1A„Undefinederrorcode.'‰DC.B…ISTAICE‡$1B„Undefinederrorcode.'‰DC.B…ISTAICE‡$1C„Undefinederrorcode.'‰DC.B…ISTAICE‡$1D„Undefinederrorcode.'‰DC.B…ISTAICE‡$1E„Undefinederrorcode. "‰DC.B…ISTAUNR‡$1F„Self-testerror.* PAGE  '‰DC.B…ISTAICE‡$20„Undefinederrorcode.'‰DC.B…ISTAICE‡$21„Undefinederrorcode.'‰DC.B…ISTAICE‡$22„Undefinederrorcode.'‰DC.B…ISTAICE‡$23„Undefinederrorcode.'‰DC.B…ISTAICE‡$24„Undefinederrorcode.'‰DC.B…ISTAICE‡$25„Undefinederrorcode.'‰DC.B…ISTAICE‡$26„Undefinederrorcode.'‰DC.B…ISTAICE‡$27„Undefinederrorcode.'‰DC.B…ISTAICE‡$28„Undefinederrorcode.'‰DC.B…ISTAICE‡$29„Undefinederrorcode.'‰DC.B…ISTAICE‡$2A„Undefinederrorcode.'‰DC.B…ISTAICE‡$2B„Undefinederrorcode.'‰DC.B…ISTAICE‡$2C„Undefinederrorcode.'‰DC.B…ISTAICE‡$2D„Undefinederrorcode.'‰DC.B…ISTAICE‡$2E„Undefinederrorcode.'‰DC.B…ISTAICE‡$2F„Undefinederrorcode. '‰DC.B…ISTAICE‡$30„Undefinederrorcode.'‰DC.B…ISTAICE‡$31„Undefinederrorcode.'‰DC.B…ISTAICE‡$32„Undefinederrorcode.'‰DC.B…ISTAICE‡$33„Undefinederrorcode.'‰DC.B…ISTAICE‡$34„Undefinederrorcode.'‰DC.B…ISTAICE‡$35„Undefinederrorcode.'‰DC.B…ISTAICE‡$36„Undefinederrorcode.'‰DC.B…ISTAICE‡$37„Undefinederrorcode.'‰DC.B…ISTAICE‡$38„Undefinederrorcode.'‰DC.B…ISTAICE‡$39„Undefinederrorcode.'‰DC.B…ISTAICE‡$3A„Undefinederrorcode.'‰DC.B…ISTAICE‡$3B„Undefinederrorcode.'‰DC.B…ISTAICE‡$3C„Undefinederrorcode.'‰DC.B…ISTAICE‡$3D„Undefinederrorcode.'‰DC.B…ISTAICE‡$3E„Undefinederrorcode.'‰DC.B…ISTAICE‡$3F„Undefinederrorcode.'‰DC.B…ISTAICE‡$40„Undefinederrorcode.‰DS.W…0ERRCEND‚EQU†*-ERRCODE D*ˆErrorcodesintherange$40through$80arereportedas"ISTAICE"A*ˆandarenotshowninthetable.Errorcode$1Fistheself-test?*ˆerrorcodeandisreportedas"ISTAUNR".‚Thechecksforthese;*ˆerrorconditionsaremadeintheaboveroutine'STATERR'.‰PAGE‰TTL‡ROUTINESCALLEDBYDISKLIBO********************************************************************************!*’ROUTINESƒCALLEDƒBY**œDISKLIB**O*******************************************************************************‰PAGEN*******************************************************************************)*ˆSET_CNFG…SETUPFORACONFIGURECOMMAND*C*ˆThis‚isadevicedependentroutinewhoseoffsetmustbeinstalledD*ˆatthebeginningofthedriver.ThefunctionofthisroutineistoD*ˆsetthefields'sinthedrive'svariableblock,device-independent#*ˆportion,foraconfigurecommand.**A*ˆEntry:A1=pointertoDrive'sVariableBlockinglobalmemory.#*A5=physicaladdressoftheCCB.* *Interruptlevelonentryis0.*!*ˆRegisterusage:…01234567*™D *™A„P*…P* *ˆCalls:none*/*ˆExit:‚RTStocallerwithconditioncodesset:7*‚Drive/controllersupportstheconfigurerequest.?*‚Drive/controllerdoesnotsupporttheconfigurerequest.4*•D1.B=VERSAdoserrorcodefortheerrordetected.*F*ˆTheinterruptleveluponexitmustbethesameasitwasuponentry.*N****************************************************************************** SET_CNFG:0‰MOVE.L„A2,-(SP)ŽSavetheregisterswewilluse.=‰MOVE.L„IOCAPTR(A1),A2ˆA2<--addressofthiscommandpacket. >EQ410„EQU†CONFGBLK+IOSSHD+1†Copythestartingheadnumberfrom@‰MOVE.BƒEQ410(A1),STARTHD(A2)‚thedriveblocktocommandpacket. ;EQ420„EQU†CONFGBLK+IOSHDSˆCopythenumberofheadsfromthe@‰MOVE.BƒEQ420(A1),NUMHEAD(A2)‚driveblocktothecommandpacket. @EQ430„EQU†CONFGBLK+IOSTRKD‡Copythenumberofcylindersfromthe?‰MOVE.WƒEQ430(A1),NUMCYL(A2)ƒdriveblocktothecommandpacket. >EQ440„EQU†CONFGBLK+IOSPCOM‡Copytheprecompensationcylinder#A‰MOVE.WƒEQ440(A1),PRECOMP(A2)‚fromdriveblocktocommandpacket. =EQ450„EQU†CONFGBLK+IOSSPTˆCopythesectors-per-trackfromthe@‰MOVE.BƒEQ450(A1),SECTORS(A2)‚driveblocktothecommandpacket. ?EQ455„EQU†CONFGBLK+IOSSRTD‡Copythestepping-ratecodefromtheA‰MOVE.BƒEQ455(A1),STEPRATE(A2)driveblocktothecommandpacket. /‰MOVE.Lƒ(SP)+,A2Restoretheregistersweused.'‰CMP.B„D0,D0’Setgoodstatusonreturn.‰RTS ‰PAGEN******************************************************************************* *ˆSET_CODE*F*ˆThisisadevicedependentroutinewhoseoffsetmustbeinstalledatE*ˆthebeginningofthedriver.‚ThefunctionofthisroutineistosetD*ˆanymedia‚and/or‚driverelatedcodesinthedrive'svariableblockC*ˆ(device-dependentportion)‚requiredby‚theparticular‚controller.>*ˆItiscalledbyconfigure,read,write,andformatcommands.**A*ˆEntry:„A1=pointertoDrive'sVariableBlockinglobalmemory.#*’A5=physicaladdressoftheCCB.* *’Interruptlevelonentryis0.*!*ˆRegisterusage:…01234567*™D‚** *™A„P*…P* *ˆCalls:none**ˆExit:‚RTStocaller.*F*ˆTheinterruptleveluponexitmustbethesameasitwasuponentry.*N****************************************************************************** SET_CODE: 7‰MOVEM.LƒD0/D1/A2,-(SP)ˆSavetheregisterswewilluse. =EQ460„EQU†CONFGBLK+IOSPSMˆGetthesectors-per-trackvaluefor;‰MOVE.WƒEQ460(A1),D1‰themediaintoD1(thisisourworking2‰MOVEQ.L‚#0,D0register).‚ClearD0tousetostore*¦theresults. :COM10„SUB.W„#128,D1Foreachmultipleof128bytes,weadd2‰BEQ.S„COM20onetothesectorsizecode,starting-‰ADD.B„#1,D0with128bytes/sectorequaltoa2‰BRA†COM10sectorsizecodeof00.‚Thesectorsize:COM20„LSL.B„#3,D0codeisassignedtobits3-4ofMISCTRL. >EQ470„EQU†CONFGBLK+IOSATWˆGettheattributewordforthemedia4‰MOVE.WƒEQ470(A1),D1‰intoD1(ourworkingregister). 8‰BTST…#IOARDISC,D1‹Ifthisisafloppydisk,gorightto'‰BEQ.S„COM30thefloppybitattributes. 5‰BTST…#IOARIBS,D1ŒDefinearequiredseekforarigid-/‰BEQ.S„COM90SMDdrive.‚WesettheIBSbitifa5‰BSET…#IBS,D0Žseekisrequiredwithaheadchangeand0‰BRA.S„COM90leavethatbitaszeroifaseekis"*¦notrequiredwithaheadchange.‰PAGE=COM30„BTST…#IOATDEN,D1ŒDefinethetrackdensityofthemedia.5‰BNE.S„COM40WesettheFTDbitwhenthemediaTPIis5‰BSET…#FTD,D0Žone-halfofthedriveTPI.Weleavethe?COM40„BTST…#IOATDEND,D1‰bitaszerowhenthemediaTPIisequal‰BNE.S„COM50tothedriveTPI.‰BCLR…#FTD,D0Ž* ;COM50„BTST…#IOAFRMT,D1ŒDefinetheformat-typeofthemedia.3‰BNE.S„COM60WesettheFSNbitforMotorolaformat1‰BSET…#FSN,D0ŽandleavethatbitaszeroforIBM. 9COM60„BTST…#IOADDEN,D1ŒDefinetherecording-method(data-2‰BEQ.S„COM70density)ofthemedia.‚WesetbitFMF4‰BSET…#FMF,D0ŽforMFMencoding(doubledata-density)#*¦andleavethatbitaszerofor‚FM!*¦encoding(singledata-density). 7COM70„BTST…#IOADSIDE,D1‹Definethenumberofsidesona.‰BEQ.S„COM80floppydisk.‚WesetbitFDSfora5‰BSET…#FDS,D0Ždouble-sideddiskandleavethatbitas"*¦aszeroforasingle-sideddisk. 7COM80„BTST…#IOASIZE,D1ŒDefinethefloppydiskdatarate2‰BEQ.S„COM90(size).‚WesetbitFDRfor500kbits/5‰BSET…#FDR,D0Žsec(8")andleavethatbitaszerofor*¦250kbits/sec(5-1/4"). ACOM90„MOVE.BƒD0,MEDCODE(A1)‰Savethedefinedcontrolcodeforthe(*¦currentdriveintothevariableblock. 8‰MOVE.LƒSAVECAP(A5),A2‰SetupA2topointtothecommand;‰MOVEQ.L‚#PKTLEN,D0‹packetforthediskdrivethatistobe5‰MOVEQ.L‚#0,D1accessedforthiscommand.Getaddress<‰MOVE.BƒDRIVENUM(A1),D1†ofpacketfordrive0,thenmultiply1‰MULU…D1,D0thelengthofonepacketbythedrive&‰ADD.L„D0,A2numbertogettheoffset. ;‰MOVEQ.L‚#PKTLONG-1,D0ŠWemustclearoutthecommandpacket8‰ADD.L„#PKTLEN,A2‹we'reabouttouse.‚SetupD0withthe;CLRPKTƒCLR.L„-(A2)lengthinlongwordsminusoneandpoint3‰DBRA…D0,CLRPKTŒA2tothestartofthenextpacket. ;‰MOVE.LƒA2,IOCAPTR(A1)‰Saveaddressofthiscommandpacket. 6‰MOVEM.L‚(SP)+,D0/D1/A2‰Restoretheregistersweused.‰RTS‰PAGEN********************************************************************************ˆCHK_FLOPPYROUTINE*C*ˆThisisa‚devicedependent‚routinewhose‚offsetmust‚beinstalled D*ˆatthebeginningofthedriver.The‚functionof‚thisroutine‚istoF*ˆcheckthatthebytespersector,‚sectorspertrack,anddata-densityG*ˆdensityvaluesareconsistentwitheachother.Thisroutineiscalled?*ˆafterthe‚user's‚configuration‚block‚has‚been‚filled‚with‚theG*ˆproposedconfiguration.Therefore,A0pointstotheendoftheuser's*ˆconfigurationblock.*0*ˆEntry:A0=endofuser'sconfigurationblock.* *Interruptlevelonentryis0.*!*ˆRegisterusage:…01234567*™D*™A‚P* *ˆCalls:none*/*ˆExit:‚RTStocallerwithconditioncodesset:-*noerrorsinthisconfigurationcheck.*anerrorwasfound.*F*ˆTheinterruptleveluponexitmustbethesameasitwasuponentry.*N****************************************************************************** CHK_FLOPPY: ‰CMP.BD0,D0‰RTS‰PAGEN******************************************************************************* *ˆCHK_LSN*C*ˆThisisadevicedependentroutinewhoseoffsetmust‚be‚installedD*ˆatthebeginningofthe‚driver.ThefunctionofthisroutineistoC*ˆcheckthat‚therequestedstartinglogical‚sectornumber(inD2.L)E*ˆislessthanorsameasthelargestlogicalsectornumbersupported$*ˆbytheparticulardiskcontroller.**-*ˆEntry:D2=startinglogicalsectornumber.* *Interruptlevelonentryis0.*!*ˆRegisterusage:…01234567*™D†P*™A* *ˆCalls:none*/*ˆExit:‚RTStocallerwithconditioncodesset:3*=startinglogicalsectornumberisinvalid.1*=startinglogicalsectornumberisvalid.*F*ˆTheinterruptleveluponexitmustbethesameasitwasuponentry.*N****************************************************************************** CHK_LSN: ‰CMP.BD0,D0‰RTS‰PAGEN******************************************************************************* *ˆBLD_PACKET*C*ˆThisisadevice-dependentroutinewhose‚offsetmustbeinstalledD*ˆatthebeginningofthedriver.ThefunctionofthisroutineistoC*ˆbuildanyorall‚partsofthecommandpacketthatcanbebuiltat=*ˆinterrupt‚level0‚which‚willbe‚used‚bythe‚particular‚disk,*ˆcontrollertoprocessthecurrentcommand.*A*ˆEntry:„A1=pointertoDrive'sVariableBlockinglobalmemory.#*’A5=physicaladdressoftheCCB.* *’Interruptlevelonentryis0.*!*ˆRegisterusage:…01234567 *™D‚**‹* *™A„P*…P* *ˆCalls:„none*/*ˆExit:‚RTStocallerwithconditioncodesset:3*‚Noerrorswerefoundinbuildingthepacket.4*‚Anerrorwasdetectedinbuildingthepacket.4*•D1.B=VERSAdoserrorcodefortheerrordetected.*F*ˆTheinterruptleveluponexitmustbethesameasitwasuponentry.*N****************************************************************************** BLD_PACKET:*>*ˆThisroutinecompletesthecommandpacket.‚Itfillsinthose?*ˆfieldsthatarecommontoallcommandsaswellassomefields?*ˆwhichareuniquetoaparticularcommand.Commandchainingis<*ˆrequiredforreadandwritecommandswhentheI/Otransfer>*ˆcrossesthetrackzerototrackoneboundary.Forthiscase,$*ˆtwocommandpacketsareprocessed.* :‰MOVEM.LƒD0/D1/D7/A2,-(SP)ƒSavetheregisterswewilluse. *.*‚Getthepointertothefirstcommandpacket.*=‰MOVE.L„IOCAPTR(A1),A2†A2<--addressofthiscommandpacket.7‰MOVEQ.Lƒ#0,D7D7<--pointertosecondcommandpacket.0EQATTRƒEQU‡CONFGBLK+IOSATW…Foreasyreference...‰PAGE*F*‚Determineifthisisareadorwritecommand.‚Ifitis,completetheJ*‚sectoraddressandbufferfieldsofthiscommandpacket.IfthiscommandK*‚requestscrossingthetrackzero/trackoneboundaryona256bytes/sectorD*‚floppydisk,thensetupD7topointtothesecondcommandpacket.*<‰CMP.B…#READFUNC,IOFUNCT(A1)ƒDothefollowingforread/write‰BEQ.S…RW_PROC‘operationsonly.‰CMP.B…#WRTFUNC,IOFUNCT(A1)‰BEQ.S…RW_PROC ‰BRA.S…NOT_RW  HRW_PROCƒMOVE.LƒIOSECTOR(A1),CMDLSN(A2)ƒStorethestartingsectornumber.;ŠMOVE.LƒIOSCTCNT(A1),CMDNST(A2)ƒStorethecountofsectors.9ŠMOVE.LƒIOBUFPTR(A1),CMDBUF(A2)ƒStorethebufferaddress. 1ŠTST.L„HALFSCTS(A1)ŠIfHALFSCTSiszero,skipany!ŠBEQ.S„PKT_LOOPŒcommandchaining. 8ŠMOVE.LƒIOSCTCNT(A1),D0‡Ifthere'satrack-zerocrossing>ŠSUB.L„HALFSCTS(A1),D0…ona256bytes/sectorfloppydisk,then3ŠIFTHEN‘commandchainingmustbeused.‚Setup5‹MOVE.L‚A2,D7D7topointtothenextcommandpacket.‹ADD.Lƒ#CMDLEN,D7ŠENDINOT_RW *G*‚Thissectionofcodefillsinthefirst8bytesofthecommandpacketF*‚whicharecommontomostcommands.‚Iftwopacketsarerequired,thisF*‚codeisenteredasecondtimewithA2pointingtothesecondcommand *‚packet.* PKT_LOOP***¤RETRYCOUNT<‰BTSTW„#IOPRTYB,IOOPTS(A1)‚Istheoptionfornoretriesset?.‰IFTHEN’Ifset,noretriesisrequested.6ŠMOVE.Bƒ#0,D0Usearetrycountofzeroforalldisks.)‰ELSEšIfclear,setretrycountfordisk. 6‰MOVE.Bƒ#HRTRYCNT,D0‰Defaulttoharddiskretrycount.2‰BTSTW„#IOARDISC,EQATTR(A1)Isthisafloppydisk?‰IFTHEN’Yes.7ŠMOVE.Bƒ#FRTRYCNT,D0ˆReplaceD0withfloppydiskcount.‰ENDI‰ENDI8‰MOVE.B„D0,RETRY(A2)ˆCopycorrectretrycounttopacket.‰PAGE***¤MISCCONTROLCODEA‰MOVE.BƒMEDCODE(A1),MISCTRL(A2)Copythemedia/misccontrolcode.2‰BTSTW„#IOARDISC,EQATTR(A1)Checkforfloppydisk.‰IFTHEN’Ifyes,3ŠMOVEQ.L‚#0,D0Ifweaccesstrack0,modifyMISCTRLDŠMOVE.BƒCONFGBLK+IOSSPT(A1),D0forasectorsizecodeof00equalto8ŠCMP.L„IOSECTOR(A1),D0…128bytes/sectorandFMrecording2ŠIFTHEN‘density.Thisreallyonlyappliesto>‹AND.Bƒ#$C7,MISCTRL(A2)„MFMdisksbutwedoitforFMaswell.ŠENDI‰ENDI ***¤VECTORNUMBERANDLEVEL@‰MOVE.BƒCCBVECT(A5),INTNUM(A2)‚Copytheinterruptvectornumber.9‰MOVE.BƒCCBPPRIO(A5),INTLEV(A2)Copytheinterruptlevel. ***¤COMMANDOPTIONS,ETC.:‰MOVE.Bƒ#AMCODE,CMDAMC(A2)ƒCopytheaddressmodifiercode.6‰MOVE.BƒDRIVENUM(A1),CMDLUN(A2)Copythedrivenumber.C‰MOVE.Bƒ#OPTDFLT,CMDOPT(A2)‚Copythecommandoptionsdefaultvalue. ***¤COMMANDCODE/‰MOVE.BƒIOFUNCT(A1),D0‡D0<--I/Ofunctioncode ‰EXT.W„D0“*B‰MOVE.BƒOPTBL(PC,D0),CMDCODE(A2)UsetabletosetcodeintheECA. ‰BRA†SKIP_TBL O*********************************************************************************ˆVM22COMMANDCODETABLE*@*ˆThistablecontainstheVM22definedcommandcodesfortheI/O!*ˆoperationscurrentlysupported.*O******************************************************************************* .‰DC.B…CMDWRITŽWritecommand:‚IOFUNCTequals-13OPTBL„DC.B…CMDFRMTŽFormatcommand:IOFUNCTequals‚0.‰DC.B…CMDCNFGŽConfigure-seek:IOFUNCTequals‚1,‰DC.B…CMDREADŽReadcommand:ƒIOFUNCTequals‚2SKIP_TBLDS.W†0“Endoftable*8‰CMP.B…#FMTFUNC,IOFUNCT(A1)‚IfthisisaFORMATcommand,‰IFTHEN’dothefollowing: =EQ510„EQU†CONFGBLK+IOSILV†Copytheinterleavefactorfromthe?‰MOVE.BƒEQ510(A1),ILEAVE(A2)driveblocktothecommandpacket. THEN•changetheVM22commandcodeto)‹MOVE.B‚#CMDFRMU,CMDCODE(A2)„format-unit.#ŠELSEElseitmustbeformattrack. @ŠMOVE.LIOSECTOR(A1),CMDLSN(A2)ƒCopystartinglogicalsectorno. 9ŠCMP.W„#IOPBAD,IOOPTS(A1)†Ifthisisaformatw/alternate1ŠIFTHEN•command,storethealternatesectorB‹MOVE.LIOALTSEC(A1),CMDNST(A2)‚no.inthecommandpacket.Setthe<‹BSETƒ#CFMTBAD,CMDOPT(A2)†optionbitforformatw/alternate.ŠENDIŠENDI ‰ENDI CPKT_TWO‚MOVE.Bƒ#0,S_COMP(A2)ˆClearthestatusbyteinfirstcommand9‰MOVE.LƒD7,CMDPNTR(A2)‡packetandcopythechainpointer.*J*‚Thecommandchainingpointeriszeroifthisisthelastoronlypacket.  '6>!;)!194AJ*‚Thecommandchainingpointerisnotzeroifasecondpacketisrequired.*+‰IFTHEN’Ifthepointerisnotzero... 4‰MOVE.L„HALFSCTS(A1),D1…D1<--sectorsintrackzero=‰MOVE.L„D1,CMDNST(A2)‡Copythenumberofsectorstotransfer.,‰MOVE.L„D7,A2PointA2tocommandpacket#2. 5‰MOVE.L„IOSECTOR(A1),D0…D0<--startingsectornumber5‰ADD.L…D1,D0Addtofindnextstartingsectornumber.0‰MOVE.L„D0,CMDLSN(A2)‡Copytocommandpacket#2.;‰MOVE.L„D0,IOSECTOR(A1)…CopyheresothatwesetupMISCTRL"*§forcommandpacket#2correctly. +‰MOVE.L„IOSCTCNT(A1),D0…D0<--sectorcount4‰SUB.L…D1,D0Subtracttofindnextcountofsectors.0‰MOVE.L„D0,CMDNST(A2)‡Copytocommandpacket#2. -‰MOVE.L„IOBUFPTR(A1),D0…D0<--bufferaddress5‰MULU†#128,D1Calculatenextbufferaddressbyadding'‰ADD.L…D1,D0tocurrentbufferaddress.0‰MOVE.L„D0,CMDBUF(A2)‡Copytocommandpacket#2. 7‰MOVEQ.Lƒ#0,D7D7<--0indicatinglastcommandpacket..‰BRA†PKT_LOOPLoopbacktocompletepacket#2. ‰ENDI 9‰MOVEM.Lƒ(SP)+,D0/D1/D7/A2ƒRestoretheregistersweused.'‰CMP.B…D0,D0Setgoodstatusonreturn.‰RTS‰PAGEN******************************************************************************* *ˆDISK_START*C*ˆThisisadevicedependentroutinewhoseoffsetmustbeinstalledE*ˆatthebeginningofthedriver.Thefunctionofthisroutineisto:*.*Š1.‚Setupthedevice-dependentfieldsinthe*Ždrive'svariableblock.B*Š2.‚Ifthedriveisnotbusy,tellthecommandtothecontroller.**D*ˆEntry:A1=addressofthedrivesvariableblockinglobalmemory.#*A5=physicaladdressoftheCCB.*=*Interruptlevelonentryisatourhardwarelevel(masked).*!*ˆRegisterusage:…01234567*™D‚* *™A‚*P‡P* *ˆCalls:none**ˆExit:‚RTStocaller.*N****************************************************************************** DISK_START:4‰MOVEM.LƒD0/A0,-(SP)‹Savetheregisterswewilluse. 9‰MOVE.L„CCBCHB(A5),A0‰Assurethatthecontrollerisready<‰MOVE.L„#TIMEOUT,D0‰toreceivethecommandthatwe'veplaced9SEND10ƒSUBQ.L„#1,D0intoglobalmemory.Thecontrolleris0‰BEQ‡CTRLERRreadywhentheCSQUEbitisoff.‚We=‰BTST†#CSQUE,STATUS(A0)ƒmaytimeoutinthisloopindicatinga&‰BNE‡SEND10Žprobablecontrollererror. 1‰MOVE.B„#0,CAAM(A0)‹InitializetheCommandAccess*¦AddressModifiercode. 9‰MOVE.L„IOCAPTR(A1),D0ˆSendtheCAPaddressthroughwrite&‰MOVEP.LƒD0,CAP(A0)ŠregistersWR4-WR7. =‰BSET†#CRQUE,CONTROL(A0)„SettheCRQUEbittoinformtheVM22'*¦thatacommandpackethasbeenplaced(*¦inmemoryandisreadytobeexecuted."*¦Acceptancetestisnotneccesary*¦becauseithappenssofast. 3‰MOVEM.Lƒ(SP)+,D0/A0‹Restoretheregistersweused.‰RTS‰PAGEN********************************************************************************ˆCHK_PARAMROUTINE*C*ˆThisisa‚devicedependent‚routinewhose‚offsetmust‚beinstalledD*ˆatthebeginningofthedriver.The‚functionof‚thisroutine‚istoB*ˆvalidate‚any‚device‚dependent‚parameters.‚Thisroutineiscalled?*ˆafterthe‚user's‚configuration‚block‚has‚been‚filled‚with‚theG*ˆproposedconfiguration.Therefore,A0pointstotheendoftheuser's*ˆconfigurationblock.*/*ˆEntry:A0=endofuser'sconfigurationblock* *Interruptlevelonentryis0.*!*ˆRegisterusage:…01234567*™DˆR*™A‚P* *ˆCalls:none*$*ˆExit:‚RTSbacktocallingroutine.>*CONDITIONCODES:noerrorsinthisconfigurationcheck.* anerrorwasfound./*D3.B=Returnederrorcodeiferrorisfound.*F*ˆTheinterruptleveluponexitmustbethesameasitwasuponentry.*N**************************************************************  **************** CHK_PARAM: ‰CMP.B…D0,D0Setconditioncodes ‰RTS›Return.‰PAGEN********************************************************************************‰FINISHOFFTHEINITIALIZATION*2*‰Theseotherdevice-dependentthingsMUSTbedone>*‰beforewecanhandlecommands.‚Theyprobablycouldhavebeen?*‰doneinINITatthestartofthedriverbutarehandledhere.*3*‰1.‚AllocateglobalmemoryfortheCommandPackets-*‰2.‚CheckthattheVM22boardisfunctional.**‰Entry:A5=addressofCCB.**‰Calls:REQSTAT*N****************************************************************************** DO_INIT:*4*‚Allocatememoryforthecommandandstatuspackets*7‰MOVE.Lƒ#PAGES,A0ŽAllocateglobalmemoryforacommand/5‰MOVE.Lƒ#4,D0statuspacketforeachpossibledevice..‰TRAP…#0“Theaddressforthememorysegmentis*¦returnedinA0.‰BRA.S„INIT20Goodreturn!‰BRA.S„INITERRŽBadreturn. EINIT20ƒMOVE.LƒA0,SAVECAP(A5)‡SavethebaseaddressoftheCAPpointer8‰MOVEQ.L‚#DRIVES,D1‹**‚01/03/86‚Clearthepacketmemory.‰MULU…#PKTLONG,D13‰SUBQ.Lƒ#1,D1D1<--numberoflongwordstoclear.INIT25ƒCLR.L„(A0)+‰DBRA…D1,INIT25 7‰MOVE.LƒSAVECAP(A5),A0‡RestoretheCAPpointerintoA0.NNN6‰MOVE.LƒA0,A2CopyitintoA2forthenextsubroutine,>‰MOVE.LƒCCBCHB(A5),A0ˆandgettheVM22channel'smemory-mapped*¦I/OareaintoA0. :‰MOVE.Lƒ#TIMEOUT*2000,D1‡Assurethatthecontrollerisnot7INIT30ƒSUBQ.Lƒ#1,D1performingtheself-test/initialize2‰BEQ†INITERRŽroutines.‚Communicationshouldnotbe=‰BTST…#CSRDY,STATUS(A0)„attemptedwhilethebitisset.Then,2‰BEQ†INIT30assurethecontrollerhasnotdetected?‰BTST…#CSFLT,STATUS(A0)„afault.Allowapproximately15seconds‰BEQ.S„INITDONEfortimeout. >‰MOVE.Bƒ#$40,CONTROL(A0)‡Ifthefaultbitisset,tryreseting=‰MOVE.Bƒ#$00,CONTROL(A0)…theVM22controller.‚Setthebitsto'*¦performaself-testandallowSYSFAIL*¦whencomingoutofreset. 5‰BSR.S„REQSTATŽRequestthestatusofthelatestself-5‰BEQ.S„INITDONEtest.‚Ifanerrorwasagaindetected,?INITERR‚SNE.B„CHANDOWN(A5)‰shutthechanneldownbysettingthe+INITDONERTS›variableCHANDOWNtonon-zero. PAGEO********************************************************************************3*ˆREQUESTSELF-TESTSTATUSFROMTHEVM22CONTROLLER*NN  NC*ˆThissubroutinerequestsstatusaboutthelastself-testfromtheA*ˆVM22Controller.Itsendsarequestself-teststatus‚command‚toF*ˆthecontrollerandthenmovesthestatusbytefromthestatuspacket?*ˆtoregisterD0.Therequestismadeusingthepollingmethod.*=*ˆEntry:„A0=PhysicaladdressofVM22Memory-mappedI/Oarea)*’A2=Commandpacketaddressfordrive0*!*ˆRegisterusage:‰01234567*œDƒR**œAƒPƒP*4*ˆExitsto:CallerviaRTSwithconditioncodesset:*’‚Self-testpassed.4*’‚Self-testfailedorcannotperformself-test.*O******************************************************************************* REQSTAT:8‰MOVE.L„#TIMEOUT*10,D1ˆAssurethatthecontrollerisnot7REQ100ƒSUBQ.L„#1,D1performingtheself-test/initialize1‰BEQ‡REQERRŽroutines.‚Communicationshouldnotbe7‰BTST†#CSRDY,STATUS(A0)ƒattemptedwhilethebitisset.1‰BEQ‡REQ100Žassurenoerrorsweredetectedduring ?‰MOVE.B„#CMDREQ,CMDCODE(A2)ƒSetupatype1commandpacketwith>‰MOVE.W„#0,INTLEV(A2)‡theREQUESTcommandopcodeandinterrupt&*¦levelandvectornumbersettozero. 7‰MOVE.L„#TIMEOUT,D1‹Assurethatthecontrollerisreadystatus.‰ENDNNNNN  N' VMES10 CRTINIT AFUU  EDITMODEAF^^  FEEDER AFgg  INCHAR AFpp  OUTCHS AFyy  PAGEMODEAF‚‚  POUTCHS AF‹‹  TERMDRV AF””  CRTINIT SAó  EDITMODESAÆÆv  FEEDER SAOO'"  INCHAR SA€€¥  OUTCHS SA¡¡ÐÙ  PAGEMODESAzzs  POUTCHS SA“„ó   TERMDRV SA•†Ìw  =/*=/*†VMES10.CRTINIT.AF=/*8=/* Chain file to assemble VME/10 screen/keyboard driver=/*:=/* If no output argument is specified for the listing the0=/* chain file will default to VMES10.CRTINIT.LS=/*=/IFC \1ƒ=ARGVMES10.CRTINIT.LS=/ENDIF=/*2=ASM VMES10.CRTINIT.SA,VMES10.CRTINIT.RO,\1;RZ=140=/*{ Included files are:=/*ƒ--none--=/*}=/*=ENDNNNNNNM=/*=/*†VMES10.EDITMODE.AF=/*8=/* Chain file to assemble VME/10 screen/keyboard driver=/*:=/* If no output argument is specified for the listing the1=/* chain file will default to VMES10.EDITMODE.LS=/*=/IFC \1ƒ=ARGVMES10.EDITMODE.LS=/ENDIF=/*4=ASM VMES10.EDITMODE.SA,VMES10.EDITMODE.RO,\1;RZ=140=/*{ Included files are:=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.VMES10.TERMDRV.EQ=/*}=/*=END  NNNNNNV=/*=/*†VMES10.FEEDER.AF=/*M=/* Chain file to assemble VMES10.FEEDER.SA for VME/10 screen/keyboard driver=/*:=/* If no output argument is specified for the listing the/=/* chain file will default to VMES10.FEEDER.LS=/*=/IFC \1ƒ=ARGVMES10.FEEDER.LS=/ENDIF=/*0=ASM VMES10.FEEDER.SA,VMES10.FEEDER.RO,\1;RZ=100=/*{ Included files are:=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.VMES10.TERMDRV.EQ=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*}=/*=ENDNNNNN_  =/*=/*†VMES10.INCHAR.AF=/*M=/* Chain file to assemble VMES10.INCHAR.SA for VME/10 screen/keyboard driver=/*:=/* If no output argument is specified for the listing the/=/* chain file will default to VMES10.INCHAR.LS=/*=/IFC \1ƒ=ARGVMES10.INCHAR.LS=/ENDIF=/*0=ASM VMES10.INCHAR.SA,VMES10.INCHAR.RO,\1;RZ=140=/*{ Included files are:=/*ƒ9995.&.UTILITY.MC=/*}=/*=ENDNNNNNNh=/*=/*†VMES10.OUTCHS.AF=/*M=/* Chain file to assemble VMES10.OUTCHS.SA for VME/10 screen/keyboard driver=/*:=/* If no output argument is specified for the listing the/=/* chain file will default to VMES10.OUTCHS.LS=/*=/IFC \1ƒ=ARGVMES10.OUTCHS.LS=/ENDIF=/*0=ASM VMES10.OUTCHS.SA,VMES10.OUTCHS.RO,\1;RZ=140=/*{ Included files are:=/*ƒ--none--=/*}=/*=ENDNNNNN  Nq=/*=/*†VMES10.PAGEMODE.AF=/*B=/* Chain file to assemble VMES10.PAGEMODE.SA for VME/10 page mode=/* input handler=/*:=/* If no output argument is specified for the listing the1=/* chain file will default to VMES10.PAGEMODE.LS=/*=/IFC \1ƒ=ARGVMES10.PAGEMODE.LS=/ENDIF=/*4=ASM VMES10.PAGEMODE.SA,VMES10.PAGEMODE.RO,\1;RZ=140=/*{ Included files are:=/*ƒ--none--=/*}=/*=ENDNNNNNNz=/*=/*†VMES10.POUTCHS.AF=/*N=/* Chain file to assemble VMES10.POUTCHS.SA for VME/10 screen/keyboard driver=/*:=/* If no output argument is specified for the listing the0=/* chain file will default to VMES10.POUTCHS.LS=/*=/IFC \1ƒ=ARGVMES10.POUTCHS.LS=/ENDIF=/*2=ASM VMES10.POUTCHS.SA,VMES10.POUTCHS.RO,\1;RZ=140=/*{ Included files are:=/*ƒ--none--=/*}=/*=ENDNNN  NNNƒ=/*=/*†VMES10.TERMDRV.AF=/*N=/* Chain file to assemble VMES10.TERMDRV.SA for VME/10 screen/keyboard driver=/*:=/* If no output argument is specified for the listing the0=/* chain file will default to VMES10.TERMDRV.LS=/*=/IFC \1ƒ=ARGVMES10.TERMDRV.LS=/ENDIF=/*2=ASM VMES10.TERMDRV.SA,VMES10.TERMDRV.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.&.KILL.MC=/*ƒ9995.&.KILLDRV.EQ=/*ƒ9995.VMES10.TERMDRV.EQ=/*}=/*=ENDNNNNNŒ4CRTINIT‚IDNT†45,0†Configurethevirtualdisplayarea0‰TTL‡CRTINIT:‚ConfigurethevirtualdisplayareaNN  NNNNN•ž=¦F®E¶*<*************************************************************º**Routinename:ŽCRTINIT—*<*----------------------------------------------------------*-*Currentrevision.....................1.00*1*Datewritten.........................12-21-82Œ*2*Writtenby...........................S.Pri-Tal‹*)*Datechanged.........................”*)*Changedby...........................”**º**Descriptionofchange:£**º**º**º**º**º**º*<************************************************************.*Function:InitializealltheCRTconstants*<*----------------------------------------------------------**Inputparameters:none£*<*----------------------------------------------------------**Registersaffected:none¡*<*----------------------------------------------------------* *Externalroutinesused:none*<************************************************************‰PAGE ‰XDEF†CRTINIT‰XDEF†SCRNINIT *‰XDEF†FACSFieldAttributeCodesineffect 5‰XDEF†CPERLINEŒNumberofcharactersperabsoluteline+‰XDEF†BPERLINEŒNumberofbytesperRAMline2‰XDEF†LPERSCRNŒNumberoflinesperabsolutescreen "‰XDEF†S.SCRNŽVirtualhomeposition*‰XDEF†E.SCRNŽEndaddressofvirtualscreen 3‰XDEF†C.LINEŽNumberofcharactersinavirtualline.‰XDEF†B.LINEŽNumberofbytesinavirtualline/‰XDEF†PB.LINENumberofblankedbytesinaline2‰XDEF†S.LINEŽStartaddressofvirtualcurrentline0‰XDEF†E.LINEŽEndaddressofvirtualcurrentline0‰XDEF†L.SCRNŽNumberoflinesinavirtualscreen (‰XDEF†SCREENŽBaseaddressofdisplayRAM<‰XDEF†CRTCADD,CRTCREG…AddressesofCRTcontrollerregisters. +‰XDEF†LEFTCOLLeftcolumnofvirtualscreen-‰XDEF†RIGHTCOLŒRightcolumnofvirtualscreen*$*Š0<=LEFTCOL/RIGHTCOL<=CPERLINE-1*(‰XDEF†TOPLINEToplineofvirtualscreen+‰XDEF†BOTLINEBottomlineofvirtualscreen*#*Š0<=TOPLINE/BOTLINE<=LPERSCRN-1*#‰XDEF†PAGEFLAGŒ0=scroll;$FFFF=page .SCREENƒEQU‡$F17000BaseaddressofdisplayRAM(CRTCADD‚EQU‡$F1A021BaseaddressofCRTC1CRTCREG‚EQU‡$F1A023AddressofCRTCregisterfile‰PAGE ‰SECTIONƒ16CPERLINEDC.W†80’Numberofcharactersinabsoluteline3LPERSCRNDC.W†25’Numberoflinesinabsolutescreen6BPERLINEDC.L†160‘NumberofbytesinabsoluteRAMline*G* The following 4 constants can be changed by using escape sequences or* their eqivalents.*,LEFTCOL‚DC.W†0“Defaultvalueforleftcolumn/RIGHTCOLDC.W†79’Defaultvaluef  orrightcolumn)TOPLINE‚DC.W†0“Defaultvaluefortopline-BOTLINE‚DC.W†23’Defaultvalueforbottomline 7S.SCRNƒDC.L†$F17000InittobethesameasstartofRAM7E.SCRNƒDC.L†$F17F00Endaddressofvirtualdisplayarea&C.LINEƒDC.W†79’AdjustedforDBRAloopsB.LINEƒDC.L†160)S.LINEƒDC.L†$F17000Startofcurrentline'E.LINEƒDC.L†$F170A0EndofcurrentlinePB.LINE‚DC.W†00&L.SCRNƒDC.W†23’AdjustedforDBRAloops)*C.SCRNƒDC.L†1919AdjustedforDBRAloopsFACS…DC.W†$4400#PAGEFLAGDC.W†0“Inittoscrollmode‰PAGE‰SECTIONƒ11’ProgramareaSCRNINITDS.W†0-‰MOVE.W„#80,CPERLINEˆ80charactersperscreen1‰MOVE.W„#25,LPERSCRNˆ24linesinthedisplayarea‰CLR.W…TOPLINE‰MOVE.W„#23,BOTLINE‰CLR.W…LEFTCOL‰MOVE.W„#79,RIGHTCOL‰CLR.W…PAGEFLAG SPC 1 CRTINIT‚EQU‡*'‰MOVEM.LƒD0/A0,-(A7)‰Saveuser'svalues‰CLR.L…D0’HSKP ** Init the FACs register*‰MOVE.W„#$4400,FACS**ˆD15†clearedforunprotect*ˆD14†setfordisplay*ˆD13†clearedfornon-blink*ˆD12†clearedfornounderline$*ˆD11†clearedfornoninvertedvideo<*ˆD10-D08‚setforhalfbrightness(111=maximumbrightness)*ˆD07†clearedfornoTAB*ˆD06-D00‚nullcharacter* *9* Init number of RAM bytes required for one absolute line**’BPERLINE=CPERLINE*2*:‰MOVE.W„CPERLINE,D0‰Maximumnumberofcharactersinaline‰LSL.L…#1,D0Ž*2,‰MOVE.L„D0,BPERLINEˆ=Bytesperabsoluteline *M* Init the number of character per line in the virtual display area - C.LINE.*!*’C.LINE=RIGHTCOL-LEFTCOL+1*>* (adjusted for DBRA loops, expressed in characters on screen)* ‰CLR.L…D0;‰MOVE.W„RIGHTCOL,D0‰Requestedlastcolumninvirtualscreen;‰SUB.W…LEFTCOL,D0‰-Requestedfirstcolumninvirtualscreen9‰MOVE.W„D0,C.LINEŠ=Numberofcharactersinavirtualline*¦-1toadjustforDBRAloops ‰ADD.W…#1,D0 ‰LSL.W…#1,D0-‰MOVE.L„D0,B.LINE‹Initbytespervirtualline *1* Init the number of blanked bytes in a RAM line.* *’PB.LINE=[CPERLINE-C.LINE]*2* ‰CLR.L…D0<‰MOVE.W„CPERLINE,D0‰Numberofcharactersinanabsoluteline8‰SUB.W…C.LINE,D0Š-Numberofcharactersinavirtualline)‰SUB.W…#1,D0ToadjustfortheDBRAvalue‰LSL.W…#1,D0Times29‰MOVE.W„D0,PB.LINE‰=NumberofblankedbytesinaRAMline *@* Init the number of lines in the virtual display area - L.SCRN.**’L.SCRN=BOTLINE-TOPLINE+1** Adjusted for DBRA loops* ‰CLR.L…D0(‰MOVE.W„BOTLINE,D0ŠRequestedbottomline%‰SUB.W…TOPLINE,D0‰-Requestedtopline6‰MOVE.W„D0,L.SCRNŠ=Numberoflinesinavirtualscreen *D* Init the number of character in the virtual display area - C.SCRN.*#*’C.SCRN=[C.LINE+1]*[L.SCRN+1]*H* (adjusted for DBRA loops, expressed in number of characters in screen)* *ˆCLR.L…D09*ˆMOVE.W„C.LINE,D0‹Numberofcharactersinavirtualline$*ˆADD.W…#1,D0ToadjustfortheDBRA*ˆMOVE.W„D0,C.SCRN6*ˆMOVE.W„L.SCRN,D0‹Numberoflinesinavirtualscreen$*ˆADD.W…#1,D0ToadjustfortheDBRA<*ˆMULU.W„C.SCRN,D0Š=Numberofcharactersinavirtualscreen*ˆMOVE.W„D0,C.SCRN-*ˆSUB.W…#1,C.SCRNŠ-1toadjustforDBRAloops *H* Init the absolute address of home position in the virtual display area*0*ˆS.SCRN=SCREEN+TOPLINE*BPERLINE+LEFTCOL*2* ,‰MOVE.L„BPERLINE,D0ˆ=Bytesperabsoluteline0‰MULU.W„TOPLINE,D0‰=Unusedareaontopofscreen‰ADD.W…LEFTCOL,D00‰ADD.W…LEFTCOL,D0‰+Unusedbytesatstartofline.‰ADD.L…#SCREEN,D0‰+BaseaddressofdisplayRAM+‰MOVE.L„D0,S.SCRNŠ=VirtualhomeRAMaddress *B* Init the absolute address of the end of the virtual display area*1*ˆE.SCRN=SCREEN+BOTLINE*BPERLINE+RIGHTCOL*2*,‰MOVE.L„BPERLINE,D0ˆ=Bytesperabsoluteline9‰MULU.W„BOTLINE,D0‰=Numberofbytestostartoflastline‰ADD.W…RIGHTCOL,D07‰ADD.W…RIGHTCOL,D0ˆ=Numberofbytestoendoflastline&‰ADD.L…#SCREEN,D0‰=BaseaddressofRAM ‰ADD.L…#2,D01‰MOVE.L„D0,E.SCRNŠ=EndofvirtualscreeninRAM+1 *?* Init S.LINE to point to start address of cursor virtual line.=* Init E.LINE to p oint to end address of cursor virtual line.*‰CLR.L…D0’HSKP ‰MOVE.B„#$E,CRTCADD‰PointtoR14‰MOVE.B„CRTCREG,D0 ‰LSL.W…#8,D0‰MOVE.B„#$F,CRTCADD2‰MOVE.B„CRTCREG,D0ŠD0.W=absoluteaddressofcursor ‰LSL.W…#1,D0 ‰MOVE.L„D0,A02‰ADD.L…#SCREEN,A0ŠA0.L=addressofcursoronscreen ‰LSR.W…#1,D0‰DIVU†CPERLINE,D0‰D0.L=00cc00ll‰SWAP†D0’D0.W=00cc7‰SUB.W…LEFTCOL,D0ŠD0.W=numberofspotstostartofline‰LSL.W…#1,D0Tomakeitbytes ‰SUB.W…D0,A0‰MOVE.L„A0,S.LINE ‰ADD.W…C.LINE,A0‰ADD.W…C.LINE,A0 ‰ADD.W…#2,A0‰MOVE.L„A0,E.LINE‰MOVEM.Lƒ(A7)+,D0/A0‰RTS‰END NNN:EDITMODE‚IDNTƒ45,0‡VME/10editmodeemulationforTERMDRV.6ŠTTL„EDITMODE:‚VME/10editmodeemulationforTERMDRV.NNNNNNN ¾Ç7Ï?×Fß:ç3ï*÷)ÿ,)'1>'G/O7@?8O*v*****************************************************************************O*******************************************************************************O**********************************************************************************É*** =***†FILENAME:‚EDITMODE--EDITMODEEMULATIONFORTERMDRV******É***8***†ENVIRONMENT:‚LinkedintoTERMDRVfortheVME/10.’******É***E***†FUNCTION:‚Whenthekeyboard/screenisputintoeditmode,any…***?***‰charactersreceivedfromthekeyboardaresentherefor‰******‰specialinterpretation.©******É***B***†NOTES:‚OnlyRETURNCOMMANDmodeisimplemented;NON-RETURNˆ***D***‰COMMANDmodeisnotsincetheVERSAdoseditor(E.LO)doesn't„******‰useit.¹******É***,***†EXTERNALDATASTRUCTURESREFERENCED:Ÿ*** ***‰CCBforterminaldriver.¨***(***‰VariousparametersfromCRTINIT. ******É***)***†EXTERNALENTRYPOINTSREFERENCED:¢******‰OUTCHSº******É***"***†SERVICESCALLEDVIATRAPS:©******É***O*******************************************************************************O*******************************************************************************O*^***************************************************************************** *,*‚Revisionhistory(addnewchangestotop).*…Date†Author‰ChangesG*…--------‚-------------‚----------------------------------------------;*†1/30/85‚MikeDuh‡SetRING_BELLflagwhen$07isdetected.2*†7/19/83‚SteveFranckƒSeparatedoutFEEDERstuff.'*†4/31/83‚SteveFranckƒInitialwriting.*ŠPAGE* *‚XDEF's.*:ŠXDEFƒEDITMODE‹Entrypt.forchar'sreceivedineditmode.5ŠXDEFƒKB_LOCKŒFlagindicatingwhetherthekeyboardis(*§locked(fromhavingsentatermination*§packetineditmode).7ŠXDEFƒDUP_CHAR‹Thisisawordfield,$FFFFiftherewas%*§noDUPLICATECHARspecifiedwhenwe'*§gotputintocommandmode,else$00dd%*§($dd=theDUPLICATECHAR)ifonewas *§specified.    *0*‚XREF's(indicatewheretheXDEFis,ifknown).*8ŠXREFƒOUTCHSRoutineinOUTCHStooutputcharonscreen./*ž(AllofthefollowingareXDEF'edinCRTINIT)9ŠXREFƒBPERLINE‹#ofbytesperabsolutedisplayline(.L).$*§Notethatsincethisisalongword#*§theaddressBPERLINE+2isusedin%*§DIVUinstructions(whichuseonlya"*§wordforthedivisor).‚Theupper*§wordisalways0.3ŠXREFƒC.LINE#ofchar'spervirtualline-1(.W).DŠXREFƒS.LINE,E.LINEStart/endaddr+1ofcurrentvirtualline(.L).>ŠXREFƒS.SCRN,E.SCRN†Start/endaddr+1ofvirtualscreen(.L).4ŠXREFƒSCREENBaseaddressofscreenRAM(anequate).?ŠXREFƒCRTCADD,CRTCREG„Addr'sofCRTcontrollerreg's(equates)..*ž(AllofthefollowingareXDEF'edinFEEDER)3ŠXREFƒFEEDEREntrypointandsomevariablesforthe>ŠXREFƒFEEDER_ADDRESS…FEEDERmodulewhichtakesourpacketsand)ŠXREFƒFEEDER_COUNT‡givesthemtoTERMDRV. 0ŠXREFƒRING_BELL‹Flagsetwhen$07isdetectedin&*žordertoringthebellinKEYBRD.AG.ŠPAGEO*********************************************************************************‰INCLUDEFILESANDEQUATES*O******************************************************************************* *=*‚DefinetheenvironmentasEXORMACS/Sinaswitchtocontrol*‚conditionalassemblies.*2ENVIRONMENTEQU‚'EX/S'ThisisfortheEXORMACS/S.  **‚Includefiles:5*‰UTILITY.MC‹Generalpurposemacros(e.g.PUSH,POP).,*‰IOE.SAEquatesforIOS-relatedstructures.7*‰EQUCCB.EQŒEquatesfordevice-independentpartofCCB.9*‰TERMDRV.EQ‹Equatesforthegeneralizedterminaldriver.*ŠNOLISTŠINCLUDE‚9995.&.UTILITY.MCŠINCLUDE‚9995.&.IOE.EQŠINCLUDE‚9995.&.CCB.EQŠINCLUDE‚9995.VMES10.TERMDRV.EQŠLIST  .FALSE…EQU„$00ValueFALSEforaflagvariable.,TRUE†EQU„$FFValueTRUE‚foraflagvariable.  4BSˆEQU„$08DefinitionsforcertainASCIIcharacters. LFˆEQU„$0A* CRˆEQU„$0D*SPACE…EQU„$20*DELETE„EQU„$7F*  5HOME†EQU„$C0Definitionsforcertaincharacterswhich7UPARROWƒEQU„$C1arerecognizedbytheEXORTERM155(and4DOWNARROWEQU„$C2henceOUTCHS)asspecialcommands.ERASE_EOLEQU„$D5*DEL_LINE‚EQU„$D7*  :START_OF_DATAEQU$DDDefinitionsforcertainpartsofthe1FILLER_BYTEEQU‚$FFpacketretur nedineditmode.END_OF_DATAEQU‚$DE*ŠPAGEO*********************************************************************************‰MISCELLANEOUSMACROS*O*******************************************************************************  *G*‚TheOUTPUTandOUTPUT_D0macrosinvoketheexternalsubroutineOUTCHSF*‚tooutputacharactertotheEXORMACS/Sscreen.‚OUTPUT_D0justcallsC*‚theroutinetooutputwhateverisinD0.B,whileOUTCHShasasanH*‚argumentthevalueofacharacter.‚ThischaractermustbeintherangeH*‚$00-$FF,ofcourse,andmustbeanimmediatevaluespecifiedWITHOUT*‚THE'#'.‚Forexample,7*‰OUTPUT'A'ƒcausesan'A'tobewrittentothescreen.*OUTPUT_D0 MACRO ŠBSR.L‚OUTCHSŠENDM OUTPUT„MACRO ŠIFGEƒ\1-$80ŠMOVEQ‚#$FFFFFF00+\1,D0ŠENDC ŠIFLTƒ\1-$80 ŠMOVEQ‚#\1,D0ŠENDC ŠBSR.L‚OUTCHSŠENDMŠPAGEO*********************************************************************************‰DATAVARIABLES*O******************************************************************************* ŠSECTION0 **‚Flags.*THENŠIfthereisone,1ŠCMP.B‚D0,D1Ž.‚Ifthischaracterisoneofthose,&ŠBEQ.L‚ERASE_LINE‰.‚goerasetheline.ŠENDI–. ,ŠCLR„D1‘D1.W<--offsetfromtable,whichis4ŠMOVE.BEDIT_TBL(PC,D0),D1(routineaddr-JMPBASE).;ŠLEA„JMPBASE(PC),A0…Jumptothespecifiedroutine:‚thatis,4ŠJMP„0(A0,D1)‹toJMPBASE+(routinead dr-JMPBASE).ŠPAGEO********************************************************************************:*‰TABLEOFACTIONTOTAKEFOREACHCHARWHILEINEDITMODE*O******************************************************************************* EDIT_TBL: ***************7*‚$00-$1F‚*ƒRoutineoffsetˆCharƒDescriptionofactionF***************ƒ----------------†----ƒ--------------------------------&ŠDC.BƒIGNORE-JMPBASE…$00--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$01--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$02--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$03--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$04--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$05--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$06--Ignoreit.ŠDC.BƒBELL-JMPBASE‡$07--Bell.,ŠDC.BƒPRINT-JMPBASE†$08--Printasis.(BS)-ŠDC.BƒPRINT-JMPBASE†$09--Printasis.(TAB)7ŠDC.BƒDO_LF-JMPBASE†$0A--Specialprocessingfor(LF).@ŠDC.BƒPRINT_TERM-JMPBASE$0B--Printandsendpacket.(UPLINE)6ŠDC.BƒPRINT-JMPBASE†$0C--Printasis.(CURSORRIGHT)7ŠDC.BƒDO_CR-JMPBASE†$0D--Specialprocessingfor(CR).&ŠDC.BƒIGNORE-JMPBASE…$0E--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$0F--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$10--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$11--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$12--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$13--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$14--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$15--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$16--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$17--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$18--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$19--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$1A--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$1B--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$1C--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$1D--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$1E--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$1F--Ignoreit.ŠPAGE***************7*‚$20-$3F‚*ƒRoutineoffsetˆCharƒDescriptionofactionF***************ƒ----------------†----ƒ--------------------------------0ŠDC.B‚PRINT_LOOK-JMPBASE$20--Printasis.‚()0ŠDC.B‚PRINT_LOOK-JMPBASE$21--Printasis.‚(!)0ŠDC.B‚PRINT_LOOK-JMPBASE$22--Printasis.‚(")0ŠDC.B‚PRINT_LOOK-JMPBASE$23--Printasis.‚(#)0ŠDC.B‚PRINT_LOOK-JMPBASE$24--Printasis.‚($)0ŠDC.B‚PRINT_LOOK-JMPBASE$25--Printasis.‚(%)0ŠDC.B‚PRINT_LOOK-JMPBASE$26--Printasis.‚(&)0ŠDC.B‚PRINT_LOOK-JMPBASE$27--Printasis.‚(')0ŠDC.B‚PRINT_LOOK-JMPBASE$28--Printasis.‚(()0ŠDC.B‚PRINT_LOOK-JMPBASE$29--Printasis.‚())0ŠDC.B‚PRINT_LOOK-JMPBASE$2A--Printasis.‚(*)0ŠDC.B‚PRINT_LOOK-JMPBASE$2B--Printasis.‚(+)0ŠDC.B‚PRINT_LOOK-JMPBASE$2C--Printasis.‚(,)0ŠDC.B‚PRINT_LOOK-JMPBASE$2D--Printasis.‚(-)0ŠDC.B‚PRINT_LOOK-JMPBASE$2E--Printasis.‚(.)0ŠDC.B‚PRINT_LOOK-JMPBASE$2F--Printasis.‚(/)0ŠDC.B‚PRINT_LOOK-JMPBASE$30--Printasis.‚(0)0ŠDC.B‚PRINT_LOOK-JMPBASE$31--Printasis.‚(1)0ŠDC.B‚PRINT_LOOK-JMPBASE$32--Printasis.‚(2)0ŠDC.B‚PRINT_LOOK-JMPBASE$33--Printasis.‚(3)0ŠDC.B‚PRINT_LOOK-JMPBASE$34--Printasis.‚(4)0ŠDC.B‚PRINT_LOOK-JMPBASE$35--Printasis.‚(5)0ŠDC.B‚PRINT_LOOK-JMPBASE$36--Printasis.‚(6)0ŠDC.B‚PRINT_LOOK-JMPBASE$37--Printasis.‚(7)0ŠDC.B‚PRINT_LOOK-JMPBASE$38--Printasis.‚(8)0ŠDC.B‚PRINT_LOOK-JMPBASE$39--Printasis.‚(9)0ŠDC.B‚PRINT_LOOK-JMPBASE$3A--Printasis.‚(:)0ŠDC.B‚PRINT_LOOK-JMPBASE$3B--Printasis.‚(;)0ŠDC.B‚PRINT_LOOK-JMPBASE$3C--Printasis.‚(<)0ŠDC.B‚PRINT_LOOK-JMPBASE$3D--Printasis.‚(=)0ŠDC.B‚PRINT_LOOK-JMPBASE$3E--Printasis.‚(>)0ŠDC.B‚PRINT_LOOK-JMPBASE$3F--Printasis.‚(?)ŠPAGE***************7*‚$40-$5F‚*ƒRoutineoffsetˆCharƒDescriptionofactionF***************ƒ----------------†----ƒ--------------------------------0ŠDC.B‚PRINT_LOOK-JMPBASE$40--Printasis.‚(@)0ŠDC.B‚PRINT_LOOK-JMPBASE$41--Printasis.‚(A)0ŠDC.B‚PRINT_LOOK-JMPBASE$42--Printasis.‚(B)0ŠDC.B‚PRINT_LOOK-JMPBASE$43--Printasis.‚(C)0ŠDC.B‚PRINT_LOOK-JMPBASE$44--Printasis.‚(D)0ŠDC.B‚PRINT_LOOK-JMPBASE$45--Printasis.‚(E)0ŠDC.B‚PRINT_LOOK-JMPBASE$46--Printasis.‚(F)0ŠDC. B‚PRINT_LOOK-JMPBASE$47--Printasis.‚(G)0ŠDC.B‚PRINT_LOOK-JMPBASE$48--Printasis.‚(H)0ŠDC.B‚PRINT_LOOK-JMPBASE$49--Printasis.‚(I)0ŠDC.B‚PRINT_LOOK-JMPBASE$4A--Printasis.‚(J)0ŠDC.B‚PRINT_LOOK-JMPBASE$4B--Printasis.‚(K)0ŠDC.B‚PRINT_LOOK-JMPBASE$4C--Printasis.‚(L)0ŠDC.B‚PRINT_LOOK-JMPBASE$4D--Printasis.‚(M)0ŠDC.B‚PRINT_LOOK-JMPBASE$4E--Printasis.‚(N)0ŠDC.B‚PRINT_LOOK-JMPBASE$4F--Printasis.‚(O)0ŠDC.B‚PRINT_LOOK-JMPBASE$50--Printasis.‚(P)0ŠDC.B‚PRINT_LOOK-JMPBASE$51--Printasis.‚(Q)0ŠDC.B‚PRINT_LOOK-JMPBASE$52--Printasis.‚(R)0ŠDC.B‚PRINT_LOOK-JMPBASE$53--Printasis.‚(S)0ŠDC.B‚PRINT_LOOK-JMPBASE$54--Printasis.‚(T)0ŠDC.B‚PRINT_LOOK-JMPBASE$55--Printasis.‚(U)0ŠDC.B‚PRINT_LOOK-JMPBASE$56--Printasis.‚(V)0ŠDC.B‚PRINT_LOOK-JMPBASE$57--Printasis.‚(W)0ŠDC.B‚PRINT_LOOK-JMPBASE$58--Printasis.‚(X)0ŠDC.B‚PRINT_LOOK-JMPBASE$59--Printasis.‚(Y)0ŠDC.B‚PRINT_LOOK-JMPBASE$5A--Printasis.‚(Z)0ŠDC.B‚PRINT_LOOK-JMPBASE$5B--Printasis.‚([)0ŠDC.B‚PRINT_LOOK-JMPBASE$5C--Printasis.‚(\)0ŠDC.B‚PRINT_LOOK-JMPBASE$5D--Printasis.‚(])0ŠDC.B‚PRINT_LOOK-JMPBASE$5E--Printasis.‚(^)0ŠDC.B‚PRINT_LOOK-JMPBASE$5F--Printasis.‚(_)ŠPAGE***************7*‚$60-$7F‚*ƒRoutineoffsetˆCharƒDescriptionofactionF***************ƒ----------------†----ƒ--------------------------------0ŠDC.B‚PRINT_LOOK-JMPBASE$60--Printasis.‚(`)0ŠDC.B‚PRINT_LOOK-JMPBASE$61--Printasis.‚(a)0ŠDC.B‚PRINT_LOOK-JMPBASE$62--Printasis.‚(b)0ŠDC.B‚PRINT_LOOK-JMPBASE$63--Printasis.‚(c)0ŠDC.B‚PRINT_LOOK-JMPBASE$64--Printasis.‚(d)0ŠDC.B‚PRINT_LOOK-JMPBASE$65--Printasis.‚(e)0ŠDC.B‚PRINT_LOOK-JMPBASE$66--Printasis.‚(f)0ŠDC.B‚PRINT_LOOK-JMPBASE$67--Printasis.‚(g)0ŠDC.B‚PRINT_LOOK-JMPBASE$68--Printasis.‚(h)0ŠDC.B‚PRINT_LOOK-JMPBASE$69--Printasis.‚(i)0ŠDC.B‚PRINT_LOOK-JMPBASE$6A--Printasis.‚(j)0ŠDC.B‚PRINT_LOOK-JMPBASE$6B--Printasis.‚(k)0ŠDC.B‚PRINT_LOOK-JMPBASE$6C--Printasis.‚(l)0ŠDC.B‚PRINT_LOOK-JMPBASE$6D--Printasis.‚(m)0ŠDC.B‚PRINT_LOOK-JMPBASE$6E--Printasis.‚(n)0ŠDC.B‚PRINT_LOOK-JMPBASE$6F--Printasis.‚(o)0ŠDC.B‚PRINT_LOOK-JMPBASE$70--Printasis.‚(p)0ŠDC.B‚PRINT_LOOK-JMPBASE$71--Printasis.‚(q)0ŠDC.B‚PRINT_LOOK-JMPBASE$72--Printasis.‚(r)0ŠDC.B‚PRINT_LOOK-JMPBASE$73--Printasis.‚(s)0ŠDC.B‚PRINT_LOOK-JMPBASE$74--Printasis.‚(t)0ŠDC.B‚PRINT_LOOK-JMPBASE$75--Printasis.‚(u)0ŠDC.B‚PRINT_LOOK-JMPBASE$76--Printasis.‚(v)0ŠDC.B‚PRINT_LOOK-JMPBASE$77--Printasis.‚(w)0ŠDC.B‚PRINT_LOOK-JMPBASE$78--Printasis.‚(x)0ŠDC.B‚PRINT_LOOK-JMPBASE$79--Printasis.‚(y)0ŠDC.B‚PRINT_LOOK-JMPBASE$7A--Printasis.‚(z)0ŠDC.B‚PRINT_LOOK-JMPBASE$7B--Printasis.‚({)0ŠDC.B‚PRINT_LOOK-JMPBASE$7C--Printasis.‚(|)0ŠDC.B‚PRINT_LOOK-JMPBASE$7D--Printasis.‚(})0ŠDC.B‚PRINT_LOOK-JMPBASE$7E--Printasis.‚(~)7ŠDC.BƒDO_DEL-JMPBASE…$7F--Specialhandlingfor(DEL).ŠPAGE***************7*‚$80-$9F‚*ƒRoutineoffsetˆCharƒDescriptionofactionF***************ƒ----------------†----ƒ--------------------------------&ŠDC.BƒIGNORE-JMPBASE…$80--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$81--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$82--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$83--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$84--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$85--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$86--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$87--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$88--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$89--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$8A--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$8B--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$8C--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$8D--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$8E--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$8F--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$90--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$91--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$92--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$93--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$94--Ignoreit.&ŠDC.BƒIGNORE-J MPBASE…$95--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$96--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$97--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$98--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$99--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$9A--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$9B--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$9C--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$9D--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$9E--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$9F--Ignoreit.ŠPAGE***************7*‚$A0-$BF‚*ƒRoutineoffsetˆCharƒDescriptionofactionF***************ƒ----------------†----ƒ--------------------------------9ŠDC.BƒTERMINATE-JMPBASE‚$A0--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$A1--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$A2--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$A3--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$A4--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$A5--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$A6--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$A7--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$A8--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$A9--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$AA--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$AB--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$AC--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$AD--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$AE--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$AF--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$B0--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$B1--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$B2--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$B3--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$B4--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$B5--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$B6--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$B7--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$B8--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$B9--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$BA--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$BB--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$BC--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$BD--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$BE--Functionkey:sendpacket.9ŠDC.BƒTERMINATE-JMPBASE‚$BF--Functionkey:sendpacket.ŠPAGE***************7*‚$C0-$DF‚*ƒRoutineoffsetˆCharƒDescriptionofactionF***************ƒ----------------†----ƒ--------------------------------=ŠDC.BƒPRINT_TERM-JMPBASE$C0--Printandsendpacket.‚(HOME)BŠDC.BƒPRINT_TERM-JMPBASE$C1--Printandsendpacket.‚(CURSORUP)DŠDC.BƒPRINT_TERM-JMPBASE$C2--Printandsendpacket.(CURSORDOWN)5ŠDC.BƒPRINT-JMPBASE†$C3--Printasis.‚(CURSORLEFT)6ŠDC.BƒPRINT-JMPBASE†$C4--Printasis.‚(CURSORRIGHT)&ŠDC.BƒIGNORE-JMPBASE…$C5--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$C6--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$C7--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$C8--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$C9--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$CA--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$CB--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$CC--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$CD--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$CE--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$CF--Ignoreit.DŠDC.BƒPRINT_CHANGE-JMPBASE$D0--Print&change.(CHARACTERINSERT)DŠDC.BƒPRINT_CHANGE-JMPBASE$D1--Print&change.(CHARACTERDELETE)&ŠDC.BƒIGNORE-JMPBASE…$D2--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$D3--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$D4--Ignoreit.BŠDC.BƒERASE_LINE-JMPBASE$D5--Specialhandlingfor(ERASELINE).DŠDC.BƒPRINT_TERM-JMPBASE$D6--Printandsendpacket.(LINEINSERT)DŠDC.BƒPRINT_TERM-JMPBASE$D7--Printandsendpacket.(LINEDELETE)&ŠDC.BƒIGNORE-JMPBASE…$D8--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$D9--Ignoreit.5ŠDC.BƒPRINT-JMPBASE†$DA--Printasis.‚(FORWARDTAB)6ŠDC.BƒPRINT-JMPBASE†$DB--Printasis.‚(BACKWAR DTAB)&ŠDC.BƒIGNORE-JMPBASE…$DC--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$DD--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$DE--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$DF--Ignoreit.ŠPAGE***************7*‚$E0-$FF‚*ƒRoutineoffsetˆCharƒDescriptionofactionF***************ƒ----------------†----ƒ--------------------------------&ŠDC.BƒIGNORE-JMPBASE…$E0--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$E1--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$E2--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$E3--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$E4--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$E5--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$E6--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$E7--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$E8--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$E9--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$EA--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$EB--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$EC--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$ED--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$EE--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$EF--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$F0--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$F1--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$F2--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$F3--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$F4--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$F5--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$F6--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$F7--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$F8--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$F9--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$FA--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$FB--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$FC--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$FD--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$FE--Ignoreit.&ŠDC.BƒIGNORE-JMPBASE…$FF--Ignoreit.ŠPAGEO*v*****************************************************************************O**********************************************************************************É***7***GET_CURSOR_ADDRESS--RETURNSADDRESSOFCURSOR******É***=***†FUNCTION:‚ThisroutinereturnstheaddressoftheCRT***?***‰controllercursor,relativetothebaseoftheRAMused‰***C***‰toholdthecharacterstobedisplayed(calledscreenRAM).…******É******†NOTES:½******É******É***E***†REGISTERUSAGE:‚(A)rgument‚(D)estroyed‚(P)reserved‚(R)eturned‚***)***Œ0ƒ1ƒ2ƒ3ƒ4ƒ5ƒ6ƒ7‡SRhi„SRlo(CCR)…******‡D:ƒRƒ.ƒ.ƒ.ƒ.ƒ.ƒ.ƒ.‡.ˆD******‡A:ƒ.ƒ.ƒ.ƒ.ƒ.ƒ.ƒ.ƒ. ******É******†ENTRYCONDITIONS:²******É***-***†EXITCONDITIONSDIFFERENTFROMENTRY:ž***@***‰D0.L=theaddressofthecursorrelativetoscreenRAM.ˆ******É***O*^*****************************************************************************O******************************************************************************* GET_CURSOR_ADDRESS: !ŠMOVEQ‚#0,D0ŽD0<--$00000000. 9ŠMOVE.B#$0E,CRTCADD‡D0<--$0000hh00,wherehhisthe7ŠMOVE.BCRTCREG,D0‰highaddressbytetakenfromtheCRTŠLSL„#8,D0Žcontroller. 9ŠMOVE.B#$0F,CRTCADD‡D0<--$0000hhll,wherellisthe<ŠMOVE.BCRTCREG,D0‰lowaddressbytefromtheCRTcontroller. 4ŠADD.L‚D0,D0ŽConvertfromcharaddresstobyteaddr. ŠRTS—Return.ŠPAGEO*v********************************************************************************;***…CODETOPERFORMACTIONSFORCHAR'SENTEREDINEDITMODE*** ***…FUNCTION:F***‡ExceptforDUPLICATE,theseareallroutinesspecifiedinEDIT_TBLC***‡forthehandlingofincomingcharactersineditmode.‚DUPLICATEE***‡isdifferentinthatitischeckedforseparatelysinceitisnotE***‡knownatassemblytimewhichcharacterwillbetheDUPLICATEchar)***‡(andtheEDIT_TBLshouldbeROMable).****** ***…NOTES:*********…ENTRYCONDITIONS:***‡D0.B=thecharentered."***‡A5ƒ=addressofTERMDRV'sCCB.***O*^*****************************************************************************  **********6*‚Duplicateonthislinethecharfromthelineabove.* DUPLICATE:=ŠMOVE.LS.LINE(PC),D0†Ifwe'reonthetopline(startofthis=ŠCMP.L‚S.SCRN(PC),D0†line=startofscreen),justignoretheŠBEQ.L‚IGNOREDUPLICATEchar. =ŠBSR„GET_CURSOR_ADDRESSWe'renotonthetopline,sogetthe6ŠADD.L‚#SCREEN ,D0‰addressofthecursorinscreenRAM.?ŠSUB.L‚BPERLINE(PC),D0„A0<--addrofthecharacterabovethis.ŠMOVE.LD0,A0Ž*4ŠMOVEQ‚#$7F,D0ŒD0.B<--thecharthere(bits0-6).ŠAND„(A0),D0Œ*-ŠBRA„PRINT_LOOKˆGoactlikehetypedthatin.  *J*‚JMPBASEisusedinconstructingthetableEDIT_TBL.‚ThetabledesignatesM*‚theroutinetobeexecutedforagivencharbystoringtheroutine'soffsetH*‚fromJMPBASE.‚Sincetheoffsetistreatedasanunsigned8-bitnumber,?*‚theroutineentrypointsmustallbefairlyclosetoJMPBASE.* JMPBASEƒEQU„*  **********&*‚Movethecursordownwithpagewrap.*DO_LF:>ŠMOVEQIDOWNARROW,D0‡TranslatetheLFtoaDOWNARROWsoweget)*£pagewrapandfallthroughtoprintit.  ********** *‚Outputthecharandterminate.* PRINT_TERM:2ŠBSR.L‚MAKE_PACKETˆConstructaterminationpacket. ŠOUTPUT_D0‘Outputthecharacter.&ŠBRA.L‚SEND_PACKETˆGosendthepacket.  ***********‚Justterminate.* TERMINATE:5ŠBSR.L‚MAKE_PACKETˆConstructaterminationpacketandŠBRA.L‚SEND_PACKETˆgosendit.  **********"*‚Erasethelinethecursorison.* ERASE_LINE:0ŠOUTPUTCR‘Gobacktothebeginningoftheline.'ŠOUTPUTERASE_EOLŠErasetoendofline.3ŠBRA„CHANGE_EXITˆMarkchangetothislineandexit.  **********,*‚Deletethechartotheleftofthecursor.*DO_DEL:BŠBSR„GET_CURSOR_ADDRESSIfwe'renotonthe1stcolumnoftheline9ŠADD.L‚#SCREEN,D0‰(cursoraddr<>startofcurrentline),ŠIF.LD0S.LINE(PC)THEN#ŠOUTPUTBS‘outputabackspacechar.ŠENDI–* 6ŠOUTPUTSPACEŽOutputaspacecharandabackspacechar/ŠOUTPUTBS‘todeletethecharunderthecursor. >CHANGE_EXIT:ST‚CHANGEDŒMarkthatwechangedsomethingonthisŠBRA„EXITlineandexit.  **********@*‚OutputthecharandfakeaCRifwewrappedaroundthescreen.* PRINT_LOOK:(ŠST…CHANGEDŒMarkchangetothislineandŠOUTPUT_D0‘outputthechar.DŠBSR.L‚GET_CURSOR_ADDRESSIfwe'renotonthe1stcolumnoftheline<ŠADD.L‚#SCREEN,D0‰(cursoraddress<>startofcurrentline),ŠCMP.L‚S.LINE(PC),D0†*ŠBNE„EXITjustexit. :ŠOUTPUTUPARROWŒWewrapped,somoveusbacktothelinewe,ŠBRA„DO_CRŽwereonandactlikehehitaCR.  **********D*‚MarkthatthelinewaschangedandfallthroughtoPRINTandEXIT.* PRINT_CHANGE: ŠST…CHANGED  **********0*‚JustoutputthecharandfallthroughtoEXIT.*PRINT: ŠOUTPUT_D0  **********1*‚JustignorethischarandreturnfromEDITMODE.*IGNORE:5EXIT:…RESTORED0/D1/A0/A1‡Restoreregistersandexit.ŠRTS—*  ***********‚DoaCRLFsequence.*DO_CR:.ŠBSR„MAKE_PACKETˆPrepareaterminationpacket. >ŠMOVE.LE.LINE(PC),D0†Ifwe'reonthelastlineofthevirtualHˆIF.LD0E.SCRN(PC)THENscreen(endofthisline=endofscreen),9ŠMOVE.B#$D9,PKT_TERM†puta$D9terminatorinthepacket,(ŠELSE–Else(we'renotonthelastline),9ŠMOVE.B#$DF,PKT_TERM†puta$DFterminatorinthepacket,ŠENDI–* ŠOUTPUTCR‘OutputaCR,LF. ŠOUTPUTLF‘* &ŠBRA.L‚SEND_PACKETˆGosendthepacket.  ************ 07 = CTRL G = BELL*ADDED‚01/30/85*8* RING_BELL flag is set so that the interrupt routine in9* KEYBRD.AG will output an ALARM command to the keyboard.*BELL: ŠSTˆRING_BELL ŠBRA‡EXITŠPAGEO*v*****************************************************************************O**********************************************************************************É***3***ŽMAKE_PACKET--PREPAREATERMINATIONPACKET******É***@***†FUNCTION:‚WhenakeyisstruckwhichnecessitatesthataŠ***@***‰packetbesenttothedriver,thisroutineiscalled.‚It‡***C***‰willprepareapacket,includingdataiftherewasachange…***D***‰ontheline,andsetupthevariablesfortheFEEDERroutine„******‰tosenditlater.¯******É******†NOTES:½******É******É******É***E***†REGISTERUSAGE:‚(A)rgument‚(D)estroyed‚(P)reserved‚(R)eturned‚***)***Œ0ƒ1ƒ2ƒ3ƒ4ƒ5ƒ6ƒ7‡SRhi„SR lo(CCR)…******‡D:ƒAP‚.ƒ.ƒ.ƒ.ƒ.ƒ.ƒ.‡.ˆD******‡A:ƒPƒPƒ.ƒ.ƒ.ƒ.ƒ.ƒP ******É******†ENTRYCONDITIONS:²***)***‰D0.B=theterminatingcharacter.Ÿ******É***-***†EXITCONDITIONSDIFFERENTFROMENTRY:ž******É******É***O*^*****************************************************************************O******************************************************************************* MAKE_PACKET: .ŠSAVEƒD0/A0/A1‹Saveregisterswe'llblowaway.ŠST…KB_LOCKŒLockthekeyboard. **‚Constructthepacketheader.*4ŠLEA„PKT_CFLAG,A1‡A1<--addressofstartofpacket.0ŠST…(A1)+ŽSetthechangeflagto$FF(nochange)%*§fornow.‚Wemayoverwriteitlater.4ŠMOVE.BD0,(A1)+‹Puttheterminatingcharoutthere. DŠBSR.L‚GET_CURSOR_ADDRESSD0<--cursoraddrrelativetoscreenRAM.BŠDIVUƒBPERLINE+2(PC),D0‚D0<--$00xx00rr;rr=line,xx=2*column.9ŠADD.B‚#$20,D0ŒConverttoASCIIandputitinthebuffer.ŠMOVE.BD0,(A1)+‹*ŠSWAPƒD0‘D0.B<--column#. ŠLSR„#1,D0Ž*9ŠADD.B‚#$20,D0ŒConverttoASCIIandputitinthebuffer.ŠMOVE.BD0,(A1)+‹* *B*‚Ifwechangedanythingonthisline,addthedatatothepacket.*,ŠTST.B‚CHANGEDŒIfthelinehasbeenchanged,ŠIF…THENŠ* 1ŠSF…CHANGEDŒResettheCHANGEDflagfornexttime. >ŠMOVE.BPKT_LINE,PKT_CFLAGMovetheline#tothechangeflag. *1*‚MovethelinefromscreenRAMtopacketbuffer.*@ŠMOVE.LS.LINE(PC),A0†A0<--addrofcurrentlineinscreenRAM.DŠMOVEƒC.LINE(PC),D0D0<--#ofchar'sperline(adjustedforDBRA). AFILL_LOOPMOVEQ‚#$7F,D1ŒGetthenextcharfromscreenRAMandand)ŠAND„(A0)+,D1‹offallbutthelow7bits.0ŠMOVE.BD1,(A1)+‹Putthatvalueintothepacket.;ŠDBRAƒD0,FILL_LOOP‡Keepgoinguntilthefulllineismoved. *!*‚Getridofthetrailingblanks.*DŠMOVEƒC.LINE(PC),D0D0<--#ofchar'sperline(adjustedforDBRA)..ŠMOVEQ‚#SPACE,D1ŠD1<--spacecharforsearch. >TRAIL_LOOPCMP.B-(A1),D1‹Searchbackwardthroughthepacket's2ŠDBNEƒD0,TRAIL_LOOP†dataareaforanonblankchar.2ŠADD.L‚#1,A1ŽA1<--addressofthefollowingchar. ŠENDI *5*‚Finishupthepacket,preparethefeeder,andexit.*BŠMOVE.B#END_OF_DATA,(A1)‚Addtheend-of-dataindicatortopacket. 5ŠLEA„PACKET,A0ŠSetfeederaddresstostartofpacket.ŠMOVE.LA0,FEEDER_ADDRESS‚*5ŠSUB.L‚A0,A1ŽSetfeedercountto#ofbytesinpacket)ŠADD„#1,A1Ž*†=‚endaddr-startaddr+1.ŠMOVEƒA1,FEEDER_COUNT„* -ŠRESTORED0/A0/A1ŠRestoreregistersandexit.ŠRTSŠPAGEO*v********************************************************************************5***†SEND_PACKET--SENDTERMINATIONPACKETTOTERMDRV***F***†FUNCTION:‚Thiscodesendstheterminationpacket,alreadypreparedC***‰inthebufferPACKET,tothedriverTERMDRV.‚BeforedoingsoitB***‰storesthecurrentcursorline#inthepacket.‚FEEDER_ADDRESS)***‰andFEEDER_COUNTmustalreadybeset.*** ***†NOTES:*********†ENTRYCONDITIONS:"***‰A5=addressofTERMDRV'sCCB.***O*^***************************************************************************** SEND_PACKET: BŠBSR„GET_CURSOR_ADDRESSD0<--cursoraddrrelativetoscreenRAM.AŠDIVUƒBPERLINE+2(PC),D0‚D0<--$xxxx00rr.‚rr=line#,xx=trash.9ŠADD.B‚#$20,D0ŒConverttoASCIIandputitinthepacket.ŠMOVE.BD0,PKT_LINEˆ* 8ŠBSR.L‚FEEDERCallthefeedertogivethistothedriverŠBRA„EXITandexit.   ŠENDN?FEEDER„IDNTƒ45,0„VME/10subroutinetofeedabuffertoTERMDRV.;ŠTTL„FEEDER:VME/10subroutinetofeedabuffertoTERMDRV. NNNNNNNGP1XB`9h=p8O*v*****************************************************************************O*******************************************************************************O**********************************************************************************É***4***†FILENAME:‚FEEDER--FEEDABUFFERTOTERMDRV–******É***8***†ENVIRONMENT:‚LinkedintoTERMDRVfortheVME/10.’******É***G***†FUNCTION:‚TERMDRVbasicallyonlyacceptsacharacteratatime.ƒ***D***‰Ifyouhaveabufferfullofcharacterstosend,youcanuse„***=***‰thisroutinetogivethem,oneatatime,toTERMDRV.‹******É***E***†NOTES:‚Whencontrolisreturnedtothecaller,thebufferhas…***@***‰notnecessarilybeencompletelysent.‚Nonotificationis‡***;***‰providedtoindicatethatthebufferhasbeensent.******É***,***†EXTERNALDATASTRUCTURESREFERENCED:Ÿ*** ***‰CCBforterminaldriver.¨******É***)***†EXTERNALENTRYPOINTSREFERENCED:¢******‰GOT_CHAR¸******É***"***†SERVICESCALLEDVIATRAPS:©******É***O*******************************************************************************O*******************************************************************************O*^***************************************************************************** *,*‚Revisionhistory(addnewchangestotop).*…Date†Author‰ChangesG*…--------‚-------------‚----------------------------------------------D*…12/10/85‚F.W.BramwellƒInstallNEWKillermodificationwhichleaves,*žTheDriverID(Number)andReason(Number)2*žinCRASHSAValongwiththeCCBandDCBpointers.*'*†7/19/83‚SteveFranckƒInitialwriting.*ŠPAGE* *‚XDEF's.*6ŠXDEFƒSTOP_ITŒEntrypt.forbackgroundroutinetostop'*§usfromtryingtofeedmorechar'sto *§thedriver.6ŠXDEFƒUNSTOPEntrypt.forustoresumefeedingchar's"*§tothedriverifwehadstopped.6ŠXDEFƒFEEDEREntrypt.forroutinethatfeedsabuffer!*§abyteatatimetothedriver. ?ŠXDEFƒFEEDER_ADDRESS,FEEDER_COUNT,FEEDER_WAITING‚Variablesused%*§indealingwiththefeederroutine.>ŠXDEFƒREL_FLAG,REL_ADDR,REL_PAGES‚Variablestouseifyouwant&*§FEEDERtoreleasememorytotheexec*§whenitisdonefeeding.   *0*‚XREF's(indicatewheretheXDEFis,ifknown).*6ŠXREFƒGOT_CHAR‹Entrypt.inTERMDRVtoprocessachar.ŠPAGEO*********************************************************************************‰INCLUDEFILESANDEQUATES*O******************************************************************************* *=*‚DefinetheenvironmentasEXORMACS/Sinaswitchtocontrol*‚conditionalassemblies.*2ENVIRONMENTEQU‚'EX/S'ThisisfortheEXORMACS/S.  **‚Includefiles:5*‰UTILITY.MC‹Generalpurposemacros(e.g.PUSH,POP).,*‰IOE.SAEquatesforIOS-relatedstructures.7*‰EQUCCB.EQŒEquatesfordevice-independentpartofCCB.9*‰TERMDRV.EQ‹Equatesforthegeneralizedterminaldriver.(*‰STR.EQEquatesfortrap#0calls,etc.2*‰KILL.MCŽMacrolibrarycontainingtheKILL.macro9*‰KILLDRV.EQ‹EquateswithreasonsforKillertobecalled*ŠNOLISTŠINCLUDE‚9995.&.UTILITY.MCŠINCLUDE‚9995.&.IOE.EQŠINCLUDE‚9995.&.CCB.EQŠINCLUDE‚9995.VMES10.TERMDRV.EQŠINCLUDE‚9995.&.STR.EQŠINCLUDE‚9995.&.KILL.MCŠINCLUDE‚9995.&.KILLDRV.EQŠLIST  .FALSE…EQU„$00ValueFALSEforaflagvariable.,TRUE†EQU„$FFValueTRUE‚foraflagvariable.ŠPAGEO*********************************************************************************‰DATAVARIABLES*O******************************************************************************* ŠSECTION0 *I*‚ThesevariablesareusedasargumentstotheFEEDERroutinewhichgives-*‚bytesinabufferoneatatimetoTERMDRV.*@FEEDER_ADDRESSDC.L0Addressofnextbyteforfeedersubroutine*§tofeedtothedriver.;FEEDER_COUNTDC.W0‘#ofbytesremainingtofeedtodriver.CFEEDER_WAITINGDC.BFALSE‹Flagindicatingwhetherornotthefeeder$*§iswaitingforroominthereceive"*§queue.‚UsedbyUNSTOProutineto'*§restartthefeederifithadtostop. =REL_FLAG‚DC.BƒFALSEŽFlagindicatingwhetherornotthefeeder(*§shouldreleasememorytotheexecwhen)*§itisdonefeedingabuffertoTERMDRV.4REL_ADDR‚DC.Lƒ0’Startaddrofbuffertobereleased.5REL_PAGESDC.Lƒ0’#ofpagesinbuffertobereleased.ŠPAGEO*v*****************************************************************************O**********************************************************************************É***4***FEEDER--FEEDSABUFFERBYTEWISETOTERMDRV******É***G***†FUNCTION:‚Thisroutine,whoseentrypointisXDEF'ed,willtakeƒ***@***ˆthebufferdescribedbythevariablesFEEDER_ADDRESSand‰***E***ˆFEEDER_COUNTandtransferitabyteatatimetotheterminal„***C***ˆdriver,TERMDRV.‚ItsenseswhentheSTOPPEDflagintheCCB…***G***ˆgetsset,whichmeansthatthedriver'sreceivequeueisalmost‚***A***ˆfull,andstopssending.‚Provisionsmustbemadeforthis‡***C***ˆroutinetobeinvokedagainlaterwhenthereisroominthe†******ˆreceivequeue.³******É******†NOTES:½******É******É***E***†REGISTERUSAGE:‚(A)rgument‚(D)estroyed‚(P)reserved‚(R)eturned‚***)***Œ0ƒ1ƒ2ƒ3ƒ4ƒ5ƒ6ƒ7‡SRhi„SRlo(CCR)…******‡D:ƒPƒPƒ.ƒ.ƒ.ƒ.ƒ.ƒ.‡.ˆD******‡A:ƒPƒPƒ.ƒ.ƒPƒAƒ.ƒP ******É******†ENTRYCONDITIONS:²***&***ˆA5ƒ=addressofTERMDRV'sCCB.¡******É***-***†EXITCONDITIONSDIFFERENTFROMENTRY:ž******É******É***O*^*****************************************************************************O******************************************************************************* ŠDS…0ŠOPT„BRS ŠSECTION0 FEEDER: ;ŠSAVEƒD0/D1/A0/A1/A4…Saveregisterswe,orthedriver,use.AŠMOVE.LFEEDER_ADDRESS,A4‚A4<--addrof1stbytetofeeddriver.  ŠREPEAT ;ŠSUB„#1,FEEDER_COUNT„Decrementthecountofbytesremaining$ŠBMI„DONEandgetoutifwe'redone. -ŠMOVE.B(A4)+,D0‹D0<--nextbytefordriver. 5ŠPEA„RETURN(PC)‰Callthedriveratthepointwherehe6ŠPUSH.LD1‘hasthecharacterandstartstoprocessit.ŠBRA.L‚GOT_CHAR‹* @RETURN„TST.B‚STOPPED(A5)ˆHavingreturnedfromthedriver,seeif-ŠUNTIL‚he'sfullandrepeatifhe'snot.  *D*‚Thedrivercan'ttakeanymorecharactersnow,sowehavetoexit.*@ŠMOVE.LA4,FEEDER_ADDRESS‚Saveaddressofnextbytetofeedhim.6ŠST…FEEDER_WAITING…Remindsomeonethatwe'renotdone. 4ŠBRA„EXITJustexitfornow;we'llgetcalledlater.  *H*‚Thebufferhasbeenfedtothedriver.‚Releasethebufferifnecessary *‚andexit.*:DONE†TST.B‚REL_FLAG‹Ifwe'resupposedtoreleaseabuffer,ŠIF…THENŠ* 7ŠSAVEƒD2-D7/A2-A3/A5…Saverestofregisters,exceptA6.;ŠMOVE.LREL_ADDR,A0ˆA0<--startaddrofbuffertorelease.1ŠMOVE.LREL_PAGES,D1‡D1<--#ofpagesinbuffer.(ŠTR0$.PGFR,Askexectofreethepages.ŠBRA„RELEASED‹Goodreturn.>ŠRESTORED2-D7/A2-A3/A5„RestoreregistersforCCBPointer(A5)-ŠKILL.DRIVERFEEDER_ID,T0PGFR,A5,DCB_ADDR(A5) THENŠofhiswork(thisshouldbethecase),)ŠBSR„FEEDERcallhimtolethimcontinue.ŠENDI–* ŠRTS—Return.     ŠENDN IINCHAR„IDNTƒ45,0Routinetogetincomingchar'sandhandlespecialmodes.EŠTTLINCHAR:Routinetogetincomingchar'sandhandlespecialmodes.NNNNNNNx:‰@‘*O*v*****************************************************************************O*******************************************************************************O**********************************************************************************É***I***…FILENAME:INCHAR--GETINCOMINGCHAR'SANDHANDLESPECIALMODES.ƒ******É***K***…ENVIRONMENT:PartofVERSAdoskeyboard/screendriverfortheVME/10.******É***G***…FUNCTION:ThesubroutineinthismoduleiscalledbyTERMDRVto…***#***‡handleincomingcharacters.§******É******…NOTES:¾******É***,***…EXTERNALDATASTRUCTURESREFERENCED: *******‡EDIT_FLAG„KB_LOCK„PAGEFLAG„PROMODE—******É***)***…EXTERNALENTRYPOINTSREFERENCED:£***"***‡GET_CHAR…EDITMODE…PAGEMODE ******É***"***…SERVICESCALLEDVIATRAPS:ª******É******É***O*******************************************************************************O*******************************************************************************O*^***************************************************************************** *,*‚Revisionhistory(addnewchangestotop).*…Date†Author‰ChangesG*…--------‚-------------‚----------------------------------------------'*†5/23/83‚SteveFranckƒInitialwriting.* * *‚XDEF's.*+ŠXDEFƒIN_CHARŒEntrypointforthisroutine. *0*‚XREF's(indicatewheretheXDEFis,ifknown).*2ŠXREFƒGET_CHAR‹Routinetogetascancodefromthe&*§keyboardandgenerateachar,update"*§modes,etc.;inmoduleKEYBOARD. 7ŠXREFƒEDITMODE‹Routinetohandleincomingcharactersif*§we'reineditmode. 8ŠXREFƒEDIT_FLAGŠFlagindicatingwhetherornotwearein *§editmode;inmoduleEDITMODE. 7ŠXREFƒPAGEMODE‹Routinetohandleincomingcharactersif%*§we'reinpagemo deorprotectmode. 7ŠXREFƒPAGEFLAG‹Flagindicatingwhetherornotwearein*§pagemode;inmoduleCRTINIT. 6ŠXREFƒPROMODEŒFlagindicatingwhetherornotwearein!*§protectmode;inmoduleOUTCHS. 9ŠXREFƒKB_LOCKŒFlagindicatingwhetherornotthekeyboard'*§is'softwarelocked,'meaningthatno!*§charactersshouldbegenerated. **‚Equatefilesincluded:0*…UTILITY.MC„Utilitymacros(likePUSHandPOP).*ŠNOLISTŠINCLUDE9995.&.UTILITY.MCŠLISTŠPAGEO*v*****************************************************************************O**********************************************************************************É***7***IN_CHAR--HANDLECHARFROMTHEVME/10KEYBOARD******É***H***…FUNCTION:ThisroutineiscalledbyTERMDRV,thekeyboardscreen„***E***‡driver,whenscancodesarereceivedfromthekeyboard.‚After„***D***‡callingGET_CHARtofigureoutwhatthecharis,EDITMODEis†***D***‡calledifnecessary.‚'Softwarelock'ofthekeyboardisalso…*** ***‡handledbythisroutine.ª******É******…NOTES:¾******É***E***…REGISTERUSAGE:‚(A)rgument‚(D)estroyed‚(P)reserved‚(R)eturnedƒ***)***Œ0ƒ1ƒ2ƒ3ƒ4ƒ5ƒ6ƒ7‡SRhi„SRlo(CCR)…******‡D:ƒRƒPƒ.ƒ.ƒ.ƒ.ƒ.ƒ.‡.ˆR******‡A:ƒ.ƒ.ƒ.ƒ.ƒ.ƒAƒ.ƒP ******É******…ENTRYCONDITIONS:³***&***‡A5ƒ=addressofTERMDRV'sCCB.¢******É***-***…EXITCONDITIONSDIFFERENTFROMENTRY:Ÿ***I***‡CCR:=keystrokedidn'tgenerateacharorbreakforTERMDRV.***A***Œ:=generatedcharisinD0.W(bits8-15are0).„***%***’=abreakwasgenerated.š***(***‡D0isnotpreservedinanycase.¢******É***O*^*****************************************************************************O******************************************************************************* ŠDS…0 ŠSECTION0ŠOPT„BRS IN_CHAR: (ŠSAVEƒD1‘Saveregisterswe'llblowaway. 0ŠBSR.L‚GET_CHAR‹Getthecharacter(orwhatever).'ŠIF…THENŠIfitisacharorbreak, ŠIF…THENŠ.Ifit'sabreak, "ŠSF…KB_LOCKŒ.ƒUnlockthekeyboard; ŠELSE–.Else(it'sacharacter), 4ŠTST.B‚KB_LOCKŒ.ƒIfthekeyboardissoftwarelocked,ŠIF…THENŠ.ƒ* -ŠCLR„D0‘.…SetCCR:tosay'falsealarm.' *ŠELSE–.ƒElse(thekeyboardisnotlocked), *ŠTST.B‚EDIT_FLAGŠ.…Ifweareineditmode,ŠIF…THENŠ.…* 0ŠBSR.L‚EDITMODE‹.‡Calltheeditmodehandlerand-ŠCLR„D0‘.‡setCCR:tosay'falsealarm.' 'ŠELSE–.…Else(wearenotineditmode), 8ŠMOVE.BPAGEFLAG,D1ˆ.‡Ifweareinpageorprotectmode,ŠOR.BƒPROMODE,D1‰.‡*ŠIF…THENŠ.‡* 0ŠBSR.L‚PAGEMODE‹.‰Callthepagemodehandler;he*±willsettheconditioncodes. 'ŠELSE–.‡Else(wearenotinpagemode), /ŠMOVEQ‚#1,D1Ž.‰SetCCR:,tosay'there*±isacharinD0.' ŠENDI–. ŠENDI–. ŠENDI–. ŠENDI–. ŠENDI–.   7ŠRESTORED1RestoreregistersandreturnwithconditionŠRTS—codesset.   ŠENDNNN N7OUTCHSƒIDNT†45,0†OutputacharactertothedisplayRAM.3‰TTL‡OUTCHS:ƒOutputacharactertothedisplayRAM.NNNNNNN™¢5ª9²?ºBÂ-Ê,Ò-Ú0â+êTòaúOQ SDA"B*S2::UBJJSRKZ>bFjK<*************************************************************º**Routinename:ŽOUTCHS˜*<*----------------------------------------------------------*-*Currentrevision.....................1.00*1*Datewritten.........................12-18-82Œ*2*Writtenby...........................S.Pri-Tal‹*/*Datechanged.........................3-1-83Ž*2*Changedby...........................R.RUSTAD‹**º**Descriptionofchange:£**º**º*0*Datechanged.........................8-17-84*1*Changedby...........................B.NASONŒ**º**Descriptionofchange:£**ƒChangedallXREF.StoXREF**º*0*Datechanged........................10-24-84*1*Changedby...........................B.NASONŒ**º**Descriptionofchange:£*5*‚SystemwashangingwhenSHIFT/CLEARwashitwhile‡*7*‚therewasanoutput‚tothescreen.‚TheregistersA2ƒ*:*‚andD6werenotbeingsetupinCLEAR_SCREEN,whichis‚*;*‚calledbyBREAK_CLEARinGET_CHARintheKEYBOARDmodule*,*‚Sonowwesetuptheregistersproperly.**º*0*Datechanged.........................1-30-85*/*Changedby...........................M.DUHŽ**º**Descriptionofchange:£*7*ƒSetRING_BELLflagwhen$07istobeoutput(BELL).„**º**º*<************************************************************9*Function:OutputthecharacterinD0.Btothedisplay„*/*‹RAMifcharacterisprintable,elseperform„**‹therequiredfunction.™*<*----------------------------------------------------------*/*Inputparame ters:‚D0.Bcharactertooutput.*<*----------------------------------------------------------**Registersaffected:none¡*<*----------------------------------------------------------* *Externalroutinesused:none*<************************************************************‰PAGE ‰XDEF†OUTCHS‰XDEF†EDIT_FLAG 4‰XDEF†RESET_SCREEN‚Alternateentryforresetcommand4‰XDEF†CLEAR_SCREEN‚Alternateentryforclearcommand‰XDEF†PROMODE‡Protectmodeflag )‰XDEF†RABSOLUT†Readabsoluteentrypoint. (‰XREF†CRTINITƒInitthescreenparameters‰XREF†SCRNINIT /‰XREF†FACS†Fieldattribute,wordsizedregister3‰XREF†PAGEFLAG‚Wordsizedflag.If=$FFFF,pagemode 5‰XREF†CPERLINE‚Numberofcharactersperabsoluteline0‰XREF†BPERLINE‚Numberofbytesperabsoluteline2‰XREF†LPERSCRN‚Numberoflinesperabsolutescreen 2‰XREF†C.LINE„Numberofcharacterspervirtualline-‰XREF†B.LINE„Numberofbytespervirtualline *‰XREF†S.LINE„Startaddressofcurrentline(‰XREF†E.LINE„Endaddressofcurrentline *‰XREF†PB.LINEƒUnusedpartofabsoluteline 2‰XREF†L.SCRN„Numberoflinesinthevirtualscreen <‰XREF†S.SCRN„Addressofhomecharacterinthevirtualscreen<‰XREF†E.SCRN„Addressoflastcharacterinthevirtualscreen (‰XREF†TOPLINEƒToplineofvirtualscreen+‰XREF†BOTLINEƒBottomlineofvirtualscreen,‰XREF†LEFTCOLƒLeftcollumnofvirtualscreen.‰XREF†RIGHTCOL‚Rightcollumnofvirtualscreen 9‰XREF†FEEDER„Addressofsubroutinetogivedatatodriver=‰XREF†FEEDER_ADDRESS†AddressofdatabuffertogivetoFEEDER,‰XREF†FEEDER_COUNTˆ#ofbytesindatabufferA‰XREF†REL_FLAG‚Flagwhichtellsfeedersubroutinetoreleasemem.7‰XREF†REL_ADDR‚Memoryaddressofbuffertobereleased.*‰XREF†REL_PAGESNumberofpagesinbuffer.‰XREF†DUP_CHAR (‰XREF†KB_LOCKKeyboardlock/unlockflag.‰XREF†POUTCHSOutputcharacterinprotectmode 0‰XREF†RING_BELL‹Flagsetwhen$07isdetectedin%*§ordertoringthebellinKEYBRD.AG‰PAGE .SCREENƒEQU‡$F17000BaseaddressofdisplayRAM0CRTCADD‚EQU‡$F1A021AddressregisteroftheCRTC-CRTCREG‚EQU‡$F1A023RegisterfileoftheCRTC)EPCIBASEEQU‡$F1A031BaseaddressofEPCIKBDADDR‚EQU‡$0C$LFCHARƒEQU‡$0A‘ASCIIlinefeedchar.0START_OF_DATAEQU‚$DDŽ'Startofdata'indicator./END_OF_DATAEQU„$DE‘Endofwrite/readindicator,END_OF_FIELDEQUƒ$F9‘Endoffieldindicator.$FALSE„EQU‡0“Indicateconditionfalse#TRUE…EQU‡-1’Indicatetruecondition"CLEARTABEQU‡$18‘Cleartabcommand#SPACE„EQU‡$20ŽASCIIspacecharacter#ESC_CHAR‚EQU„$1BASCIIescapechar.;NUMBER_PAGESEQU‚8‘Numberofpagestogivetofeederduring*£areadabsolute.6INIT_TAB‚EQU„10‘Initialtabspacing.‚Theresetcommand#*§($F1)willputtabsonthescreen*§withthisspacing. ** Register use:*’D0.L=generaluse+*’D1.W=absoluteaddressofinitialcursor/*’D2.W=chractertodecodeandwordtodisplay)*’D3.W=linespervirtualscreencounter+*’D4.W=characerspervirtuallinecounter *’D5.L=bytesperabsoluteline*’D6.L=bytespervirtualline*’D7.L=generaluse-*’A0.L=addressofcursorinthedisplayRAM*’A1.L=AddressofFACS*’A2.L=AddressofS.LINE*’A3.L-Generaluse*  ‰PAGE ‰SECTIONƒ11  **ˆDEFINESTORAGE*=ESC_FLAG‚DC.BƒFALSEŽThisflagistrueifsomeonehasreserved(*§acharandthefirstcharreceivedwas&*§anESC.‚Inthatcasewewaitforthe*§nextcharandsetitsbit7.:CHAR_RESERVEDDC.BFALSE…Nextcharacterreservedindicator(SAVE_CHAR…DS.B1‰Saveareaforcharacter:SAVE_CR1†DS.B1‰Saveareaforcharacter‚Theseareusedfor;SAVE_CR2†DS.B1‰Saveareaforcharacter‚readabsoluteonly.)SAVE_CR3†DS.B1‰Saveareaforcharacter‚*-SAVE_CURSORƒDS.L1‰CurrentcursorramaddressBCHAR_OWNER„DS.L1‰Addressofroutinethatownsnextincomingchar.4XTCHBUF‚DS.W†10ˆScratchbufferforfeedersubroutineEDIT_FLAGDC.B…FALSE‰DS.W†0,PROMODE‚DC.W†FALSE …Setprotectmodetofalse=COL_CNT‚DS.L†1‰Currentcolumnnumber,usedinsettabroutine‰DS.W†0;SAVEFACSDC.W†0‰SaveFACSinusewhenwriteabsoluteoccurs>LASTFAC‚DC.B†FALSE…Lastcharacterprocessed--indicatesifit*œwasaFACornot.THEN.S 8ŠTST.B‚ESC_FLAG‹IfthelastcharwereceivedwasanESC,ŠIF…THEN.Sˆ* 2ŠSF…ESC_FLAG‹Clearthe'lastcharwasanESC'flag5ŠBSETƒ#7,D0Žandsetbit7inD0andD2(bothofwhich-ŠBSETƒ#7,D2ŽholdthecharfollowingtheESC). (ŠELSE.S”Else(lastcharwasnotanESC), 6ŠIF.BD0#ESC_CHARTHEN.SIfthischarisanESC,0ŠST…ESC_FLAG‹setthe'lastcharwasanESC'flagŠBRA„RETURNandexit.ŠENDI–* ŠENDI /‰SFCHAR_RESERVEDŽResetcharacterreservedflag:‰MOVE.LCHAR_OWNER,A3ŠGettheaddressoftheroutinewhich*¨processthischaracter'‰JMP(A3)–Goprocessincomingcharacter ‰ENDI *(*ˆFindentryintableforthischaracter*OUTCH1(‰MOVE†D2,D0…Resetupperpartofregister5‰ADD‡D0,D0…Multiplybytwobecausetableiswordwide+‰MOVE†JUMPTABL(PC,D0),D0Getoffsetaddress2‰JMP‡JUMPTABL(PC,D0)„Goprocessincomingcharacter‰PAGEJUMPTABL,ŠDC.WƒRETURN-JUMPTABL„$00--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$01--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$02--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$03--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$04--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$05--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$06--Illegal--exit ŠDC.WƒBELL-JUMPTABL†$07--Bell.#ŠDC.WƒBS-JUMPTABLˆ$08--Backspace.(ŠDC.WƒHT-JUMPTABLˆ$09--Horizontaltab.#ŠDC.WƒLF-JUMPTABLˆ$0A--Linefeed.&ŠDC.WƒUP-JUMPTABLˆ$0B--Verticaltab.&ŠDC.WƒRIGHT-JUMPTABL…$0C--Formfeed.)ŠDC.WƒCR-JUMPTABLˆ$0D--Carriagereturn.,ŠDC.WƒRETURN-JUMPTABL„$0E--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$0F--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$10--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$11--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$12--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$13--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$14--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$15--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$16--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$17--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$18--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$19--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$1A--Illegal--exit!ŠDC.WƒESC-JUMPTABL‡$1B--Escape.,ŠDC.WƒRETURN-JUMPTABL„$1C--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$1D--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$1E--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$1F--Illegal--exit,ŠDC.WƒDISPLAY-JUMPTABLƒ$20--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$21--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$22--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$23--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$24--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$25--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$26--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$27--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$28--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$29--Displayasis.,ŠDC.WƒDISPLAY- JUMPTABLƒ$2A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$2B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$2C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$2D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$2E--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$2F--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$30--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$31--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$32--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$33--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$34--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$35--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$36--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$37--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$38--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$39--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$3A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$3B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$3C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$3D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$3E--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$3F--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$40--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$41--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$42--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$43--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$44--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$45--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$46--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$47--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$48--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$49--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4E--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4F--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$50--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$51--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$52--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$53--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$54--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$55--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$56--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$57--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$58--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$59--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5E--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5F--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$60--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$61--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$62--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$63--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$64--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$65--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$66--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$67--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$68--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$69--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6E--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6F--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$70--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$71--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$72--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$73--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$74--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$75--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$76--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$77--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$78--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$79--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$7A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$7B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$7C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$7D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$7E--Displayasis.+ŠDC.WƒRETURN-JUMPTABL„$7F--Displayasis.'ŠDC.WƒRETURN-JUMPTABL„$80--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$81--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$8 2--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$83--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$84--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$85--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$86--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$87--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$88--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$89--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$8A--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$8B--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$8C--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$8D--Ignoreit.4ŠDC.WƒSTART_EDITMODE-JUMPTABLƒ$8E--Starteditmode1ŠDC.WƒSTOP_EDITMODE-JUMPTABL„$8F--Endeditmode'ŠDC.WƒRETURN-JUMPTABL„$90--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$91--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$92--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$93--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$94--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$95--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$96--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$97--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$98--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$99--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9A--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9B--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9C--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9D--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9E--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9F--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A0--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A1--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A2--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A3--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A4--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A5--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A6--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A7--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A8--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A9--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AA--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AB--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AC--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AD--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AE--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AF--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B0--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B1--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B2--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B3--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B4--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B5--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B6--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B7--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B8--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B9--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BA--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BB--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BC--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BD--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BE--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BF--Ignoreit.%ŠDC.WƒHOME-JUMPTABL†$C0=Cursorhome!ŠDC.WƒUP-JUMPTABLˆ$C1=Cursorup%ŠDC.WƒDOWN-JUMPTABL†$C2=Cursordown&ŠDC.WƒSEEKL-JUMPTABL…$C3=Cursorleft'ŠDC.WƒRIGHT-JUMPTABL…$C4=Cursorright$ŠDC.WƒC5-JUMPTABLˆ$C5=Writecursor#ŠDC.WƒC6-JUMPTABLˆ$C6=Readcursor(ŠDC.WƒSPAGE-JUMPTABL…$C7=Setpagemode*ŠDC.WƒRPAGE-JUMPTABL…$C8=Resetpagemode0ŠDC.WƒSETTOP-JUMPTABL„$C9=Settopdisplayline5ŠDC.WƒSETBOTOM-JUMPTABL‚$CA=Setbottomdisplayline5ŠDC.WƒSETLEFT-JUMPTABLƒ$CB=Setleftdisplaycollumn7ŠDC.WƒSETRIGHT-JUMPTABL‚$CC=Setrightdisplaycollumn,ŠDC.WƒSETPRO-JUMPTABL„$CD=Setprotectmode,ŠDC.WƒWABSOLUT-JUMPTABL‚$CE=Writeabsolute+ŠDC.WƒRABSOLUT-JUMPTABL‚$CF=Readabsolute5ŠDC.WƒICHAR-JUMPTABL…$D0=Insertcharacteratcursor5ŠDC.WƒDCHAR-JUMPTABL…$D1=Deletecharacteratcursor,ŠDC.WƒKEYENAB-JUMPTABLƒ$D2=Enablekeyboard.ŠDC.WƒKEYDSABL-JUMPTABL‚$D3=Disablekeyboard?ŠDC.WƒEEPAGE-JUMPTABL„$D4=Eraseallunprotectedtoendofpag?ŠDC.WƒEELINE-JUMPTABL„$D5=Eraseallunprotectedtoendoflin5ŠDC.WƒINS_LINE-JUMPTABL‚$D6=Insertalineatcursor5ŠDC.WƒDEL_LINE-JUMPTABL‚$D7=Deletealineatcursor:ŠDC.WƒCLEAR-JUMPTABL…$D8=Eraseallunprotectedinscreen5ŠDC.WƒRETURN-JUMPTABL„$D9=Sendpagetolineprinter'ŠDC.WƒSEEKFT-JUMPTABL„$DA=Forwardtab$ŠDC.WƒSEEKBT-JUMPTABL„$DB=Backtab#ŠDC.WƒSETTAB-JUMPTABL„$DC=SettabŠDC.WƒRETURN-JUMPTABL„$DD=ŠDC.WƒRETURN-JUMPT ABL„$DE=0ŠDC.WƒRETURN-JUMPTABL„$DF=Sendlinetoprinter%ŠDC.WƒSBLINK-JUMPTABL„$E0=Setblink'ŠDC.WƒRBLINK-JUMPTABL„$E1=Resetblink-ŠDC.WƒSINVERT-JUMPTABLƒ$E2=Setvideoinvert/ŠDC.WƒRINVERT-JUMPTABLƒ$E3=Resetvideoinvert-ŠDC.WƒUPBRIGHT-JUMPTABL‚$E4=Sethalfbright/ŠDC.WƒDNBRIGHT-JUMPTABL‚$E5=Resethalfbright)ŠDC.WƒSULINE-JUMPTABL„$E6=Setunderline+ŠDC.WƒRULINE-JUMPTABL„$E7=Resetunderline,ŠDC.WƒNONDISP-JUMPTABLƒ$E8=Setnon-display(ŠDC.WƒSETDISP-JUMPTABLƒ$E9=Setdisplay-ŠDC.WƒPROTECT-JUMPTABLƒ$EA=Setprotectmode-ŠDC.WƒALLOW-JUMPTABL…$EB=ResetprotectmodeŠDC.WƒRETURN-JUMPTABL„$EC=ŠDC.WƒRETURN-JUMPTABL„$ED=ŠDC.WƒRETURN-JUMPTABL„$EE=ŠDC.WƒRETURN-JUMPTABL„$EF=ŠDC.WƒRETURN-JUMPTABL„$F0=2ŠDC.WƒRESET24-JUMPTABLƒ$F1=Reset24linescreen.ŠDC.WƒRETURN-JUMPTABL„$F2=ŠDC.WƒRETURN-JUMPTABL„$F3=ŠDC.WƒRETURN-JUMPTABL„$F4=ŠDC.WƒRETURN-JUMPTABL„$F5=ŠDC.WƒRETURN-JUMPTABL„$F6=2ŠDC.WƒRESET25-JUMPTABLƒ$F7=Reset25linescreen.ŠDC.WƒRETURN-JUMPTABL„$F8=ŠDC.WƒRETURN-JUMPTABL„$F9=ŠDC.WƒRETURN-JUMPTABL„$FA=ŠDC.WƒRETURN-JUMPTABL„$FB=ŠDC.WƒRETURN-JUMPTABL„$FC=ŠDC.WƒRETURN-JUMPTABL„$FD=ŠDC.WƒRETURN-JUMPTABL„$FE=ŠDC.WƒRETURN-JUMPTABL„$FF=  ‰PAGE*'* $7F = DLE, delete character at cursor*DLE'‰AND.W…#$FF80,(A0)‰Nullcharacterspace)‰OR.B†#$20,(A0)‹Spacecharacteratcursor ‰BRA‡RETURN *** Send the command in D0 to this key board*'WKBD…OR.B†#KBDADDR,D0‰Tothiskeyboard‰MOVE.B„D0,EPCIBASE‰RTS ** 07 = CTRL G = BELL*ADDED‚01/30/85*8* RING_BELL flag is set so that the interrupt routine in9* KEYBRD.AG will output an ALARM command to the keyboard.*BELL ‰STˆRING_BELL ‰BRA‡RETURN ** 08 = CTRL H = BS, back space*:* Cursor moves left to first unprotected column, with line* and page rollover.**BS SEEKL„EQU‡*‰IF.L†A0S.LINEOR.L‰A0S.SCRNTHEN.S9‰MOVE.L„E.LINE,A0‹Ifstartoflineencounteredsettoend‰ENDI)‰SUBQ.L„#2,A0Backcursoruponeposition ‰BRA‡WRITCRSR‰PAGE*"* 09 = CTRL I = HT, horizontal tab*2* Seek a TAB at an un-protected spot to the right,* with line and page rollover.** If none found, move right*HT$SEEKFTƒEQU‡*“Seekatabtotheright!‰MOVE.L„A0,A3Setloopterminator*‰ADDQ.L„#2,A0Getoffofcurrentcharacter‰BRA.S…SEEKFT1‰REPEAT-‰MOVE.W„(A0)+,D0ŒScanforwardoncurrentline‰TST.B…D0’Isthetabbitset0‰BMI.S…SEEKFT2FoundtabpositionifbitwassetSEEKFT1‰IF.L†A0E.LINETHEN.S+‰MOVE.L„S.LINE,A0‹Onlywraponcurrentline‰ENDI (‰UNTIL.LƒA0A3ŠLoopforentireline%‰BRA‡RETURNŽJustexitifnotabfoundSEEKFT2)‰SUBQ.L„#2,A0Adjustbecauseofincrement,‰BRA‡WRITCRSRŒUpdatecurrentcursorposition‰PAGE**0A…LINEFEED**LF8‰MOVE.L„A0,D0…Absolutecursoraddressintoausablereg.‰SUB.L…#SCREEN,D04‰DIVU†BPERLINE+2,D0‡D0.Wistheabsolutelinenumber7‰IFˆBOTLINED0THEN.S‚IFweareonthebottomline‰BRA‡SCROLL1Scrollthescreen‰ENDI/‰BRA‡DOWNIfnotatbottommovethecursordown***0D…Carriagereturn*2* Position cursor at left most unprotected column.** FAC's are reset.*CR‰AND.W…#$4400,(A1)‰ResetFACs‰MOVE.L„S.LINE,A0‹Startofline ‰BRA‡WRITCRSR * *1B…Escape*(* Set high bit of next character output.* ESC†EQU‡*#‰BSR‡GET_CHARŒNeedanotercharacter ‰BSET†#7,D0‰BRA‡HAVE_CHAR‰PAGE**$8E„STARTEDITMODE*START_EDITMODE ‰BSR‡GET_CHAR‰IF.BD0#$FFTHEN.S‰MOVE†#$FFFF,DUP_CHAR‰ELSE.S‰MOVE†D2,DUP_CHAR‰ENDI ‰STˆEDIT_FLAG ‰BRA‡RETURN**$8F‚STOPEDITMODE* STOP_EDITMODE%‰SFˆEDIT_FLAG‹Turnoffeditmodeflag ‰BRA‡RETURN‰PAGE**$C0„cursorhome*A* Cursor moves to top left corner of screen, seeks an unprotected* space to the right.** HOME…EQU‡* ‰MOVE.L„S.SCRN,A0‹Topleftspace6‰MOVE.L„A0,S.LINE‹Modifystartandendofcurrentline‰M OVE.L„A0,E.LINE‰ADD.L…D6,4(A2) ‰BRA‡WRITCRSR * * C1 = Up*C* Cursor moves up one line in same column, seeks unprotected column+* to the left, with line and page rollover.**(UP‡SUB.L…D5,A0Samecolumninlineabove3‰SUB.L…D5,(A2)Modifystartandendofcurrentline‰SUB.L…D5,4(A2)‰CMP.L…S.SCRN,A0‹Outofscreen?‰BGE.S…UP.1No,doit‰MOVE.L„E.SCRN,A0‹Yes,rollover*‰MOVE.L„A0,S.LINE‹Updatestart/endofline‰SUB.L…D6,(A2)‰MOVE.L„A0,E.LINE ‰ADD.W…#1,D4!‰LSL.W…#1,D4Bytestoendofline(‰SUB.W…D4,A0Tostayinthesamecollumn +UP.1…EQU‡*“Modifystart/endofcurrentline ‰BRA‡WRITCRSR‰PAGE* * C2 = Down*A* Cursor seeks an unprotected spot to the right, starting at same+* collumn on next line, with page rollover.* DOWN…EQU‡*%‰ADD.L…D5,A0Samecolumnonnextline/‰ADD.L…D5,(A2)Modifystart/endofcurrentline‰ADD.L…D5,4(A2)#‰CMP.L…E.SCRN,A0‹Outofthescreen?‰BLT.S…DOWN1No,doit$‰MOVE.L„S.SCRN,A0‹Yes,pagerollover‰MOVE.L„A0,S.LINE‰MOVE.L„A0,E.LINE&‰ADD.L…D6,4(A2)ŒD6=B.LINE,A2==>S.LINE ‰ADD.W…#1,D4$‰LSL.W…#1,D4D4=#ofbytestoe.line ‰SUB.L…D4,D5 ‰ADD.W…D5,A0DOWN13‰BRA‡WRITCRSRŒSeekanunprotectedspottotheright *** C3 = cursor left, same as back space 08.* * * C4 = Right*)* Seek an unprotected space to the right.*RIGHT'‰ADDQ.L„#2,A0Getoffofcurrentcolumn‰IF.LA0E.LINETHEN.S‰MOVE.L„S.LINE,A0‹Dolinewrap‰ENDI‰BRA‡WRITCRSRŒUpdatethecursor‰PAGE*+*$C5„Movethecursortotherequestedspot*C5: 'ŠBSR„GET_CHAR‹D0.B<--theline#char.'ŠMOVE.BD0,SAVE_CHAR‡Saveitforlater. )ŠBSR„GET_CHAR‹D0.B<--thecolumn#char.&ŠMOVEQ‚#0,D1ŽD1<--thecolumn#char.ŠMOVE.BD0,D1Ž*1ŠSUB.B‚#$20,D1ŒAdjustitso0isfirstline,etc. 4ŠCMP„LEFTCOL,D1‰Ensurethatthecolumn#isinrange2ŠBLO„RETURN(LEFTCOLbotline ‰BHI‡RETURN$‰MOVE.W„D2,TOPLINEŠStoreinconstantINITIT‰BSR‡CRTINITRe-configureCRT&‰BRA‡HOME†Putcursorinhomeposition. *-*$CA„Setbottomlineofvirtualdisplayarea*"*SameasC9forbottomline‚ESCJ*SETBOTOMEQU‡*‰BSR‡GET_CHARŒGetlinenumber!‰SUB.B…#$20,D2Adjustlinenumber+‰CMP.W…LPERSCRN,D2‰lperscrn>botline>topline ‰BHS‡RETURN‰CMP.W…TOPLINE,D2 ‰BLO‡RETURN‰MOVE.W„D2,BOTLINE ‰BRA‡INITIT *5*$CB„Setleftdisplaycolumnofvirtualscreen‚ESCK* SETLEFT‚EQU‡*‰BSR‡GET_CHARŒGetleftcolumn‰SUB.B…#$20,D2‰CMP.W…RIGHTCOL,D2 ‰BHI‡RETURN‰MOVE.W„D2,LEFTCOL ‰BRA‡INITIT‰PAGE*4*$CC„Setrightdisplaycolumnofdispalyarea‚ESCL*SETRIGHTEQU‡*‰BSR‡GET_CHARŒGetrightcolumn‰SUB.B…#$20,D2,‰CMP.W…CPERLINE,D2‰cperlineleftcol ‰BHS‡RETURN‰CMP.W…LEFTCOL,D2 ‰BLO‡RETURN‰MOVE.W„D2,RIGHTCOL ‰BRA‡INITIT SEEIFIN‚EQU‡*-‰LSR.W…#8,D0Checktoseeiftheuserdefined%‰TST.W…D0’thespotinthesecondbyte ‰BNE.S…RTSIT*:* The routine will calculate the current line and collumn.+* Left collumn is #00, and top line is #00.*2*InputŒA0.L=Addressofcursorindisplayscreen**Output‹A0.L=unchanged*’D0.L=00CC00LL&*™whereˆLL=Linenumber,topline=0'*¦CC=Collumnnumber,leftcollumn=0 GETSPOT‚EQU‡*‰CLR.L…D0’HSKP ‰MOVE.L„A0,D04‰SUB.L…#SCREEN,D0‰=Absolutecursoraddressonscreen ‰LSR.W…#1,D0*‰DIVU†CPERLINE,D0‰Thequotiant=linenumber RTSIT„RTS‰PAGE**$CD„erasetoendoffield*7* All contiguous unprotected characters are spaced out.** FACs are unaffected.* Cursor stays where is.* EEFIELD‚EQU‡*$‰MOVE.W„D6,D7Wordspervirtualline#‰LSR.W…#1,D7Bytespervirtualline-‰SUB.W…D4,D7Numberofbytestostartofline‰BRA.S…EEFIELD0 ‰CLR.W…D3 ‰CLR.W…D7&EEFIELD0TST.W…(A0)Isspotprotected?‰BMI‡RETURNŽYes,that'sit#‰AND.W…#$FF80,(A0)‰No,spaceitout‰OR.W†#$20,(A0)+'‰DBRA†D4,EEFIELD0‰Repeattoendofline$‰ADD.W…PB.LINE,A0ŠStartofnextline‰MOVE.W„C.LINE,D4‰CMP.L…E.SCRN,A0(‰BLE.S…EEFIELD1ŒArewearendofscreen?#‰MOVE.L„S.SCRN,A0‹Yes,rollitover.EEFIELD1DBRA†D3,EEFIELD0‰Repeatforalllines2‰MOVE.W„D7,D4Addthecharactersbeforethecursor‰DBRA†D7,EEFIELD0‰BRA‡RETURNŽAndthenreturn‰PAGE**$CE„writeabsolute* WABSOLUT: -ŠREPEAT”Waitfora'startofdata'indicator.ŠBSR„GET_CHAR‹*ŠUNTIL.BD0#START_OF_DATA .ŠMOVEƒ(A1),SAVEFACS†SaveFACScurrentlyinuse 'ŠBSR„GET_CHAR‹D0.B<--theline#char.'ŠMOVE.BD0,SAVE_CHAR‡Saveitforlater. )ŠBSR„GET_CHAR‹D0.B<--thecolumn#char.&ŠMOVEQ‚#0,D1ŽD1<--thecolumn#char.ŠMOVE.BD0,D1Ž*1ŠSUB.B‚#$20,D1ŒAdjustitso0isfirstline,etc. 5ŠCMP„CPERLINE,D1ˆEnsurethatthecolumn#isinrange-ŠBHS„RETURN(LEFTCOL#END _OF_DATATHEN.S6‰MOVE.L„SAVE_CURSOR,D0†Restorevirtualscreen'sS.LINE *°andE.LINE!‰MOVE.L„D0,D1Copycursoraddress‰SUB.L…#SCREEN,D0*‰DIVU†BPERLINE+2,D0‡Findlinecursorison*¦remainder=positioninline‰CLR‡D0’Forgetlineweareon‰SWAP†D0,‰SUB.L…D0,D1wenowknowtheabsolutes.line-‰MOVE†LEFTCOL,D0Šsoadjustitbythevaluein‰ADD‡D0,D0leftcol.‰ADD.L…D0,D1*1‰MOVE.L„D1,S.LINE‹bingowenowhavestartofline-‰ADD.L…B.LINE,D1‹addthenumberofbytes/line%‰MOVE.L„D1,E.LINE‹andsetendofline8‰MOVE.L„SAVE_CURSOR,A0†Setcursorbacktovirtualscreen‰MOVE†SAVEFACS,FACS‰BRA‡WRITCRSRŒ*ŠENDIŠST…CHAR_RESERVED‰IF.B„D2#$E0AND.B‘D2#$EBTHEN.S6‰TST.B…LASTFACSeeifthelastcharacterprocessedwas*¦aFAC.5‰IF„THEN.SIfitwasnotaFACthendestroywhat)*¦couldbeanotherFACcurrentlyonscrn.9‰MOVE.B„#$FF,1(A0)ŠFacprocessingchecksthecurrentchar%*¦todetermineifanewFACshouldbe'*¦declared.Ifwearecurrentlysitting**¦onaFACdefinitionitmustbedestroyed‰ENDI3‰STˆLASTFACTelltheloopwehavebeenherebefore. ‰BRAOUTCH1‰ENDI3‰TST.B…LASTFACIfthelastcharacterwasaFACthen"*¦thecursormustbemovedoffit.‰IFˆTHEN.S)‰ADD.L…#2,A0MovethecursorofftheFAC.4‰SFˆLASTFACIndicatethelastcharacterwas'taFAC.‰ENDI8‰MOVE.W„LPERSCRN,D0‰FINDTHEENDOFTHEABSOLUTEDISPLAY ‰MULU†D5,D0*‰ADD.L…#SCREEN,D0Š*5‰OR.W†FACS,D2Writethecurrentcharactertothescrn‰MOVE.W„D2,(A0)+Œ*‰IF.L†A0D0THEN.S&‰BRA‡RETURNŽExitifpastendofscreen‰ENDI,‰BRA‡WRITCRSRŒUpdatecurrentcursorposition **$CF„readabsolute**RABSOLUTEQU‡*8‰BSR‡GET_CHAR‚Getrowaddressforbeginningadr.ofread*‰MOVE.B„D0,SAVE_CHAR‚Savetherowaddress.8‰BSR‡GET_CHAR‚Getcol.addressofbeginingreadaddress. ‰MOVE.B„D0,SAVE_CR1‰Saveitalso0‰BSR‡GET_CHAR‚Getrowaddressofendingaddress.‰MOVE.B„D0,SAVE_CR2‰Saveit.0‰BSR‡GET_CHAR‚Getcol.addressofendingaddress‰MOVE.B„D0,SAVE_CR3‰Saveit.***ˆALLOCATEMEMORY--SAVETHEBUFFERADDRESS*0‰MOVE.L„#4,D0…ServicerequestcodeforPAGEALOC.7‰MOVE.L„#8,A0…Setupmemorydescriptorandget8pages. ‰SUB.L…A1,A1‰TRAP†#0&‰BRA.S…RABSO1„Branchifwegotmemory.#‰BRA‡RETURN„Justexitifwedidn't.**ˆSAVEBUFFERADDRESS*RABSO13‰STˆREL_FLAGŒTellfeedertoreleasemem.whendone.*‰MOVE.L„A0,REL_ADDR‰Feederbufferaddress.4‰MOVE.L„A0,FEEDER_ADDRESSƒBufferaddressforfeeder..‰MOVE.L„A0,A2Putaddressinuseableregister.@‰MOVE.L„#NUMBER_PAGES,REL_PAGES‚Tellfeederthenumberofpages.‰MOVE.B„#START_OF_DATA,(A2)+;‰MOVE†#1,FEEDER_COUNT…Updatethecharatercountforfeeder.*=*ˆFINDTHEBEGINNINGANDENDINGADDRESSESBASEDONTHECURSOR *ˆADDRESSES*/ˆMOVE‡SAVE_CR2,D0‰Convertendingaddressfirst.)‰SUB‡#$2020,D0‹Adjustthecursoraddress.‰BSR.S…CONVERT*'‰MOVE.L„A0,A1Putitintheproperreg.,‰MOVE†SAVE_CHAR,D0ˆNowdobeginningaddress.)‰SUB‡#$2020,D0‹Adjustthecursoraddress.‰BSR.S…CONVERT*6‰MOVE.L„A0,D1Thiswillbetheendofcurrentlineadr‰ADD.L…D5,D1*?*†A0=STARTINGADDRESS†A1=ENDINGADDRESS„A2=BUFFERADDRESS ‰REPEAT8‰IF.L†A0D1THEN.SƒIfweareattheendoftheline8‰MOVE.B„#END_OF_FIELD,(A2)+moveinthelineterminator.*‰ADDQ†#1,FEEDER_COUNT…Updatefeedercount. ‰ADD.L…D5,D1‰ENDI ‰TST.B…1(A0)5‰IF‚THEN.SEndoflinesareflaggedbyanendof,‰MOVE.B‚#END_OF_FIELD,(A2)+ƒfieldcharacter.*‰ADDQ†#1,FEEDER_COUNT…Adjustfeedercount.‰ENDI‰IF.B…1(A0)#01THEN.S!‰ADDQ.L„#2,A0Adjustthepointer. ‰BRA.S…RABSO2‰ENDI+‰MOVE.B„1(A0),D0ŒWecouldbeonatabstop.)‰AND.B…#$7F,D0Stripofthetabstopbit.*‰MOVE.B„D0,(A2)+ŒMovedatabytetobuffer.%‰ADDQ.L„#2,A0Bumptonextcharacter.3‰ADDQ†#1,FEEDER_COUNT…Bumpfeederscharactercount.RABSO2‰UNTIL.LƒA0A1D‰MOVE.B„#END_OF_DATA,(A2)Wearealldonemovingdatatothebuffer.;‰ADDQ†#1,FEEDER_COUNT…Bumpnumberofcharactersforfeeder. (‰BSR‡FEEDERŽSendthedatatothedriver./‰BRA‡RETURNŽWearealldone--thankyoukindly.*2* Convert the llcc value to a display RAM address.**ˆInputƒD0.W=llcc*ˆOutput‚A0.L=screenaddress* CONVERT‚EQU‡*%‰MOVE.L„D6,-(A7)ŒGetsomeellbowroom ‰CLR.L…D6 ‰MOVE.W„D0,D6‰AND.W…#$00FF,D0‰CMP.W…CPERLINE,D0 ‰BGT.S…CONRET‰LSR.L…#8,D6D6.L=000000ll‰CMP.W…LPERSCRN,D6 ‰BGT.S…CONRET ‰MULU.W„D5,D6 ‰LSL.W…#1,D0 ‰ADD.B…D0,D6‰ADD.L…#SCREEN,D6 ‰MOVE.L„D6,A0CONRETƒMOVE.L„(A7)+,D6‰RTS‰PAGE*8*‚$D0„Insertacharacteratthecurrentcursorposition.B*‰Startingatthecurrentcursorposition,charactersaremovedto@*‰therightuntiltheendoflineoraprotectedfieldishit.‚A>*‰spaceisputinthecurrentcursorposition.‚Thecursordoes *‰notmove.*7ICHAR:„MOVEQ‚#SPACE,D0ŠInitializeLASTCHARtoaspace. ICHAR12ŠMOVEQ‚#$7F,D1ŒD1<--thecharfromthisposition.ŠAND„(A0),D1Œ*9ŠAND„#$FF80,(A0)ˆPuttheLASTCHARoutthereinitsplace.ŠOR…D0,(A0)+‹andadvancetothenextposition.1ŠMOVEƒD1,D0ŽSetLASTCHARtothecharwejustgot;ŠDBRAƒD4,ICHAR1Š(fornextpass)andloopuntilendofline. ICHAR3„BRA„RETURNExit. *8*‚$D1„Deleteacharacteratthecurrentcursorposition.F*‰Startingjustpastthecurrentcursorposition,charactersaremovedB*‰totheleftuntiltheendoflineoraprotectedfieldishit.‚A@*‰spaceisputinthefinalmodifiableposition.‚Thecursordoes%*‰notmove.‚TheentrypointisDCHAR.*<DCHAR1„MOVEƒ2(A0),D0‹D0<--thecharfromthenextposition. *ŠAND„#$7F,D0ŒPutthecharinthisposition%ŠOR…D0,(A0)+‹andadvancetothenext. :DCHAR:„AND„#$FF80,(A0)ˆRemovethecharfromthisposition.2ŠDBRAƒD4,DCHAR1ŠLoopiftherearemorecharacters. 6DCHAR2„OR…#$20,(A0)ŠPutaspaceinthisfinalpositionŠBRA„RETURNandreturn.‰PAGE**‚$D2ƒENABLEKEYBOARD*KEYENAB ‰SFˆKB_LOCK ‰BRA‡RETURN   **‚$D3ƒDISABLEKEYBOARD*KEYDSABL ‰STˆKB_LOCK ‰BRA‡RETURN   ***$D4„eraseallunprotectedtoendofpage**ˆFACsarenotaffected!*ˆCursorpositionisnotaffected* EEPAGEƒEQU‡*‰BSR‡GETSPOTD0=00CC00LL‰SUB.W…TOPLINE,D0-‰SUB.W…D0,D3NumberoflinestoendofscreenEEPAGE1‚BSR‡ERASEErasethem ‰BRA‡RETURN  **$D5„Erasetoendofline* EELINEƒEQU‡*‰CLR.W…D3’Onlyoneline ‰BRA‡EEPAGE1  *3*‚$D6„Insertalineatthecurrentcursorposition.@*‰Startingatthebottomofthescreenandworkingup,copyeach=*‰linetothelinebelow.‚Thelinethecursorisonisfilled=*‰withblanksandthecursorispositionedattheleftofthe3*‰line.‚(Inallthis,'line'means'virtualline.')*INS_LINE6ŠMOVE.LE.SCRN,A0ŠA0<--addrjustpastendofscreen. AŠWHILE.LA0E.LINEDO.S‚WhileA0isnotonthecurrentline, 6ŠMOVE.LA0,A1ŽA1<--addrjustpastendoflineabove./ŠSUB.L‚D5,A1Ž*‡(D5isbytesperabsoluteline.)0ŠMOVE.LA0,-(SP)‹Savetheaddressforthisline. 6ŠMOVEƒC.LINE,D0ŠD0<--#ofcharsinvirtualline-1.@INS_LIN1‚MOVEƒ-(A1),-(A0)ˆMoveallwords(attributeandchar)in.ŠDBRAƒD0,INS_LIN1ˆthislinetothelinebelow. 3ŠMOVE.L(SP)+,A0‹Restoretheaddressforthisline.-ŠSUB.L‚D5,A0ŽA0<--addressfornextlineup. ŠENDW (*§AtthispointA0istheaddrjustpast&*§theendofthecurrentvirtualline.6ŠMOVEƒC.LINE,D0ŠD0<--#ofcharsinvirtualline-1.?INS_LIN2‚AND.B‚#$80,-(A0)‰Fillthecurrentlinewithspacesand%ŠOR.Bƒ#$20,(A0)Šinnocuousattributes.ŠMOVE.B#$44,-(A0)‰*ŠDBRAƒD0,INS_LIN2ˆ*%*§AtthispointA0istheaddrofthe(*§beginningofthecurrentvirtualline.,ŠBRA„WRITCRSR‹Gosetthenewcursoraddress.   **$D7‚DELETELINE*DEL_LINE;‰MOVE.L„S.LINE,A0BeginningaddressofcurrentvirtuallineDELINE;‰MOVE.L„A0,A1…Calculatetheaddressofthebeginningofthe‰ADD.L…D5,A1…nextline.4‰MOVE†C.LINE,D0Numberofbytesperlinetobemoved?‰CMP.L…E.SCRN,A1Seeifmovefromaddressispassedendofscrn-‰BHS.S…DEL INE2ƒBranchifpassedendofscreen2‰MOVE.L„A0,-(A7)‚SavedestinationaddressonstackDELINE1*‰MOVE.W„(A1)+,(A0)+Movelineuponscreen‰DBRA†D0,DELINE1‚*,‰MOVE.L„(A7)+,A0‚Restoredestinationaddress'‰ADD.L…D5,A0‡Pointtonextvirtualline,‰BRA.S…DELINE„GomovenextlineuponscreenDELINE22‰MOVE.B„#$44,(A0)+ƒBlankthebottomlineofscreen.‰AND.B…#$80,(A0)„Savetabstopifthereisone+‰OR.B†#$20,(A0)+ƒSetspaceinthislocation‰DBRA†D0,DELINE2ƒ*9‰MOVE.L„S.LINE,A0„Setcursortobeginningofcurrentline‰BRA‡WRITCRSR…*   **$D8„clearscreen,cursorhome*B* All unprotected positions in display area are filled with nulls.* FAC's are not affected.* * Cursor moves to home position.** CLEAR_SCREENA‰MOVEM.LƒD0-D7/A0-A3,-(A7)ƒSetupthealternateentryforcommand6‰MOVE†L.SCRN,D3‹Setuptheregbecauseitisn'tsetip*%%%%%%%%%‚BWN‚10/24/84*6*ƒSetuptheotherregistersweneedforthisroutine.*‰LEA‡S.LINE,A2‰MOVE.L„B.LINE,D6!*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLEAR„EQU‡*‰MOVE.L„S.SCRN,A0‹Startathome‰MOVE.W„C.LINE,D4‹Afullline"‰BSR.S…ERASEEraseallunprotected‰BRA‡HOMEPutcursorathome *%* Erase D4.W characters in D3.w lines* ERASE„EQU‡*‰IF‚PAGEFLAG#TRUETHEN.S0‰TST‡(A0)+Usedonlywhenalternateentrycalled ‰BMI.S…ERASE1‰ENDI$‰AND.W…#$0080,(A0)‰ClearcurrentFAC ‰OR.W†#$4400,(A0)+ˆWriteaspace/ERASE1ƒDBRA†D4,ERASEŒRepeatforD4.wcharacters)‰MOVE.W„C.LINE,D4‹Resetcharactercounter$‰ADD.W…PB.LINE,A0ŠStartofnextline$‰DBRA†D3,ERASEŒRepeatforD3.wlines‰RTS‰PAGE**$DA„Forwardtab* * Same as HT* ** DB = BT, back tab*@* Position cursor at first tab in first unprotected to the left.**  SEEKBTƒEQU‡*‰MOVE.L„A0,A3Loopterminator‰REPEAT‰IF.L†A0S.LINETHEN.S+‰MOVE.L„E.LINE,A0‹Wraponcurrentlineonly‰ENDI1‰MOVE.W„-(A0),D0ŒCharacterpreceedingcurrentone‰TST.B…D0’Isthisatabstop*‰BMI.S…SEEKBT2BranchifwehitatabstopSEEKBT1;‰UNTIL.LƒA0A3ŠScanlineuntilwegetwherewestartedSEEKBT2#‰BRA‡WRITCRSRŒUpdatecursoraddress‰PAGE** DC = set tab* SETTABƒEQU‡*/‰CLR.L…COL_CNTƒInitializecurrentcolumnnumber‰BRA.S…SETTAB2SETTAB1:‰ADD.L…#2,COL_CNTŠUpdatethecolumncountforthenextguy‰MOVE.L„COL_CNT,D0@‰IF.L‚D0BPERLINETHEN.SMakesurewedon'tgooutofrange<‰WHILED2#LFCHARDO.S„Ifoutofrangediscardincoming/‰BSRGET_CHAR’untilterminatedwithalinefeed‰ENDW‰BRA‡RETURNŽExit‰ENDISETTAB2.‰BSR‡GET_CHAR‚Getnextcharacteroftabstring6‰MOVE†LPERSCRN,D3‰Setloopcontrolforabsolutescreen‰SUBQ†#1,D3DBRAadjustment9‰CMP.B…#LFCHAR,D2ŠEndofstringisindicatedbylinefeed‰BNE.S…SETTAB2A‹**C*‡LINEFEEDCHARACTERDETECTED,‚IFITFOLLOWEDSETTABS--RESETALL*‡CURRENTTABS*SETTAB42‰TST.L…COL_CNTIfcolumncountzerothenlinefeed*°followedsetcommand‰IFTHEN.S+‰LEA‡SCREEN,A0‹Pointtobeginningofscreen+‰MOVE†LPERSCRN,D5‰Get#oflinesperscreen8‰MULU†CPERLINE,D5‰*charactersperline=#ofcharacter*©positionsonscreenCLRTAB‰AND.W…#$FF7F,(A0)+ˆResettab(‰DBRA†D5,CLRTAB‹Loopuntilendofscreen‰ENDI ‰BRA‡RETURNSETTAB2A4‰MOVE.L„COL_CNT,A0ŠPointtocurrentpositioninline‰ADD.L…#SCREEN,A0Š*-‰CMP.B…#SPACE,D2‹Isthisafillercharacter?5‰BEQ.S…SETTAB1Getnextcharacterifcurrentisspace'‰CMP.B…#CLEARTAB,D2ˆCleartabrequest?+‰BEQ.S…RESETTABŒBranchifcleartabrequest**„SETTABREQUEST*SETTAB37‰BSET.B„#7,1(A0)ŒSettabbitinhighnibbleofthedis-4‰ADD.L…D5,A0playedchar.foreverycolumnonscreen‰DBRA†D3,SETTAB3Š*‰BRA.S…SETTAB1RESETTAB1‰BCLR.B„#7,1(A0)ŒTurntabbitoffineverycolumn‰ADD.L…D5,A0*‰DBRA†D3,RESETTAB‰* ‰BRA‡SETTAB1‰PAGE*F* The characters $E0-$EF will set or reset the field attribute bits in'* the XREFed, word sized register FACS.* FACS is defined as follows:**ˆD15=Se tforprotect*ˆD14=Setfordisplay*ˆD13=Setforblink*ˆD12=Setforunderline*ˆD11=Setforinversevideo*ˆD10=color/intensitybit1*ˆD09=color/intensitybit2*ˆD08=color/intensitybit3 *„D07-D00=0* ** E0 = set blink* SBLINKƒEQU‡*B‰IF.B1(A0)#01THEN.S…AllowanotherFACtobedefinedonly‚f&*¦ifwearecurrentlysittingonaFAC *¦definition.!‰BSET.B„#5,(A1)Settheblinkbit‰ELSE.S4‰MOVE.B„#$64,(A1)‹NotonacurrentFACdefinitionso*¦resettheFACS.‰ENDI#‰MOVE.B„FACS,(A0)‹PutFAConscreen9‰MOVE.B„#01,1(A0)‹SimulatecharacterpositionusedbyFAC ‰BRA‡RETURN ** E1 = reset blink* RBLINKƒEQU‡*#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyFACC‰IF.B‚1(A0)#01THEN.SƒAllowanotherFACtobedefinedonlyif#*¦wearecurrentlysittingonaFAC *¦definition.#‰BCLR.B„#5,(A1)Resettheblinkbit‰ELSE.S4‰MOVE.B„#44,(A1)ŒResetanyotherFACSforthisline.‰ENDI ‰BRA‡RETURN ** E2 = set video invert* SINVERT‚EQU‡*C‰IF.B‚1(A0)#01THEN.SƒAllowanotherFACtobedefinedonlyif#*¦wearecurrentlysittingonaFAC *¦definition.#‰BSET.B„#3,(A1)Settheinversebit‰ELSE.S7‰MOVE.B„#$4C,(A1)‹Setinvertonlybit.(plusdislayand *¦intensity.‰ENDI#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyFAC ‰BRA‡RETURN ** E3 = reset video invert* RINVERT‚EQU‡*#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyFACC‰IF.B‚1(A0)#01THEN.SƒAllowanotherFACtobedefinedonlyif#*¦wearecurrentlysittingonaFAC *¦definition.%‰BCLR.B„#3,(A1)Resettheinversebit‰ELSE.S#‰MOVE.B„#$44,(A1)‹Reseteverything.‰ENDI ‰BRA‡RETURN ** E4 = Set half bright*UPBRIGHTEQU‡*,‰MOVE.B„(A1),D2GettheMSBpartoftheFACs'‰AND.B…#$F8,D2Onlythebrightnessbits ‰OR.B†#$05,D2Settohalfbright‰MOVE.B„D2,(A1)* ‰BRA‡RETURN ** E5 = Reset half bright*DNBRIGHTEQU‡*,‰MOVE.B„(A1),D2GettheMSBpartoftheFACs'‰AND.B…#$F8,D2Turnoffbrightnessbits‰OR.B†#$02,D2Resethalfbright‰MOVE.B„D2,(A1)* ‰BRA‡RETURN ** E6 = set underline* SULINEƒEQU‡*C‰IF.B‚1(A0)#01THEN.SƒAllowanotherFACtobedefinedonlyif#*¦wearecurrentlysittingonaFAC *¦definition.%‰BSET.B„#4,(A1)Settheunderlinebit‰ELSE.S)‰MOVE.B„#$54,(A1)‹SetunderlineFAConly.‰ENDI#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyFAC ‰BRA‡RET.1 ** E7 = reset underline* RULINEƒEQU‡*#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyFACC‰IF.B‚1(A0)#01THEN.SƒAllowanotherFACtobedefinedonlyif#*¦wearecurrentlysittingonaFAC *¦definition.'‰BCLR.B„#4,(A1)Resettheunderlinebit‰ELSE.S.‰MOVE.B„#44,(A1)ŒResetallFACSforthisline.‰ENDI ‰BRA‡RET.1 ** E8 = set non display* NONDISP‚EQU‡*C‰IF.B‚1(A0)#01THEN.SƒAllowanotherFACtobedefinedonlyif#*¦wearecurrentlysittingonaFAC *¦definition.'‰BCLR.B„#6,(A1)Setthenon-displaybit‰ELSE.S(‰MOVE.B„#4,(A1)Turnoffthedispaybit.‰ENDI#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyFAC ‰BRA‡RETURN ** E9 = reset non-display* SETDISP‚EQU‡*#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyFACC‰IF.B‚1(A0)#01THEN.SƒAllowanotherFACtobedefinedonlyif#*¦wearecurrentlysittingonaFAC *¦definition.2‰BSET.B„#6,(A1)SetdisplayalongwithotherFACS.‰ELSE.S:‰MOVE.B„#$44,(A1)‹Setdisplaybitonly,turnoffallother*¦FACS.‰ENDI ‰BRA.S…RET.1 ** EA = set protect* PROTECT‚EQU‡*C‰IF.B‚1(A0)#01THEN.SƒAllowanotherFACtobedefinedonlyif#*¦wearecurrentlysittingonaFAC *¦definition.6‰BSET.B„#7,(A1)Setprotectbitanddon' tchangeother*¦FACsallreadythere.‰ELSE.S'‰MOVE.B„#$C4,(A1)‹SetprotectFAConly.‰ENDI#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyFAC ‰BRA.S…RET.1 ** EB = reset protect* ALLOW„EQU‡*#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyFACC‰IF.B‚1(A0)#01THEN.SƒAllowanotherFACtobedefinedonlyif#*¦wearecurrentlysittingonaFAC *¦definition.+‰BCLR.B„#7,(A1)ResetonlytheprotectFAC.‰ELSE.S!‰MOVE.B„#$44,(A1)‹ResetallFACs.‰ENDIRET.1„BRA‡RETURNŠPAGE* * F1 = reset*K* The display area is filled with spaces, all FAC's are reset, tabs are setL* every INIT_TAB spaces, the virtual screen is restored to its default size,* and the cursor is HOMEd.* RESET_SCREEN>‰MOVEM.LD0-D7/A0-A3,-(A7)Setupstacksowecanexitclean„T5‰LEA‡S.LINE,A2‡Fixuptheregistersbecausewedidn't*¢comethroughthenormalpath‰MOVE.L„B.LINE,D6‡*$‰BRA.S…RESET25‰Clear25linescreen.RESET240‰MOVE†#24,NUMBER_LINESSetuptoclear24lines.RESET253ŠBSR„SCRNINIT‹Resetalltheparameterstodefaults. *‚Fillthescreenwithblanks.4ŠLEA„SCREEN,A0ŠA0<--startaddrofabsolutescreen.6ŠMOVEƒ#$4400,D2ŠD2<--defaultattributesandaendof#*¦linecharforfillingthescreen.:ŠMOVEƒNUMBER_LINES,D5„D5<--#ofcharactersonscreen-1<ŠMULUƒCPERLINE,D5ˆ*‚=linesperscreen*charsperline-1. ŠSUBQƒ#1,D5Ž* DO.SŠWhiletherearemoretabstoplace, 5ŠBSETW‚#7,(A0)ŒSetatabinthispositionandadvance%ŠADD.L‚#2*INIT_TAB,A0…INIT_TABchars. 0ŠSUBQƒ#1,D5ŽKeepgoinguntilalltabsareplacedŠENDW–onthisline. /ŠMOVEƒBPERLINE,A0ˆA0.L<--addressofnextline7ŠADD.L‚(SP)+,A0‹*„=addroflastline+bytesperline. 0ŠSUBQƒ#1,D2ŽKeepgoinguntilalllinesaredone. ŠUNTIL‚*ŠSF…EDIT_FLAGŠCleareditmodeŠSF…PAGEFLAG‹pagemodeŠSF…PROMODEŒandprotectmode.3ŠMOVE.LƒB.LINE,D6ˆHomeneedsbytespervirtualline?ŠMOVE…#25,NUMBER_LINESSetupthescreento25linesincasewe*£dida24linescreenclear.ŠBRA‡HOMEŒHomethecursor.‰PAGE* * DISPLAYL*---------------------------------------------------------------------------L* 1. Write the requested character in the display RAM at the current cursor.I* 2. Seek a non-protected spot to the right, with line and page rollover.6*„ifnonefound,soundbell,andstayatcurrentspot.,* 3. Update the cursor register of the CRTC.** Input parameters:*------------------4* A0.L = current cursor posiotion in the display RAM8* D2.L = $000000XX, where XX is the requested character.0* D3.W = Maximum number of characters on screen.F* FACS = An XREFed, word sized register containing the FACs in effect.* DISPLAY‚EQU‡*‰MOVE.LA0,A3’Initreg.‰WHILE.LA3S.LINEDO.S2‰MOVE.B-1(A3),D0ŽMoveendoflinetocurrentchar‰AND.B#$7F,D0‘couldbeatab7‰BNE.SDISPLAY1Branchifacharacteroccupiesposition0‰OR.B‚#$20,-1(A3)Spacefilltomoveendofline)‰SUBQ.L#2,A3’Backuptobeginningofline‰ENDWDISPLAY1‰IF.B‚1(A0)#01THEN.S5‰MOVE.B„#$44,FACS‹ResettheFACdefinedforthisline#*¦becauseitisbeingwrittenover.‰ENDI :‰MOVE.B„FACS,(A0)+ŠMovecurrentFACStocurrentScreenloc%‰AND.B…#$80,(A0)‹Keeptabinformation,‰OR.B†D2,(A0)+ŒWritecharactertothescreen  SCROLLƒEQU‡*‰IF.L†A0E.SCRN‚THEN.S!‰IF.B†EDIT_FLAG#TRUETHEN.S(‰BRAHOMEŒENDOFSCREENANDINEDITMODE‰ENDI*‰BRA.SƒSCROLL1‚End ofscreennoteditmode‰ENDI SEEKR2‰IF.L†A0E.LINETHEN.S#‰ADD.L…D5,(A2)Updatestartofline‰ADD.L…D5,4(A2)Œandendofline‰MOVE.L„S.LINE,A0‰ENDI‰BRA.S…WRITCRSR ** Scroll*)* Input parameters : A0.L > end of screen* SCROLL1‚EQU‡*2‰MOVE.L„E.SCRN,E.LINE‡Modifystartandendofline‰MOVE.L„E.SCRN,S.LINE‰SUB.L…D6,(A2) %‰MOVE.L„S.SCRN,A0‹Startoffirstline‰MOVE.L„S.SCRN,A3!‰ADD.L…D5,A3Startofsecondline&‰BRA.S…SCROLLRDonotscrolllastline ,SCROLL2‚MOVE.W„C.LINE,D4‹Charactersperline6SCROLLITMOVE.W„(A3)+,(A0)+‰Moveline#n+1toline#n.!‰DBRA†D4,SCROLLIT‰Scrolloneline$‰ADD.W…PB.LINE,A0ŠStartofnextline‰ADD.W…PB.LINE,A3SCROLLR%‰DBRA†D3,SCROLL2ŠRepeatforalllines $‰MOVE.L„S.LINE,A0‹Startoflastline7‰MOVE.W„C.LINE,D4‹Resetlastlinetonofacsandspaces‰MOVE.W„(A1),D2 ‰OR.B†#$20,D2 2SCROLL3‚AND.W…#$0080,(A0)‰Saveonlyapossibletab,‰OR.W†D2,(A0)+ŒInitFACsandspacecharacter‰DBRA†D4,SCROLL3ŠThewholeline $‰MOVE.L„S.LINE,A0‹Startoflastline WRITCRSREQU‡**9* Convert display RAM address to absolute cursor address,* and write into CRTC.** A0.L = Diaplay cursor address*/‰MOVE.L„A0,D1Calculatecursorabsoluteaddress‰SUB.L…#SCREEN,D1+‰LSR.L…#1,D1Totakecareofattributearea WRITEABSEQU‡**/* Write the absolute cursor address in the CRTC* * D1.W = absolute cursor address*!‰MOVE.B„#$0F,CRTCADDˆPointtoR152‰MOVE.B„D1,CRTCREGŠStoreLSBofnewcursoraddress ‰LSR.W…#8,D1Positionupperbyte!‰MOVE.B„#$0E,CRTCADDˆPointtoR143‰MOVE.B„D1,CRTCREGŠSroreMSBofnewcursorregister 6RETURNƒMOVEM.Lƒ(A7)+,D0-D7/A0-A3ƒRestoreuser'svalues‰RTS‰PAGEREADCRSREQU‡***‚Readthecursorposition*6*‚Thisroutineisforinternaluse,andisnotXDEFed.)*‚ForanexternalcontrolroutineseeC6.**‚Inputparametersƒ:none*>*‚Registersaffected:D1.W=Absoluteaddressofcursorspot.&*—A0.L=ScreenRAMaddressofcursor.*‰CLR.L…D1’HSKP!‰MOVE.B„#$0E,CRTCADDˆPointtoR14.‰MOVE.B„CRTCREG,D1ŠGetcurrentcursorposition‰ROL.W…#8,D1PutitinMSB!‰MOVE.B„#$0F,CRTCADDˆPointtoR154‰MOVE.B„CRTCREG,D1ŠGetlowerbyteofcursorposition-‰LSL.W…#1,D1AdjustforscreenRAMoperations ‰MOVE.L„D1,A0‰ADD.L…#SCREEN,A0‰RTS***GET_CHAR3‰STˆCHAR_RESERVED‡Reservenextcharacterforcaller>‰MOVE.L„(A7)+,CHAR_OWNER„Savecallersreturnaddressforlater'‰BRA‡RETURNŽWaitforthenextcharacter‰END:PAGEMODE‚IDNTƒ45,0†VME/10pagemodeemulationforTERMDRV.6ŠTTL„PAGEMODE:VME/10pagemodeemulationforTERMDRV.NNNNN NNr{?ƒ3O*v*****************************************************************************O*******************************************************************************O**********************************************************************************É***=***†FILENAME:‚PAGEMODE--PAGEMODEEMULATIONFORTERMDRV******É***7***†ENVIRONMENT:‚LinkedintoTERMDRVfortheVME/10“******É***E***†FUNCTION:‚Whenthekeyboard/screenisputintopagemode,any…***?***‰charactersreceivedfromthekeyboardaresentherefor‰******‰specialinterpretation.©******É******†NOTES:½******É***,***†EXTERNALDATASTRUCTURESREFERENCED:Ÿ******É***)***†EXTERNALENTRYPOINTSREFERENCED:¢******‰OUTCHSº******É***"***†SERVICESCALLEDVIATRAPS:©******É******É***O*******************************************************************************O*******************************************************************************O*^***************************************************************************** *,*‚Revisionhistory(addnewchangestotop).*…Date†Author‰ChangesG*…--------‚-------------‚----------------------------------------------&*†5/23/83‚RussRustad„Initialwriting.*ŠPAGE* *‚XDEF's.*:ŠXDEFƒPAGEMODE‹Entrypt.forchar'sreceivedinpagemode.  *0*‚XREF's(indicatewheretheXDEFis,ifknown).*8ŠXREFƒOUTCHSRoutineinOUTCHStooutputcharonscreen./*ž(AllofthefollowingareXDEF'edinCRTINIT)ŠPAGEO*********************************************************************************‰INCLUDEFILESANDEQUATES*O******************************************************************************* **‚Includefiles:*  *.*‚Equatesforthevaluesofthefunctionkeys.*9FN_LOW„EQU„$A0Thesedefinetherangeofvaluesgenerated%FN_HIGHƒEQU„$BFbythefunctionkeys.ŠPAGEO*v*****************************************************************************O**********************************************************************************É***+***PAGEMODE--PAGEMODEINPUTHANDLER–******É***E***†FUNCTION:‚Whenanexternalroutinereceivesacharacterwhile…***:***‰thescreenisinpagemode,hecallsthisroutine.Ž******É******†NOTES:½******É***E***†REGISTERUSAGE:‚(A)rgument‚(D)estroyed‚(P)reserved‚(R)eturned‚***)***Œ0ƒ1ƒ2ƒ3ƒ4ƒ5ƒ6ƒ7‡SRhi„SRlo(CCR)…******‡D:ƒAR‚.ƒ.ƒ.ƒ.ƒ.ƒ.ƒ.‡.ˆR******‡A:ƒ.ƒ.ƒ.ƒ.ƒ.ƒ.ƒ.ƒP ******É******†ENTRYCONDITIONS:²***8***‰D0.W=$00ccwhereccisthereceivedcharacter.******É***-***†EXITCONDITIONSDIFFERENTFROMENTRY:ž***6***‰CCR:=keystrokedidnotgenerateachar.’***@***Ž,=generatedcharisinD0.W(bits8-15are0).ƒ***(***‰D0isnotpreservedinanycase. ******É***O*^*****************************************************************************O******************************************************************************* ŠDS…0ŠOPT„BRS ŠSECTION0  PAGEMODE: 1ŠMOVEM.LD1,-(SP)ŠSaveregisterswe'llblowaway. DŠIF.BD0#FN_LOWAND.BD0#FN_HIGHTHENƒIfthekeypressed*§wasafunctionkey, 9ŠMOVEQ‚#1,D1ŒSetCCRto,tosay'wegotachar.' %ŠELSE–Else(it'snot afunctionkey), 8ŠBSR.L‚OUTCHSCallOUTCHStooutputthecharandsetCCR3ŠMOVEQ‚#0,D1Žtotosay'ignorethekeystroke.' ŠENDI -ŠMOVEM.L(SP)+,D1ŠRestoreregistersandexit.ŠRTS—*   ŠENDNN8POUTCHSƒIDNT†45,0†OutputacharactertothedisplayRAM.4ŠTTL‡POUTCHS:‚OutputacharactertothedisplayRAM.NNNNNNN„‹”5œ<¤E¬4´,¼,Ä/Ì-ÔFÜHäNìSôNüST <JL$I,;4B<TDCLZTE\EdBl;tK<*************************************************************º**Routinename:POUTCHS˜*<*----------------------------------------------------------*-*Currentrevision.....................1.10*1*Datewritten.........................12-18-82Œ*2*Writtenby...........................S.Pri-Tal‹*/*Datechanged.........................3-1-83Ž*2*Changedby...........................R.RUSTAD‹**º**Descriptionofchange:£**º*0*Datechanged.........................8-17-84*1*Changedby...........................B.NASONŒ**º**Descriptionofchange:£**ƒChangedallXREF.StoXREF**º*0*Datechanged.........................8-30-84*3*ƒchangedtomask'tabstop'bit.....D.Vanderlinˆ**º*0*Datechanged.........................1-30-85*/*Changedby...........................M.DUHŽ**º**Descriptionofchange:£*7*ƒSetRING_BELLflagwhen$07istobeoutput(BELL).„**º*<************************************************************9*Function:Outputthecha racterinD0.Btothedisplay„*/*‹RAMifcharacterisprintable,elseperform„**‹therequiredfunction.™*<*----------------------------------------------------------*/*Inputparameters:‚D0.Bcharactertooutput.*<*----------------------------------------------------------**Registersaffected:none¡*<*----------------------------------------------------------* *Externalroutinesused:none*<************************************************************‰PAGE ‰XDEF†POUTCHS (‰XREF†CRTINITƒInitthescreenparameters‰XREF†SCRNINIT /‰XREF„FACS†Fieldattribute,wordsizedregister3‰XREF„PAGEFLAG‚Wordsizedflag.If=$FFFF,pagemode5‰XREF„PROMODEƒWordsizedflag.If=$FFFF,protectmode 5‰XREF„CPERLINE‚Numberofcharactersperabsoluteline0‰XREF„BPERLINE‚Numberofbytesperabsoluteline2‰XREF„LPERSCRN‚Numberoflinesperabsolutescreen 2‰XREF„C.LINE„Numberofcharacterspervirtualline-‰XREF„B.LINE„Numberofbytespervirtualline *‰XREF„S.LINE„Startaddressofcurrentline(‰XREF„E.LINE„Endaddressofcurrentline *‰XREF„PB.LINEƒUnusedpartofabsoluteline 2‰XREF„L.SCRN„Numberoflinesinthevirtualscreen <‰XREF„S.SCRN„Addressofhomecharacterinthevirtualscreen<‰XREF„E.SCRN„Addressoflastcharacterinthevirtualscreen (‰XREF„TOPLINEƒToplineofvirtualscreen+‰XREF„BOTLINEƒBottomlineofvirtualscreen,‰XREF„LEFTCOLƒLeftcollumnofvirtualscreen.‰XREF„RIGHTCOL‚Rightcollumnofvirtualscreen 9‰XREF†FEEDER„Addressofsubroutinetogivedatatodriver=‰XREF†FEEDER_ADDRESS†AddressofdatabuffertogivetoFEEDER,‰XREF†FEEDER_COUNTˆ#ofbytesindatabuffer ‰XREF†DUP_CHAR (‰XREF†KB_LOCKKeyboardlock/unlockflag 2‰XREF†RABSOLUTŒOutchsreadabsoluteentryaddress. 0‰XREF†RING_BELL‹Flagsetwhen$07isdetectedin%*§ordertoringthebellinKEYBRD.AG‰PAGE .SCREENƒEQU‡$F17000BaseaddressofdisplayRAM0CRTCADD‚EQU‡$F1A021AddressregisteroftheCRTC-CRTCREG‚EQU‡$F1A023RegisterfileoftheCRTC)EPCIBASEEQU‡$F1A031BaseaddressofEPCIKBDADDR‚EQU‡$0C$LFCHARƒEQU‡$0A‘ASCIIlinefeedchar.0START_OF_DATAEQU‚$DDŽ'Startofdata'indicator./END_OF_DATAEQU„$DE‘Endofwrite/readindicator$FALSE„EQU‡0“Indicateconditionfalse#TRUE…EQU‡-1’Indicatetruecondition"CLEARTABEQU‡$18‘Cleartabcommand#SPACE„EQU‡$20ŽASCIIspacecharacter#ESC_CHAR‚EQU„$1BASCIIescapechar.+END_OF_FIELDEQU$F9Endoffieldindicator6INIT_TAB‚EQU„10‘Initialtabspacing.‚Theresetcommand#*§($F1)willputtabsonthescreen*§withthisspacing.* *ˆFACEQUATES*3PROTECT_FACEQU„$C5‡Protectfacwithintensitycode3DISPLAY_FACEQU„$44‡Displayfacwithintensitycode/BLINK_FACƒEQU„$A5‡Blinkfacwithintensitycode7UNDERLINE_FACEQU‚$55‡Underlinefacwithintensitycode9INVERSE_FACEQU„$4D‡Inversevideofacwithintensitycode!NODIS_FACƒEQU„$05‡Setnon-display** Register use:*’D0.L=generaluse+*’D1.W=absoluteaddressofinitialcursor/*’D2.W=chractertodecodeandwordtodisplay)*’D3.W=linespervirtualscreencounter+*’D4.W=characerspervirtuallinecounter *’D5.L=bytesperabsoluteline*’D6.L=bytespervirtualline*’D7.L=generaluse-*’A0.L=addressofcursorinthedisplayRAM*’A1.L=AddressofFACS*’A2.L=AddressofS.LINE*’A3.L-Generaluse*  ‰PAGE ‰SECTIONƒ11  **ˆDEFINESTORAGE*=ESC_FLAG‚DC.BƒFALSEŽThisflagistrueifsomeonehasreserved(*§acharandthefirstcharreceivedwas&*§anESC.‚Inthatcasewewaitforthe*§nextcharandsetitsbit7.:CHAR_RESERVEDDC.BFALSE…Nextcharacterreservedindicator(SAVE_CHAR…DS.B1‰Saveareaforcharacter-SAVE_CURSORƒDS.L1‰CurrentcursorramaddressBCHAR_OWNER„DS.L1‰Addressofroutinethatownsnextincomingchar.5XTCHBUF‚DS.W†162‡ScratchbufferforfeedersubroutineEDIT_FLAGDC.B…FALSE=COL_CNT‚DS.L†1‰Currentcolumnnumber,usedinsettabroutine?PRO_FIELDDC .B…FALSE…Thisfieldusedtodeterminewheretostop(* whenaprotectedfieldisencountered.‰DS.W†00SAVEFACS‚DC.W…0‰FACSsavedduringwriteabsolute=LASTFACƒDC.B…FALSE…SetlastcharacterprocessedtonotaFAC.8NUMBER_LINESDC.Wƒ25‡Numberoflinestoclearonscreen.‰PAGE POUTCHS‚DS.W†0 HAVE_CHAR‰MOVE.B„D0,D2D2.B=Character ** Now find out what to do*:‰TST.B…CHAR_RESERVED‡Byteissetifaroutineexpectsmore*ªthanasinglecharacter‰IFTHEN.S 8ŠTST.B‚ESC_FLAG‹IfthelastcharwereceivedwasanESC,ŠIF…THEN.Sˆ* 2ŠSF…ESC_FLAG‹Clearthe'lastcharwasanESC'flag5ŠBSETƒ#7,D0Žandsetbit7inD0andD2(bothofwhich-ŠBSETƒ#7,D2ŽholdthecharfollowingtheESC). (ŠELSE.S”Else(lastcharwasnotanESC), 6ŠIF.BD0#ESC_CHARTHEN.SIfthischarisanESC,0ŠST…ESC_FLAG‹setthe'lastcharwasanESC'flagŠBRA„RETURNandexit.ŠENDI–* ŠENDI /‰SFCHAR_RESERVEDŽResetcharacterreservedflag:‰MOVE.LCHAR_OWNER,A3ŠGettheaddressoftheroutinewhich*¨processthischaracter'‰JMP(A3)–Goprocessincomingcharacter ‰ENDI *(*ˆFindentryintableforthischaracter*OUTCH1(‰MOVE†D2,D0…Resetupperpartofregister5‰ADD‡D0,D0…Multiplybytwobecausetableiswordwide+‰MOVE†JUMPTABL(PC,D0),D0Getoffsetaddress2‰JMP‡JUMPTABL(PC,D0)„Goprocessincomingcharacter‰PAGEJUMPTABL,ŠDC.WƒRETURN-JUMPTABL„$00--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$01--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$02--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$03--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$04--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$05--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$06--Illegal--exit ŠDC.WƒBELL-JUMPTABL†$07--Bell.#ŠDC.WƒBS-JUMPTABLˆ$08--Backspace.(ŠDC.WƒHT-JUMPTABLˆ$09--Horizontaltab.%ŠDC.WƒDOWN-JUMPTABL†$0A--Linefeed.&ŠDC.WƒUP-JUMPTABLˆ$0B--Verticaltab.&ŠDC.WƒRIGHT-JUMPTABL…$0C--Formfeed.)ŠDC.WƒCR-JUMPTABLˆ$0D--Carriagereturn.,ŠDC.WƒRETURN-JUMPTABL„$0E--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$0F--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$10--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$11--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$12--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$13--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$14--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$15--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$16--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$17--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$18--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$19--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$1A--Illegal--exit!ŠDC.WƒESC-JUMPTABL‡$1B--Escape.,ŠDC.WƒRETURN-JUMPTABL„$1C--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$1D--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$1E--Illegal--exit,ŠDC.WƒRETURN-JUMPTABL„$1F--Illegal--exit,ŠDC.WƒDISPLAY-JUMPTABLƒ$20--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$21--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$22--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$23--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$24--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$25--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$26--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$27--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$28--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$29--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$2A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$2B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$2C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$2D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$2E--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$2F--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$30--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$31--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$32--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$33--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$34--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$35--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$36--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$37--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$38--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$39--Displayasis.,ŠDC.WƒDISP LAY-JUMPTABLƒ$3A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$3B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$3C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$3D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$3E--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$3F--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$40--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$41--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$42--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$43--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$44--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$45--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$46--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$47--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$48--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$49--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4E--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$4F--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$50--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$51--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$52--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$53--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$54--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$55--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$56--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$57--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$58--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$59--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5E--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$5F--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$60--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$61--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$62--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$63--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$64--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$65--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$66--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$67--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$68--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$69--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6E--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$6F--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$70--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$71--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$72--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$73--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$74--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$75--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$76--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$77--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$78--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$79--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$7A--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$7B--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$7C--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$7D--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$7E--Displayasis.,ŠDC.WƒDISPLAY-JUMPTABLƒ$7F--Displayasis.'ŠDC.WƒRETURN-JUMPTABL„$80--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$81--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$82--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$83--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$84--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$85--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$86--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$87--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$88--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$89--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$8A--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$8B--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$8C--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$8D--Ignoreit.4ŠDC.WƒSTART_EDITMODE-JUMPTABLƒ$8E--Starteditmode1ŠDC.WƒSTOP_EDITMODE-JUMPTABL„$8F--Endeditmode'ŠDC.WƒRETURN-JUMPTABL„$90--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$91--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$92--Ignoreit.'ŠDC.WƒRETURN-JUMPT ABL„$93--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$94--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$95--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$96--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$97--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$98--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$99--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9A--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9B--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9C--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9D--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9E--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$9F--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A0--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A1--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A2--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A3--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A4--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A5--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A6--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A7--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A8--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$A9--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AA--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AB--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AC--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AD--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AE--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$AF--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B0--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B1--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B2--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B3--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B4--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B5--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B6--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B7--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B8--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$B9--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BA--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BB--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BC--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BD--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BE--Ignoreit.'ŠDC.WƒRETURN-JUMPTABL„$BF--Ignoreit.%ŠDC.WƒHOME-JUMPTABL†$C0=Cursorhome!ŠDC.WƒUP-JUMPTABLˆ$C1=Cursorup%ŠDC.WƒDOWN-JUMPTABL†$C2=Cursordown&ŠDC.WƒSEEKL-JUMPTABL…$C3=Cursorleft'ŠDC.WƒRIGHT-JUMPTABL…$C4=Cursorright$ŠDC.WƒC5-JUMPTABLˆ$C5=Writecursor#ŠDC.WƒC6-JUMPTABLˆ$C6=Readcursor(ŠDC.WƒSPAGE-JUMPTABL…$C7=Setpagemode*ŠDC.WƒRPAGE-JUMPTABL…$C8=Setscrollmode0ŠDC.WƒSETTOP-JUMPTABL„$C9=Settopdisplayline5ŠDC.WƒSETBOTOM-JUMPTABL‚$CA=Setbottomdisplayline5ŠDC.WƒSETLEFT-JUMPTABLƒ$CB=Setleftdisplaycollumn7ŠDC.WƒSETRIGHT-JUMPTABL‚$CC=Setrightdisplaycollumn-ŠDC.WƒSETPROT-JUMPTABLƒ$CD=Setprotectmode,ŠDC.WƒWABSOLUT-JUMPTABL‚$CE=Writeabsolute+ŠDC.WƒREADABSO-JUMPTABL‚$CF=Readabsolute5ŠDC.WƒICHAR-JUMPTABL…$D0=Insertcharacteratcursor5ŠDC.WƒDCHAR-JUMPTABL…$D1=Deletecharacteratcursor,ŠDC.WƒKEYENAB-JUMPTABLƒ$D2=Enablekeyboard.ŠDC.WƒKEYDSABL-JUMPTABL‚$D3=Disablekeyboard?ŠDC.WƒEEPAGE-JUMPTABL„$D4=Eraseallunprotectedtoendofpag?ŠDC.WƒEELINE-JUMPTABL„$D5=Eraseallunprotectedtoendoflin3ŠDC.WƒINS_LINE-JUMPTABL‚$D6=Pagemodeinsertline3ŠDC.WƒDEL_LINE-JUMPTABL‚$D7=Pagemodedeleteline:ŠDC.WƒCLEAR-JUMPTABL…$D8=Eraseallunprotectedinscreen&ŠDC.WƒSNDPAGE-JUMPTABLƒ$D9=Sendpage'ŠDC.WƒSEEKFT-JUMPTABL„$DA=Forwardtab$ŠDC.WƒSEEKBT-JUMPTABL„$DB=Backtab#ŠDC.WƒSETTAB-JUMPTABL„$DC=SettabŠDC.WƒRETURN-JUMPTABL„$DD=ŠDC.WƒRETURN-JUMPTABL„$DE=(ŠDC.WƒSEND_LINE-JUMPTABL$DF=Sendline%ŠDC.WƒSBLINK-JUMPTABL„$E0=Setblink'ŠDC.WƒRBLINK-JUMPTABL„$E1=Resetblink-ŠDC.WƒSINVERT-JUMPTABLƒ$E2=Setvideoinvert/ŠDC.WƒRINVERT-JUMPTABLƒ$E3=Resetvideoinvert-ŠDC.WƒUPBRIGHT-JUMPTABL‚$E4=Sethalfbright/ŠDC.WƒDNBRIGHT-JUMPTABL‚$E5=Resethalfbright)ŠDC.WƒSULINE-JUMPTABL„$E6=Setunderline+ŠDC.WƒRULINE-JUMPTABL„$E7=Resetunderline,ŠDC.WƒNONDISP-JUMPTABLƒ$E8=Setnon-display(ŠDC.WƒSETDISP-JUMPTABLƒ$E9=Setdisplay-ŠDC.WƒPROTECT-JUMPTABLƒ$EA=Setprotectmode-ŠDC.WƒALLOW-JUMPTABL…$EB=ResetprotectmodeŠDC.WƒRETURN-JUMPTABL„$EC=ŠDC.WƒRETURN-JUMPTABL„$ED=ŠDC.WƒRETURN-JUMPTABL„$EE=ŠDC.WƒRETURN-JUMPTABL„$EF=ŠDC.WƒRETURN-JUMPTABL„$F0=2 ŠDC.WƒRESET24-JUMPTABLƒ$F1=Reset24linescreen.ŠDC.WƒRETURN-JUMPTABL„$F2=ŠDC.WƒRETURN-JUMPTABL„$F3=ŠDC.WƒRETURN-JUMPTABL„$F4=ŠDC.WƒRETURN-JUMPTABL„$F5=ŠDC.WƒRETURN-JUMPTABL„$F6=2ŠDC.WƒRESET25-JUMPTABLƒ$F7=Reset25linescreen.ŠDC.WƒRETURN-JUMPTABL„$F8=ŠDC.WƒRETURN-JUMPTABL„$F9=ŠDC.WƒRETURN-JUMPTABL„$FA=ŠDC.WƒRETURN-JUMPTABL„$FB=ŠDC.WƒRETURN-JUMPTABL„$FC=ŠDC.WƒRETURN-JUMPTABL„$FD=ŠDC.WƒRETURN-JUMPTABL„$FE=ŠDC.WƒRETURN-JUMPTABL„$FF=  ‰PAGE*'* $7F = DLE, delete character at cursor*DLE'‰AND.W…#$FF80,(A0)‰Nullcharacterspace)‰OR.B†#$20,(A0)‹Spacecharacteratcursor ‰BRA‡RETURN *** Send the command in D0 to this key board*'WKBD…OR.B†#KBDADDR,D0‰Tothiskeyboard‰MOVE.B„D0,EPCIBASE‰RTS ** 07 = CTRL G = BELL*ADDED‚01/30/85*8* RING_BELL flag is set so that the interrupt routine in9* KEYBRD.AG will output an ALARM command to the keyboard.*BELL ‰STˆRING_BELL ‰BRA‡RETURN‰PAGE** 08 = CTRL H = BS, back space*:* Cursor moves left to first unprotected column, with line* and page rollover.**BS SEEKL„EQU‡* ‰IF.B†PAGEFLAG#TRUETHEN.S‰IF.L†A0S.SCRNTHEN.S9‰MOVE.L„E.SCRN,A0‹Weneedtoputthecursoronthebottom7‰MOVE.L„A0,E.LINE‹lineandupdatethebeginningandend+‰MOVE.L„A0,S.LINE‹ofcurrentlinepointers.‰SUB.L…D6,S.LINE ‰BRA‡WRITCRSR‰ENDI‰IF.L†A0S.LINETHEN.S3‰SUB.L…D5,A0Findthebeginningaddressoftheline:‰MOVE.L„A0,S.LINE‹abovethecursorandupdatethepointer.0‰ADD.L…D6,A0Findtheendingaddressoftheline:‰MOVE.L„A0,E.LINE‹abovethecursorandupdatethepointer. ‰BRA‡WRITCRSRŒUpdatethecursor.‰ENDI0‰SUBQ.L„#2,A0Movethecursorleftoneposition.‰BRA‡WRITCRSRŒ*‰ENDI!‰MOVE.L„A0,A3Setloopterminator‰REPEAT‰IF.L†A0S.SCRNTHEN.S6‰MOVE.L„E.SCRN,A0‹Ifbacktostartgotoendofscreen1‰MOVE.L„A0,E.LINE‹Setendofcurrentvirtualline3‰MOVE.L„A0,S.LINE‹Setstartofcurrentvirtualline‰SUB.L…D6,(A2)*‰ELSE.S‰IF.L†A0S.LINETHEN.S'‰SUB.L…D5,A0Setstartofpreviousline‰MOVE.L„A0,S.LINE‹*$‰ADD.L…D6,A0Setendofvirtualline.‰MOVE.L„A0,E.LINE‹andA0pointstoendofline‰ENDI‰ENDI&‰TST‡-(A0)Iscurrentspotunprotected#‰BMI.S…SEEKL1ŽBranchifunprotected1‰TST.B…1(A0)Ifweareatendoflinemovecursor*¦backanotherposition.‰IFˆTHEN.S‰*‰BRA.S…SEEKL1Ž*‰ELSE.S2‰BRA.S…SEEKL2ŽGoupdatecursorbecausewefoundan*¦unprotectedspot.‰ENDISEEKL1‰UNTIL.LƒA0A35‰MOVE.L„S.SCRN,A0‹Putcursorinhomeposition--noun-$*¦protectedareasincurrentscreen.SEEKL2 ‰BRA‡WRITCRSR‰PAGE*"* 09 = CTRL I = HT, horizontal tab*2* Seek a TAB at an un-protected spot to the right,* with line and page rollover.**HT$SEEKFTƒEQU‡*“Seekatabtotheright2‰SFˆPRO_FIELD‹Havenotencounteredprotectedfield!‰MOVE.L„A0,A3Setloopterminator*‰ADDQ.L„#2,A0Getoffofcurrentcharacter‰BRA.S…SEEKFT2‰REPEAT(‰TST‡(A0)+Iscurrentlocationprotected!‰BPL.S…SEEKFT1Branchifitisn't*3*ˆCursorisinaprotectedfield--checktoseeif2*ˆencounteredearlierandwearestillinitorif*ˆthisisthefirsttime*0‰TST.B…PRO_FIELD‹Firsttimeinprotectedfield?‰IFTHEN.S0‰STˆPRO_FIELD‹Tellworldwehaveencounteredthe$*©protectedfieldforthefirsttime.‰BRA.S…SEEKFT2Nowmoveoutofprotectedfield‰ENDI7‰BRA.S…SEEKFT2Stillinprotectedfieldcontinuesearch*©forfirstunprotectedfield. SEEKFT16‰TST.B…PRO_FIELD‹Ifthisisanunprotectedfieldcheck$*¨toseeifwepassedthroughapro-"*¨tectedfieldfirst.‚Thetabmust"*¨moveoutofcurrentfieldtothe*¨nextunprotectedfield.‰IFTHEN.S/‰TST.B-1(A0)’Wecannotstoponanendofline.‰IFTHEN.S*/‰BRA.S‚SEEKFT2Branchifweareatendofline.‰ENDI'ŠSUBQ.L#2,A0‘Adjustthecursoraddress0ŠBRAWRITCRSR‘Foundourtabstopwhichreallyis"*ªjustanunprotectedfieldtothe*ªrightofthecurre ntfield.‰ENDISEEKFT2ŒIF.L‚A0E.LINETHEN.S“ADD.L‚D5,A0ˆDolinerollover8“MOVE.LA0,E.LINE„Addabsolute#ofcharacterfore.line2“SUB.L‚D6,A0ˆS.line=e.line-#charinvirtline“MOVE.LA0,S.LINE„*7ŒSTPRO_FIELD‰Becausewewentoff-linefakeaprotected*¦fieldhitsocursorwillstop‰ENDI‰IF.LA0E.SCRNTHEN.S"ŒMOVE.LS.SCRN,A0…Dopagerollover'ŒMOVE.LA0,S.LINE…Setnewstartofline%ŒMOVE.LA0,E.LINE…SetnewendoflineŒADD.L‚D6,E.LINE…*7ŒSTPRO_FIELD‰Becausewewentoff-linefakeaprotected*¦fieldhitsocursorwillstop‰ENDISEEKFT3‰UNTIL.LƒA0A3 ‰BRARETURN‰PAGE***0D…Carriagereturn*2* Position cursor at left most unprotected column.** FAC's are reset.*CR‰AND.W…#$4400,(A1)‰ResetFACs‰MOVE.L„S.LINE,A0‹Startofline ‰BSR‡SEEKR ‰BRA‡WRITCRSR * *1B…Escape*(* Set high bit of next character output.* ESC†EQU‡*#‰BSR‡GET_CHARŒNeedanotercharacter ‰BSET†#7,D0‰BRA‡HAVE_CHAR‰PAGE**$8E„STARTEDITMODE*START_EDITMODE ‰BSR‡GET_CHAR‰IF.BD0#$FFTHEN.S‰MOVE†#$FFFF,DUP_CHAR‰ELSE.S‰MOVE†D2,DUP_CHAR‰ENDI ‰STˆEDIT_FLAG ‰SFˆPAGEFLAG ‰SFˆPROMODE ‰BRA‡RETURN**$8F‚STOPEDITMODE* STOP_EDITMODE%‰SFˆEDIT_FLAG‹Turnoffeditmodeflag ‰BRA‡RETURN‰PAGE**$C0„cursorhome*A* Cursor moves to top left corner of screen, seeks an unprotected* space to the right.* HOME…EQU‡* ‰MOVE.L„S.SCRN,A0‹Topleftspace6‰MOVE.L„A0,S.LINE‹Modifystartandendofcurrentline‰MOVE.L„A0,E.LINE‰ADD.L…D6,4(A2) ‰BSR‡SEEKR ‰BRA‡WRITCRSR * * C1 = Up*C* Cursor moves up one line in same column, seeks unprotected column+* to the left, with line and page rollover.**(UP‡SUB.L…D5,A0Samecolumninlineabove3‰SUB.L…D5,(A2)Modifystartandendofcurrentline‰SUB.L…D5,4(A2)‰CMP.L…S.SCRN,A0‹Outofscreen?‰BGE.S…UP.1No,doit4‰MOVE.L„A0,D0Rollscreenover--findcursorposition(*¦relativetothebeginningoftheline.4‰SUB.L…S.LINE,D0‹D0<--cursoroffsetintothisline,‰MOVE.L„E.SCRN,A0‹Pointtobottomofscreen.*‰MOVE.L„A0,S.LINE‹Updatestart/endofline‰SUB.L…D6,(A2)‰MOVE.L„A0,E.LINE%‰MOVE.L„S.LINE,A0‹Positionthecursor‰ADD.L…D0,A0* +UP.1…EQU‡*“Modifystart/endofcurrentline ‰LEA‡2(A0),A0 ‰BRA‡SEEKL‰PAGE* * C2 = Down*A* Cursor seeks an unprotected spot to the right, starting at same+* collumn on next line, with page rollover.* DOWN…EQU‡*%‰ADD.L…D5,A0Samecolumnonnextline/‰ADD.L…D5,(A2)Modifystart/endofcurrentline‰ADD.L…D5,4(A2)#‰CMP.L…E.SCRN,A0‹Outofthescreen?‰BLT.S…DOWN1No,doit4‰MOVE.L„A0,D0Rollscreenover--findcursorposition(*¦relativetothebeginningoftheline.4‰SUB.L…S.LINE,D0‹D0<--cursoroffsetintothisline/‰MOVE.L„S.SCRN,A0‹Pointtobeginningofscreen.'‰MOVE.L„A0,S.LINE‹Updatelinepointers.‰MOVE.L„A0,E.LINE‹*‰ADD.L…D6,4(A2)Œ* ‰ADD.L…D0,A0PositionthecursorDOWN10‰BSR‡SEEKRSeekanunprotectedspottotheright ‰BRA‡WRITCRSR *** C3 = cursor left, same as back space 08.* * * C4 = Right*D* Seek an unprotected space to the right with line and page rollover*RIGHT!‰MOVE.L„A0,A3Setloopterminator'‰ADDQ.L„#2,A0Getoffofcurrentcolumn ‰BRA.S…RIGHT1‰REPEAT-‰TST.W…(A0)+Pointingtounprotectedcolumn?‰IFTHEN.S/‰TST.B…-1(A0)ŽWecannotstoponanendofline.$‰IFƒTHEN.SŽEndoflineisa00. ‰BRA.S‚RIGHT2‰ENDI'‰SUBQ.L„#2,A0Adjustforautoincrement%‰BRA‡WRITCRSRŒUpdatecursoronscreen‰ENDIRIGHT1 ‰IF.B‚PAGEFLAG#TRUETHEN.S “BRAWRITCRSR‰ENDI‰IF.LA0E.SCRNTHEN.S ‰MOVE.LS.SCRN,A0„Doscreenwrap;‰MOVE.LA0,S.LINE„Updatebeginningandendinglinepointers‰MOVE.LA0,E.LINE„*‰ADD.L‚D6,E.LINE„*‰ENDI‰IF.LA0E.LINETHEN.S‰ADD.L…D5,A0Dolinewrap!‰MOVE.L„A0,E.LINE‹Newendofline‰SUB.L…D6,A0Newstartofline‰MOVE.L„A0,S.LINE‹*‰ENDIRIGHT2‰UNTIL.LƒA0A3)‰BRA‡RETURNŽNounprotectedsoleaveasis  ‰PAGE*+*$C5„Movethecursortotherequestedspot*C5: 'ŠBSR„GET_CHAR‹D0.B<--theline#char.'ŠMOVE.BD0,SAVE_CHAR‡Saveitforlater. )ŠBSR„GET_CHAR‹D0.B<--thecolumn#char.&ŠMOVEQ‚#0,D1ŽD1<--thecolumn#char.ŠMOVE.BD0,D1Ž*1ŠSUB.B‚#$20,D1ŒAdjustitso0isfirstline,etc. 4ŠCMP„LEFTCOL,D1‰Ensurethatthecolumn#isinrange2ŠBLO„RETURN(LEFTCOL#TRUETHEN.SƒDoaseekrightifscreenis“BSRSEEKRinprotectmode.‰ENDI ŠBRA„WRITCRSR‰PAGEC6‡EQU‡***$C6„Readthecursorposition.**‚Inputparametersƒ:none.*G*‚Registersaffected:D0.W=LLCC(seeC5foranexplanationofLLCC).**+‰BSR‡READCRSRŒGetcursor'sabsoluteaddress‰DIVU†D5,D1D1=00CC00LL‰SWAP†D1’D1=00LL00CC3‰LSL.W…#8-1,D1D1=00LLCC00(-1toconverttobytes)0‰ADD.L…#$DD2020DE,D1‡Addtheoffsetfortheuser*¦Setstartdataandenddata*‰LEA‡XTCHBUF(PC),A0†SetupforFEEDERcall‰MOVE.L„D1,(A0)Movetobuffer,‰MOVE.W„#4,FEEDER_COUNT…Setlengthofbuffer:‰MOVE.L„A0,FEEDER_ADDRESSƒSetaddressofbufferforFEEDER‰BSR‡FEEDERŽGivedatatodriver‰BRA‡RETURNŽReturntocaller***$C7„Setpagemode.* SPAGE„EQU‡*‰MOVE.W„#-1,PAGEFLAG ‰SFˆPROMODE ‰BRA‡HOME **$C8„Setscrollmode.* RPAGE„EQU‡*‰CLR.W…PAGEFLAG ‰SFˆPROMODE'‰MOVE.L„S.SCRN,A0Doascrollmodehome‰MOVE.LƒA0,S.LINE‚*‰MOVE.LƒA0,E.LINE‚*‰ADD.L„D6,4(A2)ƒ*‰BRA‡WRITCRSR‚***$CD„Setprotectmode*SETPROT‰STˆPROMODEƒSetprotectmode‰CLR‡PAGEFLAG‚Resetpagemode-‰BRA‡HOME†Setthecursortothehomeposition‰PAGE***$C9„Settoplineofvirtualdisplayarea*G* The top line is set by: 1. Bringing the cursor to the requested line,*œandthenenteringanESCI."*™2.EnteringoutchwithD0.W=LLC5 SETTOPƒEQU‡* ‰BSR‡GET_CHARŒGetnextcharacter‰SUB.B…#$20,D2$‰CMP.W…BOTLINE,D2Š0=botline ‰BHI‡RETURN$‰MOVE.W„D2,TOPLINEŠStoreinconstantINITIT‰BSR‡CRTINITRe-configureCRT&‰BRA‡HOME†Putcursorinhomeposition. *-*$CA„Setbottomlineofvirtualdisplayarea*"*SameasC9forbottomline‚ESCJ*SETBOTOMEQU‡*‰BSR‡GET_CHARŒGetlinenumber!‰SUB.B…#$20,D2Adjustlinenumber+‰CMP.W…LPERSCRN,D2‰lperscrn>botline>topline ‰BHS‡RETURN‰CMP.W…TOPLINE,D2 ‰BLO‡RETURN‰MOVE.W„D2,BOTLINE ‰BRA‡INITIT *5*$CB„Setleftdisplaycolumnofvirtualscreen‚ESCK* SETLEFT‚EQU‡*‰BSR‡GET_CHARŒGetleftcolumn‰SUB.B…#$20,D2‰CMP.W…RIGHTCOL,D2 ‰BHI‡RETURN‰MOVE.W„D2,LEFTCOL ‰BRA‡INITIT‰PAGE*4*$CC„Setrightdisplaycolumnofdispalyarea‚ESCL*SETRIGHTEQU‡*‰BSR‡GET_CHARŒGetrightcolumn‰SUB.B…#$20,D2,‰CMP.W…CPERLINE,D2‰cperlineleftcol ‰BHS‡RETURN‰CMP.W…LEFTCOL,D2 ‰BLO‡RETURN‰MOVE.W„D2,RIGHTCOL ‰BRA‡INITIT SEEIFIN‚EQU‡*-‰LSR.W…#8,D0Checktoseeiftheuserdefined%‰TST.W…D0’thespotinthesecondbyte ‰BNE.S…RTSIT*:* The routine will calculate the current line and collumn.+* Left collumn is #00, and top line is #00.*2*InputŒA0.L=Addressofcursorindisplayscreen**Output‹A0.L=unchanged*’D0.L=00CC00LL&*™wher  eˆLL=Linenumber,topline=0'*¦CC=Collumnnumber,leftcollumn=0 GETSPOT‚EQU‡*‰CLR.L…D0’HSKP ‰MOVE.L„A0,D04‰SUB.L…#SCREEN,D0‰=Absolutecursoraddressonscreen ‰LSR.W…#1,D0*‰DIVU†CPERLINE,D0‰Thequotiant=linenumber RTSIT„RTS‰PAGE**$CE„writeabsolute* WABSOLUT: -ŠREPEAT”Waitfora'startofdata'indicator.ŠBSR„GET_CHAR‹*ŠUNTIL.BD0#START_OF_DATA ,ŠMOVEƒ(A1),SAVEFACS†SavecurrentFACSinuse 'ŠBSR„GET_CHAR‹D0.B<--theline#char.'ŠMOVE.BD0,SAVE_CHAR‡Saveitforlater. )ŠBSR„GET_CHAR‹D0.B<--thecolumn#char.&ŠMOVEQ‚#0,D1ŽD1<--thecolumn#char.ŠMOVE.BD0,D1Ž*1ŠSUB.B‚#$20,D1ŒAdjustitso0isfirstline,etc. 5ŠCMP„CPERLINE,D1ˆEnsurethatthecolumn#isinrange-ŠBHS„RETURN(LEFTCOL#END_OF_DATATHEN.S6‰MOVE.L„SAVE_CURSOR,D0†Restorevirtualscreen'sS.LINE *°andE.LINE!‰MOVE.L„D0,D1Copycursoraddress‰SUB.L…#SCREEN,D0*‰DIVU†BPERLINE+2,D0‡Findlinecursorison*¦remainder=positioninline‰CLR‡D0’Forgetlineweareon‰SWAP†D0,‰SUB.L…D0,D1wenowknowtheabsolutes.line-‰MOVE†LEFTCOL,D0Šsoadjustitbythevaluein‰ADD‡D0,D0leftcol.‰ADD.L…D0,D1*1‰MOVE.L„D1,S.LINE‹bingowenowhavestartofline-‰ADD.L…B.LINE,D1‹addthenumberofbytes/line%‰MOVE.L„D1,E.LINE‹andsetendofline8‰MOVE.L„SAVE_CURSOR,A0†Setcursorbacktovirtualscreen/‰MOVE†SAVEFACS,(A1)‡ResetFACSforcurrentline‰BRA‡WRITCRSRŒ*ŠENDIŠST…CHAR_RESERVED‰IF.BD2#$E0AND.BŽD2#$EBTHEN.S6‰TST.B…LASTFACSeeifthelastcharacterprocessedwas*¦aFAC.5‰IF‚THEN.SIfitwasnotaFACthendestroywhat'*¦iscurrentlyonthescreenbecauseit*¦couldbeanotherFAC.:‰MOVE.B„#$FF,1(A0)ŠDestroycurrentcharacter.(ifaFACis&*¦writtenherethecodewillbea01.)‰ENDI3‰STˆLASTFACTelltheloopwehavebeenherebefore.‰BRA‚OUTCH1“ProcesstheFAC.‰ENDI3‰TST.B…LASTFACIfthelastcharacterwasaFACthen3‰IFƒTHEN.SŽthecursorhasnotbeenupdated,so-‰ADD.L…#2,A0let'sadd2andgetoffourFAC.)‰SFˆLASTFACLastcharacterwasnotaFAC.‰ENDI8‰MOVE.W„LPERSCRN,D0‰FINDTHEENDOFTHEABSOLUTEDISPLAY ‰MULU†D5,D0*‰ADD.L…#SCREEN,D0Š*5‰OR.W†FACS,D2Writethecurrentcharactertothescrn‰MOVE.W„D2,(A0)+Œ*‰IF.L†A0D0THEN.S&‰BRA‡RETURNŽExitifpastendofscreen‰ENDI,‰BRA‡WRITCRSRŒUpdatecurrentcursorposition **$CF„readabsolute*+*ˆUsesthereadabsoluteroutineinoutchs.*READABSOEQU‡* ‰JMP‡RABSOLUT *2* Convert the llcc value to a display RAM address.**ˆInputƒD0.W=llcc*ˆOutput‚A0.L=screenaddress* CONVERT‚EQU‡*%‰MOVE.L„D6,-(A7)ŒGetsomeellbowroom ‰CLR.L…D6 ‰MOVE.W„D0,D6‰AND.W…#$00FF,D0‰CMP.W…CPERLINE,D0 ‰BGT.S…CONRET‰LSR.L…#8,D6D6.L=000000ll‰CMP.W…LPERSCRN,D6 ‰BGT.S…CONRET ‰MULU.W„D5,D6 ‰LSL.W…#1,D0 ‰ADD.B…D0,D6‰ADD.L…#SCREEN,D6 ‰MOVE.L„D6,A0CONRETƒMOVE.L„(A7)+,D6‰RTS‰PAGE*8*‚$D0„Insertacharacteratthecurrentcursorposition.B*‰Startingatthecurrentcursorposition,charactersaremovedto@*‰therightuntiltheendofline! oraprotectedfieldishit.‚A>*‰spaceisputinthecurrentcursorposition.‚Thecursordoes *‰notmove.*7ICHAR:„MOVEQ‚#SPACE,D0ŠInitializeLASTCHARtoaspace. .ICHAR1„TST„(A0)Ifthispositionisprotected,ŠBMI.S‚ICHAR3getout. 2ŠMOVEQ‚#$7F,D1ŒD1<--thecharfromthisposition.ŠAND„(A0),D1Œ*9ŠAND„#$FF80,(A0)ˆPuttheLASTCHARoutthereinitsplace.ŠOR…D0,(A0)+‹andadvancetothenextposition.1ŠMOVEƒD1,D0ŽSetLASTCHARtothecharwejustgot;ŠDBRAƒD4,ICHAR1Š(fornextpass)andloopuntilendofline. ICHAR3„BRA„RETURNExit. *8*‚$D1„Deleteacharacteratthecurrentcursorposition.F*‰Startingjustpastthecurrentcursorposition,charactersaremovedB*‰totheleftuntiltheendoflineoraprotectedfieldishit.‚A@*‰spaceisputinthefinalmodifiableposition.‚Thecursordoes%*‰notmove.‚TheentrypointisDCHAR.*#TRUETHEN.S ŠBRARETURNŠENDI6ŠMOVE.LE.SCRN,A0ŠA0<--addrjustpastendofscreen. AŠWHILE.LA0E.LINEDO.S‚WhileA0isnotonthecurrentline, 6ŠMOVE.LA0,A1ŽA1<--addrjustpastendoflineabove./ŠSUB.L‚D5,A1Ž*‡(D5isbytesperabsoluteline.)0ŠMOVE.LA0,-(SP)‹Savetheaddressforthisline. 6ŠMOVEƒC.LINE,D0ŠD0<--#ofcharsinvirtualline-1.@INS_LIN1‚MOVEƒ-(A1),-(A0)ˆMoveallwords(attributeandchar)in.ŠDBRAƒD0,INS_LIN1ˆthislinetothelinebelow. 3ŠMOVE.L(SP)+,A0‹Restoretheaddressforthisline.-ŠSUB.L‚D5,A0ŽA0<--addressfornextlineup. ŠENDW (*§AtthispointA0istheaddrjustpast&*§theendofthecurrentvirtualline.6ŠMOVEƒC.LINE,D0ŠD0<--#ofcharsinvirtualline-1.?INS_LIN2‚AND.B‚#$80,-(A0)‰Fillthecurrentlinewithspacesand%ŠOR.Bƒ#$20,(A0)Šinnocuousattributes.ŠMOVE.B#$44,-(A0)‰*ŠDBRAƒD0,INS_LIN2ˆ*%*§AtthispointA0istheaddrofthe(*§beginningofthecurrentvirtualline.,ŠBRA„WRITCRSR‹Gosetthenewcursoraddress.   **$D7‚DELETELINE*DEL_LINE‰IF.BPROMODE#TRUETHEN.S ‰BRARETURN‰ENDI;‰MOVE.L„S.LINE,A0BeginningaddressofcurrentvirtuallineDELINE;‰MOVE.L„A0,A1…Calculatetheaddressofthebeginningofthe‰ADD.L…D5,A1…nextline.4‰MOVE†C.LINE,D0Numberofbytesperlinetobemoved?‰CMP.L…E.SCRN,A1Seeifmovefromaddressispassedendofscrn-‰BHS.S…DELINE2ƒBranchifpassedendofscreen2‰MOVE.L„A0,-(A7)‚SavedestinationaddressonstackDELINE1*‰MOVE.W„(A1)+,(A0)+Movelineuponscreen‰DBRA†D0,DELINE1‚*,‰MOVE.L„(A7)+,A0‚Restoredestinationaddress'‰ADD.L…D5,A0‡Pointtonextvirtualline,‰BRA.S…DELINE„GomovenextlineuponscreenDELINE22‰MOVE.B„#$44,(A0)+ƒBlankthebottomlineofscreen.‰AND.B…#$80,(A0)„Savetabstopifthereisone+‰OR.B†#$20,(A0)+ƒSetspaceinthislocation‰DBRA†D0,DELINE2ƒ*9‰MOVE.L„S.LINE,A0„Setcursortobeginningofcurrentline‰BRA‡W! RITCRSR…* PAGE*+*$D5„Erasetoendofline‚(Pagemodeonly)* EELINEƒEQU‡*!‰MOVE†FACS,-(A7)ŠSavecurrentFAC‰IF.B1(A0)#01THEN.S ‰MOVE.Bƒ#$44,FACSŒResettoFACS.‰ELSE.S)‰MOVE.LƒA0,A3Savecurrentlineposition.‰WHILE.L‚A3S.LINEDO.S=‰IF.B…-1(A3)#01THEN.SƒFindtheFACcodeforthisfield.‰MOVE.Bƒ-2(A3),FACSŒPropogatethecurrentFAC.‰BRA.S„EELINE1‰ELSE.S5‰SUBQ.Lƒ#2,A3FindaFACdefinitionorthestartofa *¦*‚line.‰ENDI‰ENDW‰ENDIEELINE1‰WHILE.L‚A0E.LINEDO.S/‰MOVE.BƒFACS,(A0)+‹PropogateFACtoendofline%‰AND.B„#$80,(A0)ŒSavetabinformation3‰OR.B…#$20,(A0)+‹Moveendoflinemarkerbywriting*°spacestotheend.‰ENDW%‰MOVE†(A7)+,FACSŠRestorecurrentFAC. ‰BRA‡RETURN**$D8„clearscreen,cursorhome*C* All unprotected positions in display area are filled with spaces.* FAC's are not affected.* * Cursor moves to home position.** CLEAR„EQU‡*‰MOVE.L„S.SCRN,A0‹Startathome‰MOVE.W„C.LINE,D4‹Afullline"‰BSR.S…ERASEEraseallunprotected‰BRA‡HOMEPutcursorathome *%* Erase D4.W characters in D3.w lines* ERASE„EQU‡*‰IF.BPROMODE#TRUETHEN.S‰TST.W…(A0)+Isitprotected?‰BMI.S…ERASE1ŽYes,keeplooking'‰AND.W…#$FF80,-2(A0)‡PreservetheFAC's!‰OR.W†#$0000,-2(A0)‡Writeaspace‰ELSE.S,‰AND‡#$0080,(A0)‰ResetFACbutsavetabinfo,‰ORˆ#$4400,(A0)+ˆWriteendoflinecharacter‰ENDI/ERASE1ƒDBRA†D4,ERASEŒRepeatforD4.wcharacters)‰MOVE.W„C.LINE,D4‹Resetcharactercounter$‰ADD.W…PB.LINE,A0ŠStartofnextline$‰DBRA†D3,ERASEŒRepeatforD3.wlines‰RTS‰PAGE**$D9„SENDPAGE**ˆSendallunprotectedfields*SNDPAGE9‰MOVE.L„S.SCRN,A0ŠStartatbeginningofthevirtualscrn.2‰MOVE.L„A0,-(A7)ŒSavebeginninglineadronstack.%‰LEA‡XTCHBUF,A1ŠFeederneedsabuffer9‰MOVE.L„A1,FEEDER_ADDRESSƒTellfeederwherehisbufferisA‰MOVE.B„#START_OF_DATA,(A1)+Bracketdatawithstartandenddata:‰MOVE†#1,FEEDER_COUNT…Bumpnumberofcharactersforfeeder*?*‡Findallunprotectedfieldsonthescreenandputtheminthe**‡feederbufferandshipthemtothehost.*3‰MOVE…L.SCRN,D2ŽWeonlywanttodo1screensworth.0‰MOVE…C.LINE,D1ŒWedo1screenalineatatime.SNDPAGE1+‰TST.B…(A0)Iscurrentpositionprotected?2‰BPL.S…SNDPAGE3ŒBranchifpositionisunprotected.#‰ADDQ.L„#2,A0Gotonextcharacter.%‰DBRA†D1,SNDPAGE1‰Dotheentireline.7‰ADD.L…D5,(A7)Findthestartofthenextvirtualline.‰MOVE.L„(A7),A0*4‰MOVE†C.LINE,D1‹Updatenumberofcharacterperline.:‰DBRA†D2,SNDPAGE1‰Findoutifweareattheendofscreen.6‰BRA.S…SNDPAGE4ŒEndofscreensofixfeederbufferand*¦shipthedataandexit.SNDPAGE2,‰TST.B…(A0)Iscurrentcharacterprotected?3‰BPL.S…SNDPAGE3ŒBranchifcharacterisunprotected.:‰MOVE.B„#END_OF_FIELD,(A1)+Markendofunprotectedfield.>‰ADDQ†#1,FEEDER_COUNT…Bumpthenumberofchars.forthedriver4‰BRA.S…SNDPAGE6ŒGospinthroughtheprotectedfield.SNDPAGE33‰MOVEQ…#$7F,D0Thecharisinbits0-6ofthebyte.‰AND.B…1(A0),D0$*¦Bit7isthe'tabstop'bitandis*¦nottobeconsidered"data"**‰BNE.S…SNDPAG35ŒBranchifnotendofline.7‰ADD.L…D5,(A7)Findthenextvirtuallinebeginningadr‰MOVE.L„(A7),A0*5‰MOVE†C.LINE,D1‹Updatenumberofcharactersperline.*B*…Checktoseeifwewereinaprotectedorunprotectedfieldwhen*…wegottotheendofline.*!‰IF.B†PRO_FIELD#TRUETHEN.S6‰BRA.S…SNDPAGE7ŒContinueprocessingaprotectedfield.‰ELSE.S*‰BRA.S…SNDPAG36ŒUnprotectedfieldwrapped.‰ENDISNDPAG355‰MOVE.B„D0,(A1)+ŒMoveunprotectedcharactertofeeder *ªbuffer.8‰ADDQ†#1,FEEDER_COUNT…Updatethenumberofcharactersto*ªgivetothedriver.&‰ADDQ.L„#2,A0Pointtonextcharacter.)‰SFˆPRO_FIELD‹Lastfieldwasunprotected.(‰DBRA†D1,SNDPAGE2‰Spinthroughtheline.5‰ADD.L…D5,(A7)Findthebeginningofthenextvirtual*©line.‰MOVE.L„(A7),A0*0‰MOVE†C.LINE,D1‹Updatenumberofcharacter/line.SNDPAG36:‰DBRA†" D2,SNDPAGE2‰Checktoseeifweareattheendofthe *ªscreen.C‰MOVE.B„#END_OF_FIELD,(A1)+‚Moveendoffieldmarktofeederbuffer.‰ADDQ†#1,FEEDER_COUNT…Updatethefeedercount.SNDPAGE4A‰MOVE.B„#END_OF_DATA,(A1)„Moveendofdatamarktofeederbuffer..‰ADDQ†#1,FEEDER_COUNT…Updatethefeedercount. ‰BSR‡FEEDERŽShipdatatodriver.$‰MOVE.L„(A7)+,A0ŒCleanupthestack.‰BRA‡RETURNŽExit.SNDPAGE5$‰TST.B…(A0)Ischaracterprotected?#‰BPL.S…SNDPAGE3ŒBranchifitisn't.SNDPAGE6(‰ADDQ†#2,A0Pointtothenextcharacter.'‰STˆPRO_FIELD‹Lastfieldwasprotected.'‰DBRA†D1,SNDPAGE5‰Gothroughttheline.7‰ADD.L…D5,(A7)Findthenextvirtuallinebeginningadr‰MOVE.L„(A7),A0*+‰MOVE†C.LINE,D1‹Updatecharactersperline.SNDPAGE7/‰DBRA†D2,SNDPAGE5‰Gothroughtheentirescreen.0‰BRA‡SNDPAGE4ŒWeareattheendofthescreenso&*¦fixupfeedersbufferandshipitto*¦thedriverthenexit.‰PAGE**$DA„Forwardtab* * Same as HT* ** DB = BT, back tab*=* Position cursor at first unprotected character to the left.** SEEKBTƒEQU‡*‰IF.LA0S.SCRNTHEN.S**ˆDOSCREENWRAP*7‰MOVE.L„E.SCRN,A0Endofscreenbecomesnewendofline‰MOVE.L„A0,E.LINE*2‰MOVE.L„A0,S.LINEUpdatethestartoflinepointer‰SUB.L…D6,S.LINE*‰ENDI‰IF.LA0S.LINETHEN.S**ˆDOLINEWRAP*‰SUB.L…D5,A0…Newstartofline‰MOVE.L„A0,S.LINE*‰ADD.L…D6,A0…Newendofline‰MOVE.L„A0,E.LINE*‰ENDI**ˆFINDANUNPROTECTEDFIELD*‰WHILE.LA0S.LINEDO.S,‰TST‡-(A0)…Checkpreviouscharacterposition<‰BPL.S…SEEKBT1ƒBranchifunprotected(hibitofwordisoff)‰ENDW**ˆSTARTOFLINEBUTPROTECTED* ‰BRA‡SEEKBT*'*ˆFINDPROTECTEDFIELDORSTARTOFLINE*SEEKBT1‰IF.LA0S.LINETHEN.S‰TST‡(A0)†Islocationprotected‰BMI.S…SEEKBT2ƒBranchifitis/‰BRA‡WRITCRSR‚BeginningoflineandunprotectedSEEKBT2‰IF.LA0S.SCRNTHEN.S**ˆDOSCREENWRAP*7‰MOVE.L„E.SCRN,A0Endofscreenbecomesnewendofline‰MOVE.L„A0,E.LINE*2‰MOVE.L„A0,S.LINEUpdatethestartoflinepointer‰SUB.L…D6,S.LINE*‰ENDI**ˆDOLINEWRAP*‰SUB.L…D5,A0…Newstartofline‰MOVE.L„A0,S.LINE*‰ADD.L…D6,A0…Newendofline‰MOVE.L„A0,E.LINE*‰ENDI'‰TST‡-(A0)…Searchforaprotectedfield$‰BPL.S…SEEKBT1ƒBranchifunprotected&‰ADDQ.L„#2,A0…Adjustforthedecrement‰BRA‡WRITCRSR‚Updatecursor‰PAGE** DC = set tab* SETTABƒEQU‡*/‰CLR.L…COL_CNTƒInitializecurrentcolumnnumber‰BRA.S…SETTAB2SETTAB1:‰ADD.L…#2,COL_CNTŠUpdatethecolumncountforthenextguy‰MOVE.L„COL_CNT,D0@‰IF.L‚D0BPERLINETHEN.SMakesurewedon'tgooutofrange<‰WHILED2#LFCHARDO.S„Ifoutofrangediscardincoming/‰BSRGET_CHAR’untilterminatedwithalinefeed‰ENDW‰BRA‡RETURNŽExit‰ENDISETTAB2.‰BSR‡GET_CHAR‚Getnextcharacteroftabstring6‰MOVE†LPERSCRN,D3‰Setloopcontrolforabsolutescreen‰SUBQ†#1,D3DBRAadjustment9‰CMP.B…#LFCHAR,D2ŠEndofstringisindicatedbylinefeed‰BNE.S…SETTAB2A‹**C*‡LINEFEEDCHARACTERDETECTED,‚IFITFOLLOWEDSETTABS--RESETALL*‡CURRENTTABS*SETTAB42‰TST.L…COL_CNTIfcolumncountzerothenlinefeed*°followedsetcommand‰IFTHEN.S+‰LEA‡SCREEN,A0‹Pointtobeginningofscreen+‰MOVE†LPERSCRN,D5‰Get#oflinesperscreen8‰MULU†CPERLINE,D5‰*charactersperline=#ofcharacter*©positionsonscreenCLRTAB‰AND.W…#$FF7F,(A0)+ˆResettab(‰DBRA†D5,CLRTAB‹Loopuntilendofscreen‰ENDI ‰BRA‡RETURNSETTAB2A4‰MOVE.L„COL_CNT,A0ŠPointtocurrentpositioninline‰ADD.L…#SCREEN,A0Š*-‰CMP.B…#SPACE,D2‹Isthisafillercharacter?5‰BEQ.S…SETTAB1Getnextcharacterifcurrentisspace'‰CMP.B…#CLEARTAB,D2ˆCleartabrequest?+‰BEQ.S…RESETTABŒBranchifcleartabrequest**„SETTABREQUEST*SETTAB37‰BSET.B„#7,1(A0)ŒSettabbitinhighnibbleofthedis-4‰ADD.L…D5,A0playedchar.foreverycolumnonscreen‰DBRA†D3,SETTAB3Š*‰BRA.S…SETTAB1RE" SETTAB1‰BCLR.B„#7,1(A0)ŒTurntabbitoffineverycolumn‰ADD.L…D5,A0*‰DBRA†D3,RESETTAB‰* ‰BRA‡SETTAB1‰PAGE**ˆ$DFƒSEND‚LINE* SEND_LINE"‰CLR‡D1ˆSetprotectedfieldswitch'‰LEA‡XTCHBUF,A1ŠPointtofeederbuffer.:‰MOVE.L„A1,FEEDER_ADDRESSƒTellfeederwherehisbufferis.:‰MOVE.B„#START_OF_DATA,(A1)+Startofdata($DD)required.5‰MOVE†#1,FEEDER_COUNT…Tellfeederhehas1character.5‰MOVE.L„S.LINE,A0ŠStartatthebeginningoftheline. ‰WHILE.LƒA0E.LINEDO ‰ADDQ.L„#1,A0…BumppasttheFAC.;‰MOVE.B„(A0)+,D0ƒFindoutifweareattheendoftheline.#‰AND.B…#$7F,D0„Couldbeatabstop.‰IFTHEN.SSENDL1C‰MOVE.B„#END_OF_DATA,(A1)Endofline,move($DE)tofeederbuffer.1‰ADDQ†#1,FEEDER_COUNTƒUpdatehis#ofcharacters.&‰BSR‡FEEDER„Shipbuffertothedriver.(‰BRA‡RETURN„Getoutbecausewearedone.‰ENDI,‰CMP.B…#01,D0„CheckforFACdefinitioncode.‰IFTHEN.S‰MOVE.B-1(A0),D0„GettheFAC"‰ROR.W…#2,D0…Gettotherightbits**ˆCHECKHALFBRIGHT*&‰ROR.W…#1,D0…Halfbrightbitonoroff‰IFTHEN.S*‰MOVE.B#$E5,(A1)+ƒSendresethalfbright.‰ELSE.S'‰MOVE.B#$E4,(A1)+ƒSendsethalfbright‰ENDI **ˆCHECKVIDEOINVERT*'‰ROR.W…#1,D0…Videoinvertbitonoroff‰IFTHEN.S)‰MOVE.B#$E2,(A1)+ƒSendsetvideoinvert.‰ELSE.S+‰MOVE.B#$E3,(A1)+ƒSendresetvideoinvert.‰ENDI**ˆCHECKUNDERLINE*$‰ROR.W…#1,D0…Underlinebitonoroff‰IFTHEN.S&‰MOVE.B#$E6,(A1)+ƒSendsetunderline.‰ELSE.S(‰MOVE.B#$E7,(A1)+ƒSendresetunderline.‰ENDI* *ˆCHECKBLINK* ‰ROR.W…#1,D0…Blinkbitonoroff‰IFTHEN.S"‰MOVE.B#$E0,(A1)+ƒSendsetblink.‰ELSE.S$‰MOVE.B#$E1,(A1)+ƒSendresetblink.‰ENDI**ˆCHECKDISPLAY*"‰ROR.W…#1,D0…Displaybitonoroff‰IFTHEN.S$‰MOVE.B#$E9,(A1)+ƒSendsetdisplay.‰ELSE.S&‰MOVE.B#$E8,(A1)+ƒSendresetdisplay.‰ENDI**ˆCHECKPROTECT*"‰ROR.W…#1,D0…Protestbitonoroff‰IFTHEN.S$‰MOVE.B#$EA,(A1)+ƒSendsetprotect.‰ELSE.S&‰MOVE.B#$EB,(A1)+ƒSendresetprotect.‰ENDI+‰ADDQ†#6,FEEDER_COUNTUpdateFeederscount. ‰BRA.S…SENDL2‰ENDI1‰MOVE.B„D0,(A1)+‚Movecharactertofeederbuffer.-‰ADDQ†#1,FEEDER_COUNTUpdatecharactercount.SENDL2‰ENDW4‰BRA‡SENDL1„Endoflineencountered--timetoquit.‰PAGE*F* The characters $E0-$EF will set or reset the field attribute bits in'* the XREFed, word sized register FACS.* FACS is defined as follows:**ˆD15=Setforprotect*ˆD14=Setfordisplay*ˆD13=Setforblink*ˆD12=Setforunderline*ˆD11=Setforinversevideo*ˆD10=color/intensitybit1*ˆD09=color/intensitybit2*ˆD08=color/intensitybit3 *„D07-D00=0* ** E0 = set blink* SBLINKƒEQU‡*9‰IF.B1(A0)#01THEN.S„IfweareonaFACdefinition8‰BSET.B„#5,(A1)justORthenewFACbitintocurrentFAC‰ELSE.S˜otherwise&‰MOVE.B„#$64,(A1)‹resetallotherFACS‰ENDI'‰MOVE.B„FACS,(A0)‹UpdateFAConscreen. :‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyfac4‰ORˆ#$8000,(A0)‰TellworldtheFACcodeisprotected*¦soitcannotbewrittenover.2‰BSR‡PROFACŽChecktoseeifFACmustbepropogated ‰BRA‡RETURN ** E1 = reset blink* RBLINKƒEQU‡*#‰MOVE.B„FACS,(A0)‹PutFAConscreen9‰MOVE.B„#$01,(A0)‹Simulatecharacterpositionusedbyfac9‰IF.B1(A0)#01THEN.S„IfweareonaFACdefinition8‰BCLR.B„#5,(A1)justORthenewFACbitintocurrentFAC‰ELSE.S˜otherwise&‰MOVE.B„#$44,(A1)‹resetallotherFACS‰ENDI‰ORˆ#$8000,(A0)‰Setprotectbit2‰BSR‡PROFACŽChecktoseeifFACmustbepropogated ‰BRA‡RETURN** E2 = set video invert* SINVERT‚EQU‡*9‰IF.B1(A0)#01THEN.S„IfweareonaFACdefinition8‰BSET.B„#3,(A1)justORthenewFACbitintocurrentFAC‰ELSE.S˜otherwise&‰MOVE.B„#$4C,(A1)‹resetallotherFACS‰ENDI'‰MOVE.B„FACS,(A0)‹UpdateFAConscreen.:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyfac‰ORˆ#$8000,(A0)‰Setprotectbit2‰BSR‡P# ROFACŽChecktoseeifFACmustbepropogated ‰BRA‡RETURN ** E3 = reset video invert* RINVERT‚EQU‡*9‰IF.B1(A0)#01THEN.S„IfweareonaFACdefinition8‰BCLR.B„#3,(A1)justORthenewFACbitintocurrentFAC‰ELSE.S˜otherwise&‰MOVE.B„#$44,(A1)‹resetallotherFACS‰ENDI#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyfac‰ORˆ#$8000,(A0)‰Setprotectbit2‰BSR‡PROFACŽChecktoseeifFACmustbepropogated ‰BRA‡RETURN ** E4 = Set half bright*UPBRIGHTEQU‡*,‰MOVE.B„(A1),D2GettheMSBpartoftheFACs'‰AND.B…#$F8,D2Onlythebrightnessbits ‰OR.B†#$04,D2Settohalfbright‰MOVE.B„D2,(A1)*#‰MOVE.B„FACS,(A0)‹PutFAConscreen9‰MOVE.B„#$01,(A0)‹Simulatecharacterpositionusedbyfac‰ORˆ#$8000,(A0)‰Setprotectbit2‰BSR‡PROFACŽChecktoseeifFACmustbepropogated ‰BRA‡RETURN ** E5 = Reset half bright*DNBRIGHTEQU‡*,‰MOVE.B„(A1),D2GettheMSBpartoftheFACs'‰AND.B…#$F8,D2Turnoffbrightnessbits‰OR.B†#$04,D2Resethalfbright‰MOVE.B„D2,(A1)*#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyfac‰ORˆ#$8000,(A0)‰Setprotectbit2‰BSR‡PROFACŽChecktoseeifFACmustbepropogated ‰BRA‡RETURN ** E6 = set underline* SULINEƒEQU‡*9‰IF.B1(A0)#01THEN.S„IfweareonaFACdefinition8‰BSET.B„#4,(A1)justORthenewFACbitintocurrentFAC‰ELSE.S˜otherwise&‰MOVE.B„#$54,(A1)‹resetallotherFACS‰ENDI'‰MOVE.B„FACS,(A0)‹UpdateFAConscreen.:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyfac‰ORˆ#$8000,(A0)‰Setprotectbit2‰BSR‡PROFACŽChecktoseeifFACmustbepropogated ‰BRA‡RETURN  ** E7 = reset underline* RULINEƒEQU‡*9‰IF.B1(A0)#01THEN.S„IfweareonaFACdefinition8‰BCLR.B„#4,(A1)justORthenewFACbitintocurrentFAC‰ELSE.S˜otherwise&‰MOVE.B„#$44,(A1)‹resetallotherFACS‰ENDI#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyfac(‰ORˆ#$8000,(A0)‰SetprotectbitforFAC.2‰BSR‡PROFACŽChecktoseeifFACmustbepropogated ‰BRA‡RETURN ** E8 = set non display* NONDISP‚EQU‡*9‰IF.B1(A0)#01THEN.S„IfweareonaFACdefinition8‰BCLR.B„#6,(A1)justORthenewFACbitintocurrentFAC‰ELSE.S˜otherwise%‰MOVE.B„#$4,(A1)ŒresetallotherFACS‰ENDI'‰MOVE.B„FACS,(A0)‹UpdateFAConscreen.:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyfac‰ORˆ#$8000,(A0)‰Setprotectbit2‰BSR‡PROFACŽChecktoseeifFACmustbepropogated ‰BRA‡RETURN  ** E9 = reset non-display* SETDISP‚EQU‡*#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyfac9‰IF.B1(A0)#01THEN.S„IfweareonaFACdefinition8‰BSET.B„#6,(A1)justORthenewFACbitintocurrentFAC‰ELSE.S˜otherwise&‰MOVE.B„#$44,(A1)‹resetallotherFACS‰ENDI‰ORˆ#$8000,(A0)‰Setprotectbit2‰BSR‡PROFACŽChecktoseeifFACmustbepropogated ‰BRA‡RETURN ** EA = set protect* PROTECT‚EQU‡*9‰IF.B1(A0)#01THEN.S„IfweareonaFACdefinition8‰BSET.B„#7,(A1)justORthenewFACbitintocurrentFAC‰ELSE.S˜otherwise&‰MOVE.B„#$C4,(A1)‹resetallotherFACS‰ENDI'‰MOVE.B„FACS,(A0)‹UpdateFAConscreen.:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyfac‰ORˆ#$8000,(A0)‰Setprotectbit2‰BSR‡PROFACŽChecktoseeifFACmustbepropogated ‰BRA‡RETURN ** EB = reset protect* ALLOW„EQU‡*#‰MOVE.B„FACS,(A0)‹PutFAConscreen:‰MOVE.B„#$01,1(A0)ŠSimulatecharacterpositionusedbyfac9‰IF.B1(A0)#01THEN.S„IfweareonaFACdefinition8‰BCLR.B„#7,(A1)justORthenewFACbitintocurrentFAC‰ELSE.S˜otherwise&‰MOVE.B„#$64,(A1)‹resetallotherFACS‰ENDI0‰ORˆ#$8000,(A0)‰SetprotectbitforFACposition2‰BSR‡PROFACŽChecktoseeifFACmustbepropogatedRET.1„BRA‡RETURNŠPAGE* * F1 = reset*K* The display area is filled with spaces, all FAC's are reset, tabs are setL* every INIT# _TAB spaces, the virtual screen is restored to its default size,* and the cursor is HOMEd.*RESET24?‰MOVE†#24,NUMBER_LINESSetupthesmallscreenreset.(24line) RESET253ŠBSR„SCRNINIT‹Resetalltheparameterstodefaults. *‚Fillthescreenwithblanks.4ŠLEA„SCREEN,A0ŠA0<--startaddrofabsolutescreen.5ŠMOVEƒ#$4400,D2ŠD2<--defaultattributesandaspace*§charforfillingthescreen.:ŠMOVEƒNUMBER_LINES,D5„D5<--#ofcharactersonscreen-1<ŠMULUƒCPERLINE,D5ˆ*‚=linesperscreen*charsperline-1. ŠSUBQƒ#1,D5Ž* DO.SŠWhiletherearemoretabstoplace, 5ŠBSETW‚#7,(A0)ŒSetatabinthispositionandadvance%ŠADD.L‚#2*INIT_TAB,A0…INIT_TABchars. 0ŠSUBQƒ#1,D5ŽKeepgoinguntilalltabsareplacedŠENDW–onthisline. /ŠMOVEƒBPERLINE,A0ˆA0.L<--addressofnextline7ŠADD.L‚(SP)+,A0‹*„=addroflastline+bytesperline. 0ŠSUBQƒ#1,D2ŽKeepgoinguntilalllinesaredone. ŠUNTIL‚*ŠSF…EDIT_FLAGŠCleareditmodeŠSF…PAGEFLAG‹pagemodeŠSF…PROMODEŒandprotectmode.;ŠMOVE.LƒB.LINE,D6ˆHomeroutineneedsbytespervirtuallineBŠMOVE…#25,NUMBER_LINESResetlines/screenbecausewemayhavedone*£a24linereset.ŠBRA‡HOMEŒHomethecursor.‰PAGE* * DISPLAYL*---------------------------------------------------------------------------L* 1. Write the requested character in the display RAM at the current cursor.I* 2. Seek a non-protected spot to the right, with line and page rollover.6*„ifnonefound,soundbell,andstayatcurrentspot.,* 3. Update the cursor register of the CRTC.** Input parameters:*------------------4* A0.L = current cursor posiotion in the display RAM8* D2.L = $000000XX, where XX is the requested character.0* D3.W = Maximum number of characters on screen.F* FACS = An XREFed, word sized register containing the FACs in effect.* DISPLAY‚EQU‡* ‰IF.B†PAGEFLAG#TRUETHEN.S“BRA.SDISPLAY1‰ENDI/‰TST‡(A0)Checkforcursorinaprotectedfield‰BPL.S…DISPLAY1ŒBranchifnot*<*„Cursorisinaprotectedfield--wecanonlyacceptaFAC*%‰TST.B…D2’CheckifcharacterisaFAC‰IFTHEN.S BRAOUTCH1‰ENDI*BSR.SSEEKRNotaFACsoseekunprotectedDISPLAY1‰BSR‡PROFACŽPropogateFAC:‰MOVE.B„FACS,(A0)+ŠMovecurrentFACStocurrentScreenloc%‰AND.B…#$80,(A0)‹Keeptabinformation,‰OR.B†D2,(A0)+ŒWritecharactertothescreen‰IF.LƒA0E.LINETHEN.S1‰ADD.L‚D5,S.LINEŽUpdatebeginningandendingline5‰ADD.L‚D5,E.LINEŽaddressesbecauseweareabouttogo‰ENDIštothenextline.3‰BSR.S…SEEKRIfprotectedfindanunprotectedchar.#‰BRA‡WRITCRSRŒUpdatecurrentcursor*?* Starting at the current display address, find an un-protected* spot to the right.* SEEKR„EQU‡* ‰IF.BPAGEFLAG#TRUETHEN.S“RTS‰ENDI ‰MOVE.L„A0,A3Setuptermination‰IF.L†A0S.LINETHEN.S‰REPEAT D*„IftheEndofLinecharacterisinthefirstcharacterpositionofB*„aline,whileweareinprotectmode,‚thecursorismoveddowna*„line. ‰IF.B‚1(A0)#00THEN.S!‰ADD.L…D5,A0Updatestartofline‰MOVE.L„A0,S.LINE‹*+‰ADD.L…D5,E.LINE‹Updateendofvirtualline‰ELSE.S4‰BRA.S…SEEKR1ŽIfEndofLineisnotatthebeginning'*¦oftheline--goaheadandseekright.‰ENDI‰UNTIL.LA0A3‰RTS‰ENDI*7*„Findanunprotectedcharacterpositiononthescreen.*SEEKR1‰REPEAT‰IF.L†A0E.SCRNTHEN.S9‰MOVE.L„S.SCRN,A0‹Wrapthesearchforanunprotectedchar2‰MOVE.L„A0,S.LINE‹Updatebeginningandendingadr.‰MOVE.L„A0,E.LINE‹*‰ADD.L…D6,$ E.LINE‹*,‰BRA.S…SEEKR2Ž*Checktoseeifwearedone.‰ENDI‰IF.L†A0E.LINETHEN.S#‰ADD.L…D5,(A2)Updatestartofline‰ADD.L…D5,4(A2)Œandendofline‰MOVE.L„S.LINE,A0,‰BRA.S…SEEKR2Ž*Checktoseeifwearedone.‰ENDI2‰TST.W…(A0)+Unprotectedfieldsaretheoneswhere*¦bit8isturnedoff.‰IFTHEN.S5‰TST.B‚-1(A0)‘Makesurewearen'tattheendofline.‰IF‚THEN.S5‰ADD.LƒD5,S.LINEInprotectmodethecursorcannotbe%*¦onanendofline--updatepointers.‰ADD.LƒD5,E.LINEƒ*‰MOVE.L‚S.LINE,A0*3‰BRA.SƒSEEKR2Gomakesurewedidn'tgooff-screen.‰ENDI3‰SUBQ.L„#2,A0Characternotprotectedupdatecursor*¦becauseofauto-increment.‰RTS‰ENDISEEKR2‰UNTIL.LA0A3*C*‚Therearenounprotectedfieldsonthescreensohomethecursor.**:‰MOVE.L„S.SCRN,A0‹Setcursoraddresstobeginningofscrn.8‰MOVE.L„A0,S.LINE‹Updatebeginningandendinglineptrs.‰ADD.L…D5,4(A2)Œ**‰RTS‡RETURNŽExitnounprotectedareafound‰PAGEWRITCRSREQU‡**9* Convert display RAM address to absolute cursor address,* and write into CRTC.** A0.L = Diaplay cursor address*/‰MOVE.L„A0,D1Calculatecursorabsoluteaddress‰SUB.L…#SCREEN,D1+‰LSR.L…#1,D1Totakecareofattributearea WRITEABSEQU‡**/* Write the absolute cursor address in the CRTC* * D1.W = absolute cursor address*!‰MOVE.B„#$0F,CRTCADDˆPointtoR152‰MOVE.B„D1,CRTCREGŠStoreLSBofnewcursoraddress ‰LSR.W…#8,D1Positionupperbyte!‰MOVE.B„#$0E,CRTCADDˆPointtoR143‰MOVE.B„D1,CRTCREGŠSroreMSBofnewcursorregister 6RETURNƒMOVEM.Lƒ(A7)+,D0-D7/A0-A3ƒRestoreuser'svalues‰RTS‰PAGEREADCRSREQU‡***‚Readthecursorposition*6*‚Thisroutineisforinternaluse,andisnotXDEFed.)*‚ForanexternalcontrolroutineseeC6.**‚Inputparametersƒ:none*>*‚Registersaffected:D1.W=Absoluteaddressofcursorspot.&*—A0.L=ScreenRAMaddressofcursor.*‰CLR.L…D1’HSKP!‰MOVE.B„#$0E,CRTCADDˆPointtoR14.‰MOVE.B„CRTCREG,D1ŠGetcurrentcursorposition‰ROL.W…#8,D1PutitinMSB!‰MOVE.B„#$0F,CRTCADDˆPointtoR154‰MOVE.B„CRTCREG,D1ŠGetlowerbyteofcursorposition-‰LSL.W…#1,D1AdjustforscreenRAMoperations ‰MOVE.L„D1,A0‰ADD.L…#SCREEN,A0‰RTS***GET_CHAR3‰STˆCHAR_RESERVED‡Reservenextcharacterforcaller>‰MOVE.L„(A7)+,CHAR_OWNER„Savecallersreturnaddressforlater'‰BRA‡RETURNŽWaitforthenextcharacter**ˆPROPOGATEFACCODE*PROFAC‰IF.L‚A0E.LINETHEN.S ‰MOVE.LA0,A10‰MOVE.B(A1),D0GettheFACwhichwillbemoved.'‰ADDQ.L#2,A1’Getoffcurrentlocation.‰WHILE.L‚A1E.LINEDO.S2‰IF.Bƒ1(A1)#00THEN.S‚Checkforendofline.7‰BRA.S‚PROFAC1Branchifweareattheendoftheline.‰ENDI3‰CMP.B‚#1,1(A1)StopifweareonaFACdefinition.‰BEQ.SPROFAC1A*1‰MOVE.BD0,(A1)MovetheFACcodetoendofline.‰ADDQ.L#2,A1’*‰ENDW‰BRA.SPROFAC1‰ENDIPROFAC1A)‰MOVE.L„A0,A1Savecurrentcursoraddress‰IF.L†A1S.LINETHEN.S‰RTS›Exit--nothingtodo“|L…‰ENDI1‰MOVE.B-1(A1),D3ŽTherecouldbeatabstophere.%*¦Let'sturnthebitoffbeforewego*¦on.‰AND.B#$7F,D3‘*%‰IF‚‚THEN.SŽExit--nothingtodo‰RTS‰ENDI‰WHILE.LA1S.LINEDO.S@‰IF.B-1(A1)#01THEN.SƒTrytofindwhereaFACwasdefined‰MOVE.B-2(A1),D0‰BRA.SƒPROFAC1‰ELSE.S ‰SUBQ.L‚#2,A1‰ENDI‰ENDW1‰MOVE.Bƒ#DISPLAY_FAC,D0‡UseadisplayFACbecause*©a01wasnotfound.8‰MOVE.BƒD0,FACSŽUpdatetheFACfortherestoftheline.PROFAC1 ‰MOVE.L‚A0,A1‰WHILE.LA1S.LINEDO.S'‰MOVE.B‚-(A1),D3Getpreviouscharacter,‰AND.Bƒ#$7F,D3Checkiflineendortabonly‰BNE.S„PROFAC2,‰OR.B„#$20,(A1)Removeendoflinecharacter!‰MOVE.B‚D0,-(A1)ŽUpdateFACcode.‰ENDWPROFAC2‰RTS‰END$ NNNNN:TERMDRVƒIDNTƒ45,0†VERSAdosterminaldriverwithtype-ahead6ŠTTL„TERMDRV:‚VERSAdosterminaldriverwithtype-ahead ŠLLENƒ120J**************************************************************************J**************************************************************************J**************************************************************************J***************************************************************************4*‰TERMDRV:‚VERSAdosterminaldriverwithtype-ahead.*?*‰Purpose:‚VERSAdosdevicedrivertohandletheVME/10keyboard *&screen.**‰Revisionhistory: 7*12/09/85‚InstallNEWKillermodificationwhichleaves,*šTheDriverID(Number)andReason(Number)2*šinCRASHSAValongwiththeCCBandDCBpointers.5*01/15/85‚Addedcodetoreturnerrorcodetouserin,*šhaltI/Oparameterblock.Returnof$E6in*šoriginalI/Oparameterblock.9*01/30/85‚Modified‚KEYBRD.AG,OUTCHS.SA,POUTCHS.SA,and.*šEDITMODE.SA‚tousetheBELLinthekeyboard.?*10/10/84‚Therewasaproblemifanyotherboardinthesystem0*šisconfiguredtousethesameinterruptlevel,-*šbecauseGET_CHARassumesthattheinterrupt*šisalwaysforhim.,*šFixedGET_CHARtosendbackbothZbitand)*šVbitsetiftheinterruptisnotours,+*šsothatIN_CHARwillpassitalongtothe1*šmaininterrupthandler,andwewillthenreturn4*štoCMRwiththecarrybitclearedtoindicatethat *štheinterruptisnotours.†bwn;*‘2/9/84‚FixedproblemwithREADTERMINATORinitialization*šinsubroutineSETUP.6*‘7/19/83‚ChangedRESETcommandsenttoOUTCHSto$F7.**‘6/3/83‚InitialwritingbySteveFranck.**‰RMS68Kroutinesused: *TR0$.RQPA *TR0$.QEVENT*TR0$.QEVENTI *TR0$.LOGPHY *TR0$.GETTCB*TR0$.DRIVKILL**‰Othernotes:6*CurrentlythiscodeisneitherROMablenorposition-*’independent.'*AssembleusingchainfileTERMDRV.AF.*J**************************************************************************†4–Iž2¦9®E¶J¾EÆBÎ<Ö4Þ:æBî8ö;þ<86<C&H.<6A>MFAN>VE^7fBn>v>J**************************************************************************J**************************************************************************J**************************************************************************‰PAGE*F*‚Toassemblethiscodeforitspropertargetenvironment,changethisA*‚equate,whichwillserveasaswitchinconditionalassemblies.2*‚Validvaluesfortheswitchare:‚'7201','EX/S'.(*‚FORNOW,THISSWITCHMUSTBE'EX/S'!!!*ENVIRONMENT EQU 'EX/S' * % *‚XDEF's.*8ŠXDEFƒGOT_CHAR‹Entrypointfordrivertoreceiveachar.7ŠXDEFƒCHECK_WORK‰Backgroundexec'sentrypointtocheck*§formorework. * *‚XREF's.*=ŠXREFƒSTOP_IT,UNSTOP…Device-specificroutinestostopfurther&*§trafficfromthedeviceandtoallow *§itagain. ‰IFEQ†ENVIRONMENT-'EX/S'"*§Subroutinesforinitializingand'*§controllingVME/10keyboard&screen."ŠXREFƒINIT_KEYBOARD,IN_CHAR,OUTCHS‰ENDC  **‚Equatefilesincluded:**‰EQUSTR*‰EQUTCB*‰EQUCCB*‰VMES10.IOE.SA*‰NIO*‰LV5&*‰NEC7201‚onlyifENVIRONMENT='7201'*‰VMES10.TERMDRV.EQ *‰KILL.MC *‰KILLDRV.EQ*ŠNOLISTŠINCLUDE9995.&.STR.EQŠNOLISTŠINCLUDE9995.&.TCB.EQŠINCLUDE9995.&.CCB.EQŠINCLUDE9995.&.IOE.EQŠINCLUDE9995.&.NIO.EQŠINCLUDE9995.&.LV5.EQŠINCLUDE9995.&.KILL.MCŠINCLUDE9995.&.KILLDRV.EQ ŠLISTŠPAGEO*********************************************************************************‰NOTESONCODINGSTANDARDS*O******************************************************************************* G*‚BecausethisisanI/Odriver,speedisoftheutmostimportance,andG*‚asaresulttradeoffsweremadedecreasingthestraightforwardnessofL*‚thecodeinfavoroflesstimespentprocessinginterrupts.‚Inparticular,F*‚theinterruptserviceportionofthisdriverisnotatallmodular--H*‚some'routines'havemultipleentryandexitpoints,andreturnisnot*‚alwaystothecaller.*G*‚OnevisualaidusedwhichmaysaveyousomeworkistheuseoflabelsD*‚inexecutablecode.‚Considerthefollowingsampleprogramsegment:*.*‰LABEL1:˜labelaloneonline,followedby':'*‘MOVE.B......7*‰LABEL2:ADD.B‚......Šlabelnotalone,followedby':'-*‰LABEL3‚CMP.B‚......Šlabelnotalone,no':'*F*‚Eachwayofwritingthelabelhasitsownsignificance.‚LABEL1marksC*‚thebeginningofalogicalmodule,andnothingfallsintoLABEL1.G*‚LABEL2isalabelbranchedtofromoutsidethelogicalmodule.‚LABEL3F*‚isa'local'label,branchedtoonlyfromwithinthelogicalmodule.  >*‚Foreachsubroutine,registerusageisspecifiedasfollows:**‰Entry:A5=addressofCCB**‰Exit:‚A0=garbage"*A1=addressofoursideof7201*G*‚TheentryconditionsspecifyonlytheREQUIREMENTSoftheroutine.‚InI*‚otherwords,aregistermaybeknowntocontainaparticularvalue,butI*‚ifitisnotusedbyaroutine,itisnotlistedasanentrycondition.J*‚TheexitconditionslistonlythoseregisterswhichCHANGE.‚IntheaboveH*‚example,thefactthatA5isnotlistedasanexitconditionindicates"*‚thatitstillpointstotheCCB.*J*‚Ifamoduledoesnotrepresentasubroutine(thatis,willnotreturntoK*‚thecodeitwasenteredfrom),theexitconditionsfortheregisterswill*‚notbespecified.ŠPAGEO******************************************************************************** *‰EQUATES*O******************************************************************************* *,* EQUATES FOR SOME SPECIAL ASCII CHARACTERS.*'NUL†EQU‡$00‡Nullchar.‚Usuallyignored..BEL†EQU‡$07‡Bellchar.‚Ringsbellonterminal.BS‡EQU‡$08‡Backspacechar.6LF‡EQU‡$0A‡Linefeedchar.‚Causescursortomovedown.=CR‡EQU‡$0D†Carriagereturnchar.‚Movescursortoleftmargin.SPACE„EQU‡$20‡Spacechar.$L_ARROW‚EQU‡$3C‡Left‚arrowchar'<'.%R_ARROW‚EQU‡$3E‡Rightarrowchar'>'.#BKSLASH‚EQU‡$5C‡Backslashchar'\'.'CARET„EQU‡$5E‡Uparrow(caret)char'^'.8DEL†EQU‡$7F‡Deletechar(alsocalled'rubout').‚LikeBS. $HI_CTLƒEQU‡$1F‡Highestcontrolchar. IBS_SP_BSEQUBS<<24+SPACE<<16+BS<<8‚Backspace,space,backspaceallleft-*§justifiedin32bits. *?*‚Masksdelineatingallrecognized(REC)andunrecognized(UNR)(*‚attributes(ATT)andparameters(PAR).*‰IFEQ†ENVIRONMENT-'EX/S'BREC_ATTƒEQU„%1000001111000001‚1bitsrepresentdefinedattributes.CUNR_ATTƒEQU„$FFFF-REC_ATT†The1'scomplementof% thatareundefined. BREC_PARƒEQU„%0111011111111111‚1bitsrepresentdefinedparameters.CUNR_PARƒEQU„$FFFF-REC_PAR†The1'scomplementofthatareundefined.‰ENDC ŠPAGE**‚Miscellaneousequates.* *IOEVCD„EQU„1’Eventcodewewilluse(I/O). ;BRK_LENƒEQU„300#ofmillisecondstomaintainbreaksignal. *I*‚Thisisasemi-arbitraryvaluethatcanbewrittenouttoaregisteronH*‚somedeviceandthenreadback,inordertotest(inaverysmallway)C*‚thedevice'shealth.‚Onthe7201,forexample,thisiswrittento*‚thevectorregister(2B).*TEST_VAL‚EQU„$17ŠPAGEK*****************************************************************************‰EQUATESFORTRANSPARENTMODE*K*************************************************************************** *F*‚EquatesdescribingthepartoftheCSBusedwhensettingTRANSPARENTH*‚MODE.‚WepassthedrivertheaddressofourbranchtableandhepassesI*‚usbacktheaddressofhisbranchtable,thevalueweshouldhaveinA5G*‚whenwecallhim,andtheSRthatweshoulduse.‚Actually,wemayuseG*‚adifferentSRaslongasthesupervisorbitissetandtheinterrupt9*‚levelisnotlowerthantheoneintheSRhepassesus.*7ŠOFFSETIOSTTMThisstuffwillbeintheCSBatIOSTTM.9IOSTMU„DS.Bƒ4’Heretheuserwillstore,beforemakingthe&*§CHANGEDEFAULTScall,theaddressof*§histableofbranches. 7ŠOFFSETIOSTTMThisstuffwillbeintheCSBatIOSTTM.9IOSTMD„DS.Bƒ4’theaddrofthedriver'stableofbranches;/IOSTMA„DS.Bƒ4’thevaluethedriverwantsinA5;5IOSTMS„DS.Bƒ2’theSRwiththeMINIMUMinterruptlevel*§set. 5ŠOFFSET0ŽThisdefinestheuser'sTMinterfacetable.*£WeJSRtothisentrywhen:#TM_RCA„DS.Bƒ4’...wereceiveachar.7TM_TBE„DS.Bƒ4’...webecomecapableofanothertransmit.2TM_BRK_RECVDS.B4’...wedetectanincomingbreak.