CRFPREFIX                                                        22-AUG-1978 04:41:15   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)      41  DECLARATIONS

   (2)     182  DECLARATIONS

   (3)     209  INSERT_KEY 

INSRTKEY                                                         22-AUG-1978 04:41:15   VAX-11 MACRO X0.3-11               Page   1

X01.00          DECLARATIONS                                                                                                     (1)



                                     0000     1 	.TITLE	INSRTKEY 

                                     0000     2 	.IDENT	/X01.00/

                                     0000     3 

                                     0000     4 ;

                                     0000     5 ; COPYRIGHT (C) 1977

                                     0000     6 ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

                                     0000     7 ;

                                     0000     8 ; THIS SOFTWARE IS FURNISHED  UNDER A LICENSE FOR USE ONLY ON A SINGLE

                                     0000     9 ; COMPUTER  SYSTEM AND  MAY BE  COPIED ONLY WITH  THE INCLUSION OF THE

                                     0000    10 ; ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

                                     0000    11 ; MAY NOT BE PROVIDED OR  OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

                                     0000    12 ; EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

                                     0000    13 ; TERMS.  TITLE TO AND  OWNERSHIP OF THE  SOFTWARE  SHALL AT ALL TIMES

                                     0000    14 ; REMAIN IN DEC.

                                     0000    15 ;

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

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

                                     0000    18 ; CORPORATION.

                                     0000    19 ;

                                     0000    20 ; DEC ASSUMES  NO  RESPONSIBILITY  FOR  THE USE OR  RELIABILITY OF ITS

                                     0000    21 ; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

                                     0000    22 ;

                                     0000    23 

                                     0000    24 ;++

                                     0000    25 ; FACILITY:  CROSS REFERENCE PROGRAM

                                     0000    26 ;

                                     0000    27 ; ABSTRACT:  THIS ROUTINE INSERTS AN ENTRY INTO THE B-TREE, BASED ON THE

                                     0000    28 ;		HISTORY LIST BUILD BY SRCHINSRT.

                                     0000    29 

                                     0000    30 ;

                                     0000    31 ;

                                     0000    32 ; ENVIRONMENT:  IT IS PART OF A LINKABLE IMAGE.

                                     0000    33 ;

                                     0000    34 ; AUTHOR:  K.D. MORSE, CREATION DATE:  2-MAY-77

                                     0000    35 ;

                                     0000    36 ; MODIFIED BY:

                                     0000    37 ;

                                     0000    38 ;	, : VERSION

                                     0000    39 ; 01	- 

                                     0000    40 ;--

INSRTKEY                                                         22-AUG-1978 04:41:15   VAX-11 MACRO X0.3-11               Page   2

X01.00          DECLARATIONS                                                                                                     (2)



                                     0000    42 	.SBTTL	DECLARATIONS

                                     0000    43 ;

                                     0000    44 ; INCLUDE FILES:

                                     0000    45 ;

                                     0000    46 

                                     0000    47 ;

                                     0000    48 ; MACROS:

                                     0000    49 ;

                                     0000    50 

                                     0000    51 	$CRFDEF					; DEFINE CRF GLOBALS

                                     0000    52 

                                     0000    53 ;

                                     0000    54 ; EQUATED SYMBOLS:

                                     0000    55 ;

                                     0000    56 

                                     0000    57 ;

                                     0000    58 ; OWN STORAGE:

                                     0000    59 ;

                                     0000    60 

                                 00000000    61 	.PSECT	CRF$DATA,RD,WRT,NOEXE,NOSHR,PIC

                                     0000    62 

                           00000000  0000    63 CRF_TEMP_INSRT:: .LONG				; TEMPORARY INSERTION STORAGE

                           00000000  0004    64 TEMP_KEY_DOWN:	.LONG				; TEMP STORAGE FOR DOWN-TREE INSRT

                           00000000  0008    65 LINK_UP:	.LONG				; ADDRESS OF LINK-UP

                           00000000  000C    66 NEW_NODE:	.LONG				; ADDRESS OF NEW NODE

                                 00  0010    67 CRF_INSRT_FLAG:: .BYTE				; INSERTION FLAG

