IMD 1.17: 11/11/2014 11:05:05 82VKXSVRDOS B* VERSADOS/RMS68K SRC/OBJ 4.4 (NOT BOOTABLE) SN=49367 9 0F 30  SR09q82VKXSVRDOS 0420¥`-=theeventwassuccessfullyqueued5*ŒConditioncodes=badreturnfromTRAP#0call*‰PAGEH**************************************************************************ˆENTRYPOINTSANDDESCRIPTIONS*J***************************************************************************-*ˆEntrypoint“Descriptionofeventtobesent-*ˆ-----------“--------------------------------*ˆ1.N_NRM_QEVENTNormalI/Ocompletionevent*¦Queuedfromcommandlevel(0)*-*ˆ2.I_NRM_QEVENTNormalI/Ocompletionevent*¦Queuedfrominterrupthandler* *ˆ3.N_HLT_QEVENTHALTI/Oevent*¦Queuedfromcommandlevel(0)* *ˆ4.I_HLT_QEVENTHALTI/OEVENT*¦Queuedfrominterrupthandler*!*ˆForentrypoints1.through4.:*‹Registersuponentry:6*’A0=addrofplacetocopyevent(musthaveatleast*œ20bytesreserved)*—or'*—0ifyoudonotwanttheeventcopied*’A5=addrofCCB*’D1.B=errormessage*’D3.L=addrofDCB***ˆ5.N_UNS_QEVENTUnsolicited‚deviceevent*¦Queuedfromcommandlevel(0)*¦Statusvalue0(DCBknown)***ˆ6.I_UNS_QEVENTUnsoliciteddeviceevent*¦Queuedfrominterrupthandler*¦Statusvalue0(DCBknown)**ˆForentrypoints5.and6.:**‹Registersuponentry:6*’A0=addrofplacetocopyevent(musthaveatleast*œ20bytesreserved)*—or'*—0ifyoudonotwanttheeventcopied*’A5=addrofCCB*’D3.L=addrofDCB*’D4.W=devicestatusandtype*7*ˆNOTE:Theunsolicitedchannelevent(type$FF)isnotE(B0B8W@BHEPRXT`Mh% 6*ˆhandledbythisroutine.‚ItwasonlyusedintheIPC5*ˆinterpreteddriverasfarasIcoulddetermine,and0*ˆIdecideditwasnotworthcodinguphere.ƒbwn*4*ˆNOTE:Theunsoliciteddeviceevent(type$80)with2*ˆstatusvalue1isnothandledbythisroutine.‚I*ˆdon'tknowwhoneedsit.**‰PAGED*********************************************************************)*ˆEVENT…WITH†NO…ALTERNATE**‘SERVICE…ADDRESS*N********************************************************************************ˆEventasseenbyexec:*ˆ---------------------)*’Eventwithnoalternateserviceaddress*+*’+---------+---------+---------+---------+$*ˆD2‚=…|length‚|‚$01„|‚typeƒ|‚key„|+*’+---------+---------+---------+---------+**ˆD3‚=…|‚DCBaddress‚orchannelmnemonic…|+*’+---------------------------------------+&*ˆD4‚=…|‚continuationofmessage...Š|+*’+---------------------------------------+ *ˆD5‚=…|§|+*’+---------------------------------------+ *ˆD6‚=…|§|+*’+---------------------------------------+*H************************************************************************‰PAGEJ****************************************************************************’NormalI/Ocompletionevent#*’withnoalternateserviceaddress*+*’+---------+---------+---------+---------+*ˆD2‚=…|‚$A…|‚$01„|‚$70„|‚key„|+*’+---------+---------+---------+---------+*ˆD3‚=…|‹DCBaddress‘|+*’+---------------------------------------+*ˆD4‚=…|ƒ0…|errorƒ|*’+-------------------+***’I/OHALTevent#*’withnoalternateserviceaddress*+*’+---------+---------+---------+---------+*ˆD2‚=…|‚$A…|‚$01„|‚$71„|‚key„|+*’+---------+---------+---------+---------+*ˆD3‚=…|‹DCBaddress‘|+*’+---------------------------------------+*ˆD4‚=…|ƒ0…|errorƒ|*’+-------------------+**’Unsoliciteddeviceevent#*’withnoalternateserviceaddress**’andstatusvalue=0(DCBaddressknown)*+*’+---------+---------+---------+---------+*ˆD2‚=…|‚$C…|‚$01„|‚$80„|‚key„|+*’+---------+---------+---------+---------+*ˆD3‚=…|‹DCBaddress‘|+*’+---------------------------------------+$*ˆD4‚=…|ƒ0…|ƒ0…|dev.stat|dev.type|+*’+-------------------+---------+---------+***‰PAGEI**************************************************************************)*ˆEVENT…WITH„AN„ALTERNATE**‘SERVICE…ADDRESS*J***************************************************************************)*’Eventwithanalternateserviceaddress*+*’+---------+---------+---------+---------++*ˆD2‚=…|length‚|‚$81„|upperwordofaddr|+*’+---------+---------+---------+---------+)*ˆD3‚=…|lowerwordofaddr|‚typeƒ|‚key„|+*’+---------------------------------------+**ˆD4‚=…|DCBaddressorchannelmnemonic‡|+*’+---------------------------------------+"*ˆD5‚=…|continuationofmessage|+*’+---------------------------------------+ *ˆD6‚=…|§|+*’+---------------------------------------+*‰PAGED**********************************************************************’NormalI/Ocompletionevent#*’withanalternateserviceaddress*+*’+---------+---------+---------+---------+'*ˆD2‚=…|‚$E…|‚$81„|compaddrupperwd|+*’+---------+---------+---------+---------+(*ˆD3‚=…|compaddrlowerwd|‚$70„|‚key„|+*’+-------------------+---------+---------+*ˆD4‚=…|‹DCBaddress‘|+*’+---------------------------------------+*ˆD5‚=…|ƒ0…|errorƒ|*’+-------------------+***’I/OHALTevent#*’withanalternateserviceaddress*+*’+---------+---------+---------+---------+'*ˆD2‚=…|‚$E…|‚$81„|compaddrupperwd|+*’+---------+---------+---------+---------+(*ˆD3‚=…|comp.addrlowerw|ƒ$71ƒ|‚key„|+*’+-------------------+---------+---------+*ˆD4‚=…|‹DCBaddress‘|+*’+---------------------------------------+*ˆD5‚=…|ƒ0…|errorƒ|*’+-------------------+**’Unsoliciteddeviceevent#*’withanalternateserviceaddress**’andstatusvalue=0(DCBaddressknown)* +*’+---------+---------+---------+---------+(*ˆD2‚=…|‚$10„|‚$81„|compaddrupperwd|+*’+---------+---------+---------+---------+(*ˆD3‚=…|compaddrlowerwd|‚$80„|‚key„|+*’+-------------------+---------+---------+*ˆD4‚=…|‹DCBaddress‘|+*’+---------------------------------------+$*ˆD5‚=…|ƒ0…|ƒ0…|dev.stat|dev.type|+*’+-------------------+---------+---------+***J**************************************************************************‰PAGEK*****************************************************************************ˆCallingtheexec:*ˆ-----------------**ˆfrominterrupthandler:**ŠMOVE.L‚#24,D0*ŠLEA‚,A0 *ŠTRAPƒ#0*ŠBRA.Sƒƒreturn1*Їreturn2**ˆfromnon-interrupthandler:**ŠMOVE.L‚#23,D0*ŠLEA‚,A0 *ŠTRAPƒ#0*ŠBRA.Sƒƒreturn1*Їreturn2**H************************************************************************* *‚EQUATES* EXEC…EQU‡07EVNTSVSZEQU‡4‰Numberofbytesaddedtoeventlengthif**œthealternateserviceaddressisneeded.6EVNTCMSZEQU‡10ˆSizeofanormalcompletioneventwith*œnoextrafields.(EVNTMXSZEQU‡18ˆMaximumsizeofanevent6EVNTIOƒEQU‡1‰Eventcodeforaneventwithnoalternate*œserviceaddress.:EVNTIOSAEQU‡$81‡Eventcodeforaneventwithanalternate*œserviceaddress***ˆXDEF'S*‰XDEF†N_NRM_QEVENT‰XDEF†I_NRM_QEVENT‰XDEF†N_HLT_QEVENT‰XDEF†I_HLT_QEVENT‰XDEF†N_UNS_QEVENT‰XDEF†I_UNS_QEVENT* *ˆINCLUDES**ˆ9995..CCB.EQ*ˆ9995..STR.EQ*ˆ9995..LV5.EQ*ˆ9995..UTILITY.MC*‰NOLIST‰INCLUDEƒ9995.&.CCB.EQ‰NOLIST‰INCLUDEƒ9995.&.STR.EQ‰NOLIST‰INCLUDEƒ9995.&.LV5.EQ‰NOLIST‰INCLUDEƒ9995.&.UTILITY.MC‰LIST ‰SECTIONƒ15QEVENT_REGSˆREG‡D0-D7/A0-A5‰PAGEE**********************************************************************+*ˆNORMAL„COMPLETION†EVENT*D******************************************************************** N_NRM_QEVENT:)‰MOVEM.LƒQEVENT_REGS,-(SP)Saveregisters‰MOVE.L„#T0QEVNTT,D0‰BRA‡NRM_QEVENT I_NRM_QEVENT:)‰MOVEM.LƒQEVENT_REGS,-(SP)Saveregisters‰MOVE.L„#T0QEVNTI,D0 L1‡SET‡XPSNRM<<80NRM_QEVENT‰MOVE.W„#L1,D5‹D5.W<---eventtypein*°upperbyte,0'sinlower*=*‚Thefollowingcodeisusedbothbythenormaleventroutine$*‚andbythehaltI/Oeventroutine.A*‚Onentry,D5.W‚containstheappropriateeventtypeinitsupper!*‚byte,and00initslowerbyte:*+*’+---------------------------------------+*ˆD5‚=…|ƒ?…|ƒ?…|‚typeƒ|„0„|+*’+-------------------+---------+---------+*NRM_HLT*?*‚Firstwefindoutofthereisanalternatecompletionservice *‚address.*‰MOVE.L„CCBSVVC(A5),D2 ‰IF„„THEN‰PAGEJ***************************************************************************+*ˆNORMAL„COMPLETION‡EVENT**ˆOR„HALTƒI/O„EVENT*-*ˆWITH…AN…ALTERNATE…ADDRESS*E**********************************************************************@*‚Atthispointweknowthereisacompletionserviceaddressin<*‚D2.‚WehavetogetitsupperwordinthelowerwordofD2,@*‚anditslowerwordintheupperwordofD3.‚Butfirst,wemove;*‚theDCBaddresswhichiscurrentlyinD3intoD4whereit"*‚belongs,andwecopyD2intoD3.* MOVE.LƒD3,D4 MOVE.LƒD2,D3*#*‚Nowtheregisterslooklikethis:*+*’+---------------------------------------+*ˆD1‚=…|…?ƒ|„?„|ƒ?…|error„|+*’+-------------------+---------+---------+*+*’+---------+---------+---------+---------+0*ˆD2‚=…|compaddrupperwd|compaddrlowerwd|+*’+---------+---------+---------+---------+0*ˆD3‚=…|compaddrupperwd|compaddrlowerwd|+*’+-------------------+---------+---------+*ˆD4‚=…|‹DCBaddress‘|+*’+---------------------------------------+*ˆD5‚=…|ˆ?Š|type„|ƒ0…|+*’+---------------------------------------+*+*‚Remember,wewantthemtolooklikethis:*+*’+---------+---------+---------+---------+ '*ˆD2‚=…|‚$E…|‚$81„|compaddrupperwd|+*’+---------+---------+---------+---------+)*ˆD3‚=…|compaddrlowerwd|‚typeƒ|‚key„|+*’+-------------------+---------+---------+*ˆD4‚=…|‹DCBaddress‘|+*’+---------------------------------------+*ˆD5‚=…|ƒ0…|errorƒ|*’+-------------------+*@*‚NowtofixupD3.‚WewillSWAPitandthenmovetheeventtype,*‚fromD5.Wupperbyte‚intoD3.Wupperbyte.+*‚ThenwewillputtheCCBKEYbyteintoD3.*SWAPŠD3 MOVE.WˆD5,D3MOVE.BˆCCBKEY(A5),D3*#*‚Theregistersnowlooklikethis:**+*’+---------------------------------------+*ˆD1‚=…|…?ƒ|„?„|ƒ?…|error„|+*’+-------------------+---------+---------+*+*’+---------+---------+---------+---------+0*ˆD2‚=…|compaddrupperwd|compaddrlowerwd|+*’+---------+---------+---------+---------+)*ˆD3‚=…|compaddrlowerwd|type„|‚key„|+*’+-------------------+---------+---------+*ˆD4‚=…|‹DCBaddress‘|+*’+---------------------------------------+*ˆD5‚=…|ˆ?Š|‚typeƒ|ƒ0…|+*’+---------------------------------------+**=*‚NowtofixupD2.‚Weneedtomovethelengthandeventcode$*‚($0E81)intoD2.W,thendoaSWAP.*L1‡SET‡EVNTCMSZ+EVNTSVSZ%L1‡SET‡L1<<8+EVNTIOSAD2.W<---$0E81MOVE.W„#L1,D2SWAP†D2*#*‚THEREGISTERSNOWLOOKLIKETHIS:**+*’+---------------------------------------+*ˆD1‚=…|…?ƒ|„?„|ƒ?…|error„|+*’+-------------------+---------+---------+*+*’+---------+---------+---------+---------+&*ˆD2‚=…|‚$0Eˆ$81ƒ|compaddrupperwd|+*’+---------+---------+---------+---------+)*ˆD3‚=…|compaddrlowerwd|‚typeƒ|‚key„|+*’+-------------------+---------+---------+*ˆD4‚=…|‹DCBaddress‘|+*’+---------------------------------------+*ˆD5‚=…|ˆ?Š|‚typeƒ|ƒ0…|+*’+---------------------------------------+*@*‚NowtofixupD5.‚WeneedtogettheerrorcodeintothelowerB*‚byteoftheupperword,anda0intotheupperbyteoftheupper*‚word.* CLR.WƒD5 MOVE.B‚D1,D5SWAP„D5* *‚Theeventisnowreadytosend)*‚Seeifweneedtocopyintouser'sarea*‰IF.L„A0‚‚#0ƒTHENŽBSRƒCOPY4_EVENT‰ENDI* ‰PAGE‰ELSEJ***************************************************************************+*ˆNORMAL„COMPLETION‡EVENT**ˆOR„HALTƒI/O„EVENT*-*ˆWITH…NO…ALTERNATE…ADDRESS*E**********************************************************************?* We arrive here because we have a normal completion event or a>* halt I/O event with no alternate completion service address.N*‚ThusregisterD3isallset,andweonlyhavetofixupregistersD2andD4.**#*‚THEREGISTERSNOWLOOKLIKETHIS:**+*’+---------------------------------------+*ˆD1‚=…|…?ƒ|„?„|ƒ?…|errorƒ|+*’+-------------------+---------+---------+*+*’+---------+---------+---------+---------+ *ˆD2‚=…|?—|+*’+---------+---------+---------+---------+*ˆD3‚=…|‹DCBaddress‘|+*’+-------------------+---------+---------+ *ˆD4‚=…|?–|+*’+---------------------------------------+*ˆD5‚=…|‰?‰|type„|ƒ0…|+*’+---------------------------------------+**L1‡SET‡EVNTCMSZ<<24+EVNTIO<<16* MOVE.Lˆ#L1,D2‡D2<---$0A010000 MOVE.WˆD5,D2MOVE.BˆCCBKEY(A5),D2 CLR.W‰D4 MOVE.BˆD1,D4SWAPŠD4 *#*‚THEREGISTERSNOWLOOKLIKETHIS:**+*’+---------------------------------------+*ˆD1‚=…|…?ƒ|„?„|ƒ?…|errorƒ|+*’+-------------------+---------+---------+*+*’+---------+---------+---------+---------+*ˆD2‚=…|‚$0Aˆ$01ƒ|‚typeƒ|‚key„|+*’+---------+---------+---------+---------+*ˆD3‚=…|‹DCBaddress‘|+*’+-------------------+---------+---------+*ˆD4‚=…|„0„|errorƒ|‰?‰|+*’+---------------------------------------+*+*’+---------------------------------------+*ˆD5‚=…|ˆ?Š|‚typeƒ|ƒ0…|+*’+---------------------------------------+**!*‚Theeventisnowreadytosend.0*‚Seeiftheuserwantsustocopyitsomewhere.*ŒIF.LƒA0‚‚#0ƒTHEN‘BSRƒCOPY3_EVENTŒENDI‰ENDI ‰PAGE K****************************************************************************0*ˆSEND„THEƒEVENT…IN…D2-D4‚OR„D2-D5*M******************************************************************************!*‚Theeventisnowreadytosend.* SEND_EVENT**‚SetupfortheTRAP#0call.*‰MOVE.L„CCBRQSTA(A5),A0‰TRAP‚#0 ‰BRAƒEVENT_OK ‰MOVEQ#1,D0‰BRAƒRESTORE_REGSEVENT_OK„CLRƒD0 RESTORE_REGS‰MOVEM.L„(SP)+,QEVENT_REGS‰RTS‰PAGEJ***************************************************************************1*ˆCOPY…THE…EVENT„TO„USER'S„AREA*H************************************************************************ COPY3_EVENT:‰MOVEM.L„D2-D4,(A0)‰RTS COPY4_EVENT:‰MOVEM.L„D2-D5,(A0)‰RTS  ‰PAGEI***************************************************************************ˆHALT„I/O†EVENT*K*************************************************************************** N_HLT_QEVENT)‰MOVEM.LƒQEVENT_REGS,-(SP)Saveregisters‰MOVE.L„#T0QEVNTT,D0‰BRAƒHLT_QEVENT I_HLT_QEVENT)‰MOVEM.LƒQEVENT_REGS,-(SP)Saveregisters‰MOVE.L„#T0QEVNTI,D0L1‡SET‡XPSHLT<<8 HLT_QEVENT*‰MOVE.W„#L1,D5ŽD5.W<---eventtype*$100 ‰BRA‡NRM_HLT L**************************************************************************** ‰PAGEG************************************************************************-*ˆUNSOLICITED…DEVICE…EVENT*H************************************************************************ N_UNS_QEVENT:‰MOVEM.L„QEVENT_REGS,-(SP)‰MOVE.L„#T0QEVNTT,D0‰BRA‡UNS_QEVENT I_UNS_QEVENT:‰MOVEM.L„QEVENT_REGS,-(SP)‰MOVE.L…#T0QEVNTI,D0 )*‚Onentry,theregisterslooklikethis:**+*’+---------------------------------------+ *ˆD2‚=…|“?“|+*’+---------+---------+---------+---------+*ˆD3‚=…|‹DCBaddress‘|+*’+-------------------+---------+---------+ *ˆD4‚=…|‰?‰|devstat|devtype|+*’+---------------------------------------+* UNS_QEVENT‰MOVE.L„CCBSVVC(A5),D2 ‰IFƒ„THEN‰PAGEM******************************************************************************-*ˆUNSOLICITED†DEVICE„EVENT*)*ˆWITH…ALTERNATE„ADDRESS*C********************************************************************G*‚Wehavetomovethingsuptosqueezethealternatecompletionaddress0*‚intotheregistersD2andD3aswedidbefore.* ŽCLR.LŠD5 ŽMOVE.W‰D4,D5 ŽMOVE.L‰D3,D4 ŽMOVE.L‰D2,D3ŽSWAPD3 $*ƒNow,theregisterslooklikethis:**+*’+---------------------------------------+0*ˆD2‚=…|compaddrupperwd|compaddrlowerwd|+*’+---------------------------------------+0*ˆD3‚=…|compaddrlowerwd|compaddrupperwd|+*’+---------+---------+---------+---------+*ˆD4‚=…|‹DCBaddress‘|+*’+-------------------+---------+---------+$*ˆD5‚=…|„0„|„0„|devstat|devtype|+*’+---------------------------------------+*L1‡SET‡XPSUNS<<8ŽMOVE.W‰#L1,D3ŽD3.W‚<---‚$8000ŽMOVE.B‰CCBKEY(A5),D3L1‡SET‡EVNTCMSZ+EVNTSVSZ+2%L1‡SET‡L1<<8+EVNTIOSAD2.W‚<---$1081ŽMOVE.W‰#L1,D2 ŽSWAPD2$*ƒNow,theregisterslooklikethis:**+*’+---------------------------------------+(*ˆD2‚=…|‚$10„|ƒ$81ƒ|compaddrupperwd|+*’+---------------------------------------+(*ˆD3‚=…|compaddrlowerwd|‚$80„|‚key„|+*’+---------+---------+---------+---------+*ˆD4‚=…|‹DCBaddress‘|+*’+-------------------+---------+---------+$*ˆD5‚=…|„0„|ƒ0…|devstat|devtype|+*’+---------------------------------------+***!*‚Theeventisnowreadytosend.%*‚Let'sseeiftheuserwantsacopy.*IF.L‚A0‚‚#0‚THEN.L‘BSR‚COPY4_EVENTENDI‰ELSE ‰PAGED*********************************************************************-*ˆUNSOLICITED…DEVICE…EVENT*&*ˆWITH„NO„ALTERNATE„COMPLETION„ADDRESS*C******************************************************************* L1‡SET‡EVNTCMSZ+2"L1‡SET‡L1<<24+EVNTIO<<16+XPSUNS<<8 ‰MOVE.L„#L1,D2“D2<---$0C018000 ‰MOVE.B„CCBKEY(A5),D2*$*‚Now,theregisterslooklikethis:**+*’+---------------------------------------+*ˆD2‚=…|‚$0C„|‚01…|‚$80„|‚key„|+*’+---------+---------+---------+---------+*ˆD3‚=…|‹DCBaddress‘|+*’+-------------------+---------+---------+ *ˆD4‚=…|‰?‰|devstat|devtype|+*’+---------------------------------------+*‰AND.L#$0000FFFF,D4*$*‚Now,theregisterslooklikethis:**+*’+---------------------------------------+*ˆD2‚=…|‚$0C„|‚01…|‚$80„|‚key„|+*’+---------+---------+---------+---------+*ˆD3‚=…|‹DCBaddress‘|+*’+-------------------+---------+---------+#*ˆD4‚=…|ƒ0…|„0„|devstat|devtyp‚|+*’+---------------------------------------+*!*‚Nowtheeventisreadytosend.%*‚Let'sseeiftheuserwantsacopy.*ŽIF.LƒA0‚‚#0„THEN.L’BSRƒCOPY3_EVENTŽENDI‰ENDI ‰BRA‡SEND_EVENT ‰ENDéééé=/*=/*†DRVLIB.SETTIME.AF=/*C=/* Chain file to assemble DRVLIB.SETTIME.SA, a driver library file=/*:=/* If no output argument is specified for the listing the0=/* chain file will default to DRVLIB.SETTIME.LS=/*=/IFC \1ƒ=ARGDRVLIB.SETTIME.LS=/ENDIF=/*0=ASM DRVLIB.SETTIME.SA,DRVLIB.SETTIME.RO,\1;Z=75=/*{ Included files are:=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.STR.EQ=/*ƒ9995.&.CCB.EQ=/*}=/*=ENDéééééé p‰PAGE5SETTIME‚IDNT†4,4‡SETUPPERIODICACTIVATION(TRAP#0)‰OPT‡PCS,BRS,CREN******************************************************************************N******************************************************************************* *ˆSET_TIME*;*ˆThisroutinesetsupanddoesatrap0calltogeneratea;*ˆwakeupcall.‚Thedriverwritermaywanttodothisbefore>*ˆgivingacommandtothecontrollerasatimeout,sothatthe>*ˆsystemwillnothangwaitingforaninterruptthatmaynever*ˆcome.*<*ˆThisroutinewillnotdotheTRAP#0callifthenumberof!*ˆmillisecondsaskedforiszero.**ˆSubroutinescalled:**ˆEntry:„A5=addressofCCB *’A3=addressofwakeuproutine.*’D3=numberofmillisecondsforwakeupcall.*"*ˆRegistersusage:†0‚1‚2‚3‚4‚5‚6‚7 *™D„*‚*‚*‚P *™A„*‚*…P…P**™P=parameterregister*™R=returnregister!*™*=savedandrestoredregister*6*ˆExit:…CCR:=periodicactivationcallsucceeded)*—=periodicactivationcalldidnot *žsucceed*žornumberofmilliseconds=0*"*ˆExitsto:RTStocallingroutine*L******************************************************************************…NOTESonusingthisroutine:*?*…TheaddressyousendinA3istheaddresswheretheexecwill.*…startyouexecutingwhenthetimergoesoff.*@*…Whenyoustartexecuting,theregisterssavedbytheexecare:*ˆD0,D1,A0,andA1.>*…Thisisdifferentfromtheregistersthataresavedwhenyou2*…ordinarilygetaninterrupt,namely‚D0,A0,A1,A5.*D*…InD1youfindanIDthatyoutoldtheexecaboutwhenyoudidthe;*…trapcall.‚Inourcase,theIDistheaddressoftheCCB.*B*…SothefirstthingtodouponwakeupistopushA5andanyother<*…registersyoumightuseonthestack,andmoveD1intoA5.**3*…Also,youmustreturnwithanRTEfromthiscall.*M*****************************************************************************y<‚0M****************************************************************************** *ˆINCLUDES**ˆ9995.&.UTILITY.MC*ˆ9995.&.STR.EQ*ˆ9995.&.CCB.EQ*‰NOLIST‰INCLUDEƒ9995.&.UTILITY.MC‰NOLIST‰INCLUDEƒ9995.&.STR.EQ‰NOLIST‰INCLUDEƒ9995.&.CCB.EQ‰LIST ‰SECTIONƒ15 SET_TIME:*SET_REGSREG„D0-D2/A0-A1&SAVE‡SET_REGSŽSaveregistersusedfor *°trapcall* PUSH‡#1”SetflagforbadreturnTST.L†D3”Areweaskingfor0*°milliseconds?#BEQ.S†SET_RETIfso,therewillbe*°noexeccall.$MOVE.L…#T0RQPA,D0ŒD0<---directiveCLRˆD1/MOVE.B…CCBPPRIO(A5),D1‡D1<---interruptlevel!MOVE.L…A5,D2‘D2<---CCBaddress'MOVE.L…A3,A0‘A0<---addressofwakeup,MOVE.L…D3,A1‘A1<---no.ofmillisecondsto*¸waitforwakeupTRAP‡#0 BRA.S†SET_WAT1Žrequestaccepted#BRA.S†SET_RETrequestnotaccepted'SET_WAT1ˆCLRˆ(SP)’ClearflagtoshowOK**'SET_RET‰POPˆD0”FixCCRbypoppingstackRESTORE„SET_REGS ‰RTS‰END L**************************************************************************** é ééV1LOGPHY ASREL' DRVLIB LOGPHY SA'(…DRIVER LIBRARY LOGICAL-PHYSICAL SUBROUTINE2OLOGPHY /(.3Hçýü?<fJ…g h6pN@BWNqNq0Lß?¿Nu4éééééééŠO1QEVENT ASREL' DRVLIB QEVENT SA(…QUEUE EVENTS FROM DRIVERS (TRAP #0)`2OI_NRM_QE OI_HLT_QE €ON_NRM_QE ON_HLT_QE xOI_UNS_QE ”ON_UNS_QE Œ/æF3Hçÿüp`Hçÿüp:* (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 point 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 ééé=/*=/*†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ééé éééÓ9EDITMODE‚IDNTƒ1,0„VME/10editmodeemulationforTERMDRV.O*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.    * Ü8å?íFõ:ý3* ),)%'-15>=GEOM@U80*‚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ƒFEEDERE ntrypointandsomevariablesforthe>Š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‚$FFpacketreturnedineditmode.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+(routineaddr-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‚PRIN T_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-JMPBASE…$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‚*ƒRoutin  eoffsetˆ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.‚(BACKWARDTAB)&Š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*‚Justignorethischarandreturnfro  mEDITMODE.*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„SRlo(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.   ŠENDé=/*=/*†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=/*/=ASM VMES10.FEEDER.SA,VMES10.FEEDER.RO,\1;RZ=90=/*{ Included files are:=/*ƒ9995.&.UTILITY.MC=/*ƒ9995.&.IOE.EQ=/*ƒ9995.&.CCB.EQ=/*ƒ9995.VMES10.TERMDRV.EQ=/*ƒ9995.&.STR.EQ=/*}=/*=ENDéééééé]>FEEDER„IDNTƒ1,0„VME/10subroutinetofeedabuffertoTERMDRV.O*v*****************************************************************************O*******************************************************************************O**********************************************************************************É***4***†FILENAME:‚FEEDER--FEEDABUFFERTOTERMDRV–******É***8***†ENVIRONMENT:‚LinkedintoTERMDRVfortheVME/10.’******É***G***†FUNCTION:‚TERMDRVbasicallyonlyacceptsacharactera  tatime.ƒ***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*…--------‚-------------‚----------------------------------------------'*†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‚Variablestouseifyouwantf1oCw:<‡/&*§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.*ŠNOLISTŠINCLUDE‚9995.&.UTILITY.MCŠINCLUDE‚9995.&.IOE.EQŠINCLUDE‚9995.&.CCB.EQŠINCLUDE‚9995.VMES10.TERMDRV.EQŠINCLUDE‚9995.&.STR.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--FE  EDSABUFFERBYTEWISETOTERMDRV******É***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.*ŠTR0$.KILLERBadreturn--crashthesystem. THENŠofhiswork(thisshouldbethecase),)ŠBSR„FEEDERcallhimtolethimcontinue.ŠENDI–* ŠRTS—Return.     ŠENDéé=/*=/*†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=/*}=/*=ENDéééééé  HINCHAR„IDNTƒ1,0‚Routinetogetincomingchar'sandhandlespecialmodes.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'reinpagemodeorprotectmode. 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…THE  NŠ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.   ŠENDéééé=/*=/*†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--=/*}=/*=ENDééééé é±7OUTCHSƒIDNT†1,00†OutputacharactertothedisplayRAM. <*************************************************************º**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.™*<*----------------------------------------------------------*/*Inputparameters:‚D0.Bcharactertooutput.*<*----------------------------------------------------------**Registersaffected:none¡*<*----------------------------------------------------------* *Externalroutinesused:none*<************************************************************‰PAGE ‰XDEF†OUTCHS‰XDEF†EDIT_FLAG 4‰XDEF†RESET_SCREEN‚Alternateentryforresetcommand4‰XDEF†CLEAR_SCREEN‚Alternateentryforclearcommandº7Ã9Ë?ÓBÛ-ã,ë-ó0û+T aOQ#S+D3A;BCSK:SU[JcSkKs>{FƒK‰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--Displa yasis.,Š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„$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-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-JUMPTABL„$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 ‰B RA‡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‰MOVE.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,D 1Ž*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ŠLoopiftherearemorecha racters. 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…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‡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 unprotecte d 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=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‡*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‚Endofscreennoteditmode‰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=/*=/*†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--=/*}=/*=ENDéééééé‹9PAGEMODE‚IDNTƒ1,0„VME/10pagemodeemulationforTERMDRV.O*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*****************************************************************************”@3O**********************************************************************************É***+***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'snotafunctionkey), 8ŠBSR.L‚OUTCHSCallOUTCHStooutputthecharandsetCCR3ŠMOVEQ‚#0,D1Žtotosay'ignorethekeystroke.' ŠENDI -ŠMOVEM.L(SP)+,D1ŠRestoreregistersandexit.ŠRTS—*   ŠENDéé=/*=/*†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--=/*}=/*=ENDé ééééé¥8POUTCHSƒIDNT†1,00†OutputacharactertothedisplayRAM. <*************************************************************º**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:OutputthecharacterinD0.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§®7·<¿EÇ4Ï,×,ß/ç-ïF÷HÿNSNST'</J7L?IG;OBWT_CgZoEwEB‡;K—L-‰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ƒ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ƒ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-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.'ŠD C.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‹Weneedtoputthecursoron thebottom7‰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*ªrightofthecurrentfield.‰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&*™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**$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@*‰therightuntiltheendoflineoraprotectedfieldishit.‚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‡WRITCRSR…* 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,keep looking'‰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.LINEUpdatethe startoflinepointer‰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…SETTAB1RESETTAB1‰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…Videoinvertbiton oroff‰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‡PROFACŽ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ŽChecktoseei fFACmustbepropogated ‰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 WRITEABS EQU‡**/* 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‰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ééééé¶Ÿ =/*=/*†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.VMES10.TERMDRV.EQ=/*}=/*=ENDééééé¨9TERMDRVƒIDNTƒ4,1‡VERSADOSTERMINALDRIVERWITHTYPE-AHEAD6ŠTTL„TERMDRV:‚VERSADOSTERMINALDRIVERWITHTYPE-AHEAD ŠLLENƒ120J**************************************************************************J**************************************************************************J**************************************************************************J***************************************************************************4*‰TERMDRV:‚VERSAdosterminaldriverwithtype-ahead.*?*‰Purpose:‚VERSAdosdevicedrivertohandletheVME/10keyboard *&screen.**‰Revisionhistory:4*‘1/15/85‚Addedcodetoreturnerrorcodetouserin,*šhaltI/Oparameterblock.Returnof$E6in*šoriginalI/Oparameterblock.éééé 骱º%ÂGÊ6Ò6ÚTâ=êOò6úB1 :B8"<*>24:9B@JCRKZ;bAjGrFz9‚DŠ;’Aš79*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$.KILLER *TR0$.GETTCB**‰Othernotes:6*CurrentlythiscodeisneitherROMablenorposition-*’independent.'*AssembleusingchainfileTERMDRV.AF.*J**************************************************************************J**************************************************************************J**************************************************************************J**************************************************************************‰PAGE*F*‚Toassemblethiscodeforitspropertargetenvironment,changethisééA*‚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*ŠNOLISTŠINCLUDE9995.&.STR.EQŠNOLISTŠINCLUDE9995.&.TCB.EQŠINCLUDE9995.&.CCB.EQŠINCLUDE9995.&.IOE.EQŠINCLUDE9995.&.NIO.EQŠINCLUDE9995.&.LV5.EQŠLISTŠPAGEO*********************************************************************************‰NOTESONCODINGSTANDARDS*O******************************************************************************* G*‚BecausethisisanI/Odriver,speedisoftheutmostimportance,andG*‚asaresulttradeoffsweremadedecreasingthestraightforwardnessofL*‚thecodeinfavoroflesstimespentprocessinginterrupts.‚Inparticular,F*‚theinterruptserviceportionofthisdriverisnotatallmodular--H*‚some'routines'havemultipleentr yandexitpoints,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'scomplementofthatareundefined. 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.