RUNSRCKEY       - SEARCH FOR KEYWORD MATCH                       21-AUG-1978 19:04:35   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)      41  DECLARATIONS

RUNSRCKEY       - SEARCH FOR KEYWORD MATCH                       21-AUG-1978 19:04:35   VAX-11 MACRO X0.3-11               Page   1

00                                                                                                                               (1)



                                     0000     1 	.TITLE	RUNSRCKEY- SEARCH FOR KEYWORD MATCH

                                     0000     2 	.IDENT	/00/

                                     0000     3 

                                     0000     4 ;

                                     0000     5 ;			  COPYRIGHT (c) 1977 BY

                                     0000     6 ;	      DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

                                     0000     7 ;

                                     0000     8 ; THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED

                                     0000     9 ; ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND WITH THE

                                     0000    10 ; INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR  ANY  OTHER

                                     0000    11 ; COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY

                                     0000    12 ; OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY

                                     0000    13 ; TRANSFERRED.

                                     0000    14 ;

                                     0000    15 ; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT  NOTICE

                                     0000    16 ; AND  SHOULD  NOT  BE  CONSTRUED  AS  A COMMITMENT BY DIGITAL EQUIPMENT

                                     0000    17 ; CORPORATION.

                                     0000    18 ;

                                     0000    19 ; DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF  ITS

                                     0000    20 ; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.

                                     0000    21 ;

                                     0000    22 

                                     0000    23 ;++

                                     0000    24 ; FACILITY: RUN-DETACHED CLI UTILITY

                                     0000    25 ;

                                     0000    26 ; ABSTRACT:

                                     0000    27 ;

                                     0000    28 ; THIS MODULE PERFORMS A KEYWORD SEARCH AND SETS OR CLEARS THE APPROPRIATE

                                     0000    29 ; BITS IN A MASK WORD IF THE KEYWORD IS FOUND.

                                     0000    30 ;

                                     0000    31 ;

                                     0000    32 ; ENVIRONMENT: USER MODE

                                     0000    33 ;

                                     0000    34 ; AUTHOR: C. A. MONIA	, CREATION DATE:12-AUG-1977

                                     0000    35 ;

                                     0000    36 ; MODIFIED BY:

                                     0000    37 ;

                                     0000    38 ;	, : VERSION 00

                                     0000    39 ;--

RUNSRCKEY       - SEARCH FOR KEYWORD MATCH                       21-AUG-1978 19:04:35   VAX-11 MACRO X0.3-11               Page   2

00              DECLARATIONS                                                                                                     (2)



                                     0000    41 	.SBTTL	DECLARATIONS

                                     0000    42 

                                     0000    43 ;

                                     0000    44 ; MACROS

                                     0000    45 ;

                                     0000    46 ; DEFINE DATA STRUCTURE

                                     0000    47 ;

                                     0000    48  

                                     0000    49 	.MACRO	$DSECT

                                     0000    50 	.PSECT	$ABS$,ABS

                                     0000    51 	.ENDM

                                     0000    52 ;

                                     0000    53 ; EQUATED SYMBOLS:

                                     0000    54 ;

                                     0000    55 ; KEYWORD ENTRY OFFSETS

                                     0000    56 ;

                                     0000    57  

                                     0000    58 	$DSECT

                           00000000  0000    59 $$$=.

                                     0000    60  

                           00000004  0000    61 COUNT:	.BLKL	1			; STRING COUNT

                           00000008  0004    62 ADDR:	.BLKL	1			; STRING ADDRESS

                           00000010  0008    63 MASK:	.BLKQ	1			; MASK

                           00000014  0010    64 COND:	.BLKL	1			; CONDITION IF TRUE (0 = SET BITS, 1=CLEAR)

                           00000014  0014    65 KEYLEN:	.BLKL	0			; LENGTH OF KEYWORD ENTRY

                                     0014    66  

                                     0014    67 ;

                                     0014    68 ; DEFINE ARGUMENT LIST OFFSETS

                                     0014    69 ;

                                     0014    70  

                           00000000  0014    71 .=$$$

                                     0000    72  

                           00000004  0000    73 	.BLKL	1			; LENGTH OF ARGUMENT LIST

                           00000008  0004    74 KEYLIST:.BLKL	1			; ADDRESS OF KEYWORD LIST

                           0000000C  0008    75 STRNG:	.BLKL	1			; ADDRESS OF STRING DESCRIPTOR

                           00000010  000C    76 OUMASK:	.BLKL	1			; ADDRESS OF QUADWORD MASK

                                     0010    77  

                           00000000  0010    78 .=$$$

                                     0000    79 ;+

                                     0000    80 ; RUN_SRCKEY - SEARCH KEYWORD LIST FOR MATCH

                                     0000    81 ;

                                     0000    82 ; THIS PROCEDURE IS CALLED TO SEARCH A TABLE OF KEYWORDS FOR ONE AND ONLY

                                     0000    83 ; ONE MATCH. IT RETURNS INFORMATION INDICATING SUCCESS OR FAILURE , THE VAL-

                                     0000    84 ; UE OF AN ASSOCIATED BIT MASK (IF THE SEARCH SUCCEEDED) AND THE NUMBER OF

                                     0000    85 ; MATCHING KEYWORD STRINGS FOUND.

                                     0000    86 ;

                                     0000    87 ; THE PROCEDURE WILL SEARCH FOR A UNIQUE KEYWORD HAVING A SUBSTRING THAT MATCH-

                                     0000    88 ; ES THE INPUT STRING.

                                     0000    89 ;

                                     0000    90 ;

                                     0000    91 ; INPUTS:

                                     0000    92 ;

                                     0000    93 ;	AP POINTS TO AN ARGUMENT LIST IN THE FOLLOWING FORMAT:

                                     0000    94 ;

                                     0000    95 ;		.LONG	3		; COUNT

                                     0000    96 ;		.LONG	KEYLIST		; ADDRESS OF KEYWORD LIST

                                     0000    97 ;		.LONG	STRNG		; ADDRESS OF CANDIDATE STRING DESCRIPTOR