INSRTKEY                                                         22-AUG-1978 04:41:15   VAX-11 MACRO X0.3-11               Page   3

X01.00          INSERT_KEY                                                                                                       (3)



                                     0011    69 	.SBTTL	INSERT_KEY 

                                     0011    70 ;++

                                     0011    71 ; FUNCTIONAL DESCRIPTION:

                                     0011    72 ;

                                     0011    73 ;	THIS ROUTINE TAKES THE HISTORY LIST BUILT BY SRCHINSRT AND

                                     0011    74 ;	INSERTS AN ENTRY INTO THE B-TREE.

                                     0011    75 ;

                                     0011    76 ; CALLING SEQUENCE:

                                     0011    77 ;

                                     0011    78 ;	CALLS	#0,INSRT_KEY

                                     0011    79 ;

                                     0011    80 ; INPUT PARAMETERS:

                                     0011    81 ;

                                     0011    82 ;	NONE

                                     0011    83 ;

                                     0011    84 ; IMPLICIT INPUTS:

                                     0011    85 ;

                                     0011    86 ;	R4 - CONTAINS THE ADDRESS OF A HISTORY LIST BUILT BY SRCHINSRT

                                     0011    87 ;	R5 - CONTAINS THE ADDRESS OF A TEMPORY ENTRY, BUILT BY THE CALLER

                                     0011    88 ;		WITH ZEROS FOR LINKS

                                     0011    89 ;	R6 - CONTAINS THE ADDRESS OF THE CRF CONTROL TABLE (TREE LISTHEAD)

                                     0011    90 ;

                                     0011    91 ; OUTPUT PARAMETERS:

                                     0011    92 ;

                                     0011    93 ;	NONE

                                     0011    94 ;

                                     0011    95 ; IMPLICIT OUTPUTS:

                                     0011    96 ;

                                     0011    97 ;	SUCCESS:

                                     0011    98 ;		R0 - CONTAINS A ONE INDICATING SUCCESSFUL INSERTION

                                     0011    99 ;	FAILURE:

                                     0011   100 ;		R0 - CONTAINS A ZERO INDICATING FAILURE TO INSERT

                                     0011   101 ;

                                     0011   102 ; COMPLETION CODES:

                                     0011   103 ;

                                     0011   104 ;	CRF$_SUCCESS - SUCCESSFUL STATUS CODE

                                     0011   105 ;	CR$_BLDNODFAIL - FAILURE TO BUILD A NODE (ALLOCATION ERROR)

                                     0011   106 ;

                                     0011   107 ; SIDE EFFECTS:

                                     0011   108 ;

                                     0011   109 ;	R0 AND R1 ARE WIPED OUT.

                                     0011   110 ;	THE NEW ENTRY IS INSERTED INTO THE B-TREE.

                                     0011   111 ;

                                     0011   112 ;--

                                     0011   113 

                                     0011   114 

                                     0011   115 

                                 00000000   116 	.PSECT	CRF$CODE,RD,NOWRT,EXE,SHR,PIC

                                     0000   117 

                                     0000   118 INSRT_KEY::

                               01BC  0000   119 	.WORD	^M<R2,R3,R4,R5,R7,R8>		; ENTRY POINT (OR MASK)

                          51     DD  0002   120 	PUSHL	R1				; SAVE R1

            54         04 A4     D0  0004   121 	MOVL	HIS$L_TOP(R4),R4		; GET TOP OF HISTORY LIST

       0000'CF            55     D0  0008   122 	MOVL	R5,W^CRF_TEMP_INSRT		; SAVE ADDR OF TEMP INSRT BUFFER

       0004'CF         04 A6     3C  000D   123 	MOVZWL	CRF$W_ENTSIZE(R6),W^TEMP_KEY_DOWN ; GET TEMP STORAGE FOR

       0004'CF            55     C0  0013   124 	ADDL2	R5,W^TEMP_KEY_DOWN		; THE ENTRY FOR DOWN INSRT

                     0010'CF     94  0018   125 10$:	CLRB	W^CRF_INSRT_FLAG		; ASSUME RIGHT ROTATION

