.MCALL .MODULE .MODULE INDIN1,VERSION=09,COMMENT= GLOBAL=.IIN1 ; 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 calls ;+ ;System macro calls. ;- .MCALL .GVAL, .MRKT, .CSTAT, .POKE, .CMKT .MCALL GCLDF$, RT5DF$, DEFIN$ GCLDF$ ;Define GCML block offsets. RT5DF$ ;Define RT offsets. DEFIN$ ;Definitions for IND files OPSECT INDIN1 .SBTTL INDIN1 - One time initialization code ;+ ;INDIN1 ;This routine is called by the INDIN0 module. The following routine is ;executed after the initial RUN of IND. It is not entered if IND is ;re-started by KMON. The first time IND is run, that is the first time ;it is run after compilation PDLPTR is 0. Therefore, the push down list ;is taken from the GCML block. PDLPTR is never modified later. The value ;in PDLPTR is used from then on to set up the push down list. ; ; R0 = Pointer to the start of RMON ; ; Call: CALL INDIN1 ;Set up pointers and tables ; ;Contents of registers are undetermined upon return. ;- .ENABL LSB INDIN1::MOV #,SPSEXS+SEVAL ;Initialize exit status to success MOV PDLPTR,R0 ;Get the initial push down list pointer BNE 5$ ;Branch if IND has been used before MOV GCML+G.PPTR,PDLPTR ;Save the initial push down list pointer BR 10$ ;Branch around next instruction 5$: MOV R0,GCML+G.PPTR ;Restore the initial push down list pointer 10$: MOV #SS,SSP ;Initialize current pointer in subr. stack MOV #SS,SSB ;Initialize beginning of subr. stack MOV #BLOCK,R1 ;Point to area in INDIMP to initialize CLR (R1)+ ;Clear the first two bytes (BLOCK and BLKFLG) CLR (R1)+ ;Clear next two bytes (SCAN) MOV #,STATUS ;Default initial EXIT status ;+ ;Initialize SPECIAL logical symbols. ;- MOV #SPCTAB,R0 ;Start with start of special sym tbl 15$: CMP (R0)+,(R0)+ ;Point to area to initialize MOV #1,(R0)+ ;Set value to false (LOGF) .ASSUME EQ 1 CMP R0,#SPTRU ;End of logical symbols (FALSE)? BLO 15$ ;No, get next CLR SPSOCT+SETYP ;Default OCTAL symbol true .ASSUME EQ 0 MOV #SPSTP,R0 ;Point to start of numeric special symbols 20$: CMP (R0)+,(R0)+ ;Adjust pointer to store..... TST (R0)+ ; ....word for numeric value CLR (R0)+ ;Initialize area CMP R0,#SPSSU ;End of list? BLO 20$ ;No, get next ;+ ;Initialize DATE and DATE4Y special symbols. ;- MOV #SPSDAT+6,R0 ;Point to first byte to initialize MOV #SPSD4Y+6,R1 ; in both DATE and DATE4Y tables ;009 25$: MOVB #,(R0)+ ;Move space for no date MOVB #,(R1)+ ;Move space for no date ;009 CMP R0,#SPSDAT+17 ;End of DATE area? BLO 25$ ;No, get more MOVB #,(R1)+ ;Fill up the end of DATE4Y ;009 MOVB #,(R1)+ ; with two more spaces ;009 ;+ ;Initialize other stuff... ;- CLRB SPSDEV+SELEN ;Set null to initialize MOV RMON,R0 ;Get starting address of RMON. MOV #SYMTAB,SYMTB ;Set start of symbol table MOV #SYMTAB+STSIZ,SYMND ;Set end of symbol table BIC #1,SYMND ;Make sure end of SYMTAB is on word boundary MOV SYMTB,SYMFR ;Set address of first free entry MOV SYMND,LSYME ;Set end of local symbol table BISB #,G.MODE+GCML ;Set to return on file open don't ; convert lower to upper case BICB #,G.MODE+GCML ;Clear file close bit ; allow comments to come through don't rewind ; on end-of-file MOVB #-1,G.CDEP+GCML ;Make sure current depth is -1 MOV #VAR0,R1 ;Point to start of impure area to initialize 30$: CLR (R1)+ ;Initialize variables in impure area CMP R1,#VAR1 ;Done? BLO 30$ ;No, keep clearing CALL CLRLBT ;Clear label table MOV #,.LIFLG ;Enable substitution, lowercase, suffix, ;prefix, and octal, and DCL processing MOV #,.LFLG2 ;Enable typeahead CLR ENDAT ;Clear ENABLE DATA word MOV #DATDN,R1 ;Get first data file FDB. MOV #NDATF,R0 ;Get the number of files to close. 35$: CLRB F$FLGS(R1) ADD #F$SIZE,R1 ;Point to next FDB to close DEC R0 ;Decrement file count BGT 35$ ;Loop til done. .GVAL #EMTBLK,#$WILDDF ;Get jobs on word boundary SWAB R0 ;Move job slot byte to low byte MOVB R0,SPSJOB+SEVAL ;Store it in special symbol .GVAL #EMTBLK,#$CNFG3 ;Get contents of third configuration word BIC #^C,R0 ;Get rid of all but the 2 top bits CMP #,R0 ;Are both bits set? BNE 40$ ;No, not ID space mode CLRB SPSMOD+SETYP ;Set to TRUE .ASSUME EQ 0 40$: .GVAL #EMTBLK,#$CONFG ;CONFIG word MOV #60.,TICKS ;Default to 60 HZ clock BIT #,R0 ;Is it a 50 HZ clock? BEQ 45$ ;No, already set to 60 MOV #50.,TICKS ;Set ticks per second to 50. 45$: MOV #10,SPSSYS+SEVAL ;Assume the running monitor is FB or XM BIT #,R0 ;Running FB or XM? BNE 50$ ;Yes,We have the correct system number DEC SPSSYS+SEVAL ;No, set to 7 (SJ). 50$: BIT #,R0 ;Is this extended memory? BEQ 55$ ;No CLRB SPCTAB+SETYP ;Yes set true. .ASSUME EQ 0 55$: BIT #,R0 ;FB or XM monitor? BNE 60$ ;Branch if yes .GVAL #EMTBLK,#$SYSOP ;Sysgen option word BIT #,R0 ;Timer support? BEQ 70$ ;Branch if no need to check for clock 60$: CLR TIMBLK ;No high order word MOV #3,TIMBLK+2 ;Set low order word for 3 ticks .MRKT #EMTBLK,#TIMBLK,#CMPLET,#1 MOV #100000,R0 ;Set up a counter 65$: TSTB TIMSUP ;Has the flag word been modified? BNE 70$ ;Yes, we've timed out DEC R0 ;Decreament count BNE 65$ ;And keep looping 70$: .CMKT #EMTBLK,#1 ;Make sure MRKT is cancelled MOV RMON,R0 ;Get location of start of RMON MOVB $SUNIT(R0),SPSSU+SEVAL ;Store the system device unit number MOV $SINDX(R0),R1 ;Get device table index ADD $PNPTR(R0),R0 ;Point to $PNAME table ADD R1,R0 ;Point to system device in $PNAME MOV @R0,R1 ;Get name (in RAD50) MOV #CSIBLK,R0 ;Point to scratch buffer CALL $C5TA ;Convert name to ASCII MOV CSIBLK,SPSSD+SEVAL ;Store device name MOV RMON,R1 ;Get start of RMON again MOV $MNAM2(R1),-(SP) ;Save second word for conversion MOV $MNAM1(R1),R1 ;Get first RAD50 word of monitor name MOV #SPSMON+SEVAL,R0 ;Point to area to store ASCII characters CALL $C5TA ;Convert first word MOV (SP)+,R1 ;Get second word CALL $C5TA ;And convert it .CSTAT #EMTBLK,#17,#SCR ;Get status on channel 17 ;bcs ;No error can occur here since 17 must be open ;for overlayed file MOV SCR+12,R0 ;RAD50 handler name (without prefix) MOV SCR+10,R1 ; unit number CALL $DEVTR ;Translate to 64-unit-compatible name MOV R0,R1 ;put result in R1 for ASCII conversion MOV #CSIBLK,R0 ;Point to scratch area CALL $C5TA ;Convert it to ASCII .GVAL #EMTBLK,#$INDDV ;Point to ASCII device name for RUN IND MOV CSIBLK,(R0)+ ;Store the ASCII device name MOV CSIBLK+2,(R0)+ ;Store the ASCII device name MOVB #,-(R0) ;Move in colon RETURN .DSABL LSB .SBTTL CMPLET - Completion routine for MRKT ;+ ;CMPLET ;Completion routine for MRKT. If there is a clock the MRKT should time out ;before the count is exhausted. ;- CMPLET: INCB TIMSUP ;Set timer support flag word non-zero RETURN ROUNDUP ;Check for overflow and roundup .END