.MCall .Module .Module KEDCM8 RELEASE=V02 VERSION=09 COMMENT=,IDENT=NO,AUDIT=NO,GLOBAL=.KEDC8 ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. .Enable LC .Enable GBL ; ;MODULE: KEDCM8 ; ;ABSTRACT: ; ; This module contains the routines to parse the keywords of ; command mode command lines. It is called by KEDCM1 and ; returns to KEDCM1 for the dispatching. ; .SbTtl Definitions .SbTtl Error Macro Definitions ;+ ;ERROR ; .IIf NDF,$KED$, .Page .IIf NDF,$KED$, .SbTtl Errors from KEDCM8 module ; ; Module: KEDCM8 ; ; Define the error macros for this module ; .MCall ErrDef ErrDef C8,ERROR ;- ;+ ;HELPER ; .IIf NDF,$KED$, .Page .IIf NDF,$KED$, .SbTtl Errors from KEDCM8 module ; ; Module: KEDCM8 ; ; Define the help macros for this module ; .MCall HlpDef HlpDef C8 ;- .SbTtl .SbTtl Command Processing Data and Routine .SbTtl .SbTtl KYSRCH - Key word parser ;++ ;KYSRCH ; ;FUNCTIONAL DESCRIPTION: ; ; Search for keyword in list ; ;used to search keyword lists by both KYCALL and KYDATA ; ;INPUT: ; R1 -> target string ; R3 -> .WORD KYLST,KYDATA ; ; KyLst: .Asciz /Key-Words/ ;- marks abreviation ; ... ; .Byte 0 ; ; KyDat: .Word KyVal1 ;data or routine address ; .Word KyVal2+1 ;chained keyword list ; ... ; .Word KyErrValue ; ;OUTPUT: ; R1 -> char after good match ; R3 -> data value to use ; R0,R2 used ;-- .Enable LSB 10$: Dec R3 ;~x~Make address even KySrch:: ;~x~ Call SpNor ;~x~Ignore leading spaces Push ;Save start of target ;and abbreviation indicator Mov (R3)+,R2 ;Get keyword list Mov (R3)+,R3 ;Address list 20$: Clr @SP ;~x~For next word Mov 2(SP),R1 ;Set for this word 30$: TstB @R2 ;~x~End of this word Beq 50$ ;~x~Yes- check end of list CmpB @R2,#'- ;Abbreviation indicator? Bne 40$ ;~x~No Inc @SP ;Remember so Inc R2 ;Next char of pattern Br 30$ ;~x~And look again ........... 40$: MovB (R1)+,R0 ;~x~Get the char Call KeyTrm ;~x~Term? Make upper case Beq 60$ ;~x~Term CmpB R0,(R2)+ ;Save as list Beq 30$ ;~x~Yes keep going Br 70$ ;~x~Mismatch- keep looking ........... 50$: MovB @R1,R0 ;~x~Check char after end Call KeyTrm ;~x~Is it a terminator? Beq 90$ ;~x~Yes- end ok Br 70$ ;~x~No- keep looking ........... 60$: Tst @SP ;~x~No, abbrev legal Bne 80$ ;~x~Yes- take it 70$: TstB (R2)+ ;~x~Scan to end of keyword Bne 70$ ;~x~Ended by zero Tst (R3)+ ;Bump address pointer TstB @R2 ;End of list? Bne 20$ ;~x~Nope carry on (not set) 80$: Dec R1 ;~x~R1 -> term on illegal char 90$: Add #4,SP ;~x~Dump stuff from stack Mov @R3,R3 ;Get address Call SpNor ;~x~Ignore spaces Bit #1,R3 ;Chain to next list? Bne 10$ ;~x~Yes- next list Return ;~x~ ...... .Dsabl LSB .SbTtl Command keyword lists ; ; Command keyword lists ; ; ; KlSet Nam,?Lst,?Adr ; ; Nam name of list ; Lst word list address ; Adr address list address ; .Macro KlSet Nam,?Lst,?Adr .Enable LSB PSect .LST. .Even Nam: .Word Lst,Adr Lst: PSect .ADR. Adr: .EndM ; ; KL Wrd,Adr ; ; Wrd keyword ; Adr transfer address ; .Macro KL Wrd,Adr PSect .LST. .If IDN,Wrd,/END/ .Byte 0 .Even .IfF .Asciz \Wrd\ .EndC PSect .ADR. .Word Adr .If IDN,Wrd,/END/ .Dsabl LSB PSect KEDCMD .EndC .EndM ; ; Command lists ; .Globl K.Lst KLSet K.Lst ;~x~ KL A-DJUST,C.TAdj ;~x~ KL F-ILL,C.Fill ;~x~ KL CH-ANGE,C.Chng ;~x~ KL CLO-SE,C.Cls ;~x~ KL CLE-AR,K.Clr+1 ;~x~ KL EXIT,K.Exit+1 ;~x~ KL INC-LUDE,C.Incl ;~x~ KL INP-UT,C.OpI ;~x~ KL LE-ARN,C.Lern ;~x~ KL LOC-AL,C.Locl ;~x~ KL OP-EN,K.Opn+1 ;~x~ KL OU-TPUT,C.OpO ;~x~ KL PURGE,C.PrgO ;~x~ KL QUIT,K.Quit+1 ;~x~ KL LOA-D,C.Load ;~x~ KL SA-VE,C.Save ;~x~ KL SE-T,K.Set+1 ;~x~ KL SK-IP,C.Skip ;~x~ KL T-ABS,K.Tab+1 ;~x~ KL W-RITE,K.Writ+1 ;~x~ KL /END/,C.NCmd ;~x~ ;+*JMP* ;KL @,C.At ;implemented as part of C.NCmd ;KL /END/,C.Err ;implemented as part of C.NCmd ;-*JMP* ; ; Sublist for clear ; KLSet K.Clr ;~x~ KL P-ASTE,C.PsCl ;~x~ KL M-ACRO,C.Clr ;~x~ KL A-LL,K.All+1 ;~x~ KL /END/,C.Err ;~x~ ; ; Sub-Sublist for clear all ; KLSet K.All ;~x~ KL M-ACROS,C.AClr ;~x~ KL /END/,C.Err ;~x~ ; ; Sublist for Quit ; KLSet K.Quit ;~x~ KL S-AVE,C.QSav ;~x~ KL /END/,C.Quit ;~x~ ; ; Sublist for Exit ; KLSet K.Exit ;~x~ KL S-AVE,C.ESav ;~x~ KL /END/,C.Exit ;~x~ ; ; Sublist for open ; KLSet K.Opn ;~x~ KL I-NPUT,C.OpI ;~x~ KL O-UTPUT,C.OpO ;~x~ KL /END/,C.Err ;~x~ ; ; Sublist for no ; KLSet K.No ;~x~ KL H-ELP,C.NHlp ;~x~ .If NE,VT10$0 ;VT100 Terminal KL Q-UIET,C.ClrQ ;~x~ .EndC; NE,VT10$0 ;VT100 Terminal KL R-ETURN,C.NRtn ;~x~ KL S-ELECT,C.NSlt ;~x~ KL T-ABS,C.NoTb ;~x~ KL WO-RKING,C.NoWo ;~x~ KL WR-AP,C.ClrW ;~x~ KL /END/,C.Err ;~x~ .If NE,VT10$0 ;VT100 Terminal ; ; Sublist for screen ; KLSet K.Scr ;~x~ KL 80,C.S80 ;~x~ KL 132,C.S132 ;~x~ KL D-ARK,C.Dark ;~x~ KL L-IGHT,C.Lite ;~x~ KL /END/,C.Err ;~x~ .EndC; NE,VT10$0 ;VT100 Terminal ; ; Sublist for Set Error ... ; KLSet K.Erro ;~x~ KL C-ONTINUE,C.ErCo ;~x~ KL S-TOP,C.ErSt ;~x~ KL /END/,C.Err ;~x~ ; ; Sublist for entity ; KLSet K.Ent ;~x~ KL S-ECTION,C.SPar ;~x~ KL P-AGE,C.SPag ;~x~ KL /END/,C.Err ;~x~ ; ; Sublist for search ; KLSet K.Srch ;~x~ KL BE-GIN,C.SrBg ;~x~ KL BO-UNDED,C.SrBo ;~x~ KL EN-D,C.SrEn ;~x~ KL EX-ACT,C.SrEx ;~x~ KL G-ENERAL,C.SrNe ;~x~ KL NOR-ETURN,C.NRtn ;~x~ KL NOS-ELECT,C.NSlt ;~x~ KL NO,K.SNo+1 ;~x~ KL R-ETURN,C.Rtrn ;~x~ KL S-ELECT,C.SSlt ;~x~ KL U-NBOUNDED,C.SrUn ;~x~ KL /END/,C.Err ;~x~ ; ; Sublist for search no ; KLSet K.SNo ;~x~ KL SE-LECT,C.NSlt ;~x~ KL R-ETURN,C.NRtn ;~x~ KL /END/,C.Err ;~x~ ; ; Sublist for tabs ; KLSet K.Tab ;~x~ KL A-DJUST,C.TAdj ;~x~ KL /END/,C.Err ;~x~ ; ; Sublist for journal ; KLSet K.Jour ;~x~ KL NO,K.JNo+1 ;~x~ KL NOS-AVE,C.NJSa ;~x~ KL S-AVE,C.JoSa ;~x~ KL /END/,C.Err ;~x~ ; ; Sublist for journal no ; KLSet K.JNo ;~x~ KL SA-VE,C.NJSa ;~x~ KL /END/,C.Err ;~x~ ; ; Sublist for write ; KLSet K.Writ ;~x~ KL J-OURNAL,C.WrJo ;~x~ KL /END/,C.Writ ;~x~ ; ; The remaining sublists are used by commands directly. ; They are not automatically chained to by the dispatcher. ; ; ; Sub lists for page and section ; .Globl K.Pgr KLSet K.Pgr ;~x~ KL L-INES,C.SPgL ;~x~ KL /END/,C.SPgE ;~x~ ; ; Sublist for include and skip ; .Globl I.Lst KLSet I.Lst ;~x~ KL P-AGES,C.IPag ;~x~ KL L-INES,C.ILin ;~x~ KL R-EST,C.IRst ;~x~ KL /END/,C.Err1 ;~x~ ; ; Sublist for write ; .Globl W.Lst KLSet W.Lst ;~x~ KL P-AGES,C.WPag ;~x~ KL L-INES,C.WLin ;~x~ KL R-EST,C.WRst ;~x~ KL S-ELECT,C.WSlc ;~x~ KL /END/,C.Err1 ;~x~ ; ; Sublist for set ; KLSet K.Set ;~x~ KL BE-GIN,C.SrBg ;~x~ KL BO-UNDED,C.SrBo ;~x~ KL EN-D,C.SrEn ;~x~ KL ENT-ITY,K.Ent+1 ;~x~ KL ER-ROR,K.Erro+1 ;~x~ KL EX-ACT,C.SrEx ;~x~ KL F-REQUENCY,C.Freq ;~x~ KL G-ENERAL,C.SrNe ;~x~ KL H-ELP,C.SHlp ;~x~ KL J-OURNAL,K.Jour+1 ;~x~ KL NO,K.No+1 ;~x~ KL NOH-ELP,C.NHlp ;~x~ KL NOR-ETURN,C.NRtn ;~x~ KL NOSA-VE,C.NJSa ;~x~ KL NOSE-LECT,C.NSlt ;~x~ KL NOT-ABS,C.NoTb ;~x~ KL NOWR-AP,C.ClrW ;~x~ KL NOWO-RKING,C.NoWo ;~x~ KL P-AGE,C.SPag ;~x~ KL R-ETURN,C.Rtrn ;~x~ KL SEA-RCH,K.Srch+1 ;~x~ KL SEC-TION,C.SPar ;~x~ KL SEL-ECT,C.SSlt ;~x~ KL T-ABS,C.Tabs ;~x~ KL U-NBOUNDED,C.SrUn ;~x~ KL WO-RKING,C.StWo ;~x~ KL WR-AP,C.SetW ;~x~ .If NE,VT10$0 ;VT100 Terminal KL 80,C.S80 ;~x~ KL 132,C.S132 ;~x~ KL D-ARK,C.Dark ;~x~ KL L-IGHT,C.Lite ;~x~ KL NOQ-UIET,C.ClrQ ;~x~ KL Q-UIET,C.SetQ ;~x~ KL SC-REEN,K.Scr+1 ;~x~ .EndC; NE,VT10$0 ;VT100 Terminal KL /END/,C.Err ;~x~ PSect KEDCMD .End