INSRTKEY                                                         22-AUG-1978 04:41:15   VAX-11 MACRO X0.3-11               Page   4

X01.00          INSERT_KEY                                                                                                       (3)



            57            64     D0  001C   126 	MOVL	HIS$L_NODE(R4),R7		; GET ADDR OF INSERTION NODE

                          15     12  001F   127 	BNEQ	20$				; BRANCH IF NODE EXISTS

                       04 A4     D4  0021   128 	CLRL	HIS$L_OFFSET(R4)		; CLEAN OFF TOP TO HIST LIST ADDR

                          FFD9'  30  0024   129 	BSBW	BUILD_NODE			; NO ROOT NODE, MAKE ONE

            57            50     D0  0027   130 	MOVL	R0,R7				; GET NEW INSERTION NODE

                          03     12  002A   131 	BNEQ	15$				; BRANCH ON SUCCESS

                          0148   31  002C   132 	BRW	ERROR_EXIT			; RETURN ON BUILD NODE FAILURE

         04 A0            66     D0  002F   133 15$:	MOVL	CRF$L_ROOT(R6),DMY$L_LINKUP(R0)	; SET OLD ROOT AS NEW ROOT'S LINKUP

            66            57     D0  0033   134 	MOVL	R7,CRF$L_ROOT(R6)		; STORE ROOT ADDR IN LISTHEAD

                       0C A7     B5  0036   135 20$:	TSTW	DMY$W_NUMFREE(R7)		; ANY FREE SPACE?

                          03     13  0039   136 	BEQL	25$				; NO, GO CHECK BROTHERS

                          0122   31  003B   137 	BRW	110$				; YES, GO INSERT ENTRY

                                     003E   138 ;

                                     003E   139 ; CHECK LEFT BROTHER FOR ROOM.

                                     003E   140 ;

            57         F8 A4     D0  003E   141 25$:	MOVL	HIS$L_LEFTBRO(R4),R7		; IS THERE A LEFT BRO?

                          11     13  0042   142 	BEQL	30$				; NO, GO TRY RIGHT BROTHER

            02         0C A7     B1  0044   143 	CMPW	DMY$W_NUMFREE(R7),#2		; LEFT BROTHER HAVE ROOM?

                          0B     19  0048   144 	BLSS	30$				; NO, GO TRY RIGHT BROTHER

                     0010'CF     96  004A   145 	INCB	W^CRF_INSRT_FLAG		; YES, SET LEFT ROTATE FLAG

       0008'CF            64     D0  004E   146 	MOVL	HIS$L_NODE(R4),W^LINK_UP	; REMEMBER LINK-UP ADDR

                          11     11  0053   147 	BRB	40$				; GO TRANSFER FATHER ENTRY

                                     0055   148 ;

                                     0055   149 ; CHECK FOR ROOM IN RIGHT BROTHER.

                                     0055   150 ;

            57         FC A4     D0  0055   151 30$:	MOVL	HIS$L_RIGHTBRO(R4),R7		; IS THERE A RIGHT BRO?

                          3D     13  0059   152 	BEQL	60$				; NO, GO CREATE NEW NODE

            02         0C A7     B1  005B   153 	CMPW	DMY$W_NUMFREE(R7),#2		; ANY FREE ROOM?

                          37     19  005F   154 	BLSS	60$				; NO, GO CREATE NEW NODE

       0008'CF            57     D0  0061   155 	MOVL	R7,W^LINK_UP			; YES, REMEMBER LINK-UP

                                     0066   156 ;

                                     0066   157 ; COMMON ROTATION CODE:

                                     0066   158 ;

                                     0066   159 ; FIRST, THE FATHER ENTRY IS TRANSFERRED TO THE BROTHER NODE.  IF

                                     0066   160 ; IT IS BEING ROTATED TO THE LEFT BROTHER, THEN THE PREVIOUS ENTRY 

                                     0066   161 ; NOT THE INSERTION POINT ENTRY IS TAKEN OUT OF THE FATHER NODE.

                                     0066   162 ; IN THIS CASE, A NEW INSERTION POINT OFFSET IS STORED IN THE

                                     0066   163 ; HISTORY LIST.

                                     0066   164 ;

       000C'CF            57     D0  0066   165 40$:	MOVL	R7,W^NEW_NODE			; REMEMBER NEW NODE ADDR

            52         F0 A4     D0  006B   166 	MOVL	HIS$L_FATHER(R4),R2		; GET ADDR OF FATHER NODE

            53         F4 A4     D0  006F   167 	MOVL	HIS$L_FATHROFF(R4),R3		; GET OFFSET TO INSRT PNT

            53            52     C0  0073   168 	ADDL2	R2,R3				; GET ADDR OF INSRT PNT

                     0010'CF     97  0076   169 	DECB	W^CRF_INSRT_FLAG		; CHECK FOR RIGHT ROTATION

                          06     12  007A   170 	BNEQ	50$				; BRANCH IF RIGHT ROTATION

                          FF81'  30  007C   171 	BSBW	GET_NXT_PRV			; GET PREVIOUS ENTRY

            53            51     D0  007F   172 	MOVL	R1,R3				; SET NEW FATHER INSRT ENTRY

         F4 A4            63     3C  0082   173 50$:	MOVZWL	KEY$W_NEXT(R3),HIS$L_FATHROFF(R4) ; SET NEW FATHER INSRT OFFSET

                     0010'CF     96  0086   174 	INCB	W^CRF_INSRT_FLAG		; RESTORE INSERTION FLAG

                          FF73'  30  008A   175 	BSBW	MOVE_ENTRY			; MOVE FATHER ENTRY TO BRO

            50         04 A1     D0  008D   176 	MOVL	KEY$L_LINKUP(R1),R0		; SAVE LINK-UP OF NEW ENTRY

         04 A1         04 A0     D0  0091   177 	MOVL	KEY$L_LINKUP(R0),KEY$L_LINKUP(R1) ; SET NEW LINK-UP

                          12     11  0096   178 	BRB	70$				; GO BALANCE NODES

                                     0098   179 ;

                                     0098   180 ; SET UP A NEW BROTHER NODE TO THE RIGHT OF THE INSERTION NODE.

                                     0098   181 ;

                          FF65'  30  0098   182 60$:	BSBW	BUILD_NODE			; CREATE NEW NODE

