þþ]5dX;SAVE#D:BUPP1.M65nX;xX;------------------;‚X; BUP.SYS part I ;ŒX; ;–X; (c) 1989 ; X; by Barry Kolbe ;ªX; ;´X;------------------;¾EIÈX;Ò X;equatesÜX;æ ‚LOð ‚JOúƒEOL›;;end of line†LINENOè;;line number†LINPTRË;;ptr to line #…CLINEÍ;;current line"…ILINEÏ;;increment line,…FLINEþ;;first line6…RLINEâ;;referenced line@„SPTRä;;ptr. for seachJ…SLINEæ;;search lineT„VNTP‚;;var. name table^†STMTABˆ;;BASIC statmt.h†PROMPTÂ;;flag-BAIC done?r†CRITICB;;cirtical I/O|…ICCOMB;;command†…ICBALD;;buff. address …ICBAHEš…ICBLLH;;buff. length¤ …ICBLHI®†ICAUX1J;;aux. byte¸†HATBAS;;handler table„LBUF€;;input bufferÌ…MEMLOç;;memloÖ†DOSINI ;;disk init.à†DLISTL0;;display listê†DLISTH1ôƒCIOVä;;cio vectorþ„FASCæØ;;fp to asciiƒAFPØ;;ascii to fpƒIFPªÙ;;integer to fpƒFPIÒÙ;;fp to integer&ƒFR0Ô;;fp register 00 ƒFR1Õ:†SETLBFQÚ;;reset lbufD†SETVBV\ä;;set vert. blnkN†SYSVBV_ä;;system vbiX†XITVBVbä;;exit vbib…INBUFó;;input buf. ptrlƒCIXò;;char. indexv†WARMSTtä;;warnstart€†VVBLKD$;;deferred regŠ †DOSVEC ”X;ž ¨X;²ƒIN1-¼Q†DLISTL;;save origÆPƒDLS;;display listÐQ†DLISTH;;pointerÚPƒDLHäQ†DOSINI;;saveîP†SYSRST;;DOSINIøQ†DOSINIP†SYSRST X;X;save immed.vbi vectors X;* Q†VVBLKD4 P†VBLKDS>Q†VVBLKDHP†VBLKDSRX;\"X;reset my SYSTEM RESET routinefX;pƒIN2Q>5†SYSRSTzP†DOSINI„ Q>4†SYSRSTŽ P†DOSINI˜X;¢X;reset character counter¬X;¶Q>À P†CHRCNTÊ P†QTFLAGÔP„TFLG;;trace flagÞX;èX;find editor vectorsòX;search handler for E:üX;%>‚E1Q†HATBAS8R> E$F‚E2;;got it.383B3L)>!VH‚E1`:jX;t‚E23;;point to~Q>4†MYEDIT;;my patchˆ P†HATBAS8’3œ Q>5†MYEDIT¦ P†HATBAS8°%>;;copy systemº‚E3Qä8;;routinesÄP†MYEDIT8;;to myÎ 3;;patchØ)>âH‚E3ìX;öX;get byte vectorX; Q>4†GETCOM;;point itP†MYEDIT;;to myQ>5†GETCOM;;wedge(P†MYEDIT2,;;put system<Qä;;get byteFO>;;at beginningPP†GETCOMZQädO>nP†GETCOMxX;‚X;put byte vectorŒX;–Qä;;get vector ,;;vectors areªO>;;always -1´P„PUT1;;add 1¾Qä;;install inÈO>;;my 'PUTC'ÒP„PUT1;;routineÜQ>5†ENDPRG;;set LOMEMæ P…MEMLOð Q>4†ENDPRGú P…MEMLOX;Q>;;chang colorPÆ"$>;;say we are,‚B1QƒBB19;;here!6 „PUTC@ „WAIT;;wait a jiffJ „WAIT;;maybe twoT0^I‚B1h$>ÿ;;clear stackrB|! ;;jump to BASIC†X;„WAITQ>;;wait a jiffyšP¤ ƒWITQ®FƒWIT¸:ÂX;ÌX;handle SYSTEM RESET buttonÖX;à†SYSRST ÿÿ;;does DOSINIê!ƒIN2;;resetôX;þ#X;print Accumulator via put byteX;„PUTC&„XSAV;;save X, Y '…PYSAV&„PUT1 ÿÿ;;put byte0$„XSAV;;restore X,Y: %…PYSAVD:NX;XX;get bytes from editorbX;l†GETCOM ÿÿ;;get a bytev6;;save status€)>€;;break keyŠ FƒBRK;;yes”R>ƒEOL;;RETURN?žF†GOTRT1;;yup¨&‚X3;;save X²$†LSTKEY;;last key¼(>ÿ;;ret? =ffÆHƒKOKÐ$>;;reset countrÚ &†CHRCNTä &†LSTKEYîƒKOK$‚X3;;get Xø #†CHRCNT!…NOBRK;;skip over X;ƒBRKQ>;;on break turn P…ONOFF;;everything*P†QTFLAG;;OFF!4 P†CHRCNT> P†ENDLINHQ>;;restore vectorsR%†VBLKDS;;for VBI\$†VBLKDSf †SETVBVp †SETLBF;;floating pointz!…EXIT2;;pointers„X;Ž…NOBRK8;;restore status˜ :;;done¢X;¬X;BASIC done with line¶X;ÀX;PROMPT <> 0 when BASICÊX;is done parsing a lineÔX;endlin =0 means lineÞX;not completely enteredèX;from BASICòX;ü†GOTRT1Q†QTFLAG HƒBRK Q…ONOFF;;autonum? F…NOTON;;0= off$ Q>;;VBI timer. P…TIMER8 Q>B P†ENDLINL Q>V P†PROMPT;;clear for` P†CHRCNT;;BASICj Q>ƒEOLt 8~ :ˆ X;’ X;autonum not onœ X;¦ …NOTON'‚Y1;;save regs° &‚X1º $>ÿ;;last keyÄ &†LSTKEYÎ X;Ø X;check commandâ X;ì %>ö 'ƒCY1 …GTCM1%ƒCY1 $> Q„LBUF9;;first char R†COMTAB8;;in table?( H…NOMAT2 3< 2F Q„LBUF9;;try secondP R†COMTAB8;;charZ H…NOMATd 3n 2x Q„LBUF9;;try third‚ R†COMTAB8Œ H…NOMAT– X;  X;got matchª X;´ 3¾ Q†COMTAB8È P†TAKEOF;;find addrÒ 3;;of myÜ Q†COMTAB8;;routineæ P†TAKEOFð %†CHRCNT;;stick inú Q>ƒEOL;;a RETURN P„LBUF8 -  †CRUNCH;;smash spaces" †TAKEOF!ÿÿ;;go to it, X;6 X;exit routines@ X;J …EXIT2%>;;show BASICT 'Ã;;no error^ '†CHRCNTh Q> .;;REMr P„LBUF8| 3† Q>ƒEOL;;and EOL P„LBUF8š …EXIT1$‚X1;;restore X,Y¤ %‚Y1;;make a® Q>ƒEOL;;normal exit¸ 8 :Ì X;Ö X;no matchà X;ê …NOMATQƒCY1;;try nextô ,;;commandþ O> PƒCY1 R>A;;13 commands H…GTCM1;;@ 5 bytes& %†CHRCNT;;each0 Q>ƒEOL;;put in RETURN: P„LBUF8D H…EXIT1;;and exitN X;X X;crunch out spaces in inputb X;l †CRUNCH$>;;find thev ƒCR1Q„LBUF9;;length€ R>ƒEOLŠ F†GOTEND;;found it” 2ž IƒCR1¨ †GOTEND&†ENDPTR;;save end² $>;;now collapse¼ †SQUISHQ„LBUF9;;it andÆ R>ƒEOL;;remove spacesÐ FƒCR2Ú R> ;;space?ä H†NOSQSH;;no squishî †DOSQSHAø ?;;copy from †SQSHLPQ„LBUF8;;back P„LBUF8;;to front 3;;next one )†ENDPTR;;done yet?* H†SQSHLP;;no4 "†ENDPTR;;len=len-1> !†SQUISH;;moreH †NOSQSH2;;done yetR (†ENDPTR\ H†SQUISH;;nof ƒCR2:;;finishedp X;z X;command table„ X;Ž †COMTAB AƒDIRA˜  ƒDIR¢ AƒERAA¬  ƒERA¶ AƒPROAÀ „LOCKÊ AƒUNPAÔ †UNLOCKÞ AƒNAMAè …RENAMò AƒDOSAü  ƒDOS AƒTRAA …TRACE AƒOFFA$ „TOFF. AƒNUMA8 †AUTNUMB AƒRENAL …RENUMV AƒDECA` †DECHEXj AƒHEXAt †HEXDEC~ AƒLVAAˆ †VARLST’X;œX;directory routine¦X;°ƒDIR †TURNOF;;trace offº †CLOSE5;;close iocb 5Ä$>PÎQ>;;open chan #5Ø P…ICCOM9âQ>;;directoryì P†ICAUX19öQ>5†DIRNAM;;D1:*.* P…ICBAH9  Q>4†DIRNAM P…ICBAL9 ƒCIO;;openning(I†NOERR1;;no error2G…ENDIR;;opps<X;F†NOERR1$>P;;chan 5PQ>;;20 charsZ P…ICBLL9dQ>;;for inputn P…ICBLH9xQ>5†DIRBUF;;my buffer‚ P…ICBAH9Œ Q>4†DIRBUF– P…ICBAL9 Q>;;get bytesª P…ICCOM9´ ƒCIO;;get 'em¾G…ENDIR;;error-quitÈX;Ò$>ÜQ> ;;put bytesæ P…ICCOMðQ>;;20 of 'emú P…ICBLL &…ICBLHQ>5†DIRBUF;;my buffer P…ICBAH" Q>4†DIRBUF, P…ICBAL6 ƒCIO;;print 'em@I†NOERR1;;okJ…ENDIR †CLOSE5;;close #5T!…EXIT2;;to BASIC^X;hX;close iocb #5rX;|†CLOSE5$>P†Q>  P…ICCOM9š ƒCIO¤:®X;¸X;do XIOs using CIOÂX;Ì…DOXIO5;;save commandÖ †CLOSE5;;close chanà †TURNOF;;trace offê 7;;get XIOô$>P;;commandþ P…ICCOM9Q>;;zero length P…ICBLH9 P…ICBLL9&Q>4„LBUF;;D:filespec0 P…ICBAL9:Q>5„LBUFD P…ICBAH9N ƒCIO;;do XIOXCb I…ENDIRl !…ERRORvX;€X;XIO jmp tableŠX;”ƒERAQ>!;;erase filež H…DOXIO¨„LOCKQ>#;;lock a file² H…DOXIO¼†UNLOCKQ>$;;unlock itÆ H…DOXIOÐ…RENAMQ> ;;rename itÚ H…DOXIOäƒDOSQ†SYSRST;;resstoreîP†DOSINI;;DOSINIøQ†SYSRST;;vectorP†DOSINI  †TURNOF;;trace off!†WARMST;;do warm start X;*X;turn trace on4X;special display list>X;from ANALOG issue 31HX;June 1985 page 74RX;\…TRACEQ„TFLG;;check flagfHƒAON;;1 = on nowp#„TFLG;;set to 1zQ†DLISTL;;get display„PƒDLS;;list andŽ ,;;save it˜O>¢P„BACK;;put it into¬Q†DLISTH;;my display¶PƒDLH;;listÀO>Ê P„BACKÔQ>5†NDLIST;;installÞP†DLISTH;;the newèQ>4†NDLIST;;specialòP†DLISTL;;displayü Q>;;list%>4ƒVBI;;turn on$>5ƒVBI;;VBI †SETVBV$ƒAON!…EXIT2;;out.X;8X;turn off VBIBX;L„TOFF †TURNOF;;turn NUM offV!…EXIT2;;goto BASIC`X;j†TURNOFQƒDLH;;restoretP†DLISTH;;original~QƒDLS;;display listˆ P†DLISTL’Q>;;set flagœ P„TFLG¦$†SYSVBV;;reset VBI°%†SYSVBV;;to systemºQ>;;vectorsÄ †SETVBVÎ:ØX;âX;print error messageìX;ö…ERROR5;;save error #$> ƒE11Q…ERMES9;;get byte „PUTC;;print it0(IƒE1127;;get error<PƒFR0FQ>PPƒFR1Z ƒIFP;;convert tod „FASC;;ATASCIIn †MPRINTx „DOCR‚ …PRRDYŒ !…ENDIR–X; X;print "READY"ªX;´ …PRRDY$>¾ƒRDYQ„READ9È „PUTCÒ0ÜIƒRDYæ:ðX;úX;vert blank code for traceX;ƒVBIQ†CRITIC;;criticalF‚V3;;section? no"!†SYSVBV;;out,‚V3Q†DLISTL;;see if special6R>4†NDLIST;;display list@H…PUTDL;;is presentJQ†DLISTH;;if not - formTR>5†NDLIST;;it^ F‚V9;;yesh…PUTDLQ†DLISTL;; save itrPƒDLS|,†O>;;install inP„BACK;;new displayšQ†DLISTH;;list¤PƒDLH®O>¸ P„BACK Q>4†NDLISTÌ P†DLISTLÖ Q>5†NDLISTà P†DLISTHê‚V9QŠ;;get executingôP;;line pointerþQ‹P%>;;get executingQ@7;;line no.& P„BFR003:Q@7D P„BFR1NQ>;;clear out BCDXPƒBCD;;work spaceb PƒBCDl PƒBCDv PƒBCD€<;;decimal modeŠ%>;;16 bits”‚V4T„BFR0;;2 BCD digitsžU„BFR1;;per byte¨$>;;6 BCD digits²‚V5QƒBCD9;;total¼ OƒBCD9Æ PƒBCD9Ð0ÚH‚V5ä1îH‚V4ø-;;clear decimal$>;;put digits on %>;;top line‚V6QƒBCD8 5;;high nibble*V?4V?>V?HV?RL>;;internal code\ P…TLINE9f2p7;;get bytezM>;;low nibble„L>;;internal codeŽ P…TLINE9˜2¢3¬)>;;done?¶ H‚V6;;noÀ!†SYSVBV;;goneÊX;ÔX;convert dec to hexÞX;è†DECHEXQ>;;point to #òPƒCIX;;in 'DECdddd'ü Q>5„LBUFP…INBUF;;point FPQ>4„LBUF;;to it P…INBUF$ ƒAFP;;to FP. DƒDD2;;ok8!†VALERR;;errorBƒDD2 ƒFPI;;to integerL †BNTOHX;;to hex digitsVQ> =` „PUTC;;'=$'jQ> $t „PUTC~$>;;print theˆƒDD1Q…N2BUF9;;hex digits’ „PUTCœ0¦IƒDD1° „DOCRº †SETLBF;;resetÄQ>;;FP stuffÎPƒCIXØ!…EXIT2;;to BASICâX;ìX;do a carriage returnöX;„DOCRQ>ƒEOL  „PUTC:X;(X;binary to hex converter2X;<†BNTOHX%>;;work backwardsF$>;;2 hex numbersP ƒHX1&‚X3ZQƒFR09;;get highd 5;;save itnV?;;move toxV?;;low nibble‚V?ŒV?–X; >ªQ†HEXTAB9;;get hex digit´P…N2BUF8;;store it¾1;;move pointerÈ 7;;downÒM>;;now low nibbleÜ>æQ†HEXTAB9;;get hexðP…N2BUF8;;save itú1$‚X3;;next hex numbr0IƒHX1" :;;done,X;6X;hex to dec converter@X;J†HEXDEC%>;;point toTQ„LBUF8;;hex in^R> $;;'HEX[$]hhhh'hHƒHD1;;skip '$'r3|ƒHD1$>;;clear work†&ƒFR0;;space &ƒFR0š&‚X2;;digit countr¤ƒPU1Q„LBUF8;;get digit®$>;;in table¸‚H2R†HEXTAB9ÂF‚H3;;X = 0-15Ì0ÖI‚H2àG‚H6;;oh! oh!ê‚H3&‚X1;;= 0 <-> 15ôX;þX;convert to binaryX;TƒFR0;;times 16 UƒFR0&TƒFR00 UƒFR0:TƒFR0D UƒFR0NTƒFR0X UƒFR0b-l,vQƒFR0;;add in value€O‚X1;; 0<-> 15ŠPƒFR0” QƒFR0žO>¨ PƒFR0²3;;next dec digit¼#‚X2;;hex counterÆQ‚X2ÐR>;;got 4Ú F‚H6;;yesä!ƒPU1;;do moreî‚H6Q‚X2;;# digitsøH‚H7!†VALERR;;error X;X;convert to ATASCII $ print X;* ‚H7 ƒIFP4 „FASC;;to ATASCII>Q> =H „PUTCR$>\ ‚H9Q„LBUF9f 5;;save itpM>;;mask inversez „PUTC„2Ž 7;;get it˜ I‚H9;;more¢ „DOCR¬ †SETLBF;;reset LBUF¶!…EXIT2;;to BASICÀX;ÊX;do listing of variablesÔX;Þ†VARLSTQ„VNTP;;point toèP‚JO;;variableòQ„VNTP;;tableü P‚JOQ>;;first var=$80 P‡MYTOKEN…LSBEGQ‚JO$R…;;at end of.H…LPVAR;;var table?8Q‚JOBR„L H…LPVARV!…EXIT2;;to BASIC`X;j…LPVAR%>;; print variablet Q@‚JO7~ 5;;save itˆM>;;mask inverse’ „PUTC;;to screenœ#‚JO;;move pntr up¦HƒLV1° #‚JOºƒLV17;;get byteÄI…LPVAR;;more if +Î „DOCR;;do CRØQ†STMTAB;;get start ofâP‚LO;;BASICìQ†STMTAB;;linesö P‚LOQ>;;column cntr  P†PRFLAG#‡MYTOKEN;;next variableX;(ƒVV0 ‡GETTOKN;;get line2P†LINENO;;number< ‡GETTOKNFP†LINENOPR>€;;at 32768?Z DƒVV1;;nod „DOCR;;yes tryn!…LSBEG;;next variablexX;‚ƒVV1 ‡GETTOKN;;offsetŒƒVN1 ‡GETTOKN;;offset– ‡GETTOKN;;token R>;;rem /dataªEƒVV2´ƒVV3 ‡GETTOKN;;get byte¾R>ƒEOL;;EOL yetÈHƒVV3;;keep goingÒFƒVV0;;next lineÜX;look for end of statementæ X;or lineðƒVV2 ‡GETTOKNúR>;;statmt end?FƒVN1;;next stmtR>;;THEN?FƒVN1"R>;;line end?,FƒVV0;;next line6R>;;num constant?@HƒVV4;;try stringJ$>;;skip numberTƒVV7 ‡GETTOKN;;pull numbr^0hHƒVV7rFƒVV2|ƒVV4R>;;a string?† HƒVV6;;no ‡GETTOKN;;lengthš >;;skip it¤HƒVV7®ƒVV6R‡MYTOKEN;;a variable?¸HƒVV2;;nopeÂQ†LINENO;;show lineÌPƒFR0;;numberÖQ†LINENOà PƒFR0ê ƒIFP;;INT to FPô „FASC;;ATASCIIþ#†PRFLAG;;screen Q†PRFLAG;;format R>;;5 per screen HƒVP2;;line& Q>0 P†PRFLAG;;reset: „DOCRD ƒVP2 †MPRINT;;roll pressesN ƒVP4Q> ;;spaceX „PUTCb 3;;format withl )>;;spaces sov HƒVP4;;in columns€ !ƒVV2;;try more linesŠ X;” X;get a token and incrementž X;the pointer in BASIC¨ X;² ‡GETTOKN%>¼ Q@‚LO7Æ #‚LOÐ H„NINCÚ #‚LOä „NINC:î X;ø >‹D:BUPP2.M65!X; ! X;data!X; !…ERMES Aˆ # RORREA*!ƒBB1 ›=AegakcaP seitiA4! AŠlitU CISABA=}>!†NDLIST p=p=B;;newH! …TLINE;;disply listR! \!„BACK ;;disp.lst flgf!…TLINE A EXECUTIAp! A’ING LINE: Az! A† A„!…ONOFF ;;auto num flgŽ!„TFLG ;;trace flg˜!ƒDLS ;;save old¢!ƒDLH ;;disp. list¬!ƒBCD ;;bcd wrk area¶!„BFR0 ;;psuedo FPÀ!„BFR1 ;;registersÊ!„YSAV ;;save y,xÔ! „XSAV Þ!…PYSAV ;;save yè!‚Y1 ;;more saveò!‚X1 ;;x and yü! ‚Y2 " ‚X2 "ƒCY1 ;;ysave in cmd"†QTFLAG ;;quit num flg$"†TOKTAB  = = = =#=."†OFFSET ;;ren-stmt offst8"†NXTSTM ;;next st. offstB"†PRFLAG ;;print flgL"†LSTKEY ;;last keyV"‡MYTOKEN ;;save my token`"‚X3 ;;save xj"†DONMES ƒEOL=A‹derebmuner At" A‡margorPA~"†OVRMES ›=A86723 => eniLAˆ"„READ ƒEOL=A…YDAERA’"…TIMER ;;vbi timer-numœ"†ENDLIN ;;end line-num¦"†CHRCNT ;;char. cnter°"†VBLKDS ;;save vvblkdº"…FPMES ƒEOL=A‹rorre eulaVAÄ"†HEXTAB A0123456789ABCDEFAÎ"†ENDPTR ;;crunchØ"†MYEDIT ;;ed. vector tabâ"†DIRBUF ;;for directryì"†DIRNAM A…D:*.*A=ƒEOLö"„NBUF ;;# buffers-num#…N2BUF ;;& ren # ;;for unify#X;#I(#†ENDPRG 2#EI<#âF# ƒIN1P#