.MCALL .MODULE .MODULE INDSET,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 .MCALL DEFIN$ DEFIN$ ;Definitions for IND files .PSECT INDSET .SBTTL SETT, SETF, SETN, SETS directives ;+ ;SETT - Set symbol true ;SETF - Set symbol false ;- .ENABL LSB SETT:: CLRB -(SP) ;Set symbol true .ASSUME EQ 0 BR 1$ ;Go set symbol type SETF0:: MOVB #,-(SP) ;Set symbol false 1$: CLRB R1 ;Set symbol type to logical .ASSUME EQ 0 BR SET ;Do common set code SETL0:: CLRB SYMTP ;Make symbol type logical CALL PRSYM ;Look for symbol in symbol table INCB SETLFL ;Set SETL flag for negative logic CALL EVNX ;Evaluate the expression BIC #^C,R1 ;Any bits set that shouldn't be? MOVB R1,SETYP(R5) ;Set true or false BR DONE ;Exit from routine ;+ ;SETN - Set numeric symbol ;- SETN:: MOVB #,R1 ;Set symbol numeric BR SET ;Do common set code ;+ ;SETS - Set string symbol ;- SETS:: MOVB #,R1 ;Set symbol string .BR SET ;+ ;Common set code ;- SET: MOVB R1,SYMTP ;Set symbol type BNE 4$ ;If not equal, don't test for bit manipulation SAVE ;Save command buffer CALL $GNBLK ;Get next non-blank character BCS 7$ ;Branch to error if end of line CMPB R2,# ;Open bracket? BNE 3$ ;Branch if no - logical set TSTB (SP)+ ;Throw away old buffer pointer CALL EVNX ;Evaluate expression CMPB (R0)+,# ;End in close bracket? BNE 7$ ;Branch to error SAVE ;Save results CALL GTSYM ;Get symbol BCS 7$ ;Branch if error CALL SRSYM ;Search for symbol in table BCS 9$ ;Branch if not found BITB #,SETYP(R5);Numeric symbol? BEQ 11$ ;Branch to error if not RESTOR ;Get bit word TSTB (SP)+ ;Bit set or clear? BEQ 2$ ;Branch to set BIC R1,SEVAL(R5) ;Clear specified bits BR DONE ;Join common exit 2$: BIS R1,SEVAL(R5) ;Set specified bits BR DONE ;Join common exit 3$: RESTOR ;Restore old buffer pointer 4$: CALL PRSYM ;Parse symbol TSTB SYMTP ;Logical symbol? .ASSUME EQ 0 BNE 5$ ;No MOVB (SP)+,SETYP(R5) ;Set true or false BR DONE ;Exit from routine 5$: CMPB SYMTP,# ;Numeric symbol? BNE 6$ ;No CALL ASVALN ;Assign numeric value BCS 7$ ;Branch on error - syntax error MOVB SYMTP,SETYP(R5) ;Override radix set in ASVALN ;Set radix to spec instead of current rad mode BR DONE ;Get next control string 6$: SAVE ;Save SYMTAB entry CALL GSVAL ;Get string value MOV R5,R0 ;Get pointer in R0 RESTOR ;Restore SYMTAB pointer CALL ASVALS ;Assign string value BCC DONE ;Done, get next control string TRAP ERSOV ;Symbol table overflow 7$: TRAP ERSYN ;Syntax error 8$: TRAP ERRES ;Error redefining special symbol 9$: TRAP ERUDS ;Undefined symbol 10$: TRAP ERRED ;Error redefining symbol 11$: TRAP ERTYP ;Symbol type error .DSABL LSB .SBTTL Set symbol decimal or octal ;+ ;SETD/SETO ;Set numeric symbol to decimal or octal ;- .ENABL LSB SETD0:: MOV #,-(SP) ;Set symbol to decimal BR 1$ ;Branch to common code SETO:: MOV #,-(SP) ;Set symbol to octal 1$: MOVB #,SYMTP ;Setup the symbol type CALL PRSYM ;Get or create the symbol MOVB (SP)+,SETYP(R5) ;Set the appropriate symbol type DONE: JMP INDRD ;Done, get next control string .DSABL LSB .END