INSRTKEY                                                         22-AUG-1978 04:41:15   VAX-11 MACRO X0.3-11               Page   5

X01.00          INSERT_KEY                                                                                                       (3)



       0008'CF            50     D0  009B   183 	MOVL	R0,W^LINK_UP			; NEW NODE BECOMES LINK-UP

                          03     12  00A0   184 	BNEQ	65$				; BRANCH ON SUCCESS

                          00D2   31  00A2   185 	BRW	ERROR_EXIT			; RETURN ON BUILD NODE FAILURE

       000C'CF            50     D0  00A5   186 65$:	MOVL	R0,W^NEW_NODE			; REMEMBER NEW NODE ADDR

                                     00AA   187 ;

                                     00AA   188 ; NOW FIND ROOM FOR NEW ENTRY BY ROTATING ONE ENTRY FROM INSERTION

                                     00AA   189 ; TO BROTHER NODE.  IF THE INSERTION POINT IS THE FIRST ENTRY IN

                                     00AA   190 ; THE NODE AND THE ROTATION IS TO THE LEFT, THEN MOVE THE NEW ENTRY

                                     00AA   191 ; INTO THE BROTHER NODE (NEW NODE) INSTEAD OF ROTATING ONE ENTRY.

                                     00AA   192 ; IF THE INSERTION POINT IS THE LAST ENTRY IN THE NODE AND THE ROTATION

                                     00AA   193 ; IS TO THE RIGHT, THEN MOVE THE NEW ENTRY INTO THE BROTHER NODE

                                     00AA   194 ; (NEW NODE) INSTEAD OF ROTATING ONE ENTRY.

                                     00AA   195 ;

            52            64     D0  00AA   196 70$:	MOVL	HIS$L_NODE(R4),R2		; GET INSERT NODE ADDR

            53            52     D0  00AD   197 	MOVL	R2,R3				; OFFSET TO DUMMY ENTRY

            57       000C'CF     D0  00B0   198 	MOVL	W^NEW_NODE,R7			; GET BROTHER NODE

                          FF48'  30  00B5   199 	BSBW	GET_NXT_PRV			; GET FIRST OR LAST ENTRY

            53            51     D0  00B8   200 	MOVL	R1,R3				; BASED ON ROTATION DIRECTION

                     0010'CF     95  00BB   201 	TSTB	W^CRF_INSRT_FLAG		; RIGHT OR LEFT ROTATION?

                          08     13  00BF   202 	BEQL	210$				; BRANCH ON RIGHT

            62         04 A4     B1  00C1   203 	CMPW	HIS$L_OFFSET(R4),DMY$W_FIRST(R2) ; INSRT PNT = FIRST ENTRY?

                          25     12  00C5   204 	BNEQ	240$				; NO, GO ROTATE ENTRY

                          05     11  00C7   205 	BRB	220$				; YES, CAN INSERT NEW ENTRY

                       04 A4     B5  00C9   206 210$:	TSTW	HIS$L_OFFSET(R4)		; IS OFFSET LAST ENTRY IN NODE

                          1E     12  00CC   207 	BNEQ	240$				; NO, GO ROTATE ENTRY

                                     00CE   208 ;

                                     00CE   209 ; INSTEAD OF ROTATING ONE ENTRY, THE NEW ENTRY MAY BE INSERTED INTO

                                     00CE   210 ; THE NEW NODE (BROTHER NODE).

                                     00CE   211 ;

            55       0000'CF     D0  00CE   212 220$:	MOVL	W^CRF_TEMP_INSRT,R5		; GET NEW ENTRY ADDR

                          FF2A'  30  00D3   213 	BSBW	REQ_SPACE			; GET SPACE IN NEW NODE

                          FF27'  30  00D6   214 	BSBW	TRANS_ENTRY			; MOVE IN THE NEW ENTRY

            50            67     3C  00D9   215 	MOVZWL	DMY$W_FIRST(R7),R0		; ASSUME RIGHT ROTATION

                     0010'CF     95  00DC   216 	TSTB	W^CRF_INSRT_FLAG		; RIGHT OR LEFT ROTATION?

                          02     13  00E0   217 	BEQL	230$				; BRANCH ON RIGHT

                          50     D4  00E2   218 	CLRL	R0				; OFFSET FOR LEFT ROTATION

                          FF19'  30  00E4   219 230$:	BSBW	LOG_INSRT_KEY			; LINK NEW ENTRY INTO NODE

            57            64     D0  00E7   220 	MOVL	HIS$L_NODE(R4),R7		; GET ADDR OF INSERTION NODE

                          26     11  00EA   221 	BRB	75$				; GO BALANCE NODES

                                     00EC   222 ;

                                     00EC   223 ; ROTATE ONE ENTRY TO MAKE ROOM FOR THE NEW ENTRY, THEN INSERT IT.

                                     00EC   224 ; FOR RIGHT ROTATION, THE LAST ENTRY IN THE INSERTION NODE BECOMES THE

                                     00EC   225 ; FIRST ENTRY IN THE BROTHER NODE.  FOR LEFT ROTATION, THE FIRST ENTRY

                                     00EC   226 ; IN THE INSERTION NODE BECOMES THE LAST ENTRY IN THE BROTHER NODE.

                                     00EC   227 ;

            51            52     C3  00EC   228 240$:	SUBL3	R2,R1,R0			; GET OFFSET TO ENTRY TO MOVE

                          50         00EF       

            50         04 A4     B1  00F0   229 	CMPW	HIS$L_OFFSET(R4),R0		; IS OFFSET = INSERTION PNT?

                          04     12  00F4   230 	BNEQ	245$				; BRANCH ON NO

         04 A4            61     3C  00F6   231 	MOVZWL	KEY$W_NEXT(R1),HIS$L_OFFSET(R4)	; NEXT ENTRY IS NEW INSERTION PNT

                          FF03'  30  00FA   232 245$:	BSBW	MOVE_ENTRY			; ROTATE ONE ENTRY TO BRO

            57            64     D0  00FD   233 	MOVL	HIS$L_NODE(R4),R7		; GET INSERTION NODE ADDR

            55       0000'CF     D0  0100   234 	MOVL	W^CRF_TEMP_INSRT,R5		; GET ADDR OF INSERT ENTRY

                          FEF8'  30  0105   235 	BSBW	REQ_SPACE			; GET SPACE TO INSERT ENTRY

                          FEF5'  30  0108   236 	BSBW	TRANS_ENTRY			; MOVE ENTRY INTO NODE

            50         04 A4     D0  010B   237 	MOVL	HIS$L_OFFSET(R4),R0		; GET INSRTION PNT OFFSET

                          FEEE'  30  010F   238 	BSBW	LOG_INSRT_KEY			; LINK KEY INTO NODE

