.TITLE CALLING_ARGUMENT_INDEX GENERATION ; DEBUG_FLAG=0 ; ; THIS MODULE IS NEW WITH INDEX VERSION V3.04 BUT USES AS A STARTING POINT ; THE MODULE "SUPER.MAR". ALL NEW LINES ADDED ARE CONSIDERED TO BE AS OF V3.04 ; BUT THOSE LINES CONTAINING EARLIER VERSION NUMBERS FROM THE ORIGINAL ; "SUPER.MAR" CODE ARE LEFT IN IF THE LINE HAS NOT BEEN MODIFIED. ; .SUBTITLE DATA STORAGE AREA .ENABLE DEBUG .PSECT IMPURE_DATA,RD,WRT,NOSHR,NOEXE,LONG,CON,GBL ARG1: .LONG 0 ARG2: .LONG 0 OUTPUT_LINE: .BLKB 132 OUTPUT_STRING: .LONG 0,0 NAME_LINE: ;V3.05 .BLKB 65 ;V3.05 NAME_STRING: ;V3.05 .LONG 0,0 ;V3.05 NUMBER: .LONG 0 LINE_COUNT: .LONG 0 CHAR_COUNT: .LONG 0 NEW_NODE: ;V1.10 .LONG 0 ;V1.10 DESCRIPTER: ;V1.10 .LONG 0,0 ;V1.10 ERROR_NUMBER: ;V3.02 .LONG 0 ;V3.02 ARGUMENT: .ASCII /$Argument_/ ARGUMENT_NUMBER: .ASCII /xxxx/ INSERT_ARGUMENT_ARG: .LONG 7,0 .ADDRESS DESCRIPTER,NULL,ARGUMENT_COMPARE .ADDRESS ARGUMENT_ALLOCATE,NEW_NODE .LONG -1 ;V1.10 INSERT_NAME_ARG: .LONG 7,0 .ADDRESS NAME_STRING,NULL,NAME_COMPARE ;V3.05 .ADDRESS NAME_ALLOCATE,NEW_NODE .LONG -1 ;V1.10 INSERT_CALL_ARG: .LONG 7,0 .ADDRESS DESCRIPTER,NULL,CALL_COMPARE .ADDRESS CALL_ALLOCATE,NEW_NODE .LONG -1 ;V1.10 .PSECT PURE_DATA,RD,NOWRT,SHR,NOEXE,CON,GBL INSERT_MODULE_ARG: .LONG 7 ;V1.10 .ADDRESS SYMBOL_TABLE_QUEUE,DESCRIPTER,NULL,MODULE_COMPARE .ADDRESS MODULE_ALLOCATE,NEW_NODE .LONG -1 ;V1.10 CODE_0: .LONG 0 ;V2.09 CODE_1: .LONG 1 ;V1.4 CODE_2: .LONG 2 ;V1.4 CODE_3: .LONG 3 ;V1.4 CODE_4: .LONG 4 ;V1.4 CODE_5: .LONG 5 ;V1.4 VM_ARG: .LONG 2 .ADDRESS ARG1,ARG2 REWIND_ERROR: .ASCID /INDEX-F-Error Rewinding Super Index Scratch File/ READ_ERROR: .ASCID /INDEX-F-Error Reading Super Index Scratch File/ PRESERVE_ERROR: ;V2.19 .ASCID /INDEX-E-Error writeing Preserve data file-file terminated/ ;V2.19 READ_PRESERVE_ERROR: ;V2.20 .ASCID /INDEX-F-Error reading Preserve data file/ ;V2.20 CALLED_BY: .ASCID / Called by / ARGUMENTS: .ASCID / argument(s) / UNKNOWN:.ASCID /??????/ .PAGE .SUBTITLE INITIALIZATION CODE .PSECT CODE,RD,NOWRT,SHR,EXE,CON,GBL .ENTRY DUMP_ARGUMENT_INDEX,^M PUSHAL TIME_COMMAND ;V1.4 PUSHAL CODE_1 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_COMMAND+8 ;V1.4 PUSHAL CODE_2 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_COMMAND+12 ;V1.4 PUSHAL CODE_3 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_COMMAND+16 ;V1.4 PUSHAL CODE_4 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_COMMAND+20 ;V1.4 PUSHAL CODE_5 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 CALLG NULL,G^LIB$INIT_TIMER ;V1.4 $REWIND RAB=SUPER_INDEX_RAB ;REWIND THE SCRATCH FILE BLBS R0,1$ MOVL R0,ERROR_NUMBER ;V3.02 PUSHAL SUPER_INDEX_RAB+RAB$L_STV ;V3.02 PUSHAL ERROR_NUMBER ;V3.02 PUSHAL REWIND_ERROR ;V3.02 CALLS #3,SYSTEM_ERROR_MESSAGE ;V3.02 $EXIT_S ;V3.02 1$:; SYMBOL TABLE IS IN AN EMPTY CONDITION ; OPEN PRESERVE FILE IF REQUIRED ;V2.19 BITL #PRESERVE_FLAG!ADD_PRESERVE_FLAG!RESTORE_FLAG,FLAG_WORD+4 ;V2.20 BEQL 2001$ ;V2.19 CALLS #0,OPEN_PRESERVE ;V2.19 2001$: ;V2.19 PUSHAL DAY_TIME CALLS #1,G^LIB$DATE_TIME ;GET CURRENT TIME FOR HEADER CLRL LINES_ON_PAGE MOVL #132,LINE_COUNT ;V1.16 BITL #NARROW_FLAG,FLAG_WORD ;V1.16 BEQL 3011$ ;V1.16 MOVL #80,LINE_COUNT ;V1.16 3011$: MOVL #ARGUMENT_OUTPUT,STATUS_WORD ; ; THE DATA TREE GENERATED BY THIS PROCEDURE CONSISTS OF FOUR TYPES OF ; ELEMENTS. THE MAIN ELEMENTS IN THE TREE (POINTED TO BY THE TOP ; LEVEL POINTER "SYMBOL_TABLE_QUEUE" IS THE MODULE NAME ELEMENT ; ; ---------------------------------------- ; ! POINTER TO LEFT MODULE NAME ! 0 ; ---------------------------------------- ; ! POINTER TO RIGHT MODULE NAME ! 4 ; ---------------------------------------- ; ! ! BALANCE ! 8 ; ---------------------------------------- ; ! POINTER TO LEFT ARGUMENT NAME ! 12 ; ---------------------------------------- ; ! POINTER TO RIGHT ARGUMENT NAME ! 16 ; ---------------------------------------- ; ! ! BALANCE ! 20 ; ---------------------------------------- ; ! !COUNT ! 24 ; ---------------------------------------- ; !MODULE NAME-COUNTED STRING ! ; ; ! ! ; ---------------------------------------- MODULE_Q_MODULE_POINTER=0 MODULE_Q_ARGUMENT_POINTER=12 MODULE_B_COUNT=24 MODULE_S_STRING=25 MODULE_LENGTH=56 ; ; THE ARGUMENT LIST MODULE-ONE PER ARGUMENT IN THE ARGUMENT LIST IN THE MODULE DIFINITION ; LINE, POINTS TO TWO DIFFERENT SUB TREES. ONE IS THE LIST OFARUMENT NAMES AS DEFINED IN THE ; SUBROUTINE/FUNCTION DECLARATION AND ALSO IN ANY ENTRY STATEMENTS, IN THAT ARGUMENT POSITION ; THE SECOND SUB TREE IS THE NAME OF A MODULE THAT CONTAINS A CALL TO THIS PROCEDURE AND THE NAME(S) ; OF THE VARIABLES PASSED IN THIS POSITION. ; THE ARGUMENT LIST ELEMENTS POINTED TO BY THE MODULE LIST ELEMENTS ARE ; FORMATTED AS FOLLOWS ; ; ---------------------------------------- ; ! POINTER TO LEFT ARGUMENT NAME ! 0 ; ---------------------------------------- ; ! POINTER TO RIGHT ARGUMENT NAME ! 4 ; ---------------------------------------- ; ! ! BALANCE ! 8 ; ---------------------------------------- ; ! POINTER TO LEFT DEFINED NAME ! 12 ; ---------------------------------------- ; ! POINTER TO RIGHT DEFINED NAME ! 16 ; ---------------------------------------- ; ! ! BALANCE ! 20 ; ---------------------------------------- ; ! POINTER TO LEFT CALLED NAME ! 24 ; ---------------------------------------- ; ! POINTER TO RIGHT CALLED NAME ! 28 ; ---------------------------------------- ; ! ! BALANCE ! 32 ; ---------------------------------------- ; ! !14 ! 36 ; ---------------------------------------- ; !14 BYTE LONG COUNTED STRING ! ; $Argument_xxxx ; !WHERE xxxx IS THE ARGUMENT NUMBER ! ; ---------------------------------------- ARGUMENT_Q_ARGUMENT_POINTER=0 ARGUMENT_Q_NAME_POINTER=12 ARGUMENT_Q_CALL_POINTER=24 ARGUMENT_B_COUNT=36 ARGUMENT_S_STRING=37 ARGUMENT_LENGTH=68 ; ; DEFINED ARGUMENTS LIST ARGUMENT NAME(S) ; ; ---------------------------------------- ; ! POINTER TO LEFT NAME ! 0 ; ---------------------------------------- ; ! POINTER TO RIGHT NAME ! 4 ; ---------------------------------------- ; ! ! BALANCE ! 8 ; ---------------------------------------- ; ! !COUNT ! 12 ; ---------------------------------------- ; ! COUNTED VARIABLE NAME STRING ! ; INCLUDEING TYPE NAME IN PARENS ; ! ! ; ---------------------------------------- NAME_Q_NAME_POINTER=0 NAME_B_COUNT=12 NAME_S_STRING=13 NAME_LENGTH=77 ; ; THE CALLING MODULE ARGUMENT ELEMENT IS FORMATTED AS FOLLOWS ; THE SUB TREE OF VARIABLE NAMES PASSED BY THIS MODULE TO CALLED ; MODULE IS IDENTICAL IN FORMAT TO THE "NAME" DATA STRUCTURE. ; ; ---------------------------------------- ; ! POINTER TO CALLING LEFT NAME ! 0 ; ---------------------------------------- ; ! POINTER TO RIGHT CALLING NAME ! 4 ; ---------------------------------------- ; ! ! BALANCE ! 8 ; ---------------------------------------- ; ! POINTER TO LEFT NAME ! 12 ; ---------------------------------------- ; ! POINTER TO RIGHT NAME ! 16 ; ---------------------------------------- ; ! ! BALANCE ! 20 ; ---------------------------------------- ; ! !COUNT ! 24 ; ---------------------------------------- ; ! COUNTED MODULE NAME STRING ! ; ; ! ! ; ---------------------------------------- CALL_Q_CALL_POINTER=0 CALL_Q_NAME_POINTER=12 CALL_B_COUNT=24 CALL_S_STRING=25 CALL_LENGTH=56 ; ; .PAGE .SUBTITLE BUILD ARGUMENT INDEX SYMBOL TABLE BUILD_LOOP: BITL #RESTORE_FLAG,FLAG_WORD+4 ;V2.20 BEQL 6$ ;V2.20 $GET RAB=PRESERVE_RAB ;V2.20 BLBS R0,8$ ;V2.20 CMPL #RMS$_EOF,R0 ;RAN OUT OF DATA-GO OUTPUT IT ;V2.20 BNEQ 9$ ;V2.20 JMP OUTPUT_ARGUMENT 9$: MOVL R0,ERROR_NUMBER ;V3.02 PUSHAL PRESERVE_RAB+RAB$L_STV ;V3.02 PUSHAL ERROR_NUMBER ;V3.02 PUSHAL READ_PRESERVE_ERROR ;V2.20 CALLS #3,SYSTEM_ERROR_MESSAGE ;V3.02 $EXIT_S ;V3.02 8$: MOVC3 #197,PRESERVE_BUFFER,SUPER_BUFFER ;V3.05 BRB 1$ ;V2.20 6$: ;V2.20 $GET RAB=SUPER_INDEX_RAB BLBS R0,1$ CMPL #RMS$_EOF,R0 ;RAN OUT OF DATA-GO OUTPUT IT BNEQ 2$ JMP OUTPUT_ARGUMENT 2$: MOVL R0,ERROR_NUMBER ;V3.02 PUSHAL SUPER_INDEX_RAB+RAB$L_STV ;V3.02 PUSHAL ERROR_NUMBER ;V3.02 PUSHAL READ_ERROR CALLS #3,SYSTEM_ERROR_MESSAGE ;V3.02 $EXIT_S ;V3.02 1$: ; SEE IF PRESERVE OF DATA REQUIRED ;V2.19 BITL #PRESERVE_FLAG!ADD_PRESERVE_FLAG,FLAG_WORD+4 ;V2.20 BNEQ 1001$ ;V2.19 BRW 5$ ;V2.19 1001$: ;GET NAME ;V2.19 MOVZBL SUPER_BUFFER,R6 ;GET COUNT ;V2.19 INCL R6 ;GET LENGTH INCL COUNT ;V2.19 MOVC5 R6,SUPER_BUFFER,#^A/ /,#32,PRESERVE_BUFFER ;V2.19 ;GET MODULE ;V2.19 MOVZBL SUPER_BUFFER+32,R6 ;GET COUNT ;V2.19 INCL R6 ;GET LENGTH INCL COUNT ;V2.19 MOVC5 R6,SUPER_BUFFER+32,#^A/ /,#32,PRESERVE_BUFFER+32 ;V2.19 ;GET TAG ;V2.19 MOVZBL SUPER_BUFFER+64,R6 ;GET COUNT ;V2.19 INCL R6 ;GET LENGTH INCL COUNT ;V2.19 MOVC5 R6,SUPER_BUFFER+64,#^A/ /,#64,PRESERVE_BUFFER+64 ;V2.19 ;GET STORAGE ;V2.19 MOVZBL SUPER_BUFFER+96,R6 ;GET COUNT ;V2.19 INCL R6 ;GET LENGTH INCL COUNT ;V2.19 MOVC5 R6,SUPER_BUFFER+96,#^A/ /,#96,PRESERVE_BUFFER+96 ;V2.19 ;GET ARGUMENT ;V2.19 MOVZBL SUPER_BUFFER+128,R6 ;GET COUNT ;V2.19 INCL R6 ;GET LENGTH INCL COUNT ;V2.19 MOVC5 R6,SUPER_BUFFER+128,#^A/ /,#37,PRESERVE_BUFFER+128 ;V2.19 ;GET TYPE INFO ;V3.05 MOVZBL SUPER_BUFFER+165,R6 ;GET COUNT ;V3.05 INCL R6 ;GET LENGTH INCL COUNT ;V3.05 MOVC5 R6,SUPER_BUFFER+165,#^A/ /,#32,PRESERVE_BUFFER+165 ;V3.05 ;WRITE DATA TO FILE ;V2.19 $PUT RAB=PRESERVE_RAB ;V2.19 BLBS R0,5$ ;V3.02 ; ERROR-OUTPUT MESSAGE AND CANCEL PRESERVE ;V2.19 PUSHAL PRESERVE_RAB+RAB$L_STV ;V3.02 MOVL R0,ERROR_NUMBER ;V3.02 PUSHAL ERROR_NUMBER ;V3.02 PUSHAL PRESERVE_ERROR ;V3.02 CALLS #3,SYSTEM_ERROR_MESSAGE ;V3.02 BICL #PRESERVE_FLAG!ADD_PRESERVE_FLAG,FLAG_WORD+4 ;V2.20 CALLS #0,CLOSE_PRESERVE ;V2.19 5$: ; LOAD NAME LINE/STRING ;V3.05 MOVZBL SUPER_BUFFER,R6 ;GET SIZE OF NAME ;V3.05 MOVAL NAME_LINE,NAME_STRING+4 ;V3.05 MOVC3 R6,SUPER_BUFFER+1,L^NAME_LINE ;V3.05 MOVB #^A/(/,L^NAME_LINE(R6) ;V3.05 INCL R6 ;V3.05 MOVZBL SUPER_BUFFER+165,R7 ;V3.05 MOVC3 R7,SUPER_BUFFER+166,L^NAME_LINE(R6) ;V3.05 ADDL2 R7,R6 ;V3.05 MOVB #^A/)/,L^NAME_LINE(R6) ;V3.05 INCL R6 ;V3.05 MOVL R6,NAME_STRING ;V3.05 ; TWO POSSABLE ENTRIES TO BA MADE FROM EACH SUPER INDEX DATA ENTRY ; 1. SEE IF IT IS STORAGE TYPE $Argument_xxxx, IF IT IS-THEN ; ADD THE MODULE NAME TO THE SYMBOL TABLE (IF IT NOT ALREADY THERE) ; THEN ADD THE SYMBOL $Argument_xxx IF IT IS NOT ALREADY THERE ; AND THEN THE NAME THAT APPEARS IN THE ARGUMENT LIST ; 2. SEE IF THE ARGUMENT ENTRY IS DECLARED (module_called_name_xxxx) ; AND IF IT IS, THEN ENTER THE MODULE CALLED NAME(IF NOT ALREADY IN), ; THE $Argument_xxxx IF IT NOT ALREADY IS, THE MODULE NAME OF THE CALLING ; MODULE (IF NOT ALREADY IN) AND FINALY THE VARIABLE NAME OF THER VAR PASSED ; (IF NOT ALREADY IN). ; ; FIRST LETS ENTER THE MODULE NAME IN THE SYMBOL TABLE MOVZBL SUPER_BUFFER+32,DESCRIPTER MOVAL SUPER_BUFFER+33,DESCRIPTER+4 CALLG INSERT_MODULE_ARG,G^LIB$INSERT_TREE ; SEE IF THIS IS $Argument_xxxx STORAGE CMPC3 #10,ARGUMENT,SUPER_BUFFER+97 BNEQ 10$ ;NO-SKIP THIS PART ; NEW_NODE ALREADY CONTAINS A POINTER TO THE MODULE NAME ; INSERT $Argument_xxxx AS REQUIRED MOVL NEW_NODE,R11 MOVAL MODULE_Q_ARGUMENT_POINTER(R11),INSERT_ARGUMENT_ARG+4 MOVZBL SUPER_BUFFER+96,DESCRIPTER MOVAL SUPER_BUFFER+97,DESCRIPTER+4 CALLG INSERT_ARGUMENT_ARG,G^LIB$INSERT_TREE ; FINALLY ADD VAR NAME AS REQUIRED MOVL NEW_NODE,R11 MOVAL ARGUMENT_Q_NAME_POINTER(R11),INSERT_NAME_ARG+4 MOVZBL SUPER_BUFFER,DESCRIPTER MOVAL SUPER_BUFFER+1,DESCRIPTER+4 CALLG INSERT_NAME_ARG,G^LIB$INSERT_TREE 10$: ; NOW STEP 2-SEE ABOUT CALLING ARG ; TEST THE ARGUMENT USEAGE SEGMENT OF THE SUPER_BUFFER TSTB SUPER_BUFFER+128 BNEQ 11$ BRW 20$ ;NOT HERE-GO TO NEXT ITEM ; FIRST FIND THE MODULE 11$: MOVZBL SUPER_BUFFER+128,R0 ;CALCULATE LENGTH OF MODULE NAME WITHOUT "_xxxx" SUBL3 #5,R0,DESCRIPTER MOVAL SUPER_BUFFER+129,DESCRIPTER+4 CALLG INSERT_MODULE_ARG,G^LIB$INSERT_TREE ; LOAD THE ARGUMENT NUMBER TO BUILD THE STRING "$Argument_xxxx" MOVZBL SUPER_BUFFER+128,R11 ADDL2 #,R11 MOVC3 #4,(R11),ARGUMENT_NUMBER ; INSERT STRING $Argument_xxxx IF REQUIRED MOVL #14,DESCRIPTER MOVAL ARGUMENT,DESCRIPTER+4 MOVL NEW_NODE,R11 MOVAL MODULE_Q_ARGUMENT_POINTER(R11),INSERT_ARGUMENT_ARG+4 CALLG INSERT_ARGUMENT_ARG,G^LIB$INSERT_TREE ; GET THE NAME OF THE CALLING MODULE MOVL NEW_NODE,R11 MOVAL ARGUMENT_Q_CALL_POINTER(R11),INSERT_CALL_ARG+4 MOVZBL SUPER_BUFFER+32,DESCRIPTER MOVAL SUPER_BUFFER+33,DESCRIPTER+4 CALLG INSERT_CALL_ARG,G^LIB$INSERT_TREE ; FINALLY THE VARIABLE NAME PASSED AS ARGUMENT MOVL NEW_NODE,R11 MOVAL CALL_Q_NAME_POINTER(R11),INSERT_NAME_ARG+4 MOVZBL SUPER_BUFFER,DESCRIPTER MOVAL SUPER_BUFFER+1,DESCRIPTER+4 CALLG INSERT_NAME_ARG,G^LIB$INSERT_TREE 20$: BRW BUILD_LOOP .PAGE ;V1.10 .SUBTITLE INSERT TREE UTILITES .ENTRY MODULE_COMPARE,^M ; ;V1.10 ; RET_VALUE=MODULE_COMPARE(SYMBOL DESCRIPTER,TREE ELEMENT) ; RETURNS -1 IF SYMBOL < CURRENT TREE ELEMENT ;V1.10 ; 0 = ;V1.10 ; 1 > ;V1.10 ; ;V1.10 MOVL 4(AP),R2 ;GET ADDRESS OF SYMBOL DESCRIPTER ;V1.10 MOVL 8(AP),R3 ;GET ADDRESS OF TREE ELEMENT ;V1.10 MOVZBL (R2),R0 ;V1.10 MOVZBL MODULE_B_COUNT(R3),R1 CMPC5 R0,@4(R2),#0,R1,MODULE_S_STRING(R3) BLSS 1$ ;V1.10 BEQL 2$ ;V1.10 MOVL #1,R0 ;V1.10 RET ;V1.10 1$: MOVL #-1,R0 ;V1.10 RET ;V1.10 2$: CLRL R0 ;V1.10 RET ;V1.10 .ENTRY MODULE_ALLOCATE,^M ; ;V1.10 ; IRET=MODULE_ALLOCATE(SYMBOL,NEW_NODE,) ; ;V1.10 MOVL #MODULE_LENGTH,ARG1 CALLG VM_ARG,ALLOCATE ;V1.10 INCL SYMBOLS_PROCESSED ;V1.10 MOVL R0,@8(AP) ;V1.10 MOVL 4(AP),R1 MOVZBL (R1),R2 MOVB R2,MODULE_B_COUNT(R0) MOVL 4(R1),R3 MOVC5 R2,(R3),#0,#31,MODULE_S_STRING(R0) MOVL #LIB$_NORMAL,R0 ;V1.10 RET ;V1.10 .ENTRY ARGUMENT_COMPARE,^M ; ;V1.10 ; RET_VALUE=ARGUMENT_COMPARE(SYMBOL DESCRIPTER,TREE ELEMENT) ; RETURNS -1 IF SYMBOL < CURRENT TREE ELEMENT ;V1.10 ; 0 = ;V1.10 ; 1 > ;V1.10 ; ;V1.10 MOVL 4(AP),R2 ;GET ADDRESS OF SYMBOL DESCRIPTER ;V1.10 MOVL 8(AP),R3 ;GET ADDRESS OF TREE ELEMENT ;V1.10 MOVZBL (R2),R0 ;V1.10 MOVZBL ARGUMENT_B_COUNT(R3),R1 CMPC5 R0,@4(R2),#0,R1,ARGUMENT_S_STRING(R3) BLSS 1$ ;V1.10 BEQL 2$ ;V1.10 MOVL #1,R0 ;V1.10 RET ;V1.10 1$: MOVL #-1,R0 ;V1.10 RET ;V1.10 2$: CLRL R0 ;V1.10 RET ;V1.10 .ENTRY ARGUMENT_ALLOCATE,^M ; ;V1.10 ; IRET=ARGUMENT_ALLOCATE(SYMBOL,NEW_NODE,) ; ;V1.10 MOVL #ARGUMENT_LENGTH,ARG1 CALLG VM_ARG,ALLOCATE ;V1.10 INCL SYMBOLS_PROCESSED ;V1.10 MOVL R0,@8(AP) ;V1.10 MOVL 4(AP),R1 MOVZBL (R1),R2 MOVB R2,ARGUMENT_B_COUNT(R0) MOVL 4(R1),R3 MOVC5 R2,(R3),#0,#31,ARGUMENT_S_STRING(R0) MOVL #LIB$_NORMAL,R0 ;V1.10 RET ;V1.10 .ENTRY NAME_COMPARE,^M ; ;V1.10 ; RET_VALUE=NAME_COMPARE(SYMBOL DESCRIPTER,TREE ELEMENT) ; RETURNS -1 IF SYMBOL < CURRENT TREE ELEMENT ;V1.10 ; 0 = ;V1.10 ; 1 > ;V1.10 ; ;V1.10 MOVL 4(AP),R2 ;GET ADDRESS OF SYMBOL DESCRIPTER ;V1.10 MOVL 8(AP),R3 ;GET ADDRESS OF TREE ELEMENT ;V1.10 MOVZBL (R2),R0 ;V1.10 MOVZBL NAME_B_COUNT(R3),R1 CMPC5 R0,@4(R2),#0,R1,NAME_S_STRING(R3) BLSS 1$ ;V1.10 BEQL 2$ ;V1.10 MOVL #1,R0 ;V1.10 RET ;V1.10 1$: MOVL #-1,R0 ;V1.10 RET ;V1.10 2$: CLRL R0 ;V1.10 RET ;V1.10 .ENTRY NAME_ALLOCATE,^M ; ;V1.10 ; IRET=NAME_ALLOCATE(SYMBOL,NEW_NODE,) ; ;V1.10 MOVL #NAME_LENGTH,ARG1 CALLG VM_ARG,ALLOCATE ;V1.10 INCL SYMBOLS_PROCESSED ;V1.10 MOVL R0,@8(AP) ;V1.10 MOVL 4(AP),R1 MOVZBL (R1),R2 MOVB R2,NAME_B_COUNT(R0) MOVL 4(R1),R3 MOVC5 R2,(R3),#0,#31,NAME_S_STRING(R0) MOVL #LIB$_NORMAL,R0 ;V1.10 RET ;V1.10 .ENTRY CALL_COMPARE,^M ; ;V1.10 ; RET_VALUE=NAME_COMPARE(SYMBOL DESCRIPTER,TREE ELEMENT) ; RETURNS -1 IF SYMBOL < CURRENT TREE ELEMENT ;V1.10 ; 0 = ;V1.10 ; 1 > ;V1.10 ; ;V1.10 MOVL 4(AP),R2 ;GET ADDRESS OF SYMBOL DESCRIPTER ;V1.10 MOVL 8(AP),R3 ;GET ADDRESS OF TREE ELEMENT ;V1.10 MOVZBL (R2),R0 ;V1.10 MOVZBL CALL_B_COUNT(R3),R1 CMPC5 R0,@4(R2),#0,R1,CALL_S_STRING(R3) BLSS 1$ ;V1.10 BEQL 2$ ;V1.10 MOVL #1,R0 ;V1.10 RET ;V1.10 1$: MOVL #-1,R0 ;V1.10 RET ;V1.10 2$: CLRL R0 ;V1.10 RET ;V1.10 .ENTRY CALL_ALLOCATE,^M ; ;V1.10 ; IRET=CALL_ALLOCATE(SYMBOL,NEW_NODE,) ; ;V1.10 MOVL #CALL_LENGTH,ARG1 CALLG VM_ARG,ALLOCATE ;V1.10 INCL SYMBOLS_PROCESSED ;V1.10 MOVL R0,@8(AP) ;V1.10 MOVL 4(AP),R1 MOVZBL (R1),R2 MOVB R2,CALL_B_COUNT(R0) MOVL 4(R1),R3 MOVC5 R2,(R3),#0,#31,CALL_S_STRING(R0) MOVL #LIB$_NORMAL,R0 ;V1.10 RET ;V1.10 .PAGE .SUBTITLE OUTPUT ARGUMENT INDEX SYMBOL TABLE OUTPUT_ARGUMENT: BITL #PRESERVE_FLAG!ADD_PRESERVE_FLAG!RESTORE_FLAG,FLAG_WORD+4 ;V2.20 BEQL 2$ ;V2.19 CALLS #0,CLOSE_PRESERVE ;V2.19 2$: ;V2.19 PUSHAL TIME_PARSE ;V1.4 PUSHAL CODE_1 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_PARSE+8 ;V1.4 PUSHAL CODE_2 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_PARSE+12 ;V1.4 PUSHAL CODE_3 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_PARSE+16 ;V1.4 PUSHAL CODE_4 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_PARSE+20 ;V1.4 PUSHAL CODE_5 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 CALLG NULL,G^LIB$INIT_TIMER ;V1.4 MOVL #132,LINE_COUNT CLRL OUTPUT_STRING MOVAL OUTPUT_LINE,OUTPUT_STRING+4 BITL #NARROW_FLAG,FLAG_WORD BEQL 1$ MOVL #80,LINE_COUNT 1$: TSTL SYMBOL_TABLE_QUEUE ;V1.10 BEQL 1001$ ;V1.10 PUSHL #-1 ;V1.10 PUSHAL DUMP_MODULE_SYMBOL PUSHAL SYMBOL_TABLE_QUEUE ;V1.10 CALLS #3,G^LIB$TRAVERSE_TREE ;V1.10 1001$: PUSHAL TIME_OUTPUT ;V1.4 PUSHAL CODE_1 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_OUTPUT+8 ;V1.4 PUSHAL CODE_2 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_OUTPUT+12 ;V1.4 PUSHAL CODE_3 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_OUTPUT+16 ;V1.4 PUSHAL CODE_4 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_OUTPUT+20 ;V1.4 PUSHAL CODE_5 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 CALLG NULL,G^LIB$INIT_TIMER ;V1.4 MOVL ELEMENT_64+4,ELEMENT_64+12 ;V1.4 MOVL ELEMENT_128+4,ELEMENT_128+12 ;V1.4 MOVL ELEMENT_192+4,ELEMENT_192+12 ;V1.4 MOVL ELEMENT_256+4,ELEMENT_256+12 ;V1.4 MOVL ELEMENT_LARGE+4,ELEMENT_LARGE+12 ;V1.4 JMP CLEANUP_ARGUMENT .PAGE ;V1.10 .SUBTITLE DUMP A MODULE SYMBOL .ENTRY DUMP_MODULE_SYMBOL,^M ; OUTPUT THE MODULE NAME AS FIRST LINE OF SET TSTL OUTPUT_STRING BLEQ 1$ PUSHAL OUTPUT_STRING CALLS #1,PRINT_LINE CLRL OUTPUT_STRING 1$: MOVL 4(AP),R10 ; FIRST LETS SEE IF THE MODULE ACTUALLY HAS ANY ARGUMENTS, IF NOT THEN ; DONT BOTHER PRINTING IT OUT TSTL MODULE_Q_ARGUMENT_POINTER(R10) BNEQ 3$ TSTL MODULE_Q_ARGUMENT_POINTER+4(R10) BEQL 2$ 3$: MOVZBL MODULE_B_COUNT(R10),R7 MOVC3 R7,MODULE_S_STRING(R10),OUTPUT_LINE MOVL R7,OUTPUT_STRING MOVAL OUTPUT_LINE,OUTPUT_STRING+4 PUSHAL OUTPUT_STRING ;V1.10 CALLS #1,PRINT_LINE ;V1.10 CLRL OUTPUT_STRING ; NEXT GO THROUGH THE TREE OF ARGUMENT SYMBOLS PUSHL #-1 ;V1.10 PUSHAL DUMP_ARGUMENT PUSHAL MODULE_Q_ARGUMENT_POINTER(R10) CALLS #3,G^LIB$TRAVERSE_TREE ;V1.10 TSTL OUTPUT_STRING ;V2.10 BLEQ 2$ ;V2.10 PUSHAL OUTPUT_STRING ;V1.10 CALLS #1,PRINT_LINE ;V1.10 CLRL OUTPUT_STRING 2$: MOVL #LIB$_NORMAL,R0 ;V1.10 RET ;V1.10 .PAGE .SUBTITLE DUMP AN ARGUMENT SYMBOL AND ALL SUB TREES .ENTRY DUMP_ARGUMENT,^M ; DUMP ARGUMENT LINE(S) OF SET ; $Argument_xxxx arg_list_name,,,,,.... ; calling module name calling argument value,..... ; ; IF NOT EMPTY-OUTPUT CURRENT LINE TSTL OUTPUT_STRING BLEQ 1$ PUSHAL OUTPUT_STRING CALLS #1,PRINT_LINE CLRL OUTPUT_STRING 1$: ; CLEAR THE OUTPUT LINE MOVC5 #0,NULL,#^A/ /,#132,OUTPUT_LINE ; COPY THE "$Argument_xxxx" string over MOVL 4(AP),R11 MOVC3 #14,ARGUMENT_S_STRING(R11),OUTPUT_LINE+4 ; MOVE IN "is" MOVW #^A/is/,OUTPUT_LINE+19 ; UPDATE ALL POINTERS AND COUNTERS MOVL #22,OUTPUT_STRING MOVAL OUTPUT_LINE,OUTPUT_STRING+4 SUBL3 #22,LINE_COUNT,CHAR_COUNT ; SEE IF ANY ARGUMENTS IN ARG LIST DEFINED, IF NOT PUT IN ????? TSTL ARGUMENT_Q_NAME_POINTER(R11) BNEQ 5$ TSTL ARGUMENT_Q_NAME_POINTER+4(R11) BNEQ 5$ MOVZBL UNKNOWN,R10 MOVL UNKNOWN+4,R9 ADDL3 #OUTPUT_LINE+1,OUTPUT_STRING,R8 MOVC3 R10,(R9),(R8) INCL R10 ADDL2 R10,OUTPUT_STRING SUBL2 R10,CHAR_COUNT BRB 4$ ; DUMP TREE OF VAR NAME(S) 5$: PUSHL #-1 ;V1.10 PUSHAL DUMP_NAME PUSHAL ARGUMENT_Q_NAME_POINTER(R11) CALLS #3,G^LIB$TRAVERSE_TREE ;V1.10 4$: TSTL OUTPUT_STRING ;V2.10 BLEQ 2$ ;V2.10 PUSHAL OUTPUT_STRING ;V1.10 CALLS #1,PRINT_LINE ;V1.10 2$: CLRL OUTPUT_STRING ; THEN TREE OF CALL MODULES AND RESPECTIVE SUB TREES PUSHL #-1 ;V1.10 PUSHAL DUMP_CALL PUSHAL ARGUMENT_Q_CALL_POINTER(R11) CALLS #3,G^LIB$TRAVERSE_TREE ;V1.10 TSTL OUTPUT_STRING ;V2.10 BLEQ 3$ PUSHAL OUTPUT_STRING ;V1.10 CALLS #1,PRINT_LINE ;V1.10 CLRL OUTPUT_STRING 3$: MOVL #LIB$_NORMAL,R0 ;V1.10 RET ;V1.10 .PAGE .SUBTITLE DUMP OF ALL CALL MODULE NAMES AND SUB TREE .ENTRY DUMP_CALL,^M ; SEE IF OUTPUT LINE IS EMPTY-IF NOT THEN OUTPUT AND CLEAN IT UP TSTL OUTPUT_STRING BLEQ 1$ PUSHAL OUTPUT_STRING CALLS #1,PRINT_LINE CLRL OUTPUT_STRING 1$: ; SET UP OUTPUT LINE FOR " Called by " module_name " argument(s)" MOVC5 #0,NULL,#^A/ /,#132,OUTPUT_LINE MOVL 4(AP),R11 MOVZBL CALLED_BY,R10 MOVC3 R10,@CALLED_BY+4,OUTPUT_LINE MOVL R10,OUTPUT_STRING SUBL3 R10,LINE_COUNT,CHAR_COUNT ADDL2 #OUTPUT_LINE,R10 MOVZBL CALL_B_COUNT(R11),R9 MOVC3 R9,CALL_S_STRING(R11),(R10) ADDL2 R9,OUTPUT_STRING SUBL2 R9,CHAR_COUNT ADDL2 R9,R10 MOVZBL ARGUMENTS,R9 MOVC3 R9,@ARGUMENTS+4,(R10) ADDL2 R9,OUTPUT_STRING SUBL2 R9,CHAR_COUNT ; NOW TRAVERSE NAME TREE FOR CALL PUSHL #-1 ;V1.10 PUSHAL DUMP_NAME PUSHAL CALL_Q_NAME_POINTER(R11) CALLS #3,G^LIB$TRAVERSE_TREE ;V1.10 TSTL OUTPUT_STRING ;V2.10 BLEQ 3$ PUSHAL OUTPUT_STRING ;V1.10 CALLS #1,PRINT_LINE ;V1.10 CLRL OUTPUT_STRING 3$: MOVL #LIB$_NORMAL,R0 ;V1.10 RET ;V1.10 .PAGE .SUBTITLE DUMP VARIABLE NAMES .ENTRY DUMP_NAME,^M MOVL 4(AP),R11 MOVZBL NAME_B_COUNT(R11),R10 ;GET SIZE OF NAME STRING CMPL R10,CHAR_COUNT ;MUST BE LESS THAN NO OF CHRS LEFT BLSS 1$ ;IS SMALLER-OK PUSHAL OUTPUT_STRING ;OUTPUT CURRENT LINE CALLS #1,PRINT_LINE MOVC5 #0,NULL,#^A/ /,#132,OUTPUT_LINE ;REINIT LINE AND POINTERS MOVL #10,OUTPUT_STRING ;INDENT CONTINUATION LINE 10 SPACES SUBL3 #10,LINE_COUNT,CHAR_COUNT ; SEE WHERE TO PUT VAR NAME-ALLOW LEADING BLANK 1$: ADDL3 #OUTPUT_LINE+1,OUTPUT_STRING,R9 MOVC3 R10,NAME_S_STRING(R11),(R9) ; NOW UPDATE ALL POINTERS AND COUNTERS INCL R10 ;ACCOUNT FOR LEADING BLANK ADDL2 R10,OUTPUT_STRING SUBL R10,CHAR_COUNT MOVL #LIB$_NORMAL,R0 ;V1.10 RET ;V1.10 .PAGE .SUBTITLE CLEAN UP SYMBOL TABLE CLEANUP_ARGUMENT: ; REMOVE ALL ENTRYS IN SYMBOL TABLE AND RETURN THEM TO HEAP ;V1.10 MOVAL SYMBOL_TABLE_QUEUE,R11 ;GET ADDR OF QUEUE HEADER ;V1.10 MOVL (R11),R10 ;GET QUEUE ELEMENT ;V2.10 BEQL 2$ ;V2.10 CALLG NULL,CLEAN_MODULE_TAIL ;REMOVE ALL ATTACHED ITEMS MOVL #MODULE_LENGTH,ARG1 MOVL R10,ARG2 ;V1.10 CALLG VM_ARG,FREE ;V1.10 2$: MOVL 4(R11),R10 ;GET QUEUE ELEMENT ;V2.10 BEQL 3$ ;V2.10 CALLG NULL,CLEAN_MODULE_TAIL ;REMOVE ALL ATTACHED ITEMS MOVL #MODULE_LENGTH,ARG1 MOVL R10,ARG2 ;V2.10 CALLG VM_ARG,FREE ;V2.10 3$: CLRQ SYMBOL_TABLE_QUEUE ;CLEAN UP QUEUE ;V2.10 CLRW SYMBOL_TABLE_QUEUE+8 ;V2.10 BRW ARGUMENT_COMPLETE .ENTRY CLEAN_MODULE_TAIL,^M ; FIRST CLEAN OUT ALL MODULES TO LEFT AND RIGHT ; ;V1.10 ; DOES IT HAVE A LEFT LINK ;V1.10 TSTL MODULE_Q_MODULE_POINTER(R10) BEQL 1$ ;NO-SEE ABOUT HIGHER ;V1.10 ; HAS LOWER SYMBOL TO REMOVE ;V1.10 PUSHR #^M ;SAVE CURRENT ;V1.10 MOVL MODULE_Q_MODULE_POINTER(R10),R10;GET LEFT ELEMENT CALLG NULL,CLEAN_MODULE_TAIL MOVL #MODULE_LENGTH,ARG1 MOVL R10,ARG2 ;V1.10 CALLG VM_ARG,FREE ;FREE BLOCK ;V1.10 POPR #^M ;V1.10 1$: TSTL MODULE_Q_MODULE_POINTER+4(R10) ;ANY RIGHT BEQL 2$ ;NO ;V1.10 ; HAS HIGHER SYMBOLS TO REMOVE ;V1.10 PUSHR #^M ;SAVE REGESTERS ;V1.10 MOVL MODULE_Q_MODULE_POINTER+4(R10),R10 CALLG NULL,CLEAN_MODULE_TAIL MOVL #MODULE_LENGTH,ARG1 MOVL R10,ARG2 ;V1.10 CALLG VM_ARG,FREE ;V1.10 POPR #^M ;V1.10 2$:; REMOVE ALL ARGUMENT FROM ELEMENT ;V1.10 MOVL MODULE_Q_ARGUMENT_POINTER(R10),R9 BEQL 3$ ;NO LEFT ;V1.10 CALLG NULL,CLEAN_ARGUMENT_TAIL 3$: MOVL MODULE_Q_ARGUMENT_POINTER+4(R10),R9 ;GET RIGHT BEQL 4$ ;V1.10 CALLG NULL,CLEAN_ARGUMENT_TAIL 4$: RET .ENTRY CLEAN_ARGUMENT_TAIL,^M ; POINTED TO BY R9 MOVL ARGUMENT_Q_NAME_POINTER(R9),R7 BEQL 1$ CALLG NULL,CLEAN_NAME_TAIL 1$: MOVL ARGUMENT_Q_NAME_POINTER+4(R9),R7 BEQL 2$ CALLG NULL,CLEAN_NAME_TAIL 2$: MOVL ARGUMENT_Q_CALL_POINTER(R9),R8 BEQL 3$ CALLG NULL,CLEAN_CALL_TAIL 3$: MOVL ARGUMENT_Q_CALL_POINTER+4(R9),R8 BEQL 4$ CALLG NULL,CLEAN_CALL_TAIL 4$: PUSHR #^M MOVL ARGUMENT_Q_ARGUMENT_POINTER(R9),R9 BEQL 5$ CALLG NULL,CLEAN_ARGUMENT_TAIL 5$: POPR #^M PUSHR #^M MOVL ARGUMENT_Q_ARGUMENT_POINTER+4(R9),R9 BEQL 6$ CALLG NULL,CLEAN_ARGUMENT_TAIL 6$: POPR #^M MOVL R9,ARG2 MOVL #ARGUMENT_LENGTH,ARG1 CALLG VM_ARG,FREE RET .ENTRY CLEAN_CALL_TAIL,^M ; POINTER IN R8 MOVL CALL_Q_NAME_POINTER(R8),R7 BEQL 1$ CALLG NULL,CLEAN_NAME_TAIL 1$: MOVL CALL_Q_NAME_POINTER+4(R8),R7 BEQL 2$ CALLG NULL,CLEAN_NAME_TAIL 2$: PUSHR #^M MOVL CALL_Q_CALL_POINTER(R8),R8 BEQL 3$ CALLG NULL,CLEAN_CALL_TAIL 3$: POPR #^M PUSHR #^M MOVL CALL_Q_CALL_POINTER+4(R8),R8 BEQL 4$ CALLG NULL,CLEAN_CALL_TAIL 4$: POPR #^M MOVL R8,ARG2 MOVL #CALL_LENGTH,ARG1 CALLG VM_ARG,FREE RET .ENTRY CLEAN_NAME_TAIL,^M ; POINTER IN R7 PUSHR #^M MOVL NAME_Q_NAME_POINTER(R7),R7 BEQL 1$ CALLG NULL,CLEAN_NAME_TAIL 1$: POPR #^M PUSHR #^M MOVL NAME_Q_NAME_POINTER+4(R7),R7 BEQL 2$ CALLG NULL,CLEAN_NAME_TAIL 2$: POPR #^M MOVL R7,ARG2 MOVL #NAME_LENGTH,ARG1 CALLG VM_ARG,FREE RET .PAGE .SUBTITLE STATISTICS ARGUMENT_COMPLETE: PUSHAL TIME_CLEANUP ;V1.4 PUSHAL CODE_1 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_CLEANUP+8 ;V1.4 PUSHAL CODE_2 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_CLEANUP+12 ;V1.4 PUSHAL CODE_3 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_CLEANUP+16 ;V1.4 PUSHAL CODE_4 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 PUSHAL TIME_CLEANUP+20 ;V1.4 PUSHAL CODE_5 ;V1.4 CALLS #2,G^LIB$STAT_TIMER ;V1.4 CALLG NULL,G^LIB$INIT_TIMER ;V1.4 CALLG NULL,DUMP_STATS ;V1.4 CLRL LINES_ON_PAGE MOVL #PARSE_LINES,STATUS_WORD MOVL #1,SUPER_SAVED_FLAG ;V1.32 BITL #SUPER_SAVE_FLAG,FLAG_WORD ;V1.32 BNEQ 1$ ;V1.32 CLRL SUPER_SAVED_FLAG ;V1.32 CALLG NULL,CLOSE_SCRATCH CALLG NULL,OPEN_SCRATCH 1$: RET .PAGE .IF DF DEBUG_FLAG .SUBTITLE DEBUG AIDS .ENTRY DUMP_SUPER_BUFFER,^M .MACRO DUMP_BUFFER_SLOT SLOT_OFFSET,?A,?B MOVZBL SUPER_BUFFER+SLOT_OFFSET,DUMP_DESCRIPTER BEQL A MOVAL SUPER_BUFFER+SLOT_OFFSET+1,DUMP_DESCRIPTER+4 PUSHAL DUMP_DESCRIPTER BRB B A: PUSHAL DUMP_EMPTY B: CALLS #1,G^LIB$PUT_OUTPUT .ENDM PUSHAL SUPER_BUFFER_TITLE CALLS #1,G^LIB$PUT_OUTPUT DUMP_BUFFER_SLOT 0 DUMP_BUFFER_SLOT 32 DUMP_BUFFER_SLOT 64 DUMP_BUFFER_SLOT 96 DUMP_BUFFER_SLOT 128 DUMP_BUFFER_SLOT 165 RET .ENTRY DUMP_TREE,^M MOVL #132,LINE_COUNT CLRL OUTPUT_STRING MOVAL OUTPUT_LINE,OUTPUT_STRING+4 BITL #NARROW_FLAG,FLAG_WORD BEQL 1$ MOVL #80,LINE_COUNT 1$: TSTL SYMBOL_TABLE_QUEUE ;V1.10 BEQL 1001$ ;V1.10 PUSHL #-1 ;V1.10 PUSHAL DUMP_MODULE_SYMBOL PUSHAL SYMBOL_TABLE_QUEUE ;V1.10 CALLS #3,G^LIB$TRAVERSE_TREE ;V1.10 1001$: RET .PSECT IMPURE_DATA DUMP_DESCRIPTER: .LONG 0,0 .PSECT PURE_DATA SUPER_BUFFER_TITLE: .ASCID /Dump of SUPER_BUFFER/ DUMP_EMPTY: .ASCID /Empty/ .ENDC .END