.MCALL .MODULE .MODULE INDDCL,VERSION=02,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 .SBTTL Macro definitions ;+ ;External macros. ;- .MCALL .SETTOP, .EXIT, .WRITW, .CLOSE, .ELRG, .RDBDF .MCALL RT5DF$ ,FDBDF$, DEFIN$, FERDF$ .RDBDF ;Define region assignments RT5DF$ ;Define RT offsets FDBDF$ ;Define FDB offsets DEFIN$ ;Definitions for IND files FERDF$ ;Define file service error codes .PSECT INDDCL .SBTTL INDCL - Print DCL command and pass to KMON ;+ ;INDCL ;This routine prints the DCL command, then writes the data overlay ;(in memory) to the save image. The DCL command is stored in the ;monitor's chain area and an EXIT is issued to return to KMON. ; ; Input: ; R0 -> Command buffer address ;- .ENABL LSB INDCL:: MOV R0,R2 ;Get the pointer to the command buffer MOV CMDBE,R3 ;Get end of buffer MOV R3,R0 ;Save end of buffer for last character check SUB R2,R3 ;Get length of command CMP R3,#134. ;Is the command string longer than 134. chr's? BLOS 1$ ;No MOV #134.,R3 ;Yes truncate it 1$: CMPB -(R0),# ;Form feed? BEQ 6$ ;Yes, ignore the line CMPB @R0,# ;How about vertical tab BEQ 6$ ;Yes, ignore it CMPB @R2,#'@ ;Indirect file command? BNE 2$ ;No MOV #GCML,R0 ;Get GCML control block address CALL $MGCL4 ;Open next level of indirect file JMP INDRD1 ;Read in next command file 2$: MOVB R2,PRFLAG ;Indicate trailing by making non-zero MOV R2,R1 ;Set up command buffer pointer for PRMSG MOV R3,R2 ;Set up buffer length CMPB @R1,# ;Comment line? BEQ 5$ ;Yes CMPB @R1,# ;External comment? BNE 3$ ;No, check for end of file BIT #,.LIFLG ;Suppress semi-colon? BNE 5$ ;No, print it TSTB (R1)+ ;Point beyond it DEC R2 ;One less character to worry about BR 5$ ;Now print it 3$: CMPB @R1,#'/ ;End of command file? BNE 4$ ;No TRAP EREOF ;Print EOF message and exit 4$: BIT #,.LIFLG ;Suppress KMON call? BNE 7$ ;Branch if no MOVB #,-(R1) ;Yes, make it a comment INC R2 ;Adjust the command string length 5$: CALL PRMSG1 ;Print string as comment 6$: JMP INDRD ;Process the next command. ;+ ;At this point it has been determined that the string is a KMON command and ;it should be passed to KMON as such. ;- 7$: MOV #GCML,R0 ;Point to GCML block CALL $MGCL3 ;Close the current file and push it down BCS 10$ ;Notify that error occured SAVE ;Save the command buffer pointer BIS #,.LIFLG ;Set flag to print dot before the command CALL PRMSG1 ;Print the command MOV #NDATF,R5 ;Get the number of data files MOV #DATDN,R1 ;Point to first data FDB 8$: TSTB F$FLGS(R1) ;Is the file open? BEQ 9$ ;No TRAP ERXQT ;Yes, data file open error 9$: ADD #F$SIZE,R1 ;Point to next data FDB DEC R5 ;All FDB'S checked? BNE 8$ ;No RESTORE ;Restore the pointer to command buffer MOV SP,ISTACK ;Save pointer to internal stack for later TST REGCRE ;Was a region created for the symbol table BNE 11$ ;Branch if yes - no need to write out to self MOV SYMOVL,R5 ;Get pointer into overlay table MOV (R5)+,R1 ;Core address MOV (R5)+,R3 ;Relative block MOV (R5)+,R2 ;Word count .WRITW #EMTBLK,#17,R1,R2,R3 BCC 11$ ;Branch if no error 10$: MOV R1,R0 ;Get FDB pointer MOV #,F$ERR(R0) ;Set up second message for write error TRAP ERSPW ;Swap error ;+ ;Store command in chain area and exit. ;- 11$: MOV @#SYSPTR,R1 ;Get address of RMON BISB #,$INDIR(R1) ;Indicate KMON called by IND MOV #$CHAIN+2,R1 ;Point to chain area SAVE ;Save pointer to start of chain area 12$: MOVB (R4)+,(R1)+ ;Move command into chain area BNE 12$ ;Branch until done SUB (SP)+,R1 ;Calculate length of commands MOV R1,@#$CHAIN ;and save it for KMON BIS #,@#$JSW ;Indicate passing commands to KMON CLR R0 ;Set up to do SETTOP .SETTOP ;Issue SETTOP here before exiting. This ;prevents IND from being unnecessarily swapped ;out by KMON. One less access to floppy BIC #,REGION+R.GSTS ;Make sure global region stays around .ELRG #EMTBLK,#REGION ;Eliminate region for now CLR R0 ;R0 must be zero on CHAIN from exit .EXIT ;Pass the commands to KMON SETEND: ;Location to issue SETTOP .DSABL LSB .END