INSRTKEY                                                         22-AUG-1978 04:41:15   VAX-11 MACRO X0.3-11               Page   6

X01.00          INSERT_KEY                                                                                                       (3)



                                     0112   239 ;

                                     0112   240 ; INSERTION ENTRY IS NOW PHYSICALLY IN NODE.  NOW BALANCE THE FREE

                                     0112   241 ; SPACE BETWEEN THE BROTHER NODES.

                                     0112   242 ;

            52            57     D0  0112   243 75$:	MOVL	R7,R2				; SET INSRT NODE ADDR

            53            57     D0  0115   244 	MOVL	R7,R3				; SET CURRENT ENTRY ADDR

            57       000C'CF     D0  0118   245 	MOVL	W^NEW_NODE,R7			; GET ADDR OF NEW NODE

                          FEE0'  30  011D   246 	BSBW	GET_NXT_PRV			; GET NEXT ENTRY

            53            51     D0  0120   247 	MOVL	R1,R3				; GET REAL ENTRY TO MOVE

         0C A7         0C A2     A3  0123   248 80$:	SUBW3	DMY$W_NUMFREE(R2),DMY$W_NUMFREE(R7),R8 ; GET FREE DIFFERENCE

                          58         0128       

            01            58     B1  0129   249 	CMPW	R8,#1				; IS DIFFERENCE <1?

                          05     1B  012C   250 	BLEQU	90$				; BRANCH IF NODES BALANCED

                          FECF'  30  012E   251 	BSBW	MOVE_ENTRY			; MOVE ENTRY TO BRO

                          F0     11  0131   252 	BRB	80$				; CONTINUE BALANCING NODES

                                     0133   253 ;

                                     0133   254 ; NODES ARE BALANCED.  SET UP ENTRY TO MOVE DOWN TREE, (I.E. TO REPLACE

                                     0133   255 ; THE ENTRY MOVED OUT OF THE FATHER NODE).

                                     0133   256 ;

            51       0004'CF     D0  0133   257 90$:	MOVL	W^TEMP_KEY_DOWN,R1		; GET DOWN-TREE INSRT ADDR

                          FEC5'  30  0138   258 	BSBW	MOVE_ENTRY_1			; MOVE ENTRY INTO NODE

            55       0004'CF     D0  013B   259 	MOVL	W^TEMP_KEY_DOWN,R5		; GET ADDR OF DOWN INSRT ENTRY

            51       0008'CF     D0  0140   260 	MOVL	W^LINK_UP,R1			; GET ADDR OF LINK-UP

         04 A1         04 A5     D0  0145   261 	MOVL	KEY$L_LINKUP(R5),KEY$L_LINKUP(R1) ; SET ENTRY'S LINK-UP

         04 A5            51     D0  014A   262 	MOVL	R1,KEY$L_LINKUP(R5)		; SET INSRT ENTRY'S LINK-UP

       0004'CF       0000'CF     D0  014E   263 	MOVL	W^CRF_TEMP_INSRT,W^TEMP_KEY_DOWN ; SWITCH DOWN + INSRT ENTRIES

       0000'CF            55     D0  0155   264 	MOVL	R5,W^CRF_TEMP_INSRT		; SET TO INSRT THE DOWN ENTRY

            54            10     C2  015A   265 	SUBL2	#HIS$K_ENTRYSIZE,R4		; ELIMINATE TOP ENTRY

                          FEB8   31  015D   266 	BRW	10$				; GO INSERT DOWN ENTRY

                                     0160   267 ;

                                     0160   268 ; TERMINATE INSERTION PROCESS BY INSERTING AN ENTRY INTO A NODE

                                     0160   269 ; WITHOUT ANY ROTATION.  THIS IS EITHER BECAUSE THE INSERTION NODE

                                     0160   270 ; HAD FREE ROOM AT THE START OR THE DOWN-TREE INSERTION INTO THE 

                                     0160   271 ; FATHER NODE NOW CAN BE DONE.

                                     0160   272 ;

                          FE9D'  30  0160   273 110$:	BSBW	REQ_SPACE			; GET FREE ENTRY IN NODE

                          FE9A'  30  0163   274 	BSBW	TRANS_ENTRY			; PUT ENTRY INTO NODE

            50         04 A4     D0  0166   275 	MOVL	HIS$L_OFFSET(R4),R0		; GET INSERT PNT OFFSET

                          FE93'  30  016A   276 	BSBW	LOG_INSRT_KEY			; LOGICALLY INSERT INTO NODE

                                     016D   277 INSRT_KEY_EXIT:

            51            8E     D0  016D   278 	MOVL	(SP)+,R1			; RESTORE R1

            50   00658001 8F     D0  0170   279 	MOVL	#CRF$_SUCCESS,R0		; SET SUCCESS CODE

                                     0177   280 ERROR_EXIT:

                                 04  0177   281 	RET					; RETURN

                                     0178   282 	.END

