.MCALL .MODULE .MODULE INDPRC,VERSION=03,COMMENT= ; 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. .ENABL GBL,LC .MCALL DEFIN$ DEFIN$ ;Definitions for IND files .PSECT INDPRC .SBTTL CMDTB - ASCII directives ;+ ;The following are the valid directives in ASCII. These should be kept in ;the same order as the PROTB table that follows. ;- .NLIST BEX CMDTB: .ASCIZ /BEGIN/ .ASCIZ /END/ .ASCIZ /EXIT/ .ASCIZ /STOP/ .ASCIZ /OPENA/ .ASCIZ /ERASE/ .ASCIZ /DELAY/ .ASCIZ /PARSE/ .ASCIZ /TESTFILE/ .ASCIZ /TESTDEVICE/ .ASCIZ /OPENR/ .ASCIZ /READ/ .ASCIZ /PURGE/ .ASCIZ /ASKN/ .ASCIZ /ASKS/ .ASCIZ /ASK/ .ASCIZ /SETT/ .ASCIZ /SETF/ .ASCIZ /SETL/ .ASCIZ /SETN/ .ASCIZ /SETD/ .ASCIZ /SETO/ .ASCIZ /SETS/ .ASCIZ /INC/ .ASCIZ /DEC/ .ASCIZ /GOTO/ .ASCIZ /ONERR/ .ASCIZ /OPEN/ .ASCIZ /VOL/ .ASCIZ /STRUCTURE/ .ASCIZ /DUMP/ .ASCIZ /CLOSE/ .ASCIZ /DATA/ .ASCIZ /ENABLE/ .ASCIZ /DISABLE/ .ASCIZ /GOSUB/ .ASCIZ /RETURN/ .ASCIZ /CHAIN/ .ASCIZ /TEST/ .BYTE 0 ;End of table .EVEN .LIST BEX .SBTTL PROTB - Dispatch table. ;+ ;The following is the directive dispatch table. This table should be kept in ;the same order as CMDTB. ;- PROTB: .WORD BEGIN .WORD END .WORD EXIT .WORD STOP .WORD OPENA .WORD ERASE .WORD DELAY .WORD PARSE .WORD TESTFL .WORD TESTDV .WORD OPENR .WORD READ .WORD PURGE .WORD ASKN .WORD ASKS .WORD ASK .WORD SETT .WORD SETF0 .WORD SETL0 .WORD SETN .WORD SETD0 .WORD SETO .WORD SETS .WORD INC0 .WORD DEC0 .WORD GOTO .WORD ONERR .WORD OPEN .WORD VOL .WORD STRUCT .WORD DUMP XCLOSE: .WORD CLOSE .WORD DATA .WORD ENABL XDSABL: .WORD DSABL .WORD GOSUB .WORD RETUR .WORD CHAIN .WORD TEST .WORD LABEL XIF: .WORD IF0 .SBTTL PRCMD - Parse IND command ;+ ;PRCMD ;Process indirect file processor commands. ; ; these commands are flagged by a period (.) in character ; position one of the line. ; ; Input: R0 -> address of first character in line (period) ;- .ENABL LSB PRCMD:: INC R0 ;Skip period MOV R0,R4 ;Save pointer to the first character MOV #,R1 ;Assume .IFxxx command MOVB @R0,-(SP) ;Get first two characters MOVB 1(R0),1(SP) ; of command on stack BIC #<40*400!40>,@SP ;Make sure characters are in uppercase CMP (SP)+,#<"IF> ;Is it an .IFxxx command? BEQ 1$ ;Yes MOV #CMDTB,R2 ;Point to valid commands CALL TBSRC ;Search table for command BCC 1$ ;Found it CMP R0,# ;Pointing at the second character for label? BNE 9$ ;No, error 1$: CALL CKDDAT ;Default all lines to data file? BEQ 2$ ;No, process it as divective CMP R1,# ;Is it a DISABLE directive? BEQ 2$ ;Yes, ignore DATA ENABLE CMP R1,# ;Is it a CLOSE directive? BEQ 2$ ;Yes MOV #CMDBUF,R0 ;Get address of data MOV CMDBL,R1 ;Get its length JMP WDATA ;Write it out to the data file ;+ ;At this point it must be determined if we have a directive or a label. ;- 2$: MOV R0,R3 ;Copy command line pointer 3$: CMPB @R3,#<':> ;Colon (label)? BEQ 7$ ;Yes, process the label CMPB @R3,#<'$> ;Dollar sign? BEQ 6$ ;Don't display CMPB @R3,#<'0> ;Is it an alphanumeric? BLO 5$ ;No, process as terminator CMPB @R3,#<'Z+40> ;Higher than lowercase z? BHI 5$ ;Branch if yes CMPB @R3,#<'A+40> ;Lowercase alpha character? BHIS 4$ ;Yes, process as such CMPB @R3,#<'Z> ;Is it an alphanumeric? BHI 5$ ;Yes, process as terminator CMPB @R3,#<'A> ;Is it within the range A-Z? BHIS 4$ ;Yes, process as alphanumeric CMPB @R3,#<'9> ;Is it within the range 0-9? BHI 5$ ;No, process as terminator 4$: TSTB (R3)+ ;End-of-line? BNE 3$ ;No 5$: BIT #,.LIFLG ;Are we in trace mode? BEQ 6$ ;No, don't display the line TST LINDS ;Has this line been displayed? BNE 6$ ;Yes, don't display it a second time CALL DSPLY ;Display the line 6$: JMP @PROTB(R1) ;Go to command processor ;+ ;It has been determined that we have a label. ;- 7$: MOV #,R0 ;Get the pointer to the beginning of line. CMP R0,R4 ;Are we at the beginning of the line? BNE 8$ ;Error - label not valid here JMP LABEL ;Go do the label 8$: TRAP ERLAB ;Error - label not valid here 9$: TRAP ERIKW ;Illegal keyword .DSABL LSB .END