RUNSRCKEY       - SEARCH FOR KEYWORD MATCH                       21-AUG-1978 19:04:35   VAX-11 MACRO X0.3-11               Page   3

00              DECLARATIONS                                                                                                     (2)



                                     0000    98 ;		.LONG	MASK		; ADDRESS OF QUADWORD MASK

                                     0000    99 ;

                                     0000   100 ;	EACH ENTRY IN THE LIST IS IN THE FOLLOWING FORMAT:

                                     0000   101 ;

                                     0000   102 ;		.LONG	COUNT		; STRING COUNT

                                     0000   103 ;		.LONG	ADDR		; STRING ADDRESS

                                     0000   104 ;		.QUAD	MASK		; MASK TO BE SET

                                     0000   105 ;		.LONG	COND		; STATE IF CONDITION IS TRUE (0=SET,-1=CLEAR)

                                     0000   106 ;

                                     0000   107 ;	A QUADWORD OF ZERO TERMINATES THE LIST.

                                     0000   108 ;

                                     0000   109 ;	THE PREFIX 'NO' PRECEDING A STRING IS USED TO  SPECIFY NEGATION OF

                                     0000   110 ;	THE KEYWORD.

                                     0000   111 ;

                                     0000   112 ; OUTPUTS:

                                     0000   113 ;

                                     0000   114 ;	R0 LBS = SUCCESS, A SINGLE MATCHING VALUE WAS FOUND

                                     0000   115 ;

                                     0000   116 ;	R1 = 1

                                     0000   117 ;	THE BITS SPECIFIED IN THE KEYWORD TABLE ARE SET (OR CLEARED) IN THE

                                     0000   118 ;	MASK WORD.

                                     0000   119 ;

                                     0000   120 ; 	R0 LBC = FAILURE

                                     0000   121 ;

                                     0000   122 ;	R1 = 0, NO MATCHING KEYWORD FOUND

                                     0000   123 ;	R1 > 1, MORE THAN ONE MATCHING KEYWORD FOUND

                                     0000   124 ;-

                                     0000   125  

                                 00000000   126 	.PSECT	RUNSRCKEY,RD,BYTE

                                     0000   127  

                                     0000   128 RUN_SRCKEY::				;

                               01FC  0000   129 	.WORD	^M<R2,R3,R4,R5,R6,R7,R8> ; SAVE R2 - R8

                          54     D4  0002   130 	CLRL	R4			; RESET MATCH COUNT

            56         04 AC     D0  0004   131 	MOVL	KEYLIST(AP),R6		; GET ADDRESS OF KEYWORD LIST

            58         0C AC     D0  0008   132 	MOVL	OUMASK(AP),R8		; GET ADDRESS OF QUADWORD MASK

                                     000C   133 10$:					;

            50         08 BC     7D  000C   134 	MOVQ	@STRNG(AP),R0		; GET ADDRESS OF CANDIDATE STRING DESCR.

            52            66     7D  0010   135 	MOVQ	(R6),R2			; GET ADDRESS OF STRING TO TEST

                          2B     13  0013   136 	BEQL	40$			; IF EQL AT END OF LIST

                          57     D4  0015   137 	CLRL	R7			; ASSUME KEYWORD NOT NEGATED

            02            50     B1  0017   138 	CMPW	R0,#2			; TEST LENGTH FOR POSSIBLE NEGATION

                          0F     1B  001A   139 	BLEQU	20$			; IF LEQU NO ROOM FOR NEGATION

       4F4E 8F            61     B1  001C   140 	CMPW	(R1),#^A/NO/		; TEST FOR NEGATION

                          08     12  0021   141 	BNEQ	20$			; IF NEQ NO NEGATION

                          57     D7  0023   142 	DECL	R7			; COMPLEMENT MASK

            51            02     C0  0025   143 	ADDL	#2,R1			; STEP PAST NEGATE

            50            02     C2  0028   144 	SUBL	#2,R0			; ...

                                     002B   145 20$:					;

            50            52     B1  002B   146 	CMPW	R2,R0			; FIND SUBSTRING

                          0B     1F  002E   147 	BLSSU	30$			; IF LSSU CANDIDATE LONGER, SKIP TO NEXT

            61            50     29  0030   148 	CMPC3	R0,(R1),(R3)		; SEE IF THERE IS A MATCH

                          63         0033       

                          05     12  0034   149 	BNEQ	30$			; IF NEQ, NO MATCH

            55            56     D0  0036   150 	MOVL	R6,R5			; SAVE ADDRESS OF KEY TABLE ENTRY

                          54     D6  0039   151 	INCL	R4			; INCREMENT MATCH COUNT

                                     003B   152 30$:					;

            56            14     C0  003B   153 	ADDL	#KEYLEN,R6		; POINT TO NEXT TABLE ENTRY