INSRTKEY                                                         22-AUG-1978 04:41:15   VAX-11 MACRO X0.3-11               Page   7

SYMBOL TABLE                                                                                                                     (3)



BIT...         = 006580AA            ERROR_EXIT       00000177 R     04   

BUILD_NODE       ********   X   04   FLD$B_MAXLNG   = 00000003            

CRF$B_FLAGS      00000009            FLD$B_SET_CLR  = 00000002            

CRF$B_IR_DEFIND  00000014            FLD$K_LENGTH   = 0000000C            

CRF$B_KEYTYPE    00000008            FLD$L_FAODSC   = 00000004            

CRF$B_OU_PAG1    0000000C            FLD$W_MASK     = 00000000            

CRF$B_OU_PRTIND  00000014            GBL...         = 00000000            

CRF$B_OU_SAVIND  00000018            GET_NXT_PRV      ********   X   04   

CRF$B_OU_SUCPAG  00000010            HIS$K_ENTRYSIZE= 00000010            

CRF$K_FACILCOD = 00000065            HIS$K_LISTSIZE = 00000070            

CRF$L_ERROR      0000000C            HIS$L_FATHER   = FFFFFFF0            

CRF$L_IK_CTLTBL  00000004            HIS$L_FATHROFF = FFFFFFF4            

