~ RSX88A.BCKܰ RSX88A.BCK%BACK/INTER/LO [...] [-]RSX88A.BCK/SAV PREP wD-V7.1 _PREP::  _PREP$DKB0: V6.2 ~ w*[RSX88A]265020.DIR;1+,'./ 4-'0123 KPWO56j+7dj+89GHJI LETTER.TXT 'MCE.MAC!' MCEBLD.CMD"' MCEREL.DOC#'*[RSX88A.265020]LETTER.TXT;1+, './ 4E-'0123KPWO56L>;7Ԝ@89GHJ/Hans (J.H.) Hamakers Rotterdam, may 17, 1988Asea Brown Boveri b.v. Dept. VUA P.O. box 3013000 AH RotterdamThe NetherlandsTel : + 31 10 407863141200 bd Modem, account DECUS/DECUS : + 31 10 4078528 Dear Alan,( Sorry about my bad english )EOn this floppy I send you the latest version of MCE wich has a lot of2new features since the version I gave you in Rome.=It has become a generaly used program, even DEC TSC's use it.@I hope you will forward this version to the next symposium tape.=It might be a good idea to put it on the RSX BBS machine too.:Hope to hear from you. ( How are the Rome Photographs ? ). Hans Hamakers.*[RSX88A.265020]MCE.MAC;1+,!'./ 4N*-'0123KPWO569>;7B՜@89GHJr' .TITLE MCE - CLI-Commandline-Editor .IDENT -V4.2d- ;JHB03 .ENABLE LC;; Copyright (c) 1988;; J.H. Hamakers,; ASEA Brown Boveri b.v.2; P.O.Box 301 3000 AH Rotterdam, The Netherlands; Phone : +31 - 10 - 4078631;; All rights reserved;2; This software may be copied and distributed ONLY1; on a non profit basis and with the inclusion of ; the above copyright statement.;/; PLEASE CONTACT ME FOR PROBLEMS OR SUGGESTIONS;=; +---------------------------------------------------+7; | See MCEREL.DOC for information about this release |=; +---------------------------------------------------+;* .SBTTL MCE - Macros, Constants, Variables4 .MCALL QIO$S ,QIOW$S ,EXIT$S ,SPWN$S ,STSE$ ,STSE$S+ .MCALL MRKT$S ,SDIR$S ,SREX$S ,WTSE$ ,DIR$ .IF DF COMPND ;JHB03 ;JHB03 .MCALL WTSE$S ;JHB03 ;JHB03 .ENDC ;COMPND ;JHB03 .IF DF TMOTIM .MCALL ASTX$S ,GLUN$S .ENDC ;TMOTIM .IF DF CLISUP .MCALL GCII$S .ENDC ;CLISUP .NLIST BEX;; Local symbol definitions;3BUFSIZ = 76. ; (this is max for >SET /BUF=TI:80.);BELL = 7 BKSP = 10LF = 12CR = 15ESC = 33 BLNK = 40 DEL = 177-SS3 = 217 ; SS3 8-bit control character;TI = 1 ; TI: LUNINI = 2 ; MCEINI.xxx LUNEFN = 1 ; Eventflag .IF DF TMOTIM&STATUS"EFNAST = 2 ; Eventflag in TIMAST .ENDC ;TMOTIM&STATUS .IIF NDF MAXFIF MAXFIF = 23. .IIF NDF MINCHR MINCHR = 0 .IF DF FILE .MCALL CSI$ .MCALL DIR$,GMCR$ .MCALL CSI$1,CSI$2> .MCALL FSRSZ$,FDBDF$,FDRC$A,FDOP$A,OPEN$R,GET$S,CLOSE$,NMBLK$* CSI$ ; Define CSI control block offsets FSRSZ$ 1 .PSECT IDATA,D,RWASTOPIO: STSE$ EFN ; Normaly we STOP for I/O. When MCE is aborted=WAITIO: WTSE$ ; we WAIT for I/O. We use this directive here2 ; to copy the DIC-code to STOPIO (See EXAST:)2FDBIN: FDBDF$ ; FDB for initialization FDRC$A ,NEW,BUFSIZ FDOP$A INI,FDSPT,DFNB,FO.RD*DEV: .ASCII /LB:/ ; Device Name DEVL = .-DEVDIR: .IF DF A$SV .ASCII /[2,2]/ ; Directory .IFF ;A$SV .ASCII /[1,2]/ ; Directory .ENDC ;A$SV DIRL = .-DIR .EVEN;!; Default startup file name block;7; Default file name (if no CLI support) is 'MCEINI.CMD'B; default device is SY: (but superimposed by the first LB: in DSPT>; SY: in the DFNB will be effective for files specified in the@; invoking MCR commandline. Specifying 'MCE XXX' thus results in; file name 'SY0:XXX.CMD'F; Note, that the file-type in DFNB will be overwritten by the CLI name;DFNB: NMBLK$ MCEINI,CMD,0,SY,08DFTYP = DFNB+N.FTYP ; Define address of RAD-50 filetype;*FDSPT: DEVL,DEV ; File Descriptor: Device+FDIR: DIRL,DIR ; Directory string at begin, 0 ,0 ; No File name (DFNB will be used);; CSI$ Control block; CSIBLK: CSI$ .BLKB C.SIZE .EVEN .ENDC ;FILEPOOLTX: .ASCII /MCE -- Pool:/POOLDT: .BLKB 18. .EVEN!POOL: 0,0,0 ; Pool information MAXF: MAXFIF ; Fifo size*MINC: MINCHR ; Commandlength to be saved .PSECT PDATA,D,RO;; Text Formats;=STRTXT: .ASCII \MCE -- CLI-Commandline-Editor V4.2d\ ;JHB03; .IF DF A$SV .ASCII \/ASV\ .ENDC ;A$SV .IF DF VT2XX .ASCII \/VT2\ .ENDC ;VT2XX .IF DF TDV2XX .ASCII \/TDV\ .ENDC ;TDV2XX .ASCIZ ENDTXT: .ASCII EXITXT: .ASCIZ /MCE -- Exit/CRET:KNOPOOL: .ASCIZ /MCE -- Pool exhausted - Install MCE with INC/<ERRTXT: .ASCIZ /MCE -- Internal command error/6TOOLON: .ASCIZ /MCE -- Command too long/ .IF DF FILEDFLSTXT: .ASCIZ /MCE -- Filespecification syntax error/5FILTXT: .ASCIZ /MCE -- File open error/ .ENDC ;FILE .IF DF TMOTIMBYETXT: .ASCIZ /BYE/ .ENDC ;TMOTIM .IF DF VT2XX,VT2ESQ: .ASCII /[23~/ ; VT2XX PictureVT2ESL = .-VT2ESQ ; .ENDC ;VT2XXHLPTXT: .IF DF A$SV .ASCIZ \HELP ASV MCE\ .IFF ;A$SV .IF DF HLPNEW .ASCIZ \HELP /MCE\ .IFF ;HLPNEW .ASCIZ \HELP MCE\ .ENDC ;HLPNEW .ENDC ;A$SV .IF DF EDTAPLTXT: .ASCII /=/NUMTXT: .ASCII />/EDTTXT: .IF DF A$SV .ASCIZ \HELP ASV MCE KEYPAD\ .IFF ;A$SV .IF DF HLPNEW .ASCIZ \HELP /MCE KEYPAD\ .IFF ;HLPNEW .ASCIZ \HELP MCE KEYPAD\ .ENDC ;HLPNEW .ENDC ;A$SV .ENDC ;EDT .EVEN;=; internal MCE command dispatch table (see subroutine Intern);INTCMD: .ASCII /EXIT/ ; Task exit EXIT1 .ASCII /PURG/ ; Delete all command translations ICPURG. .ASCII /RING/ ; FIFO is a ringbuffer ICRING( .ASCII /LIST/ ; FIFO is a list ICLIST( .ASCII /FREE/ ; Free poolspace ICFREE& .ASCII /FISZ/ ; Fifo maximum ICMAXF* .ASCII /CMSZ/ ; Minimum cmd size ICMINC$ .ASCII /CLEA/ ; Clear fifo ICCLEA! .ASCII /VERS/ ; Version ICVERS6 .ASCII /SVIN/ ; Save Internal commands on/of ICSVIN1 .ASCII /SVOL/ ; Save Old commands on/of ICSVOL .IF DF STATUS+ .ASCII /STAT/ ; Status line on/of ICSTAT .ENDC ;STATUS .IF DF FILE9 .ASCII /READ/ ; Read definition file 'MCE READ filespc' ICREAD. .ASCII /CHAI/ ; Chain to other file (= READ) ICREAD: .ASCII /REPL/ ; Replace translations by new file ICREPL .ENDC ;FILE .IF DF EDT .ASCII /KEYP/ ICKEYP .ENDC ;EDT 0 ; End of table marker; .PSECT IDATA;; data;;; FIFO Buffer descriptors;; Entry offsets :;#;FNXT = 0 ; Pointer to next EntryFLEN = 2 ; Length of entry*FTXT = 4 ; Text, terminated by binary 0%FIFO: 0, FIFO ; Header FIFO Buffer:,FIFCNT: .BYTE 0 ; Number of entries in FIFOFIFPOI: .BYTE 0 ; Entry number6FIFPTR: 0 ; Ptr to current Entry (for UP, DOWN keys);(; Commandbuffer, same entries as in FIFO;5CMDB: 0, CMDB ; Header command definitions;&FREE: 0, 0 ; Free memory listhead;!; Terminal characteristics buffer;SFGMCB:$ANI: .BYTE TC.ANI,0 ; ANSII Terminal&HLD: .BYTE TC.HLD,0 ; Hold screen mode .IF DF VT2XX!TDV2XX'TTP: .BYTE TC.TTP,0 ; Get terminal type .ENDC ;VT2XX!TDV2XXSFGMCL = .-SFGMCB%IOSTAT: .BLKW 2 ; I/O Statusblock;7PROMLF: DEFPR ; Point to default prompt with 5PROMPT: DEFPR+1 ; Point to default prompt with ; ; Buffers; .IF DF STATUSSTATX1: .ASCII "D" .ASCII "M"STATX2: .ASCII "7" .ASCII "[1;23r" .ASCII "[24;1H" .ASCII "[7m""STATX3: .ASCII "MCE-V4.2c FIFO:"STALIR: .ASCII "list/" .ASCII "xx/" .ASCII "xx/" .ASCII "xx CMSZ:"STACMD: .ASCII "xx KEYP:"STAKEY: .ASCII "xxx SVINT:"STASVI: .ASCII "xxx SVOLD:"STASVR: .ASCII "xxx TMO:"STATMO: .ASCII "no "STALN3=.-STATX3 .ASCII "[K" .ASCII "[0m" .ASCII "8"STALN2=.-STATX2STALN1=.-STATX1STACLR: .ASCII "7" .ASCII "[1;24r" .ASCII "8" .ASCII "[J"STACLN=.-STACLR .ENDC ;STATUS .BLKB 16. ; Prompt buffer) .ASCII '/' ; Hold screen esc seq.5DEFPR: .ASCII ; Default prompt with new line& .ASCII \+>\ ; without new lineDEFPRL=.-DEFPR .EVEN&NEW: ; Current Buffer, word aligned) .ASCII '[' ; Hold screen esc seq. .REPT BUFSIZ+4-2 ;* .ASCII ; Must be blanked .ENDR ; .EVEN;SAVB: .BLKB BUFSIZ+4 ; Save Buffer (start on even boundary)%RECB: .BLKB BUFSIZ+4 ; Recall Buffer )BS: .REPT BUFSIZ+2 ; Backspace buffer for' .ASCII ; cursor positioning .ENDR .EVEN .IF DF FILE;'; MCR command line directive and buffer; GMCR: GMCR$MCRLIN=GMCR+G.MCRB .ENDC ;FILE .IF DF CLISUP .IF DF FILE;/; IF DF FILE : GCLI buffer overlaps GMCR buffer;$$$=. ; Save ALC.=GMCR ; Map GMCR buffer .IFTF ;FILE;$; Buffer to receive CLI information:; GCISIZ = 50. GCLI: .BLKB GCISIZ ; For GCII$S .IFT ;FILE.=$$$ ; Restore ALC .ENDC ;FILE$TASK: .RAD50 \CLI...\ ; Current CLI .IFF ;CLISUPy .PSECT PDATA=TASK: .RAD50 \MCR...\ ; Task for Systems without CLI-Support3 .PSECT IDATAa .ENDC ;CLISUPCODE: 0 ; QIO-FunctioncodeADR: 0 ; Buffer-address#LEN: 0 ; Buffer-lengh (to output) WAITFL: 0 ; Event flag;p CHAR: .BYTE 0 ; Input-character;; Flagsb; *OVSTMO: .BYTE 0 ; If ne : Overstrike mode>NOLOAD: .BYTE 0 ; If ne : Don't load Command in Commandbuffer0NOEXEC: .BYTE 0 ; If ne : Don't execute Command-RING: .BYTE 0 ; If ne : FIFO is a ringbuffer 6SINFLG: .BYTE 1 ; If ne : Internal commands are saved1SOLFLG: .BYTE 1 ; If ne : Old commands are saved3OLDFLG: .BYTE 0 ; If ne : Old command , not editedS .IF DF STATUS3STAFLG: .BYTE 1 ; If ne : Status line is displayedH .ENDC ;STATUS .IF DF FILE%FILINP: .BYTE 0 ; If ne : File InputN7FILINI: .BYTE 0 ; If ne : Startup file being processedX?FILREX: .BYTE 0 ; If ne : MCE Read or MCE Replace being ;JHA99 ; processed ;JHA99 .ENDC ;FILE .IF DF EDTs*EDTFLG: .BYTE 0 ; If ne : EDT Mode active(GOLDFL: .BYTE 0 ; If ne : "GOLD" pushed .ENDC ;EDT .IF DF TMOTIMTTN: .BYTE 0 ; Terminal Number +TMOCNT: .BYTE TMOTIM ; Counter for timeoutT .ENDC ;TMOTIM .EVENx,CDSC: 0, 0 ; Descriptor of whole remainder!PDSC: ; Descriptor of P0 .. P8i .REPT 9. 0, 0 .ENDR+CFETCH: .BYTE 0 ; Flag if Paramter fetchedI'OVMSG: .BYTE 0 ; Send Overflow MessageE7CTSTAR: .BYTE 0 ; Find command with "*" enabled (ne 0)=TMPFLG: .BYTE 0 ; Temporary Flag: "*" encountered in compare$ .EVEN 9CLL = .-CDSC ; Region to be cleared from CDSCC D! .SBTTL MCE - DSPTAB -- Jumptabler .PSECT PDATAI; ;JUMP TABLEb;e3; Here is the dispatch table for control charactersrA; The table contains the addresses of the action routines for the; different codes.=; When bit 0 of an address is set, the corresponding ctrl-keyN*; may not be superimposed by a definition.; DSPTAB:c INSERT+1 ; SINGLE CHR.: CHOVER ; CTRL/A UP ; CTRL/B  CLRBUF ; CTRL/CF LEFT ; CTRL/DI ENDLIN ; CTRL/Eo RIGHT ; CTRL/F loop ; CTRL/G BEGLIN ; BS (CTRL/H) MOVWRD ; HT (CTRL/I) DELEW ; LF (CTRL/J)  DELRL ; CTRL/K loop ; CTRL/L EXEC+1 ; CR (CTRL/M) SAVE ; CTRL/Ne8 ESCAP+1 ; CTRL/O = SS3 8-bit ctrl. char. in 7-bit mode loop ; CTRL/Pp loop+1 ; CTRL/Q (XON)g RETYPE ; CTRL/Rp loop+1 ; CTRL/S (XOFF) DELAY ; CTRL/T DELEL ; CTRL/U DELRC ; CTRL/V DELRW ; CTRL/W loop ; CTRL/Xt EXIT ; CTRL/Ye loop ; CTRL/Z$ ESCAP+1 ; ESC (CTRL/[)  loop ; CTRL/\ (CTRL/|) loop ; CTRL/] (CTRL/}) loop ; CTRL/^ (CTRL/~) HELP ; CTRL/?e D .IF DF EDT ) .SBTTL MCE - EDTTAB -- EDT-Key JumptableF; EDTTAB:B;l1; normal gold esc. sequ key EDT GOLD EDTS- DELRC, DELRC ; ESC O l , DELCHR / UNDLCHRL- DELRW, DELRW ; ESC O m - DELWRD / UNDLWRD* loop, loop ; ESC O n . SELECT / RESET loop, loop ; ESC O o . BEGLIN, CLRBUF ; ESC O p 0 BLINE / OPENLINE, MOVWRD, MOVWRD ; ESC O q 1 WORD / CHNGCAS* ENDLIN, DELRL ; ESC O r 2 EOL / DELEOL' loop, loop ; ESC O s 3 CHAR / SPECINI* loop, loop ; ESC O t 4 ADVANCE / BOTTOM& loop, loop ; ESC O u 5 BACKUP / TOP& loop, loop ; ESC O v 6 CUT / PASTE, TRANSL, TRANSL ; ESC O w 7 PAGE / COMMAND, PRINTC, SHVERS ; ESC O x 8 SECTION / FILL. PRINTF, SHFREE ; ESC O y 9 APPEND / REPLACE+ GOLD, GOLD ; ESC O P PF1 GOLD / GOLDC/ EDTHLP, EDTHLP ; ESC O Q PF2 HELP / HELP2 RECALL, RECALL ; ESC O R PF3 FINDNXT / FIND1 DELRL, DELRL ; ESC O S PF4 DELLIN / UNDLIN .ENDC ;EDTa n .IF DF VT2XXB' .SBTTL MCE - VT2TAB -- VT2XX Key tablep;e; Entry:;); word 1 : 2 ascii char. from esc-seq. $; word 2 : action routine address$; word 3 : 2 ascii char. from key;2 .MACRO KEYVT2,ESC,ACT,KEY .ASCII /ESC/. .IF NB ACT ACT .IFF LOOP  .ENDC .ASCII /KEY/  .ENDM;VT2TAB:S! KEYVT2 <1 > ,RECALL ,<$F> ; FindS" KEYVT2 <2 > , ,<$I> ; Insert here KEYVT2 <3 > , ,<$R> ; Remove; KEYVT2 <4 > , ,<$S> ; SelectD# KEYVT2 <5 > , ,<$P> ; Prev. ScreenU" KEYVT2 <6 > , ,<$N> ; Next Screen;. KEYVT2 <17> , ,<6 > ; F6L KEYVT2 <18> , ,<7 > ; F7  KEYVT2 <19> , ,<8 > ; F8P KEYVT2 <20> , ,<9 > ; F9K KEYVT2 <21> , ,<10> ; F10$ KEYVT2 <23> ,VT2ESC ,<11> ; F11 ESC# KEYVT2 <24> ,BEGLIN ,<12> ; F12 BS" KEYVT2 <25> ,DELEW ,<13> ; F13 LF KEYVT2 <26> , ,<14> ; F14# KEYVT2 <28> ,HELP ,<15> ; F15 HELPI# KEYVT2 <29> ,EXECNW ,<16> ; F16 DOI KEYVT2 <31> , ,<17> ; F17 KEYVT2 <32> , ,<18> ; F18 KEYVT2 <33> , ,<19> ; F19 KEYVT2 <34> , ,<20> ; F20;.VT2LEN =.-VT2TAB .ENDC ;VT2XXi .IF DF TDV2XXTDVTAB: ; Action routine Key;I loop ; F1I loop ; F2 loop ; F3x loop ; F4 loop ; F5S loop ; F6 loop ; F7i .ENDC ;TDV2XX ! .SBTTL MCE - START -- INIT-CodeE;; Register usage; ; R0 Scratch Pointer.; R1 Cursor in NEW ,; R2 First free byte in NEW (End of Text); R3 Scratch ; R4 Scratchd; R5 Scratch CounterF;  .PSECT CODE,I,RO ;ASTART:" SREX$S #EXAST ; Specify exit ast* MOV #FREE,R0 ; R0 => Free memory listhead& CALL $INIDM ; Initialize Free Memory CALL TERM ; Get terminal infoC .IF DF TMOTIMh3 MOV #NEW+1&^C1,R0 ; Temporary buffer, word alignede, GLUN$S #TI,R0 ; Get terminal number MOVB 2(R0),TTN ; And save itS" CALL MARK ; Marktime for timeout .ENDC ;TMOTIM .IF NDF SILENT. MOV #STRTXT,R0 ; Print CALL IOMSG ; Startup message .ENDC ;SILENT .IF DF FILE " CALL FILOP ; Open MCEINI file .ENDC ;FILE1 .SBTTL MCE - RESTAR -- Get next Line, Main-LoopO;,RESTAR:  CLRB NOEXEC ; Always execute .IF DF EDT  CLRB GOLDFL ; Clear "GOLD" .ENDC ;EDTm CALL TERM ; Get terminal infoE .IF DF FILE TSTB FILINP ; File Input ? BEQ 10$ ; No : => 10$, CALL FILREA ; Goto EXEC1 if something read#10$: ; then come back to RESTARm .ENDC ;FILE MOV #IO.ATT,CODE ; Attachf CALL IO ; the terminalE .IF DF EDTI" TSTB EDTFLG ; EDT Keys enabled ? BEQ 20$ ; No : => 20$! MOV #APLTXT,ADR ; Numeric keypad  MOV #2,LEN ; Length. CALL IOW ; Write20$: .ENDC ;EDT;TC; Set our task default directory string to that of the terminal. WefC; need to do that since the last command could have been a SET /DEFpB; RSX11M does nothing with this directive so it doesn't have to be; conditionalized ;C. SDIR$S #SD.TI ; Set task DDS to terminal DDS;r; S .IF DF STATUS! CALL PRSTAT ; Print status lineI JMP PRPROM ; => Print prompt;I;i- .SBTTL MCE - PRSTAT -- Print the status linex;MPRSTAT:C MOV #STATX1,ADR ; Print MOV #STALN1,LEN ; The BR PRSTA2 ; StatuslinePRSTA1:S MOV #STATX2,ADR ; Print MOV #STALN2,LEN ; The BR PRSTA2 ; status linePRSTA2:E" CALL STAFIL ; Fill status record*;;;; TSTB ANI+1 ; Ansii Screen ? ;JHA99&;;;; BEQ 10$ ; No : => 10$ ;JHA99# TSTB STAFLG ; Statusline wanted ?C BEQ 10$ ; No : => 10$ CALLR IOW ; Statusline10$: RETURN ;E;'( .SBTTL MCE - STAFIL -- Fill status line;<STAFIL:f;t MOV R1,-(SP) ; Save R1. MOV R2,-(SP) ; Save R2u MOV #STALIR,R0 ; +D TSTB RING ;E BEQ 10$ ;n MOVB #'r,(R0)+ ;n MOVB #'i,(R0)+ ;' MOVB #'n,(R0)+ ;c MOVB #'g,(R0)+ ; Ring or List BR 20$ ;10$: MOVB #'l,(R0)+ ;d MOVB #'i,(R0)+ ;  MOVB #'s,(R0)+ ;B MOVB #'t,(R0)+ ; -u20$: TSTB (R0)+ ; + MOV MAXF,R1 ; Maxfif CALL CONV ; -r TSTB (R0)+ ; + MOVB FIFCNT,R1 ; Fifcnt CALL CONV ; -  TSTB (R0)+ ; + MOVB FIFPOI,R1 ; Fifpoi CALL CONV ; - MOV #STACMD,R0 ; +e MOV MINC,R1 ; Minchr CALL CONV ; -C MOV #STAKEY,R0 ; +. MOV #EDTFLG,R1 ; Keypad CALL OFFON ; - MOV #STASVI,R0 ; +:" MOV #SINFLG,R1 ; Save internals CALL OFFON ; - MOV #STASVR,R0 ; +a MOV #SOLFLG,R1 ; Save old CALL OFFON ; - .IF DF TMOTIM MOV #STATMO,R0 ; +5# MOVB TMOCNT,R1 ; Time-out count MOV #15012,R2 ; CALL $CBTA ; - .ENDC ;TMOTIM MOV (SP)+,R2 ; Restore R2 MOV (SP)+,R1 ; Restore R1 RETURN ; ;TOFFON:;R/; Depending on flag in R1 : Fill with ON or OFFp;3 MOVB #'o,(R0)+ ; +. TSTB (R1) ; BEQ 10$ ;I MOVB #'n,(R0)+ ;: MOVB #' ,(R0)+ ;s RETURN010$: MOVB #'f,(R0)+ ;p MOVB #'f,(R0)+ ; RETURN ; -;R;BCONV:; MOV #11012,R2 ; Convert 2 chars CALLR $CBTA ; Converte .ENDC ;STATUS O( .SBTTL MCE - PRPROM -- Print the prompt;nPRPROM:u# MOV #IO.CCO,CODE ; Cancel t- MOV PROMLF,ADR ; Start of prompt buffer ( MOV #DEFPRL,LEN ; Assume default prompt .IF DF CLISUPs# CALL GETCLI ; Get CLI informationO BCC 10$ ; Success : => 10$  MOV #^RMCR,TASK ; MCR... only( JMP 60$ ; Continue with default prompt;T10$:; ; Copy CLI prompt ;p3 MOV #GCLI+G.CIDP,R0 ; R0 => CLI Prompt informationB5 MOVB (R0)+,R4 ; Get length, advance to prompt string:% ADD R4,R0 ; Point behind CLI prompt ; MOV #NEW+2,R3 ; Point behind prompt buffer (ROOM for ESC[) 1 MOVB #'[,-(R3) ; Insert '[' ( hold screen mode )D2 MOVB #ESC,-(R3) ; Insert ESC ( hold screen mode ) CLR -(SP) ; Reserve space"20$:! MOVB -(R0),(SP) ; Save characterM CMPB (SP),#CR ; ?e BEQ 30$ ; Yes : => 30$T CMPB (SP),#LF ; ?i BEQ 30$ ; Yes : => 30$! MOVB (SP),-(R3) ; Copy charactero30$:% SOB R4,20$ ; Next characterf TST (SP)+ ; Flush space .IF DF EDTF! TSTB EDTFLG ; EDT mode active ?c BEQ 40$ ; No : => 40$ .IF DF STATUS TSTB STAFLG ; Status line ?n BNE 40$ ; Yes : => 40$ .ENDC ;STATUS) MOVB #':,-(R3) ; Display EDT mode active40$: .ENDC ;EDTC$ MOVB #'+,-(R3) ; Assume insert mode BITB #1,OVSTMO ; Overstrike ? BEQ 50$ ; No : => 50$ MOVB #'-,(R3) ; Overstrike50$: MOVB #CR,-(R3) ; Insert r MOVB #LF,-(R3) ; Insert t2 MOVB #'/,-1(R3) ; Insert '/' ( hold screen mode )5 MOVB #ESC,-2(R3) ; Insert ( hold screen mode )t* MOV #NEW,LEN ; Point behind prompt buffer SUB R3,LEN ; Lengtho MOV R3,PROMPT ; + MOV R3,PROMLF ; Adjust INC PROMPT ; Pointers/ MOV PROMLF,ADR ; -F60$:! TSTB HLD+1 ; Hold screen mode ?R BEQ 70$ ; No : => 70$4 ADD #4,LEN ; Adjust length for Hold screen escseq. SUB #2,ADR ; Adjust addressL70$: .ENDC ;CLISUP CALL IO ; Output prompt;V3; Clear edit buffer and setup R1 and R2 as pointersa;i! CALL CLRNEW ; Clear edit buffero ;C .SBTTL MCE - LOOP -- Accept next Char. for input and dispatch it ;TLOOP:D MOV #IO.RST!TF.RNE!TF.RAL,CODE ; Accept one chr. # MOV #CHAR,ADR ; 1 Character buffer; MOV #1,LEN ; LengthS CALL IO ; Read 1 charRLOOP00:/ .IF DF TMOTIM - CMPB IOSTAT,#IE.ABO ; IO killed ? (time-out)/ BNE 20$ ; No : => 20$ MOV #BYETXT,R0 ; Assume "BYE"p TSTB TTN ; Are we on TT0: ? # BNE 10$ ; No : => 10$, Spawn BYEL MOV #EXITXT,R0 ; "MCE EXIT"10$: CALL GETBUF ; Copy in NEW  CALL DISPLY ; DisplayR0 JMP EXEC ; Execute "BYE" or "MCE EXIT" command20$: .ENDC ;TMOTIM0 MOVB IOSTAT+1,R4 ; Test for branch table;N?; The following 2 lines test if there is a VT2xx/VT3xx TerminalL0; in 8-Bit Ctrl-Mode on an 8-Bit line that sends1; 'P' - 'S' when pressing 'PF1' - 'PF4'A:; On a 7-Bit line (217) is stripped to (17);o8 CMPB R4,#SS3 ; 'SS3' Control-String ?. BNE 30$ ; No : => 30$2 JMP ESCAP ; Process as 30$:& BIC #177600,R4 ; 7-bit ASCII CMPB R4,#DEL ; Delete ?  BNE 40$ ; No : => 40$ JMP DELEC ; => Delete char. 40$:; BIC #177740,R4 ; IO.RST: all ctrl-char in iostatN MOV R4,R3 ; Copy in R3! ASL R3 ; Word offset ( BIT #1,DSPTAB(R3) ; May be translated ? BEQ 50$ ; Yes : => 50$ ! MOV DSPTAB(R3),R3 ; Take address  BIC #1,R3 ; Clear bit 0w JMP (R3) ; Do action routine50$:;A; Check if to be translatedI;E MOVB #'^,SAVB ; Insert  MOVB R4,SAVB+1 ; key. BISB #100,SAVB+1 ; Make ASCII CMPB SAVB+1,#'_ ; "_" ? BNE 60$ ; No : => 60$ MOVB #'?,SAVB+1 ; Make "?"T60$:! ASL R4 ; Word offset,# ADD #DSPTAB,R4 ; Add table address; MOV #2,PDSC ; P0 Length = 2,PROCESS: MOV #SAVB,PDSC+2 ; P0 Address MOV R2,-(SP) ; Save R2, CALL FNDCMD ; Find cmd MOV (SP)+,R2 ; Restore R2$ BCS 10$ ; No entry found : => 10$ JMP FUNC ; Proccess it10$:) JMP @(R4) ; <== DispatchB ( .SBTTL MCE - BEGLIN -- Begin of line;2BEGLIN:>' CALL SPBACK ; Back space one positionL) BCC BEGLIN ; If CC not yet at the beginK BR LOOP1 ; => LOOP;;YB .SBTTL MCE - CHOVER -- Flip between insert and overstrike mode;>CHOVER:. INCB OVSTMO ; Change mode; MOV PROMLF,R4 ; R4 => PromptT( CMPB (R4)+,(R4)+ ; R4 => Mode character CMPB (R4),#'+ ; "+" ? BEQ 10$ ; Yes : => 10$o MOVB #'+,(R4) ; Insert "+"  BR 20$ ; => 20$D10$: MOVB #'-,(R4) ; Insert "-"N20$: CALL DISPLY ; Rewrite line BR LOOP1 ; => LOOP;;12 .SBTTL MCE - DELEC -- Delete left single char; DELEC:' CALL SPBACK ; Back space one position5 BCS LOOP1 ; Error : => LOOP BR DELCHR ; => DELCHR;E; > .SBTTL MCE - DELEL -- Delete from start of line to cursor;eDELEL:$ CMP R1,#NEW ; At begin of buffer ? BLOS 50$ ; Yes : => 50$ MOV #NEW,R0 ; R0 => NEWM10$: CMP R1,R2 ; EOL ?y BEQ 20$ ; Yes : => 20$U% MOVB (R1)+,(R0)+ ; Shift string leftr BR 10$ ; => 10$ 20$: MOV R0,R2 ; End of textk30$:% CMP R0,#NEW+BUFSIZ ; End of buffer ?F BHIS 40$ ; Yes : => 40$# MOVB #BLNK,(R0)+ ; Fill with blanks BR 30$ ; => 30$E40$: MOV PROMPT,ADR ; +$ MOV R1,LEN ; Rewrite line SUB PROMPT,LEN ; CALL IOW ; - MOV #NEW,LEN ; +$ SUB PROMPT,LEN ; Reposition cursor CALL IO ;D MOV #NEW,R1 ; - CLRB OLDFLG ; No old command50$: BR LOOP1 ; => LOOP;;T2 .SBTTL MCE - DELEW -- Delete left single word;CDELEW:$ CMP R1,#NEW ; At begin of buffer ? BLOS LOOP1 ; Yes : => LOOPA$ MOV R1,-(SP) ; Save cursor position10$: DEC R1 ; Cursor left$ CMP R1,#NEW ; At begin of buffer ? BLOS 30$ ; Yes : => 30$# MOVB -1(R1),R0 ; Get previous charP CMPB R0,#BLNK ; Space ? BNE 20$ ; No : => 20$C+ CMPB R0,(R1) ; Was previous one a space ?$ BEQ 10$ ; Yes : => 10$, delete it20$: CALL SRWORD ; Search worde BCC 10$ ; i30$:, MOV (SP)+,R0 ; R0 = Initial cursor position( MOV R1,-(SP) ; Save new cursor position BR DELWRD ; => Delwrd ;dLOOP1: JMP LOOP ; => LOOP;I3 .SBTTL MCE - DELRC -- Delete right single char ;TDELRC: CMP R1,R2 ; At EOL ? BHIS LOOP1 ; Yes : => LOOPnDELCHR: MOV R1,R0 ; R0 => Cursor10$:% MOVB 1(R0),(R0)+ ; Shift string leftV CMP R0,R2 ; At EOL ? BLOS 10$ ; No : => 10$  CALL UPDATE ; Rewrite line DEC R2 ; End of text CLRB OLDFLG ; No old command BR LOOP1 ; => LOOP;n;4 .SBTTL MCE - DELRL -- Delete from cursor to eol;NDELRL: MOV R1,R0 ; R0 => Cursor10$: CMP R0,R2 ; EOL ?  BHIS 20$ ; Yes : => 20$ CLRB OLDFLG ; No old command MOVB #BLNK,(R0)+ ; Space BR 10$ ;20$: CALL UPDATE ; Rewrite line MOV R1,R2 ; Cursor at EOLe BR LOOP1 ; => LOOP;R;(3 .SBTTL MCE - DELRW -- Delete right single wordR; DELRW: CMP R1,R2 ; At EOL ? BHIS LOOP1 ; Yes : => LOOP'$ MOV R1,-(SP) ; Save cursor position10$: MOVB (R1)+,R0 ; Get char0 CMPB R0,#BLNK ; Space ? BNE 20$ ; No : => 20$M& CMPB R0,(R1) ; Is next one a space ?$ BEQ 30$ ; Yes : => 30$, delete it20$: CALL SRWORD ; Search word BCS 40$ ; V30$: CMP R1,R2 ; At EOL ? BLO 10$ ; No : => 10$40$:* MOV R1,R0 ; R0 = Current cursor position, MOV (SP),R1 ; R1 = Initial cursor position;CDELWRD:  CMP R0,R2 ; EOL ?  BHIS 10$ ; No : => 10$ MOVB (R0),(R1)+ ; Shift downT- MOVB #BLNK,(R0)+ ; Must be replaced by spaces BR DELWRD ; => DELWRD#10$: MOV R1,R2 ; New end ptr  MOV (SP)+,R1 ; Restore cursor CLRB OLDFLG ; No old commandRETYPE:M CALL DISPLY ; Write buffer BR LOOP1 ; => LOOP;C; . .SBTTL MCE - ENDLIN -- Jump to end of text;tENDLIN:M MOV R1,ADR ; +( MOV R2,LEN ; Write from cursor to end SUB R1,LEN ; BEQ 10$ ;w CALL IOW ; - MOV R2,R1 ; End of text10$: BR LOOP1 ; => LOOP;,;)/ .SBTTL MCE - INSERT -- Insert one character';RINSERT:M" CMP R2,#NEW+BUFSIZ ; Still Room ? BHIS LOOP1 ; No : => LOOP MOV #CHAR,ADR ; + MOV #1,LEN ; Echo character CALL IOW ; - CLRB OLDFLG ; No old command BITB #1,OVSTMO ; Overstrike ? BEQ 10$ ; No : => 10$ MOVB CHAR,(R1)+ ; Overstrikeo CMP R1,R2 ; At end ? BLOS LOOP1 ; No : => LOOP MOV R1,R2 ; Increment end ptr  BR LOOP1 ; => LOOP10$: INC R2 ; No overstrike - shift MOV R2,R0 ; R0 => EOL.20$:& MOVB -(R0),1(R0) ; Shift string right CMP R0,R1 ; At cursor ?I BHI 20$ ; No : => 20$' MOVB CHAR,(R1)+ ; Insert new character CALL UPDATE ; Rewrite line BR LOOP1 ; => LOOP;;D$ .SBTTL MCE - MOVWRD -- Move word;#MOVWRD:; CMP R1,R2 ; At EOL ? BLO 10$ ; No => 10$ MOV #NEW,R1 ; Set at begin BR 40$ ; => 40$10$: MOVB (R1)+,R0 ; Get charo CMPB R0,#BLNK ; Space ? BNE 20$ ; No : => 20$& CMPB R0,(R1) ; Is next one a space ? BEQ 30$ ; Yes : => 30$320$: CALL SRWORD ; Search wordF BCS 40$ ; Q30$: CMP R1,R2 ; At EOL ? BLO 10$ ; No : => 10$40$: CALL DISPLY ;  BR LOOP1 ; => LOOP : .SBTTL MCE - ESCAP -- Escape Sequences / FIFO - Commands;D .ENABL LSB ESCAP: CALL IO ; Read next char MOVB CHAR,R0 ; R0 = Charactert CMPB R0,#'[ ; [ ?s BEQ ESCAP ; Yes : => ESCAP CMPB R0,#'O ; O ?D BEQ ESCAP ; Yes : => ESCAP; CMPB R0,#'? ; ? ?s BEQ ESCAP ; Yes : => ESCAPM" CMPB IOSTAT+1,#ESC ; ? BNE 10$ ; No : => 10$e JMP EXECNW ; Execute no-wait10$: CMPB R0,#'A ; ? BNE 70$ ; No : => 70$);I; UP-ARROW .....;eUP:e" MOV FIFPTR,R5 ; Get Ptr of buffer BNE 20$ ; Defined : => 20$E TST FIFO ; Any entry ? BEQ 90$ ; No : => 90$n MOV FIFO+2,FIFPTR ; TakeM& MOVB FIFCNT,FIFPOI ; newest entry BR 90$ ; => 90$P20$:# MOV #FIFO,R5 ; Find previous entryc30$: MOV (R5),R5 ; Next BNE 40$ ; Got one : => 40$s TSTB RING ; Ringbuffer ? BNE 50$ ; Yes : => 50$  BR 90$ ; => 90$.40$:* CMP (R5),FIFPTR ; Does this point to me ? BNE 30$ ; No : => 30$  DECB FIFPOI ; One older BR 60$ ;50$: CLRB FIFPOI ; None60$: MOV R5,FIFPTR ; Found - load ! BR 90$ ; and displayT;O70$: CMPB R0,#'B ; ? BNE 120$ ; No : => 120$;#; DOWN-ARROW .....;bDOWN::" MOV FIFPTR,R5 ; Get Ptr of buffer BNE 80$ ; Defined : => 80$D TST FIFO ; Any entry at all ?O BEQ 90$ ; No : => 90$ TSTB RING ; Ringbuffer ? BEQ 100$ ; No : => 100$ MOV FIFO,FIFPTR ; Take oldest MOVB #1,FIFPOI ; Oldest BR 90$ ; => 90$V80$:$ TST (R5) ; Goto next buffer if any# BEQ CLRBUF ; No more : => CLRBUFp MOV (R5),FIFPTR ; Nexte INCB FIFPOI ; One newerd90$:" CALL GEFIFO ; Load NEW from FIFO BR 110$ ; => 110$ ;n; CLEAR LINE .....;lCLRBUF:i' CALL CLEAR ; Clear flags and pointersa100$:n! CALL CLRNEW ; Clear edit bufferh$ CALL DISPLY ; and display prompt110$:  .IF DF STATUS! CALL PRSTA1 ; Print status linee .ENDC ;STATUS BR LOOP2 ; => LOOP;S; CLEAR:;3; Clear flags and pointers;  CLRB OLDFLG ; No old command CLR FIFPTR ;  CLRB FIFPOI ; None RETURN ;>;0;120$:  CMPB R0,#'C ; ?C BNE 130$ ; No : => 130$E;$; RIGHT-ARROW .....P;L' .SBTTL MCE - RIGHT -- Cursor right7;0RIGHT: CMP R1,R2 ; End of text ?i BHIS LOOP2 ; Yes : => LOOP3 MOV R1,ADR ; Rewrite MOV #1,LEN ; CharacterR# CALL IOW ; at Cursor position  INC R1 ; Shift cursor right, BR LOOP2 ; => LOOP;#130$:  CMPB R0,#'D ; ? BNE 140$ ; No : => 140$; ; LEFT-ARROW .....;E& .SBTTL MCE - LEFT -- Cursor left; LEFT:.% CALL SPBACK ; Cursor left one space  BR LOOP2 ; => LOOP;6140$:N .IF DF EDTV;,; EDT-KEYS .....;0" TSTB EDTFLG ; EDT Keys enabled ? BEQ 190$ ; No : => 190$ CMPB R0,#'M ; ?  BNE 150$ ; No : => 150$M JMP EXEC ; Execute150$: CMPB R0,#'P ; +e BLO 160$ ; PFx range ?c CMPB R0,#'S ; No : => 160$ BHI 160$ ; -/ ADD #<'z-'l-'P>,R0 ; Relocate to table offset0 BR 170$ ; => 170$(160$:  CMPB R0,#'l ; +# BLO 190$ ; Within Keypad range ?  CMPB R0,#'y ; No : => 180$  BHI 180$ ; - SUB #'l~ RSX88A.BCK!''[RSX88A.265020]MCE.MAC;1N|:,R0 ; MakeI170$:  ASL R0 ; dispatchtableB ASL R0 ; offsetY TSTB GOLDFL ; Gold ? BEQ 180$ ; Yes : => 180$# TST (R0)+ ; Point to "GOLD" entryV CLRB GOLDFL ; Clear "GOLD"180$:;" JMP @EDTTAB(R0) ; Do EDT function190$:o CLRB GOLDFL ; Clear "GOLD" .ENDC ;EDT$;Y; PF-KEYS .....V;' SUB #'P,R0 ; Any PFn key ? BLO VT2KEY ; No : => VT2KEY CMP R0,#'S-'P ; > PF4 ? BHI VT2KEY ; Yes : => VT2KEYP* MOV R0,-(SP) ; Save 0..3 for .. MOV #"PF,SAVB ; "PF' in SAVBUF( ADD #'1,R0 ; Make ascii from PR-number! MOV R0,SAVB+2 ; Insert in SAVBUFO MOV #3,PDSC ; P0 Length MOV #SAVB,PDSC+2 ; P0 Address MOV R2,-(SP) ; Save R2  CALL FNDCMD ; Find cmd MOV (SP)+,R2 ; Restore R2 MOV (SP)+,R0 ; Restore R0# BCC FUNC ; Entry found : => FUNCM;0$ MOV R2,R1 ; Point to end of buffer ASL R0 ; Word offset ADD R0,PC ; Branch BR TRANSL ; = BR RECALL ; , BR PRINTC ; 0'; ; F+; Fall through to PRINTF, adjacency assumed); .DSABL LSBn, .SBTTL MCE - PRINTF -- Print fifo buffer;;PRINTF:R;E; Print fifo .....;S& CALL PRIFIF ; Print whole fifo BR LOOP2 ; => LOOP;+LOOP2: JMP LOOP ; => LOOP; / .SBTTL MCE - PRINTC -- Print command buffer ; PRINTC:R;L; Print CMD Buffer;$ CALL PRICMD ; Print command buffer BR LOOP2 ; => LOOP; ;t+ .SBTTL MCE - RECALL -- Recall a commandb;nRECALL:r;; - RECALL;  CALL RECCMD ; Recall Command .IF DF STATUS" CALL PRSTA1 ; Dispay status line .ENDC ;STATUS BR LOOP2 ; => LOOP; ;>. .SBTTL MCE - TRANSL -- Translate a command;0TRANSL:S;e; Translate ;=% CMP R2,#NEW ; Something in buffer ?n BEQ LOOP2 ; No : => LOOPs$ DECB NOLOAD ; Disable command load SUB #NEW,R2 ; Calculate Length MOV R2,LEN ; Store# CALL CMDCHK ; Command TranslationR MOV LEN,R2 ; Restore R2o ADD #NEW,R2 ; Point> MOV R2,R1 ; to end CALL DISPLY ; Write line# CLRB NOLOAD ; Enable command loadg BR LOOP2 ; => LOOP;P .IF DF EDTL% .SBTTL MCE - GOLD -- "GOLD" KeyR;GOLD:, INCB GOLDFL ; Set "GOLD" flag( BR LOOP2 ; => LOOP;l;V" .SBTTL MCE - SHVERS -- Version; SHVERS:0- MOV #RESTAR,-(SP) ; RESTAR as return addressd CALLR ICVERS ; Display Version;a;$ .SBTTL MCE - SHFREE -- Free pool;MSHFREE:L- MOV #RESTAR,-(SP) ; RESTAR as return addressV" CALLR ICFREE ; Display Free pool;2; & .SBTTL MCE - EDTHLP -- Keypad Help;LEDTHLP:o MOV #EDTTXT,R0 ; EDT helptext BR FUNCEX ; => FUNCEX: .ENDC ;EDT ;r; # .SBTTL MCE - HELP -- Help keyB;O&; or Spawn "HELP MCE";LHELP:D+ MOV #HLPTXT,R0 ; Move HELP MCE into Buffer, BR FUNCEX ; => FUNCEXP;;9 .SBTTL MCE - FUNC -- Exectute function key commands:;MFUNC:) MOV R1,R0 ; Find start of textFUNCEX:;E; Execute command in (R0)P;0 CALL IOCR ; Clear current line CALL GETBUF ; Load new buffert SUB #NEW,R2 ; Calculate length MOV R2,LEN ; Save it CALL DETACH ; Detach terminal$% JMP EXEC3 ; Execute without display0 C* .SBTTL MCE - VT2KEY -- VT2xx Functionkeys;iVT2KEY:o .IF DF VT2XX!TDV2XX CMPB TTP+1,#T.V2XX ; VT2xx ?  BEQ 10$ ; Yes : => 10$) JMP TDVTST ; => TDVTST10$: .ENDC ;VT2XX!TDV2XX .IF DF VT2XX ;D; Check if function key :;2; [n~ n 1..6; ore; [nn~ nn 17..34G;  MOVB CHAR,R0 ; R0 = characterP BIC #177600,R0 ;  CMPB R0,#'1 ; +P BLO EX1 ; 1..6 ?M CMPB R0,#'6 ;m BHI EX1 ; -t SWAB R0 ; Char in highbyte BISB #BLNK,R0 ; Lowbyte = space MOV R0,-(SP) ; Save it; CALL IO ; Next char. MOVB CHAR,R0 ; Take char.E CMPB R0,#'~ ; Tilde ?P BEQ 20$ ; Yes: => 20$ CMPB R0,#'0 ; +  BLO EX2 ; 0..9 ?e CMPB R0,#'9 ; BHI EX2 ; -F CLRB (SP) ; Clear byte BISB R0,(SP) ; Insert in wordR CALL IO ; Next char. CMPB CHAR,#'~ ; Tilde ? BNE EX2 ; No: => EX2o20$: MOV (SP)+,R0 ; Retrieve wordt SWAB R0 ; Adjust# MOV #VT2TAB,R4 ; R4 => VT2XX tables& MOV #VT2LEN/6,R5 ; R5 = Table length30$:$ CMP R0,(R4)+ ; Look for table entry BEQ VT2FN ; Found : => VT2FN CMP (R4)+,(R4)+ ; Next entry- SOB R5,30$ ; Try next=! JMP LOOP ; Not found : => LOOPhEX2: TST (SP)+ ; Flush wordEX1: JMP LOOP00 ; => LOOP00;2;; .SBTTL MCE - VT2FN -- Check if VT2xx key to be translatedr; VT2FN:;O; Check if to be translatedT;  MOVB #'F,SAVB ; Insertd MOVB 2(R4),SAVB+1 ; key MOVB 3(R4),SAVB+2 ; ident$ MOV #3,PDSC ; Assume P0 Length = 3 CMPB SAVB+2,#BLNK ; Blank ? BNE 10$ ; No : => 10$ DEC PDSC ; P0 Length = 210$: JMP PROCESS ; Go via table; ;t2 .SBTTL MCE - VT2ESC -- Check for VT2XX ; 4; Typed VT2xx F11 () key; look for a second one; VT2ESC:? CALL IO ; Next char1 CMPB IOSTAT+1,#ESC ; ?  BNE 20$ ; No : => 20$& MOV #VT2ESQ,R4 ; R4 -> VT2XX ESC-SEQ. MOV #VT2ESL,R5 ; R5 = Length 10$: CALL IO ; Next char. CMPB CHAR,(R4)+ ; Match ? BNE 20$ ; No : => 20$ SOB R5,10$ ; NextE JMP EXECNW ; C20$: .ENDC ;VT2XXD JMP LOOP ; => LOOP S+ .SBTTL MCE - TDVTST -- TDV2230 Key support ;YTDVTST:S .IF DF TDV2XX;S ; O ...?;B CMPB TTP+1,#200 ; TDV2XX ?P BNE 10$ ; No: => 10$t;08; Test character is in the range of "T" - "Z" for F1..F7; MOVB CHAR,R4 ; R4 = CharacterM BIC #177600,R4 ;  SUB #'T,R4 ; Normalize BLT 10$ ; Less then : => 10$A CMPB R4,#'Z-'T ; In range ? BGT 10$ ; No : => 10$;; ; Function ok: convert to string;e MOVB #'F,SAVB ; Insert0 MOVB R4,R0 ; ADD #'1,R0 ; key code MOVB R0,SAVB+1 ; t;B MOV #2,PDSC ; P0 Lengths ASL R4 ; Make word offset# ADD #TDVTAB,R4 ; Add table address; JMP PROCES ; C10$: .ENDC ;TDV2XX JMP LOOP ; => LOOP . .SBTTL MCE - DELAY -- Detach and delay;0DELAY: CALL IOCR ; Print  CALL DETACH ; Detach terminala MRKT$S #EFN,#10.,#2 ; Wait  STSE$S #EFN ; 10 seconds JMP RESTAR ; => RESTAR; ; < .SBTTL MCE - SAVE -- Save command without execution;;SAVE:r INCB NOEXEC ; Don't executed BR EXEC1 ; => EXEC1;;y;t5 .SBTTL MCE - EXECNW -- Execute command no-wait ;g .ENABL LSBQEXECNW:  CLR WAITFL ; Clear EVF BR EXEC1 ; => EXEC1V;1;F- .SBTTL MCE - EXEC -- Execute command5;;EXEC:e MOV #1,WAITFL ; EVF = 1EXEC1: CALL IOCR ; Print  CALL DETACH ; Detach terminalI SUB #NEW,R2 ; Calculate Length MOV R2,LEN ; Store BLE 60$ ; Zero : => 60$;L MOV R2,R1 ; R1 = Counter MOV #NEW,R5 ; R5 => NEW buffer10$: CMPB (R5)+,#BLNK ; A space ?  BNE 20$ ; No : => 20$! SOB R1,10$ ; Look for non space BR 60$ ; Only spaces => 60$ 20$:# TSTB SOLFLG ; Save old commands ?B BNE 30$ ; Yes : => 30$ TSTB OLDFLG ; Old command ?o BNE 40$ ; Yes : => 40$ 30$: CALL LDFIF ; Load into FIFOR40$:' CALL CLEAR ; Clear flags and pointers TSTB NOEXEC ; Execute ?W BNE 60$ ; No : => 60$EXEC2:- CALL CMDCHK ; Check for command Translation- BCS 60$ ; Nothing to executeEXEC3: .IF DF TMOTIM0 CLRB TMOCNT ; Disable timeouts (until next IO) .ENDC ;TMOTIM) CALL INTERN ; Internal command or BYE ? * BCC 60$ ; If C clear: no command for CLI, CALL DOEXEC ; Excute command in buffer NEW TST WAITFL ; Wait ?? BNE 50$ ; Yes : => 50$$ INC WAITFL ; Make flag #1* MRKT$S WAITFL,#20.,#1 ; Allow task to run50$:! STSE$S WAITFL ; Stop until donep60$: JMP RESTAR ; => RESTAR .DSABL LSBF; ;V% .SBTTL MCE - EXAST -- Task exit astF; EXAST:;e; Change STOP to WAIT ;: MOV #IO.KIL,CODE ;; KillE CALL IO ;; pending read% MOV WAITIO,STOPIO ;; Change DIC-code DIR$ #STOPIO ;; Wait for I/O;F;a! .SBTTL MCE - EXIT -- Task exit6;EXIT:0 .IF NDF SILENT' MOV #ENDTXT,R0 ; Exit CALL IOMSG ; message .ENDC ;SILENTEXITS: .IF DF STATUS& TSTB ANI+1 ; Ansii Screen ? ;JHA99" BEQ 10$ ; No : => 10$ :JHA99 MOV #STACLR,ADR ; MOV #STACLN,LEN ; CALL IOW ;10$: ;JHA99o .ENDC ;STATUS CALL DETACH ; Detach terminal= EXIT$S ; Exit ;n;o; .SBTTL MCE - CLFIF -- Clear first entry of FIFO bufferD;BCLFIF: MOV #FIFO,R0 ; This header $ CALL FRENT ; Free entry from queue BCC 10$ ; Empty : => 10$ DECB FIFCNT ; Adjust count10$: RETURN ;:; ;K( .SBTTL MCE - CLRNEW -- Clear Buffer NEW; CLRNEW:V MOV #NEW,R1 ; R1 => NEWe MOV R1,R2 ; R2 => NEWM MOV #BUFSIZ,R5 ; R5 = BUFSIZ10$:& MOVB #BLNK,(R1)+ ; Reset NEW TO BLANK% SOB R5,10$ ; Go back if not the end, MOV R2,R1 ; R1 => NEW# RETURN ; ;A;e' .SBTTL MCE - DETACH -- Detach terminalD; DETACH: .IF DF EDT " TSTB EDTFLG ; EDT Keys enabled ? BEQ 10$ ; No : => 10$! MOV #NUMTXT,ADR ; Numeric keypadn MOV LEN,-(SP) ; Save length MOV #2,LEN ; LengthC CALL IOW ; Write MOV (SP)+,LEN ; Restore length,10$: .ENDC ;EDT0 MOV #IO.DET,CODE ; Detach CALLR IO ; the terminal ;N; * .SBTTL MCE - DISPLY -- Rewrite whole Line; DISPLY:P TSTB ANI+1 ; Ansii Screen ? BNE 20$ ; Yes : => 20$ . CMP ADR,PROMLF ; Just new Line written ? BNE 10$ ; No : => 10$P" CMP LEN,#2 ; Something written ? BLE 20$ ; No : => 20$-10$:$ MOV PROMLF,ADR ; Line with  BR 30$ ; => 30$f20$:% MOV PROMPT,ADR ; Line with 30$: MOV R2,LEN ; Calculate SUB ADR,LEN ; length MOV R0,-(SP) ; Save R0r MOV R2,R0 ; R0 => EOL  MOVB #ESC,(R0)+ ; Appendm" MOVB #'[,(R0)+ ; Clear till EOL$ MOVB #'K,(R0)+ ; Esc sequence TSTB ANI+1 ; Ansii Screen ? BEQ 40$ ; No : => 40$" ADD #3,LEN ; Make Escseq visible40$: CALL IOW ; Write MOVB #BLNK,-(R0) ; +n! MOVB #BLNK,-(R0) ; Flush Escseq  MOVB #BLNK,-(R0) ; -  MOV (SP)+,R0 ; Restore R0 MOV #BS,ADR ; +t MOV R2,LEN ; SUB R1,LEN ; Restore Cursor BEQ 50$ ;l CALLR IO ; -50$: RETURN ;;D;E- .SBTTL MCE - DOEXEC -- Submit command to CLII;YDOEXEC:  .IF DF COMPND ;JHB03m ;JHB03O& MOV #NEW,R0 ; R0 => Buffer ;JHB03, MOV R0,R3 ; Copy start of command ;JHB0310$: ;JHB03e% MOV LEN,R1 ; R1 = Length ;JHB03l' CLR R2 ; Compute length here ;JHB0320$: ;JHB03E+ CMPB (R3)+,#'& ; Ampersand here ? ;JHB03R BEQ 30$ ; If eq yes ;JHB03( INC R2 ; Count command length ;JHB03& SOB R1,20$ ; End of story ? ;JHB03& MOV R2,R1 ; Load new length ;JHB033 BR GVCLI2 ; Process as last command to CLI ;JHB03y30$: ;JHB03o& MOV R2,R1 ; Load new length ;JHB03& INC R2 ; Account for &-sign ;JHB033 SUB R2,LEN ; Compute unused string length ;JHB03L' CALL GVCLI1 ; Go execute it ;JHB03P+ MOV R3,R0 ; Set to unused string ;JHB03e$ BR 10$ ; Go for next part ;JHB03; GVCLI1: ;JHB03$ CMPB (R0),#BLNK ; Blank ? ;JHB03" BNE 10$ ; No : => 10$ ;JHB03 INC R0 ; Next ;JHB03n DEC R1 ; char. ;JHB03 BR GVCLI1 ; Again ;JHB0310$: ;JHB03@ SPWN$S #TASK,,,,,#EFN,,,R0,R1 ; *** EXECUTE COMMAND *** ;JHB03 WTSE$S #EFN ; ;JHB03; ;JHB03 RETURN ; ;JHB03 ;JHB03K .IFF ;COMPND ;JHB03 MOV LEN,R1 ; R1 = Length2 MOV #NEW,R0 ; R0 => Buffer .ENDC ;COMPND ;JHB030GVCLI2: ;JHB03 CMPB (R0),#BLNK ; Blank ? BNE 10$ ; No : => 10$ INC R0 ; Next t DEC R1 ; char. BR GVCLI2 ; Again10$:; SPWN$S #TASK,,,,,WAITFL,,,R0,R1 ; *** EXECUTE COMMAND ***r;e RETURN ;6;R; 3 .SBTTL MCE - FRENT -- Free entry from queue#; -; Header in R0. CC-C clear if it was emptye;BFRENT: JSR R5,.SAVR1 ; Save Regs MOV (R0),R2 ; Get entry if any CLC ; Assume emptyR BEQ 20$ ; None : => 20$* MOV (R2),(R0) ; Remove from head of queue BNE 10$ ; More entries! MOV R0,2(R0) ; This was last oneI10$:( MOV FLEN(R2),R1 ; R1 = Length of entry+ MOV #FREE,R0 ; R0 => Free memory list head.# CALL $RLCB ; Release memory block  SEC ; Success20$: RETURN ; ;r;e@ .SBTTL MCE - GEFIFO -- Get FIFO Buffer, pointed to by FIFPTR;VGEFIFO:6 CLRB OLDFLG ; No old command MOV FIFPTR,R0 ; Get Ptr BNE 10$ ; Defined : => 10$d MOV #FIFPTR,R0 ; Null String; BR 20$ ; => 20$R10$: INCB OLDFLG ; Old commando! ADD #FTXT,R0 ; Get start of text+20$: CALL GETBUF ; Load buffer; CALLR DISPLY ; and display ;T; , .SBTTL MCE - GETBUF -- Load Buffer into NEW;F; R0 points to sourcee;aGETBUF: MOV #NEW,R1 ; R1 => NEWd MOV R1,R2 ; R1 => NEWk MOV #BUFSIZ,R5 ; R5 = BUFSIZ10$: MOVB (R0)+,(R1)+ ; (R0) --> NEW BEQ 30$ ; Zero : => 30$ CMPB -1(R1),#BLNK ; Blank ? BEQ 20$ ; Yes : => 20$ MOV R1,R2 ; R2 => Behind laste20$:% SOB R5,10$ ; Go back if not the endT BR 40$ ; => 40$30$:+ MOVB #BLNK,-1(R1) ; Overprint 000 (.ASCIZ)e40$: MOV R2,R1 ; Both at the end1 RETURN ;T;#; + .SBTTL MCE - IO -- General I/O RoutineT;QIO:  .IF DF TMOTIM+ MOVB #TMOTIM,TMOCNT ; Set new timeoutcount  .ENDC ;TMOTIM+ QIO$S CODE,#TI,#EFN,,#IOSTAT,,>4 DIR$ #STOPIO ; Stop for I/O (or wait when aborted) RETURN ;N;;;X" .SBTTL MCE - IOCR -- Print ; IOCR:D& MOV #IO.CCO,CODE ; Cancel ! MOV #CRET,ADR ; Print  MOV #1,LEN ; Length, BR IO ; Go to IO;1; % .SBTTL MCE - IOMSG -- Print Message ;t; Print a Msg in (R0)o;1IOMSG: CALL IOCR ; Print  CALL GETBUF ; (R0) --> NEW CALL DISPLY ; Write line CALLR CLRNEW ;;:; % .SBTTL MCE - IOW -- Write routineT;$IOW: MOV #IO.WVB,CODE ; write BR IO ; Go to IO;;V7 .SBTTL MCE - LDFIF -- Load NEW into FIFO Bufferk; ; Input: R2 - Length ;LDFIF: JSR R5,.SAVR1 ; Save Regs MOV R2,R5 ; Length BEQ 40$ ; Zero : => 40$ CMP R2,MINC ; Save it ?; BLO 40$ ; No : => 40$ MOV R5,R1 ; Save itP& ADD #FTXT+2,R1 ; Increment for header% CMPB FIFCNT,MAXF ; Maximum reached ?  BLO 20$ ; No : => 20$10$: CALL CLFIF ; Release one entry BCC 40$ ; Nothing to release20$:* MOV #FREE,R0 ; R0 => Free memory listhead! CALL $RQCB ; Request core blockd/ BCS 10$ ; Nothing received yet - release moreo CLR (R0) ; No next entry" MOV R0,@FIFO+2 ; Link to previous MOV R0,FIFO+2 ; New last entryi MOV R1,FLEN(R0) ; Total lengthC# ADD #FTXT,R0 ; Point to text field= MOV #NEW,R1 ; Source text 30$: MOVB (R1)+,(R0)+ ; Load SOB R5,30$ ; stringA CLRB (R0) ; End of string  INCB FIFCNT ; CountL40$: RETURN ;t;i;IN .SBTTL MCE - PRICMD -- Print Cmd buffer and put pointer to end of queue;$PRICMD:V( MOV #CMDB, FIFPTR ; Point to CMD buffer BR PRIXXX ; => PRIXXXC; ;)H .SBTTL MCE - PRIFIF -- Print FIFO and put pointer to end of queue;pPRIFIF: " MOV #FIFO, FIFPTR ; Point to FIFOPRIXXX:G MOV PROMLF,ADR ; +  MOV #1,LEN ; Print  CALL IOW ; - MOV @FIFPTR, FIFPTR ; Next PTRY BEQ 10$ ; Done : => 10$ CALL GEFIFO ; Display0 BR PRIXXX ; => PRIXXXf10$:: CALL CLRNEW ; Clear edit buffer (FIFPTR already cleared)$ CALLR DISPLY ; and display prompt; ;m, .SBTTL MCE - SPBACK -- Backspace 1 char.;SPBACK:$ CMP R1,#NEW ; At begin of buffer ? BLOS 10$ ; Yes : => 10$ MOV #BS,ADR ; WriteC MOV #1,LEN ; al CALL IOW ; backspace DEC R1 ; Shift cursorf RETURN ; 10$: SEC ; Indicate cursur error RETURN ; ;W; * .SBTTL MCE - SRWORD -- Search for word;MSRWORD:# CMPB R0,#'0 ; Digit ?1 BLO 10$ ; No : => 10$ CMPB R0,#'9 ; Digit ?t BLO 20$ ; Yes : => 20$  CMPB R0,#'_ ; Special char ? BEQ 20$ ; Yes : => 20$ # BIC #40,R0 ; Convert to uppercasen CMPB R0,#'A ; Alphabetical ? BLO 10$ ; No : => 10$  CMPB R0,#'Z ; Alphabetical ? BLOS 20$ ; Yes : => 20$10$: SEC ; RETURNr20$: CLC ; RETURN ;X; 0 .SBTTL MCE - TERM -- Get terminal information;VTERM:T! MOV #SFGMCB,ADR ; GMC Buffere' MOV #SFGMCL,LEN ; GMC BufferlengthT# MOV #SF.GMC,CODE ; GMC Code  .IF DF STATUS( CALL IO ; Do it ;JHA99- TSTB ANI+1 ; ANSII Terminal ;JHA99 # BNE 10$ ; Yes : => 10$ ;JHA99 . CLRB STAFLG ; No statusline possible ;JHA9910$: ;JHA99M RETURN ; ;JHA99 .IFF ;STATUSb CALLR IO ; Do it .ENDC ;STATUS;e;* .SBTTL MCE - UPDATE -- Update commandline; B; Write from current Position to End of Line and reposition Cursor; UPDATE:B MOV R1,ADR ; Address of Cursor MOV R2,LEN ; R2 => EOL SUB R1,LEN ; LengthV BEQ 10$ ; Zero : => 10$ CALL IOW ; Write rest of lineM" MOV #BS,ADR ; Address backspaces CALLR IO ; Reposition Cursor10$: RETURN ;1 .IF DF FILE6 .SBTTL MCE - FILOP -- Open MCEINI file from MCR line;"FILOP: INCB FILINI ; Startup file2 CALL GETMCR ; Get MCR commandline (startup file) BCC FILOP2 ; OK : => FILOP2 RETURN ;V;N;S( .SBTTL MCE - FILOP1 -- Open MCEINI file;LFILOP1:W CLRB FILINI ; No startupFILOP2:, .IF DF CLISUPD% CALL GETCLI ; Get CLI info/filetypeI .ENDC ;CLISUP, CALL FILOP4 ; Open File LB:[1,2]xxx.CLI BCC FILRET ; Success( TST FDIR ; Was it first default file ? BEQ 10$ ; No : => 10$! CALL FILOP3 ; Open 'SY:xxx.CLI'n BCC FILRET ; Ok : => FILRET TSTB FILINI ; Startup ?i BNE FILRET ; Yes : => FILRET-10$: MOV #FILTXT,R0 ; Errorw CALLR IOMSG ; Message ;fFILOP3:M$ CLR FDIR ; No directory descriptor% MOV #"SY,DEV ; Try file 'SY:xxx.CLI'RFILOP4: - CLRB FILINP ; Assume file can not be opened0! OPEN$R #FDBIN ; Open input fileA" BCS FILRET ; Not OK : => FILRET! INCB FILINP ; Enable File Input FILRET: RETURN ; Return;r- .SBTTL MCE - FILREA -- Read from MCEINI file#;EFILREA:  GET$S #FDBIN ; Get a record / BCS FILCLO ; No more records : => Close file0 MOV F.NRBD(R0),R2 ; LengthN& BLE FILREA ; Empty line : => FILREA MOV R2,LEN ; Store length, TST (SP)+ ; Do not returnr/ MOV #1,WAITFL ; Wait for execution of commandsT$ JMP EXEC2 ; but execute directly; ;m1 .SBTTL MCE - FILCLO -- Close current MCEINI file ; FILCLO: CLRB FILINP ; No file input ! CLOSE$ #FDBIN ; Close inputfile3( TST FDIR ; Was it first default file ? BEQ 10$ ; No : => 10$ CALL FILOP3 ; Open next file$ BCC FILREA ; If opened : => FILREA10$: RETURN ;0 .ENDC ;FILE  .IF DF CLISUP+ .SBTTL MCE - GETCLI -- Get CLI information;CGETCLI:u GCII$S #GCLI,#GCISIZB .IF DF FILE; BCS 10$ ; Error is C set;,;; Choose the startup file type according to the CLI in use: ;m MOV G.CICL+GCLI,DFTYP ; Use CLI name for file type10$: .ENDC ;FILE RETURN ;c .ENDC ;CLISUP .IF DF TMOTIM( .SBTTL MCE - TIMAST -- TI: Time-out AST;L'; On timeout - log off (TT0: just exit)V;,TIMAST:  TST (SP)+ ;; Restore stack DECB TMOCNT ;; Timeout ?( BLT 10$ ;; Should not have decremented BNE 20$ ;; Not yet;J; Timed out - kill pending read ;B MOV #IO.KIL,CODE ;; KillH CALL IO ;; pending read10$: CLRB TMOCNT ;;20$: .IF DF STATUS CALL STAFIL ;; Fill statusline$ TSTB STAFLG ;; Statusline wanted ? BEQ 30$ ;; No : => 30$B3 QIOW$S #IO.WVB,#TI,#EFNAST,,,,<#STATX2,#STALN2,#0> 30$: .ENDC ;STATUS CALL MARK ;; Mark time ASTX$S ;; Exit ast#;,; % .SBTTL MCE - MARK -- Next Marktime;MARK: MRKT$S ,#60.,#2,#TIMAST;(;) RETURN ;(;) .ENDC ;TMOTIM N3 .SBTTL MCE - FNDCMD -- Find entry in command tableB< .SBTTL MCE - FNDCMA -- Find entry in command table with "*"; 6; FNDCMD - Find entry in Command (=Translation-) TableM; FNDCMA - Find entry in Command (=Translation-) Table - accept Abbreviations ;i"; Input - PDSC of P0 defined>; - CTSTAR .ne.0 to allow abreviated command if command-; definition contains "*" (a la VMS)2*; Output - CC-C set - no entry found!; CC-C clr - entry foundh; R0 - to entry-; R1 - to point to string after ":="R:; R2 - to previous entry (for remove and inserts);m .ENABL LSBFNDCMA:e& MOVB #1,CTSTAR ; Enable abbreviations BR 10$GFNDCMD:G0 CLRB CTSTAR ; Ignore "*" in translation buffer10$:# MOV #CMDB,R0 ; R0 => CommandbufferT MOV R3,-(SP) ; Save R3  MOV R1,-(SP) ; Save R1V CLR -(SP) ; For previous entry20$:# MOV R0,(SP) ; Save previous entrym TST (R0) ; Any next entry ? ' BEQ 100$ ; No : => 100$, end of liste MOV (R0),R0 ; Take next entry  MOV R0,R1 ; R1 => EntryB ADD #FTXT,R1 ; R1 => Text% MOV PDSC,R3 ; Length to be compared BLE 100$ ; Zero : => 100$! MOV PDSC+2,R2 ; Start addr of P0S& TSTB CTSTAR ; Without abbreviation ? BEQ 80$ ; Yes : => 80$3; 9; Check for match, accepting any "*" in command defintion ;s8 CLRB TMPFLG ; Reset Flag: "*" found in Cmd Translation30$:4 CMPB (R1),#'* ; Check for "*" in translation buffer# BNE 40$ ; Not yet found : => 40$A" INCB TMPFLG ; Found, remember it INC R1 ; Next char40$:. CMPB (R1),#BLNK ; End of translation buffer ?, BEQ 60$ ; Yes : => 60$, terminate compare CMPB (R2)+,(R1)+ ; Equal ?  BEQ 50$ ; Yes : => 50$S1 BGT 20$ ; NE and must come further down in listI- TSTB TMPFLG ; Passed entry - any "*" seen ?R* BNE 20$ ; Yes : => 20$, continue search2 BR 100$ ; We passed alphabetical order : => 100$50$: SOB R3,30$ ; Next char;t( CMPB (R1),#BLNK ; End of input string ? BEQ 70$ ; Yes : => 70$C CMPB (R1),#'* ; Next byte end ? BEQ 70$ ; Yes : => 70$60$:' TSTB TMPFLG ; Abbreviation possible ?  BEQ 20$ ; No : => 20$Y70$:4 CMPB (R1)+,#BLNK ; End of string (or binary 0???) ?# BHI 70$ ; Not yet found : => 70$# BR 90$ ; Point past key ; 8; Check for match, ignoring any "*" in command defintion;t80$: CMPB (R2)+,(R1)+ ; Compare 1 BGT 20$ ; NE and must come further down in lists. BLT 100$ ; Already passed alphabetical order SOB R3,80$ ; Nexta;i' CMPB (R1)+,#BLNK ; Followed by space ?1 BNE 100$ ; No : => 100$ 90$: ADD #3,R1 ; Skip ":= " CLC ; Successfule$ MOV (SP)+,R2 ; R2 => Previous entry TST (SP)+ ; Flush old R1 BR 110$ ;C100$:  SEC ; Not found$ MOV (SP)+,R2 ; R2 => Previous entry MOV (SP)+,R1 ; Old R1110$:e MOV (SP)+,R3 ; Restore R3 RETURN ;v .DSABL LSB o4 .SBTTL MCE - CMDCHK -- Check for Command definition;r; Check for Command definitionB; or replace first command word by stuff defined in command buffer; P1..P8 may also be replacedo;e6; R2 - length of buffer in NEW (also stored in LEN)/; on return: LEN updated, all Regs destroyedC; CMDCHK: MOV #CDSC,R0 ; + MOV #CLL/2,R1 ;10$: ; Clear scratch buffer CLR (R0)+ ;i SOB R1,10$ ; -# MOV #NEW,R1 ; R1 => Source Buffer;( MOV #SAVB,R3 ; R3 => Destination Buffer2 MOV #PDSC,R5 ; R5 => Current Parameter Descriptor MOV R3,2(R5) ; Start of P0q20$:;; Store single char ;P MOVB (R1)+,R0 ; R0 = char/ CALL CNVUPC ; Convert and check for delimiter>% MOVB R0,(R3)+ ; Store char in SAVBUF;( BCC 40$ ; No delimiter found : => 40$ CMP R5,#PDSC ; Is this P0 ? BNE 30$ ; No : => 30$C# MOV R3,CDSC+2 ; Load start AddressT30$:; ; To next Pn;D$ CMP R5,#8.*4+PDSC ; Already on P8 ?, BHIS 40$ ; Yes : => 40$, put it all there ADD #4,R5 ; Next Parameter MOV R3,2(R5) ; Start address  BR 50$ ; Do not countS40$:;r; No delimiter found;l INC (R5) ; Count chars50$: SOB R2,20$ ; Next characterR; / MOV CDSC+2,R2 ; Remainder Descriptor defined ?  BEQ 60$ ; No => 60$ SUB R2,R3 ; Calculate length MOV R3,CDSC ; Store length;i#; Now everything is moved into SAVBC-; Check if we define a new command ":=" in P10;60$: MOV #4+PDSC,R2 ; R2 => P1 descr CMP (R2)+,#2 ; Correct length ? BNE 70$ ; No => 70$ MOV (R2),R2 ; R2 => string CMPB (R2)+,#': ; += BNE 70$ ;  CMPB (R2)+,#'= ; ":=" BNE 70$ ; -e JMP NEWCMD ; Match found;T4; Try find an entry in the commandbuffer with key P0;M70$:! CALL FNDCMA ; Check in tableT BCC 80$ ; Entry found => 80$e CLC ; Indicate successG RETURN ;t80$:; ; Entry found, R1 points to Text;F! MOV #NEW,R2 ; R2 => Destination 90$:; ; Assemble buffer NEWA;1 MOVB (R1)+,R0 ; Next char BEQ 110$ ; All done : => 110$" CMPB R0,#'' ; Could it be 'Pn' ? BNE 100$ ; No : => 100$ 3 CALL SUBST ; Check it and substitute if necessary( BCS 90$ ; Already substituted : => 90$100$:.' MOVB R0,(R2)+ ; Store character in NEW! BR 90$ ; Next char from CMD Bufo110$: ;e; Whole buffer moved to NEWP;E' TSTB CFETCH ; Buffer already feched ?V BLT 120$ ; Yes : => 120$,) MOV #CDSC,R1 ; This descriptor to append CALL STORE ; Store120$:n;; All done, execute new commands;C$ SUB #NEW,R2 ; Calculate new length MOV R2,LEN ; and storeE TSTB OVMSG ; Buffer overflow ? BEQ 130$ ; No : => 130$ MOV #TOOLON,R0 ; Give CALL IOMSG ; message SEC ; Not success130$:t RETURN ;C;L; STORE:; +; Append string with descriptor (R1) to NEWI;1 MOV (R1)+,R5 ; R5 = LengthO BEQ 30$ ; Empty : => 30$t MOV (R1),R1 ; R1 = Source Addr10$:! CMP R2, #NEW+BUFSIZ ; In range ? BLO 20$ ; Yes : => 160  DECB OVMSG ; Mark for Ovflwx RETURN ;L20$: MOVB (R1)+,(R2)+ ; Copy SOB R5,10$ ; characters30$: RETURN ;1SUBST:;I; Substitute Pn'sx;I JSR R5,.SAVR1 ; Save Regs# CMPB (R1)+,#'P ; Check next symbolB BNE 10$ ; No match : => 10$% MOVB (R1)+,R3 ; Get Parameter numberI SUB #'0,R3 ; Decode BLE 10$ ; Illegal : => 10$t CMP R3,#8. ; In range ?E BHI 10$ ; No : => 10$ CMPB (R1)+,R0 ; Endmark ? BEQ 20$ ; Yes : => 20$e10$: CLC ; Tell no substit RETURN ;F20$:; ; Substitution string foundI; & MOV R1,2(SP) ; Set up R1 after retunr ASL R3 ; Param num ASL R3 ; times 4 ADD #PDSC,R3 ; R3 => Descriptor MOV R3,R1 ;a CALL STORE ; Load it& MOV R2,2*2(SP) ; Load R2 after return+ DECB CFETCH ; Mark that parameter fetchedt SEC ; Tell substituted, RETURN ;l;t, .SBTTL MCE - CNVUPC -- Convert to uppercase;;.; Convert to upper case, CC-C set if delimiter;uCNVUPC: ' CMPB R0,#'A+40 ; Convert to upper case BLO 10$ ;  CMPB R0,#'Z+40 ;I BHI 10$ ; BICB #40,R0 ; Convert to upper10$: CMPB R0,#BLNK ; Delimter ?I SEC ; BEQ 30$ ; Its a delimiter120$: CLC ; Character within string30$: RETURN ;L < .SBTTL MCE - NEWCMD -- Define new command or delete command;4; Define new command in command buffer, or delete it;tNEWCMD:! TSTB NOLOAD ; Skip processing ? BNE 50$ ; Yes : => 50$ ! CALL FNDCMD ; Check if in tables, BCC 60$ ; Yes : => 60$, release old entry TST 2*4+PDSC ; P2 defined ?$ BNE 10$ ; Yes : => 10$, must load TST 3*4+PDSC+2 ; P3 with addr ?& BEQ 50$ ; No : => 50$, delete only10$:; ; Insert new command;A/ MOV R2,R3 ; R3 => Entry after which to insert MOV LEN,R1 ; length of stringo BEQ 50$ ; Zero : => 50$m ADD #FTXT+1,R1 ; With overheada* MOV #FREE,R0 ; R0 => Free memory listhead! CALL $RQCB ; Request core block BCC 20$ ; Ok : => 20$ MOV #NOPOOL,R0 ; No more Pool CALL IOMSG ; Give the message. BR 50$ ; => 50$L20$:' MOV (R3),(R0) ; Link to previous entryS BNE 30$ ;t$ MOV R0,CMDB+2 ; We will be last one30$: MOV R0,(R3) ;, MOV R1,FLEN(R0) ; Total length# ADD #FTXT,R0 ; R0 => Start of text  MOV #SAVB,R1 ; R1 => Source MOV LEN,R2 ; R2 = Length-40$: MOVB (R1)+,(R0)+ ; Copy SOB R2,40$ ; text CLRB (R0) ; Write delimiterT50$: SEC ; Nothing to executed RETURN ;m60$:;B; Release old entryA;  MOV (R0),(R2) ; Link remainder"" BNE 70$ ; More entries : => 70$" MOV R2,CMDB+2 ; This was last one70$: MOV FLEN(R0),R1 ; R1 = Length MOV R0,R2 ;p* MOV #FREE,R0 ; R0 => Free memory listhead CALL $RLCB ; Release itS" BR NEWCMD ; Find more to release f0 .SBTTL MCE - RECCMD -- Recall command from FIFO;S!; Recall Command from Fifo by keye;yRECCMD: , CLR -(SP) ; Room for Pointer to FIFO entry( MOVB FIFPOI,R5 ; R5 = Fifo entry number* MOV FIFO,R4 ; R4 => Oldest Entry in Fifo BEQ 50$ ; Empty : => 50$e! MOVB #1,R5 ; Start above oldest TST FIFPTR ; Old pointer ? BNE 20$ ; Defined : => 20$C# MOV #NEW,R1 ; R1 => Source Buffero( MOV #RECB,R3 ; R3 => Destination Buffer SUB R1,R2 ; R2 = Length BLE 20$ ; Zero : => 20$10$:;C; Store single char into RECB;: MOVB (R1)+,R0 ; R0 = next charn CALL CNVUPC ; Convertx MOVB R0,(R3)+ ; Store char: SOB R2,10$ ; Nexte CLRB (R3) ; EOLa20$:;n; Check next entry in FIFO;B' MOV #RECB,R1 ; R1 => Source to Compare3# TSTB (R1) ; Search mask defined ?  BEQ 50$ ; No : => 50$ MOV R4,R3 ; R3 => EntryS# ADD #FTXT,R3 ; R3 => Text of entryn30$: MOVB (R3)+,R0 ; R0 = Next charh BEQ 40$ ; EOL : => 40$y$ CALL CNVUPC ; Convert to uppercase$ CMPB R0,(R1)+ ; Compare with source BNE 40$ ; No match : => 40$ TSTB (R1) ; EOL ? ' BNE 30$ ; No : => 30$, Try next charf. MOV R4,(SP) ; Source exhausted - match found) MOVB R5,FIFPOI ; Store fifo entry number#40$: INCB R5 ; One newerf MOV (R4),R4 ; R4 => Next entry BEQ 50$ ; No more : => 50$R" CMP R4,FIFPTR ; Continue search ? BNE 20$ ; Yes : => 20$m50$:/ MOV (SP)+,FIFPTR ; Pop Pointer to entry if anye BNE 60$ ; Any pointer ? => 60$ CLRB FIFPOI ; 60$:5 CALL GEFIFO ; Load from FIFO (or delete NEW buffer) RETURN ;S R .IF DF FILE ;> .SBTTL MCE - GETMCR -- Get filespecification from MCR command; B; This subroutine dequeues the command which invokes MCE (if any),=; and overrides the default startup file name (MCEINI.xxx) by $; file specified in the commandline.3; Command line syntax is : 'MCE file_specification't;u .ENABL LSBBGETMCR:P DIR$ #GMCR ; Get commandline BCS 20$ ; Problem => 20$m+ MOV #GMCR+G.MCRB,R1 ; Point to commandline  MOV $DSW,R2 ; Length of line;oGETFIL:r;w; reset FDB file-name pointers;s) MOV #"LB,DEV ; Reset default file volumea3 MOV #DIRL,FDIR ; Restore pointer to [1,2]directory1 MOV #FDSPT,FDBIN+F.DSPT ; Reset DSPT pointer in FDBC10$:( CMPB #BLNK,(R1)+ ; Mnemonic delimiter ? BEQ 30$ DEC R2 ; Count remaining char$ BNE 10$ ; If eq: empty command20$: CLC ; Success BR 50$ ;30$: DEC R2 ; Flush space# CSI$1 #CSIBLK,R1,R2 ; Syntax checkR# BCS 40$ ; Syntax error: ignore it * CSI$2 R0,OUTPUT ; Parse line into its com BCS 40$ ; No file: ignore it;nA; now we have a file descriptor table inside the CSI parser blockr3; override the default DSPT pointing to MCEINI.CMD:h; MOV #CSIBLK+C.DSDS,FDBIN+F.DSPT ; New DSPT pointer% CLR FDIR ; Indicate 'no more files' BR 50$ ; => 50$40$: MOV #FLSTXT,R0 ; Filespec  CALL IOMSG ; syntax errorS SEC ; Indicate error,50$: RETURN ;B .DSABL LSBA .ENDC ;FILE n> .SBTTL MCE - INTERN -- Check for internal commands (EXIT/BYE)@; Check if the command (AFTER translation) is BYE or an internal(; command starting with the verb 'MCE '.@; To check for the special commands after translation offers the6; possibility to define any other string for exit/bye.; (E.g.: LOGOF*F := BYE)A; Intern returns C set, if no intern command, i.e. the buffer NEW0!; has to b~ RSX88A.BCK!''[RSX88A.265020]MCE.MAC;1N1S xe submitted to the CLI.8>; C clear on return, if internal command found, no CLI submit.;t= .macro cmpuc src,what,action,label ; Compare upper case chars .NCHR $$$$$L, .if gt $$$$$L-1 mov src,R0r bic #" ,R0 cmp R0,#"what .iff movb src,R0 bicb #' ,R0 cmpb R0,#''what .endc action labelD .endm;eINTERN:;Q@; To be recognised as an internal command, at least 3 characters; must be present. ; Internal commands trapped are:; BYE : the RSX logout command"; MCE action: MCE internal actions;D JSR R5,.SAVR1 ; Save registers+ CMP LEN,#3 ; Length in range ? BLT 20$ ; No : => 20$ CMPUC NEW+0,BY,bne 10$; BY ?' CMPUC NEW+2,E,bne 10$ ; E ? CLR WAITFL ; Do not wait! CALL DOEXEC ; Submit BYE to CLIT# CALLR EXITS ; Immediate task exitu10$: CMPUC NEW+0,MC,bne 20$; MC ?F CMPUC NEW+2,E,beq 30$ ; E ?20$:$ SEC ; No internal command trapped RETURN ;;TG; Internal command strings must not be less than 8 characters in length ; Ignore anything else; 30$: CMP LEN,#8. ; "MCE action?"R BLT 140$ ; N* BIC #" ,NEW+4 ; 'action' verb upper case BIC #" ,NEW+6 ; 4 characters1 MOV #INTCMD,R1 ; Point to internal command table 40$:# TST (R1) ; End of table reached ?l BEQ 140$ ; Yes : => 140$0- CMP NEW+4,(R1)+ ; First 2 characters match ? BEQ 50$' ADD #4,R1 ; Point to next table entryh BR 40$ ; Look aheadP50$:. CMP NEW+6,(R1)+ ; Second 2 characters match ?( BEQ 60$ ; If eq Yes: action verb match' TST (R1)+ ; Point to next table entryS BR 40$ ; Look ahead 60$:' CALL @(R1) ; EXECute internal command  BCS 140$ ; Not OK ? => 140$' TSTB SINFLG ; Save internal command ?v BNE 130$ ; Yes : => 130$=8 TSTB FILREX ; Read or Replace being processed ? ;JHA99# BNE 70$ ; Yes : => 70$ ;JHA99 & TSTB FILINP ; File input ? ;JHA99$ BNE 130$ ; Yes : => 130$ ;JHA9970$:$ CLRB FILREX ; Clear flag ;JHA99! MOV FIFO,R0 ; R0 => First entryS! BEQ 120$ ; No entries : => 120$S! MOV FIFO+2,R2 ; R2 => Last entry: CMP R0,R2 ; 1st = last ? BEQ 100$ ; Yes : => 100$080$: CMP (R0),R2 ; (R0) => last ?" BEQ 90$ ; Yes : Delete this one MOV (R0),R0 ; Next BR 80$ ; => 80$J90$: MOV R0,FIFO+2 ; New lastR CLR (R0) ; Lastt# MOV #FREE,R0 ; R0 => Free listhead1 MOV FLEN(R2),R1 ; R1 = Length CALL $RLCB ; Release block BR 110$ ; => 110$l100$:= CALL FRENT ; Free entrya110$: DECB FIFCNT ; One less120$:R CLC ; Success130$:2 RETURN ;=140$: MOV #ERRTXT,R0 ; Errorb CALLR IOMSG ; Message  0 .SBTTL MCE - -- INTERNAL action routines;p;  .SBTTL MCE - ICCLEA -- Clearn; ; Clear FIFO; ICCLEA:;D MOV MAXF,-(SP) ; Save maxfifo CLR MAXF ; Clear CALL CLEFIF ; Fifo,! MOV (SP)+,MAXF ; Restore maxfifoC RETURN ;a;t;  .SBTTL MCE - ICFREE -- Free; ; Free poolspace; ICFREE:- MOV #POOL,R5 ; Point to pool raw data buffer;' CLR (R5)+ ; Clear number of fragmentsl CLR (R5)+ ; Clear total pool CLR (R5) ; Clear biggest holeB, MOV FREE,R4 ; Get address of pool listhead BEQ 30$ ; No blocks : => 30$10$: TST (R4)+ ; R4 => Size% CMP (R5),(R4) ; This size > stored ?e BHIS 20$ ; No : => 20$r MOV (R4),(R5) ; Set new max20$:) ADD (R4),-(R5) ; Add this space to totala0 INC -(R5) ; Increment number of pool fragments5 CMP (R5)+,(R5)+ ; Point R5 to end of raw data bufferD& MOV -(R4),R4 ; Get addr of next block! BNE 10$ ; If ne more to examinef30$: MOV #POOLDT,R0 ; POOL message MOV #3,R4 ; 3 words to convert40$: MOV (R5),R1 ; Binary value MOV #20012,R2 ; Parms.4 CALL $CBTA ; Convert MOVB #'.,(R0)+ ; Decimal, MOVB #':,(R0)+ ; Terminatee TST -(R5) ; Next SOB R4,40$ ; word;f CLRB -(R0) ; ASCIZ MOV #POOLTX,R0 ; R0 => Message CALLR IOMSG ; Write and return .IF DF EDTi;e% .SBTTL MCE - ICKEYP -- Keypad on/offr;i; Keypad On/OffC;;ICKEYP:c;  MOV #EDTFLG,R3 ; R3 => Flag BR ONOFF ; => On / Off .ENDC ;EDT ;  .SBTTL MCE - ICLIST -- LIST;=; FIFO is LIST;(ICLIST:;;n CLRB RING ; Indicate LIST$ JMP SUCCES ;;2;W .SBTTL MCE - ICMAXF -- Fisz x;R ; Fifo sizeR;LICMAXF:T;l! MOV #MAXF,R5 ; R5 => Destinationr CALL VALUE ; Get valueCLEFIF:o& CMPB FIFCNT, MAXF ; Maximum reached ? BLOS 10$ ; No : => 10$ CALL CLFIF ; Release one entry BCS CLEFIF ; => CLEFIF10$: BR SUCCES ;x;t; .SBTTL MCE - ICMINC -- Cmsz x;l ; CMD Size;MICMINC:R;;! MOV #MINC,R5 ; R5 => Destination ;rVALUE:* MOV #NEW+9.,R0 ; Point behind 'MCE XXXX ' CALL $CDTB ; Convert MOV R1,(R5) ; Insert value RETURN ; ;=;r .SBTTL MCE - ICPURG -- Purge ;R"; delete current translation table;rICPURG:f;.) MOV #CMDB,R0 ; Queue header for TR tableI! CALL FRENT ; Delete table entryb1 BCS ICPURG ; Id C SET there may be more entriesr RETURN ;y;M .IF DF FILE5 .SBTTL MCE - ICREAD -- Read; #; read commands from file specified$; ICREAD:=;0 TSTB FILINP ; Is a file open ?# BEQ 10$ ; If eq no: just open newB;2:; Close a file currently open, i.e. 'MCE READ' issued from<; inside a definition is equivalent to a 'MCE CHAIN' command; " CALL FILCLO ; Close current file10$:$ MOV #NEW+4,r1 ; Point behind 'MCE ' MOV LEN,R2 ; Length of command% SUB #4.,R2 ; Remaining # characters3! CALL GETFIL ; Get new file namex BCS 20$ ; Error => 20$ CALL FILOP1 ; Read file(s)6 INCB FILREX ; Read or Replace being processed ;JHA9920$: BR SUCCES ; Always success .SBTTL MCE - ICREPL -- Replace ;3ICREPL:S0 CALL ICPURG ; Delete current translation table BR ICREAD ; .ENDC ;FILE;$ .SBTTL MCE - ICRING -- Ring; ; FIFO is RING buffer;PICRING:+ MOVB #1,RING ; Indicate RING BR SUCCES ; ;4 .IF DF STATUS) .SBTTL MCE - ICSTAT -- Status [ on/off ]a;; Status; ICSTAT:e;u* MOV #NEW+8.,R0 ; Point behind "MCE XXXX"  MOV LEN,R2 ; Take0 SUB #8.,R2 ; lengthf BNE 10$ ; Not Zero : => 10$t CALL STAFIL ; Fill statuslineR MOV #STATX3,ADR ; Address MOV #STALN3,LEN ; Length: CALLR IOW ;10$:( TSTB ANI+1 ; ANSII Terminal ? ;JHA99" BEQ 20$ ; No : => 20$ ;JHA99 MOV #STAFLG,R3 ; R3 => Flag% MOVB (R3),R2 ; Old status ;JHA99 ! MOV R2,-(SP) ; Save it ;JHA99  CALL ONOFF ; => On / Off! MOV (SP)+,R2 ; Restore ;JHA99M BCS 20$ ;  TSTB #STAFLG ; Off ? BNE 20$ ; No : => 20$! TSTB R2 ; Was it on ? ;JHA99 " BEQ 20$ ; no : => 20$ ;JHA99 MOV #STACLR,ADR ; Address MOV #STACLN,LEN ; Lengthm CALLR IOW ; Clear status linee20$: RETURN ; .ENDC ;STATUS;% .SBTTL MCE - ICSVIN -- Intern on/off$; ; Save internal commands On/OffR;1ICSVIN:t;o MOV #SINFLG,R3 ; R3 => Flag BR ONOFF ; => On / Off;w; + .SBTTL MCE - ICSVOL -- Old commands on/offE; ; Save old commands On/Off;VICSVOL:I;  MOV #SOLFLG,R3 ; R3 => Flag BR ONOFF ; => On / Off;T;  .SBTTL MCE - ICVERS -- Version0;; Show version; ICVERS:d;m MOV #STRTXT, R0 ; Print! CALLR IOMSG ; Startup message ;f; ON/OFF;m; R3 => Byte flag;cONOFF:* MOV #NEW+8.,R0 ; Point behind "MCE XXXX"  MOV LEN,R2 ; Taken SUB #8.,R2 ; lengthy BEQ 40$ ; Zero : => 40$I10$:( CMPB #BLNK,(R0)+ ; Mnemonic delimiter ? BEQ 20$ ; Yes : => 20$# SOB R2,10$ ; Count remaining char  BR 40$ ; => 40$20$: BICB #40,(R0) ; Upcaset CMPB (R0)+,#'O ; 'O ? BNE 40$ ; No : => 40$D BICB #40,(R0) ; Upcasee CMPB (R0),#'N ; 'N ?I BNE 30$ ; No : => 30$s INCB (R3) ; Set flag BR SUCCES ;T30$: CMPB (R0)+,#'F ; 'F ? BNE 40$ ; No : => 40$C BICB #40,(R0) ; Upcase: CMPB (R0),#'F ; 'F ?B BNE 40$ ; No : => 40$ CLRB (R3) ; Reset flag BR SUCCES ;l40$: BR NOSUCC ; Errorh;fSUCCES:a CLC ; Succest RETURN ;rNOSUCC:n SEC ; Not Succesg RETURN ;b;C .END START*[RSX88A.265020]MCEBLD.CMD;1+,"'.0/ 4h0/ -'0123KPWO156n>;7B՜@89GHJZ.;@.; MCEBLD.CMD -- Commandfile to build the MCE commandline editor.;.;.; Copyright (c) 1987,1988.;.; J.H. Hamakers, .; ASEA Brown Boveri b.v.8.; P.O.Box 301 3000 AH Rotterdam, The Netherlands".; Phone : +31 - 10 - 4078631.; .; All rights reserved.;9.; This software may be copied and distributed ONLY 7.; on a non profit basis and with the inclusion of&.; the above copyright statement..;.;5.; PLEASE CONTACT ME FOR PROBLEMS OR SUGGESTIONS.;>.; +---------------------------------------------------+>.; | See MCEREL.DOC for information about this release |>.; +---------------------------------------------------+.;.;.; .ENABLE SUBSTITUTION .DISABLE DISPLAY.;N .SETF A$SV ! Conditional for CRW/ASV Erasmus university Rotterdam" .IF P1 EQ "ASV" .SETT A$SV.;1 .SETS VERS "V4.2d" ! Version6 .SETS HLPUIC "[1,2]" ! Helpfile UIC2 .SETS SYSUIC ! Task uicF .SETS INIUIC "[1,2]" ! Change mce.mac to change uicF .IFT A$SV .SETS INIUIC "[2,2]" ! Change mce.mac to change uic;;************************;* M C E B L D . C M D *;************************;>;MCEBLD.CMD -- Commandfile to build the MCE commandline editor;.;Version: 'VERS'.;.;- .PARSE "]." DUM PRNAME DUM.;.;Test if correct CLI.;) .IF = "DCL" .SETS CLI "MCR"& .IF = "MCR" .SETS CLI "" .IFDF CLI .GOTO 10$ .DISABLE QUIET ;' ;'PRNAME' -- CLI '' not supported ; .EXIT .10$: .SETF HLP .SETF COP .SETF INS .SETF PRI .IF P1 = "MAC" .GOTO MAC" .IF P1 = "LINK" .GOTO LINK .DISABLE QUIET;;*****;C; When your system uses not only MCR as a CLI, include multiple CLI; support in MCE;E .ASK CLS 'PRNAME' -- Want the multiple CLI support [ D:N ] ? ;;*****;I; When init file support is included MCE reads initialisation files which2; can contain Command definitions and CLI commands#; Files are searched in this order: .IFF CLS .GOTO 20$I; LB:'INIUIC'MCEINI.xxx, followed by SY:MCEINI.xxx,J; where "xxx" is the name of the CLI defined for the terminal invoking MCEI; and "current directory" is the default directory at the startup of MCE. .GOTO 30$.20$:H; LB:'INIUIC'MCEINI.CMD, followed by SY:MCEINI.CMDK; where "current directory" is the default directory at the startup of MCE..30$:;; This algorithm divides command-definitions into 2 groups:N; A system-wide set in LB:'INIUIC', followed by a users privat set in SY:;B .ASK INI 'PRNAME' -- Want the MCEINI file support [D:N] ? ;;*****;J; MCE allows for the definitions of compound commands; Using the ampersandG; (&) sign one can define an MCE command as a sequence of multiple CLI-5; commands: E.g. STAT := TIM & DIR & ACT /ALL ...etc.;P .ASK CMP 'PRNAME' -- Want compound command definition support [ D:N ] ? ;;*****;G; It is possible to include statusline support. Line 24 can be used for; status information.>; The statusline can be switched on/off with MCE STATus on/off;M .ASK STA 'PRNAME' -- Want Statusline/Statusmessage support [ D:N ] ? ;;*****;%; The startup and end messages like :;F; "MCE -- CLI-commandline-Editor 'VERS'/VT2" and "MCE -- Exit";; are optional.;D .ASK SIL 'PRNAME' -- Want Startup and exit messages [D:N] ? ;;*****;>; It is possible to define VT2xx and VT3xx functionkeys like :;; "F6 := TIM";P .ASK VT2 'PRNAME' -- Want the VT2xx, VT3xx function key support [D:N] ? ;;*****;5; Also the keys of a TANDBERG TDV2230 can be defined.;T .ASK TD2 'PRNAME' -- Want the TANDBERG TDV2230 function key support [D:N] ? ;;*****;G; Some edit functions can be performed on the VT1xx/VT2xx/VT3xx keypad,; simular to KED and EDT.;A .ASK EDT 'PRNAME' -- Want the EDT-Keypad support [D:N] ? ;;*****;G; When terminal time-out support is included the terminal is logged out5; after a given time-out time ( TT0: only exits MCE ); .SETF TMO .SETN TMON 4.H .ASK TMO 'PRNAME' -- Want the terminal time-out support [D:N] ? e .IFT TMO .ASKN [2.:120.:4.] TMON 'PRNAME' -- Enter number of time-out minutes [2..120 D:4] : ;;*****;D; Only commandlines with a length greater or equal to a given length; are saved in the command FIFO;h .ASKN [1.:10.:1.] MINCHR 'PRNAME' -- Enter minimal commandline length to be saved [1..10 D:1] : ;;*****;f .ASKN [1.:99.:23.] MAXFIF 'PRNAME' -- Enter maximal number of entries in FIFO [1..99 D:23.] :  .SETF MU;;*****;V .IF EQ 6 .ASK MU 'PRNAME' -- Build MCE as a multi-user task [D:N] ? ! .IF P1 <> "ALL" .GOTO 40$ .SETT HLP .SETT COP .SETF INS .SETF PRI .GOTO 50$.40$:;;*****;F; A helpfile customized to your selections is created dynamicly if you'; answer "Y" to the following question.;< .ASK HLP 'PRNAME' -- Create helpfile on LB: [D:N] ? .SETF HLPNEW+ .IFT A$SV .OR .IFF HLP .GOTO 45$W .ASKS [::HLPUIC] HLPUIC 'PRNAME' -- What is your helpfile UIC [ D:'HLPUIC' ] : ;;*****;7; The helpfile can be created in two different versions;D; Version 1 : You can access this one by typing HELP MCE [topic...]8; But you have to include a reference like ; 1 MCE; @MCE&; in MCR.HLP and DCL.HLP;E; Version 2 : You can access this one by typing HELP /MCE [topic...]L; This version does not need any editing of MCR.HLP and DCL.HLP;> .ASK HLPNEW 'PRNAME' -- Do you want Version 2 [D:N] ? .45$: .SETF INS;;*****;S .ASK COP 'PRNAME' -- When ready and successfull copy to LB: device [D:N] ? \ .IFT COP .ASKS [::SYSUIC] SYSUIC 'PRNAME' -- What is your task UIC [ D:'SYSUIC' ] : ; .IFT COP .ASK INS 'PRNAME' -- Install task [D:N] ? 4 .ASK PRI 'PRNAME' -- Print listings [D:N] ? .50$: .IFF HLP .GOTO 80$ ;'PRNAME' -- Creating help ..... .OPEN LB:'HLPUIC'MCE.HLP6.DATA MCE 'VERS' - Commandline Editor Utility Commands9.DATA MCE supports all Line Editing Functions of VMS V4.0.DATAI.DATA - Switch between Overstrike and Insert modeP.DATA Current mode is shown by first prompt character.N.DATA "+" insert mode. "-" overstrike mode.9.DATA or UP-ARROW - Retrieve previous CommandB.DATA DOWN-ARROW - Reverse of UP-ARROW (next command)0.DATA or LEFT-ARROW - Move Cursor Left:.DATA - Move Cursor to End of Line1.DATA or RIGHT-ARR - Move Cursor Right<.DATA or BACKSPACE - Move Cursor to Begin of Line?.DATA - Delete Character Left of Cursor:.DATA or LINEFEED - Delete Word Left of Cursor,.DATA - Rewrite LineC.DATA - Delete from Cursor to Begin of Line.DATA Additional Features:1.DATA - Delete whole lineA.DATA - Delete from Cursor to End of Line>.DATA - Save Command without executing?.DATA - Enable output from other tasks:L.DATA Detach TI:, Wait 10 seconds and Prompt again:.DATA - Delete Character at Cursor;.DATA - Delete Word Right at CursorN.DATA - Move word to the right or move from EOL to BOLH.IFT VT2 .DATA or - Execute Command without waitingH.IFF VT2 .DATA - Execute Command without waitingA.IFF A$SV .IFT VT2 .DATA or - Gives HELP MCE A.IFF A$SV .IFF VT2 .DATA - Gives HELP MCE E.IFT A$SV .IFT VT2 .DATA or - Gives HELP ASV MCE E.IFT A$SV .IFF VT2 .DATA - Gives HELP ASV MCEC.DATA - Translate Command without executionnM.IFF VT2 .DATA - Recall Command previously requested.tM.IFT VT2 .DATA or - Recall Command previously requested. ?.DATA - Show Command Translation Buffer E.DATA - Display previously requested Commands-a.IF MINCHR > 1 .DATA Default only Commands which contain 'MINCHR%D' or more characters are saved. G.DATA Default the savebuffer can contain up to 'MAXFIF%D' commandlines.rJ.IFT TMO .DATA Terminal time-out time support included ('TMON%D' minutes)+.IFT EDT .DATA EDT-Keypad support included +.IFT STA .DATA Statusline support includedi3.IFT CMP .DATA Compound statement support includedkF.IFF EDT .DATA More help : TRANS RECALL START EXIT INTERNAL FUNCN.IFT EDT .DATA More help : TRANS RECALL START EXIT INTERNAL FUNC KEYPAD#.IFF A$SV .IFT HLPNEW .DATA 1 TRANSE#.IFF A$SV .IFF HLPNEW .DATA 2 TRANS*.IFT A$SV .DATA 3 TRANS #.DATA A Command may be defined by:n0.DATA +>CNAM := [.IFT CMP .DATA or +>CNAM := & & ... E.DATA where CNAM is the commandname which will be substituted by the +.DATA text at the right side of the ":=". TF.DATA NOTE: The ":=" must be prececed and followed by a single space.[.IFF A$SV .DATA e.g.: +>HE := HELP MCE ! Followed by space, to append further text [.IFT A$SV .DATA e.g.: +>HE := HELP ASV MCE ! Followed by space, to append further textI.IFF A$SV .DATA +>HE ! Will request "HELP MCE"lM.IFT A$SV .DATA +>HE ! Will request "HELP ASV MCE"I.DATA [H.DATA The translation may be performed without execution by (only.DATA displayed on terminal) .DATA iE.DATA If you enter a predefined command followed by additional text,dA.DATA this additional text will normally be appended as a whole.oN.IFF A$SV .DATA e.g.: +>HE TRAN ! Will request "HELP MCE TRAN"R.IFT A$SV .DATA e.g.: +>HE TRAN ! Will request "HELP ASV MCE TRAN"H.DATA or: +>HE TRAN ! Will be translated and displayed'.IFF A$SV .DATA result +>HELP MCE TRANn+.IFT A$SV .DATA result +>HELP ASV MCE TRANc.DATA tK.DATA You may delete a command translation entry by redefining it to null.v?.DATA e.g.: +>HE := ! Delete above definitionL.DATA 'H.DATA It is also possible to allow abbreviatons of commands (as in DCL)-.DATA by seperating the optional part by "*"+.IFF A$SV .DATA e.g.: +>HM*CE := HELP MCEo/.IFT A$SV .DATA e.g.: +>HM*CE := HELP ASV MCEi..DATA This command may now be requested with:1.DATA +>HM or HMC or HMCE or HMCEXXX ect.R.DATA/Q.DATA More sophisticated substitution is possible by the Parameter-Substitution,p5.DATA similar to the indirect commandfile processor.l+.DATA e.g.: +>DIR*ECTORY := PIP ''P1''/LIo0.DATA +>COP*Y := PIP ''P2''/NV/CD=''P1''I.DATA +>DIR ! Will be translated into "PIP /LI"WL.DATA +>DIREC FIL ! Will be translated into "PIP FIL/LI"F.DATA +>COPY A.CMD [200,200] ! Will simulate DCL COPY commandS.IFT INI .DATA Note that Command Definitions may be performed from the commandfile-R.IFT INI .IFF CLS .DATA LB:'INIUIC'MCEINI.CMD and SY:[cur_dir]MCEINI.CMDR.IFT INI .IFT CLS .DATA LB:'INIUIC'MCEINI.xxx and SY:[cur_dir]MCEINI.xxx>.IFT INI .DATA which will always be read when MCE is started.I.IFT INI .DATA [cur_dir] is the default directory at the startup of MCE. 0.IFT INI .IFT CLS .DATA "xxx" = CLI nameA.IFT INI .DATA Files are read in order they are mentioned above.i.DATA e".IFF A$SV .IFT HLPNEW .DATA 1 FUNC".IFF A$SV .IFF HLPNEW .DATA 2 FUNC.IFT A$SV .DATA 3 FUNCP.DATA You may request a command with function keys , , or Q.DATA It is also possible to request commands with control keys. (e.g. )tY.IFT VT2 .DATA On a VT2xx you can also define the function keys .. and T".IFT VT2 .DATA ect.P.IFT TD2 .DATA On a TDV2230 you can also define the function keys ... >.DATA Define the command translation as "''key'' := command".C.DATA e.g. +>PF2 := TIM ! Redefine function key D.DATA ! to display the current timeT.IFT VT2 .OR .IFT TD2 .DATA +>F6 := ACT ! Define F6 function keyZ.IFT VT2 .OR .IFT TD2 .DATA ! to display the active tasksX.IFT VT2 .DATA On a VT2XX the keys ect. must be entered as F$a where "a" is theP.IFT VT2 .DATA first char. of the key function. e.g. "F$P" for '.DATA Define a control key as follows: ;.DATA e.g. +>^X := SET /UIC ! Define key$C.DATA ! to display the current UICa>.DATA Note that the following control-keys CANNOT be defined:O.DATA = , , , , = K.DATA Next to the rest of the Alphabetic characters the following keys can ?.DATA be defined : , , , *#.IFF A$SV .IFT HLPNEW .DATA 1 START #.IFF A$SV .IFF HLPNEW .DATA 2 STARTs.IFT A$SV .DATA 3 STARThP.DATA Invoke MCE with command "MCE" (at best in your LOGIN file by ".XQT MCE").H.DATA A File of Command Definitions will be executed at MCE start time,@.DATA the file may be specified in the form "MCE startup_file".L.DATA If no startup file is specified in the commandline (the normal case),0.DATA files are searched for are in this order:<.IFT CLS .DATA LB:'INIUIC'MCEINI.xxx, followed by*.IFT CLS .DATA SY:[cur_dir]MCEINI.xxx,X.IFT CLS .DATA Where "xxx" is the name of the CLI defined for the terminal invoking MCEU.IFT CLS .DATA and current directory is the default directory at the startup of MCE. <.IFF CLS .DATA LB:'INIUIC'MCEINI.CMD, followed by*.IFF CLS .DATA SY:[cur_dir]MCEINI.CMD,I.IFf CLS .DATA [cur_dir] is the default directory at the startup of MCE.p@.DATA This algorithm divides command-definitions into 2 groups:T.DATA A system-wide set in LB:'INIUIC', followed by a users privat set in SY:.N.DATA Overriding the default file name in the commandline invoking MCE offersE.DATA the possibility to tailor an application specific command set.t".IFF A$SV .IFT HLPNEW .DATA 1 EXIT".IFF A$SV .IFF HLPNEW .DATA 2 EXIT.IFT A$SV .DATA 3 EXITD.DATA To exit MCE operations, use the "MCE EXIT" internal command..DATA or ;.DATA More about internal commands see help MCE INTERNAL.F&.IFF A$SV .IFT HLPNEW .DATA 1 INTERNAL&.IFF A$SV .IFF HLPNEW .DATA 2 INTERNAL.IFT A$SV .DATA 3 INTERNALH.DATA Two command verbs are specially handled by MCE: "BYE" and "MCE".;.DATA "BYE" is sent to the CLI and MCE exits immediately.aJ.DATA (Note,that you may define any other string (e.g. LOGOFF) to result.DATA in BYE.)I.DATA Commands starting with "MCE" are treated as internal commands andfM.DATA not passed to the CLI. Following the verb "MCE " a 4 character action ,.DATA specifier defines the action wanted.#.DATA Actions defined so far are: T.IFT INI .DATA CHAI file: Chain from one INIT-file to another. (synonym for READ)@ .DATA CLEA : Delete all commands in command FifoQ .DATA CMSZ n : Changes Minimal commandlinelength to be saved to "n"VV .DATA EXIT : MCE task exit (return to the normal command environment.)I .DATA FISZ n : Changes Fifosize to "n" ( if enough memory )o^ .DATA FREE : Display MCE Pool info (largest_block:Total_free_blocks:fragments)L.IFT EDT .DATA KEYP xx : Set Keypad editing on/off ( xx = on / off )V .DATA LIST : FIFO is a list : UP- and DOWN-ARROW stop at the endE .DATA PURG : Delete all commands in translation table N.IFT INI .DATA READ file: Read new command translations from file specified5.IFT INI .DATA REPL file: Combines PURGe and READ. V.IFT STA .DATA STAT xx : Statusline on/off/show ( xx = on / off / "blank" )L .DATA SVIN xx : Save internal commands on/off ( xx = on / off )L .DATA SVOL xx : Save "old" commands on/off ( xx = on / off )\ .DATA RING : FIFO is a ringbuffer : UP- and DOWN-ARROW roll through the FIFO- .DATA VERS : Show MCE Versiono.IFF INI .GOTO 60$I.DATA The read and replace options, if no file is specified, follow thenJ.DATA the same file name convention as at startup: the file(s) accordingE.DATA to the current CLI is read in, i.e. the command "MCE REPLace"pH.DATA effects in an MCE restart (but the FIFO buffer is kept), usefull-.DATA after a SET TERMINAL new_cli command.EO.DATA When a space is given as filename, only SY:[cur_dir]MCEINI.xxx is read. A.DATA [cur_dir] is the default directory at the startup of MCE.F.60$:I#.IFF A$SV .IFT HLPNEW .DATA 1 RECALI#.IFF A$SV .IFF HLPNEW .DATA 2 RECALD.IFT A$SV .DATA 3 RECALLJ.DATA Recalling a command is done by entering the first part of a commandK.DATA which was previously executed, termimated by the function key ,C..DATA or if VT2xx support is included .I.DATA This will find the last command already executed starting with theeI.DATA string entered. The command may be edited or executed by pressingpL.DATA the return key. A second keystroke searches further back in theI.DATA FIFO. When no string is entered, the last defined string is taken.lE.DATA Note that the function key may not have any superimposed 6.DATA translation defined (by defining "PF2 := ...")..DATA Example: :.DATA +>DIR X.DAT ! Previously entered commands.DATA +>DMP X.DATm.DATA +>..N.DATA +>D ! Will recall the last command starting with "D":.DATA +>DMP X.DATf@.DATA +> ! Will recall the for last command:.DATA +>DIR X.DATa7.DATA +>DI ! Will recall the command: .DATA +>DIR X.DATe.IFF EDT .GOTO 70$$.IFF A$SV .IFT HLPNEW .DATA 1 KEYPAD$.IFF A$SV .IFF HLPNEW .DATA 2 KEYPAD.IFT A$SV .DATA 3 KEYPAD.DATAF2.DATA MCE-'VERS' VT10x / VT2xx / VT3xx Keypad :M.DATA +--------+-----------------+ +--------+--------+--------+--------+AM.DATA | | | |\\\\\\\\| | | |tM.DATA | HELP | EXECUTE NOWAIT | |\\GOLD\\| KPHELP | RECALL | DELLIN |DM.DATA | | | |\\\\\\\\| | | |)N.DATA +--------+--------+--------+ +--------+--------+--------+--------+ M.DATA | | | | | | SHOCMD | SHOFIF | |oM.DATA | RECALL | | | | TRANSL | ------ | ------ | DELWRD |eM.DATA | | | | | |\\VERS\\|\\FREE\\| |eM.DATA +--------+--------+--------+ +--------+--------+--------+--------+ M.DATA | | | | | | | | |CM.DATA | | | | | | | | DELCHR |/M.DATA | | | | | | | | |LM.DATA +--------+--------+--------+ +--------+--------+--------+--------+TM.DATA | | | | EOL | | |-M.DATA | ^ | | WORD | ------ | | |IM.DATA | | | | |\DELLIN\| | |CM.DATA +--------+--------+--------+ +--------+--------+--------+ ENTER |TM.DATA | | | | | BEGLINE | | |IM.DATA | <- | | | -> | | --------------- | | |eM.DATA | | V | | |\\\\CLRLINE\\\\\\| | |FM.DATA +--------+--------+--------+ +-----------------+--------+--------+a.70$:d .close* 'cli' PIP LB:'HLPUIC'MCE.HLP/PU/NM.80$: ';'PRNAME' -- Creating build files .....  .open MCEASM.CMD .data ;a# .data ; MCE Macro buildfileoL .data ; Created on '' '