RUNSRCKEY       - SEARCH FOR KEYWORD MATCH                       21-AUG-1978 19:04:35   VAX-11 MACRO X0.3-11               Page   4

00              DECLARATIONS                                                                                                     (2)



                          CC     11  003E   154 	BRB	10$			; GO AGAIN

                                     0040   155 40$:					;

                          50     D4  0040   156 	CLRL	R0			; ASSUME INVALID KEYWORD

            51            54     D0  0042   157 	MOVL	R4,R1			; COPY MATCH COUNT

            01            51     D1  0045   158 	CMPL	R1,#1			; FIND UNIQUE ENTRY?

                          18     12  0048   159 	BNEQ	50$			; IF NEQL NO

                          50     D6  004A   160 	INCL	R0			; SET SUCCESS

            88         08 A5     C8  004C   161 	BISL	MASK(R5),(R8)+		; ASSUME MASK IS TRUE IF SET

            68         0C A5     C8  0050   162 	BISL	MASK+4(R5),(R8)		; ....

            57         10 A5     CC  0054   163 	XORL	COND(R5),R7		; SET STATE

                          08     13  0058   164 	BEQL	50$			; IF EQL MASK SET

            68         0C A5     CA  005A   165 	BICL	MASK+4(R5),(R8)		; ELSE CLEAR MASK

            78         08 A5     CA  005E   166 	BICL	MASK(R5),-(R8)		; ...

                                     0062   167 50$:					;

                                 04  0062   168 	RET				;

                                     0063   169  

                                     0063   170 	.END

RUNSRCKEY       - SEARCH FOR KEYWORD MATCH                       21-AUG-1978 19:04:35   VAX-11 MACRO X0.3-11               Page   5

SYMBOL TABLE                                                                                                                     (2)



$$$            = 00000000            

ADDR             00000004            

COND             00000010            

COUNT            00000000            

KEYLEN           00000014            

KEYLIST          00000004            

MASK             00000008            

OUMASK           0000000C            

RUN_SRCKEY       00000000 RG    03   

STRNG            00000008            





PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        00000000      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

$ABS$            00000014      02     NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT BYTE  

RUNSRCKEY        00000063      03     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  





THERE WERE NO ERRORS OR WARNINGS.

28236. BYTES LEFT IN FREE MEMORY POOL.

OBJ$:RUNSRCKEY,LIS$:RUNSRCKEY/-SP=EXECML$/ML,LIB$:CLIUTL/ML,SRC$:RUNSRCKEY

0 MLB DIR RDS - 0 GETS TO DEFINE 0 MACROS. 2 INTER. FILE WRITES. 