CRF$L_IK_KEYADR  00000008            HIS$L_LEFTBRO  = FFFFFFF8            

CRF$L_IK_VALADR  0000000C            HIS$L_LEFTSON  = 00000008            

CRF$L_IR_CTLTBL  00000004            HIS$L_LINKUP   = 00000008            

CRF$L_IR_KEYADR  00000008            HIS$L_LINKUPOFF= 0000000C            

CRF$L_IR_REFADR  0000000C            HIS$L_NODE     = 00000000            

CRF$L_K1FMTBL    00000014            HIS$L_NTH      = 0000000C            

CRF$L_K2FMTBL    00000018            HIS$L_OFFSET   = 00000004            

CRF$L_OUTPUT     00000010            HIS$L_RIGHTBRO = FFFFFFFC            

CRF$L_OU_CTLTBL  00000004            HIS$L_RIGHTSON = 0000000C            

CRF$L_OU_LINWID  00000008            HIS$L_TOP      = 00000004            

CRF$L_R1FMTBL    00000024            INSRT_KEY        00000000 RG    04   

CRF$L_R2FMTBL    00000028            INSRT_KEY_EXIT   0000016D R     04   

CRF$L_ROOT       00000000            KEY$B_DEFLNG   = 00000018            

CRF$L_V1FMTBL    0000001C            KEY$K_DATASIZE = 0000001C            

