dX;nX; BATCHERxX; FOR DOS 2.xX;WARMST;;boot flagCLOCK3;;timerZIOCB ;;pg.0 IOCB,ICBALZ$;;addr-lo,ICBAHZ%;;addr-hi,ICBLLZ(;;len-lo,ICBLHZ);;len-hi,ICAX6Z/;;aux6.ROWCRST;;Cursor row,COLCRSU;;and column.EPTR;;Work word,INDEX;;and byte.INBUFF;;Buffer addrBATZIO;;ZIOCB copyHATABS;;IO handlers"IOCB0@;;IOCB start,,ICCOMB;;Command.6ICSTAC;;Status.@ICBALD;;Buffer,JICBAHE;;address,TICPTLF;;Put 1 byte,^ICPTHG;;vector.hICBLLH;;buffer,rICBLHI;;length.|ICAX1J;;aux. infoIOCB5;;#5 hdler-idCIOVV;;I/O rtn.X;$X; Find and replace E: tableX;@Q>;;timer set,PCLOCK3;;at 0. CLEARS;;Clear scrn%>;;Find, FINDITQHATABS8;;editor,R> E;' ;vector.FFOUNDIT;;Found.3;;Skip this, 3;;3 byte,& 3;;entry.0)>!;;Loop thru,:DFINDIT;;table.D :;;Failed.N FOUNDITX 3;;Skip Eb'INDEX;;Save indexlQHATABS8;;Set addr,vPEPTR;;of E: rtn,3;;table in,QHATABS8;;pointer,PEPTR;;word.%>;;Copy all, COPYITQ@EPTR7;;16 bytes,P8;;of editor,1;;vectors,ICOPYIT;;to PG.1.Q;;E: GET,,;;vector+1,O>;;saved in,PBATMON;;BATCHER,Q;;for non- O>;;batch,PBATMON;;commands. QICPTL;;Save,* ,;;editor,4O>;;put 1,>PBATECO;;byte rtn,HQICPTH;;for echo,RO>;;of batch,\PBATECO;;commands.fQ>;;New E:,pP;;GET addr.,zQ>;;-1 in new,P;;E: table.%INDEX;;New E:,Q>;;table,PHATABS8;;address,3;;in device,Q>;;handler,PHATABS8;;table.%>;;Copy, COPYBATQBATCHER8;;code to,P8;;its pg. 6,3;;residence.)>BATLEN;;Len. must,HCOPYBAT;;be < 256.Q> ;;Row and,PROWCRS;;column,$Q>;;to put,.PCOLCRS;;message.8$>;;E: IOCB.BQ>INMSG;;Msg-low.LPICBAL;;Addr.low.VQ>INMSG;;Msg-hi.`PICBAH;;Addr.hi.jQ>;;Length ,tPICBLL;;of msg.~A;;Zero hi,PICBLH;;len.byte.Q> ;;Put data,PICCOM;;I/O cmd. CIOV;;Send msg.$>P;;File #5,Q> ;;close,PICCOM9;;command, CIOV;;to init,%>;;BIOCB. INITBIOCBQIOCB58;;Copy #5,PBIOCB8;;closed, 1;;status, IINITBIOCB;;to BIOCB.QWARMST;;Skip if,HWAITABIT;;not boot.($>P;;Bat. iocb2Q>AUTO;;Autorun,<PICBAL9;;script,FQ>AUTO;;file,PPICBAH9;;name.ZQ>;;Enough,dPICBLH9;;length.nQ>;;Input,xPICAX19;;mode I/O.Q>;;Open,PICCOM9;;command. CIOV;;try open. BATSWAP;;BATSAVE. WAITABITQCLOCK3;;Wait for,R>p;;a while,DWAITABIT;;to pass. CLEARS;;Clr scrn. ,;;Clean, :;;return. CLEARSQ>;;Zero the,>;;iocb and,PICBAL;;address,PICBAH;;and,"PICBLL;;length,,PICBLH;;for 1,6Q> ;;byte put,@PICCOM;;command,JQ>};;from A,T CIOV;;register.^ :;;Return.hX;rINMSG AA|AUTO AD:AUTORUN.BATA X;X; BATCHER"X; E: device GET CHAR rtn.#X; (non-relocatable labels,"X; set as pg. 6 offsets.)X; BATCHERQBIOCB;;active BAT?GBATEDI;;No-real E:X;BATGET BATCHERQ>;;Set BIOCB,PICBALB;;up for 1,PICBAHB;;byte GET,PICBLLB;;to be,&PICBLHB;;returned,0%>;;in A reg.: BATCIO;;Real E:,DGBATEDI;;if error.NQICAX6Z;;saved byteXBATECO ;;CRT echo.bQICAX6Z;;restore.l ,;;data,vDBATXIT;;return.BATX9BQ>;;return EOLBATXIT$>;;E: IOCB.%>;;Return,BATRTS:;;status okX;X; Allow real E: input, X; Watch for / commands.X;BATEDI$>;;E: IOCB%>;;Stat.o.kBATMON ;;User key.)>;;Break?FBATRTS;;Yes-exit.R>;;EOL ? HBATRTS;;No-exit.%>;;Save EOL, P@ICBALZ7;;for CIO.*QICBAL;;Caller,4PINBUFF;;buff ptr,>PICBALB;;to pg.0,HQICBAH;;and BIOCBRPINBUFF;;in case,\PICBAHB;;needed.fQ@INBUFF7;;1ST byte,pR> /;' ;is BATCH?zHBATX9B;;No-returnX;X; Start a BATCH scriptX;BATGO%> ;;close, BATCIO;;BIOCB.%>;;Test if,Q> :;' ;D:, or,R@INBUFF7;;Dn:,FBATINC;;format, 3;;was,R@INBUFF7;;keyed.FBATINC;;Yes-open.QICBLL;;Only a, ;;;name was, SICBLLZ;;keyed, ?;;so we,$ BATL1Q@INBUFF7;;must,. 3;;shift,8 P@INBUFF7;;right,B 1;;overlay,L 1;;slash,V HBATL1;;with D,` Q> D;' ;and,j P@INBUFF7;;insert a,t 3;;colon,~ Q> :;' ;after it, P@INBUFF7;;then go, HBATOPN;;open file BATINC#ICBALB;;Skip, HBATOPN;;the / to, #ICBAHB;;filename. BATOPNQ>;;Set up, PICBLHB;;BIOCB, %>;;for Open, 'ICAX1B;;input, 1;;cmd and,  BATCIO;;try open. GBATX9B;;failed. QINBUFF;;Tell CIO, PICBALZ;;that the, QINBUFF;;editor, PICBAHZ;;buffer,( QICBLL;;is empty,2 PICBLLZ;;ignoring,< QICBLH;;/ cmd,toF PICBLHZ;;replace,P !BATGET;;with BAT.Z X;d BATCIO BATCHERn 'ICCOMB;;Save cmd.x  BATSWAP;;Swap I/O. $>P;;BAT IOCB.  CIOV;;Do I/O. PBATZIO;;Save data IBATCIX;;I/O o.k. C;;Status, 5;;saved. Q> ;;Close #5, PICCOM9;;restore,  CIOV;;status, 7;;and fall, ?;;thru to, BATCIX ;;BATSWAP. BATSWAP BATCHER C;;Save Y, 5;;reg. Set, %>;;copy len." BATSWLQZIOCB8;;ZIOCB,, 5;;byte save6 QBATZIO8;;copy old,@ PZIOCB8;;to ZIOCB.J 7;;Get ZIO,T PBATZIO8;;save it.^ QIOCB58;;File #5,h 5;;saved.r QBIOCB8;;BAT IOCB,| PIOCB58;;to #5. 7;;Old #5, PBIOCB8;;saved. 1;;loop for, IBATSWL;;16 bytes. 7;;Restore, ?;;Y reg, :;;and retn. X; X; Private IOCB X; BIOCB BATCHER ICCOMBBIOCB;;cmd. ICBALBBIOCB;;buffer, ICBAHBBIOCB;;address. ICBLLBBIOCB;;buffer, ICBLHBBIOCB ;;length.& ICAX1BBIOCB ;;I/O mode0 #X; BATCHER,: BATLEN BATCHER;;lengthD