CRF$L_V2FMTBL    00000020            KEY$K_SIZE     = 00000028            

CRF$W_ENTSIZE    00000004            KEY$L_DATA     = 0000000C            

CRF$W_ERRSTS     0000000A            KEY$L_KEYADDR  = 00000008            

CRF$W_IK_VALFLG  00000010            KEY$L_LINKUP   = 00000004            

CRF$W_IR_REFLAG  00000010            KEY$L_REFLIST  = 00000010            

CRF$W_NODSIZE    00000006            KEY$L_VALADDR  = 0000000C            

CRF$_BLDNODFAIL= 00658052            KEY$T_DEFNAME  = 00000019            

CRF$_BLKWTHINBL= 00658072            KEY$W_DEFFLAG  = 00000016            

CRF$_EXPREGFAIL= 0065806A            KEY$W_NEXT     = 00000000            

CRF$_FAILINSRT = 0065807A            KEY$W_PREV     = 00000002            

CRF$_FAOFAIL   = 0065809A            KEY$W_VALFLAG  = 00000014            

CRF$_FOUNDKEY  = 00658021            LINK_UP          00000008 R     03   

CRF$_HISTOVRFLO= 00658062            LOG_INSRT_KEY    ********   X   04   

CRF$_ILLBLKSIZE= 00658082            MOVE_ENTRY       ********   X   04   

CRF$_KEY1STENTR= 00658011            MOVE_ENTRY_1     ********   X   04   

CRF$_KEYPRVENTR= 00658009            NEW_NODE         0000000C R     03   

CRF$_KEYTYPE   = 006580A2            NOD$K_1STFREE  = 00000010            

CRF$_LINELNG   = 00658092            NOD$K_NUMFREE  = 0000000C            

CRF$_NO_OUTRTN = 0065808A            NOD$K_SIZE     = 000001F0            

CRF$_REFLNG    = 0065805A            REF$B_REFLNG   = 00000006            

CRF$_REFPRVENTR= 00658019            REF$K_SIZE     = 00000016            

CRF$_SUCCESS   = 00658001            REF$L_FLINK    = 00000000            

CRF_INSRT_FLAG   00000010 RG    03   REF$T_REFNAME  = 00000007            

CRF_TEMP_INSRT   00000000 RG    03   REF$W_REFFLAG  = 00000004            

DMY$K_SIZE     = 00000010            REQ_SPACE        ********   X   04   

DMY$L_KEYADDR  = 00000008            TEMP_KEY_DOWN    00000004 R     03   

DMY$L_LINKUP   = 00000004            TRANS_ENTRY      ********   X   04   

DMY$W_1STFREE  = 0000000E            

DMY$W_FIRST    = 00000000            

DMY$W_LAST     = 00000002            

DMY$W_NUMFREE  = 0000000C            

INSRTKEY                                                         22-AUG-1978 04:41:15   VAX-11 MACRO X0.3-11               Page   8

PROGRAM SECTION SYNOPSIS                                                                                                         (3)







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$            0000002C      02     NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT BYTE  

CRF$DATA         00000011      03       PIC   USR   CON   REL   LCL NOSHR NOEXE   RD    WRT BYTE  

CRF$CODE         00000178      04       PIC   USR   CON   REL   LCL   SHR   EXE   RD  NOWRT BYTE  





THERE WERE NO ERRORS OR WARNINGS.

23568. BYTES LEFT IN FREE MEMORY POOL.

1030. BYTES OF RECLAIMED MEMORY.

OBJ$:INSRTKEY,LIS$:INSRTKEY/-SP=LIB$:CRF/ML,SRC$:CRFPREFIX,INSRTKEY

16 MLB DIR RDS - 149 GETS TO DEFINE 8 MACROS. 9 INTER. FILE WRITES. 

