BackbuttonBinder Information

The Binder Information, known as BindInfo, is the MetaData which describes the structure of a compiled program or subprogram. 

The BindInfo is used in cases such as these.

The BindInfo information is encoded in a Tree of Entries.

A BindInfo Entry is described by its Universal Class (UC), SubClass (SC), by the Number of Words (N) of  information and the type of that information (ENTRY).

BindInfo Entry Keyword Layout
Field Name Description
[47:8] UCF Universal Class
[45:5] UCCF (MCP Field) Universal Class
[40:1] UCRF (MCP Field) Reference vs Value Indicator
[39:20] SCF SubClass.
[ 19:20 ] NF This is usually the Number of Words in the following Entry, and does not include the Keyword itself.

However, in some cases, it is a value, and the length of the entry is constant for the UC. The Procedure Directory is an example where the NF field is not the length of the following Entry.

An Entry is described in the Binder symbolic as (UC,SC,N,ENTRY), for example (0,4,N,GLOBALDIRECTORY).

The Binder symbol contains a description of the BindInfo and the Universal Class and SubClass Entries.

A Table which describes the Universal Class and SubClass Entries which might be used by a modern Compiler is provided below.

The BindInfo is a self describing Tree structure.;

Usually each node gives the Number of Words in the SubTree which follows. It is a recursive structure, terminated by the occurrence of a Leaf  node. However there is no internal indication of whether a node is a Leaf or a Tree. 

This can be inferred in most cases, if N <= 1, it must be a Leaf, but there are cases where N contains a value other than the Number of Words in the SubTree (0,23,Size(ProcedureDirectory),ProcedureDirectory), and cases where it is a Leaf, but N is > 1, being the size of the associated Data (0,1,WordsIn(Identifier),Identifier),  and cases where N describes only part of the entry (0, 65,N,OutputMessage Array LT48 List and <simple form name>). These exceptions have to be known.

The exceptions seem to occur only with some subclasses of UC 0. 

Program Description

The Program Description is the Root of the BindInfo and it is described by the descriptor at SegmentZero[S0SepCompileInfoV].

The descriptor gives the Segment Address of the Program Description in AddressF and the Number of Words in the Program Description in LengthF.

The entries which may occur in a Program Description depend on the type of subprogram which has been compiled.

This example of a Program Description is from a simple Algol Block Program.

Index UC SC N Hex Description
0 0 34 9 4"000002200009" Procedure Directory
1       4"00000090000A" (Length,Address)
2 0 4 24 4"000000400018" Global Directory
3 36 1 5 4"240000100005" Real Intrinsic
4 0 1 2 4"000000100002" Identifier
5       4"08010104FFF0"  
6       4"F0F7B20695B4"  
7 0 2 1 4"000000200001" Address Couple
8       4"000000100004"  
9 36 1 5 4"240000100005" Real Intrinsic
10 0 1 2 4"000000100002" Identifier
11       4"08010104FFF0"  
12       4"F1F000412003"  
13 0 2 1 4"000000200001" Address Couple
14       4"000000100007"  
15 36 1 5 4"240000100005" Real Intrinsic
16 0 1 2 4"000000100002" Identifier
17       4"08010104FFF0"  
18       4"F2F1B20EABA3"  
19 0 2 1 4"000000200001" Address Couple
20       4"000000100005"  
21 36 1 5 4"240000100005" Real Intrinsic
22 0 1 2 4"000000100002" Identifier
23       4"08010104FFF0"  
24       4"F2F3B0B85004"  
25 0 2 1 4"000000200001" Address Couple
26       4"000000100006"  
27 0 25 1 4"000001900001" BlockExit Pointer for Stop in SubProgram
28       4"000401D08003"  
29 0 19 1 4"000001300001" First Executable Code Syllable
30       4"00000130A003"  
31 0 18 1 4"000001200001" End of D[2] Stack Pointer
32       4"000802700003"  
33 0 21 1 4"000001500001" Global Stack Size
34       4"000000000007"  
35 0 42 1 4"000002A00001" Level 2 Software Control Word Image
36       4"800000400800"  

 

Procedure Directory

The Procedure Directory is described by a (0,34,N,ProcedureDirectory) entry in the Program Description.

N is the number of Words in the Procedure Directory. The next word contains a descriptor which contains the Size in Words of the Procedure Directory, and the Segment Address of the Procedure Directory.

The layout of the Procedure Directory  is defined in the ALGOL Compiler at 10151100, and the Binder at 5679000.

The Procedure Directory Entry Layout changed in 4.7, and a Bindinfo Version Level was implemented in Segment Zero[S0SepCompileInfoV] to indicate the Procedure Directory Version.

Procedure Directory Entry Layout - Version 0 (Pre 47.1)
Field Name Description
Word 0
[47:1] ExternalBitF 1 = External Procedure
[46:1] OwnsBitF On if Binding this Procedure may require changing its Local Directory (eg. If it contains OWN or VALUE ARRAY)
[45:18] DiskSegF Disk Segment of Local Directory or Value Array (Latter for Externals)
[27:1] NewProcF Entry is a New Procedure added by Binding.
[26:1] ValAryF Entry is for a Value Array
[25:5] LDWordF Word in DiskSegF where Local Directory starts.
[20:5] NestLevelF Procedure Lex Level
[15:1] SegsBitF Extra Segments. Must be 0 in Word 1 and set to 1 in the Extra Segment Words following the Procedure Directory Identifier.
[14:1] MsgAryF Entry is for an Output Message Array
[13:1] CBInfoBitF Local Directory for this Procedure contains Critical Block info for fixup. Set for Blocks with PROCESS or CALL statements.
[27:1] NewProcF Entry is a New Procedure
[12:13] SegDictIndexF Segment Dictionary Index for Procedure Stack Building Code.
Word 1..N  Procedure Identifier in Standard Form
    N= WordsIn(StandardForm Identifier)
Word N+1..M  List of Packed Segment Dictionary Indexes 
[15:1] SegsBitF 1=Word contains Packed Segment Dictionary Indexes. The List continues while this Bit is Set. It is terminated by the next Procedure Directory Entry in which it is always 0.

For N:=0 Step 1 Until 2 Do
  W.[(N)*16+12:13]

[44:13] SegInx2F Segments which are unique to this Procedure
[28:13] SegInx1F  
[12:13] SegInx0F  

As of 5.0 the ALGOL Compiler was using Version 0.

Procedure Directory Entry Layout - Version 1 (47.1)
Field Name Description
Word 0
[47:1] ExternalBitF Procedure is External.
[46:1] OwnsBitF Procedure has OWNs.
[45:1] SegsBitF Entry contains extra Segments
[44:1] MsgAryF Entry is for an Output Message Array.
[43:1] CBInfoBitF Local Directory for this Procedure contains Critical Block info for fixup. Set for Blocks with PROCESS or CALL statements.
[42:15] EntrySzF Number of Words in this Entry.
[27:1] NewProcF Entry is a New Procedure added by Binding.
[26:1] ValAryF Entry is for a Value Array
[25:6] unused  
[19:4] NestLevelF Procedure Lex Level
[15:16] SegDictIndexF Segment Dictionary Index for Procedure Stack Building Code.
Word 1
[47:19] unused  
[28:5] LDWordF Word in DiskSegF where Local Directory starts.
[15:16] DiskSegF Disk Segment of Local Directory or Value Array (Latter for Externals)
Word 2..N  Procedure Identifier in Standard Form
    N= WordsIn(StandardForm Identifier)
Word N+1..M  List of Packed Segment Dictionary Indexes 
    For N:=0 Step 1 Until 2 Do
  W.[(N)*16+15:16]
[47:16] SegInx2F Segments which are unique to this Procedure
[31:16] SegInx1F  
[15:16] SegInx0F  

The Procedure Directory Entry contains the Segment Address of the Locals Directory for a Procedure.

Local Directory

The Local Directory for a Procedure contains Bindinfo Entries for the Local Declarations, Parameters and Function Value.

The first entry is for the Local Directory.

Universal Class and SubClass Definitions

This information has been compiled from the comment in the Binder symbol, and from the Binder code and analysis of codefiles. 

A Subroutine is an Untyped Procedure.

A Function is a Typed Procedure.

An Odd Universal Class implies Call-By-Name.

UC SC N Type Content Description
0 1

WordsIn

(StdName)

Leaf Identifier
4"TT0101CC"8"XX---X"
Standard Form Name, left justified and the unused bytes in the last word are undefined.
  2 Word Count Leaf AddressCouple List
LexLevelF = [39:20]
DisplacementF = [19:20]
Types such as String have more than 1 Address Couple allocated.
  3 Word Count Tree Parameter List
Marks a sequence of entries:
(0,9,1,NumberOfParameters)
<parameter entries>
The parameter entries describe the order and type of the procedure's parameters.
  4 Word Count Tree Global Directory Marks a sequence of entries for all outer block items which may be referenced. For example, MCP Intrinsic References.
  5 Word Count Leaf D[1] Reference List Marks a sequence of syllable pointers to a NAMC,VALC or MPCW referring to a Level 1 item. 
  6 Word Count Leaf Global Reference List Marks a sequence of syllable pointers to a NAMC or VALC referring to a global to the procedure. 
  7 1 Leaf Reference to LT48 A syllable pointer to a LT48 operator which is used to make a literal containing the SDI of the Value Array Descriptor for the External Procedure
  8 Word Count Leaf List of Segments  
  9 1 Leaf Parameter Count (Integer) The Number of Parameters required by the subprogram is given by the following Integer.
If [47:1]=1 then nothing is known about the parameters for this procedure, and [46:47]=0 (Binder 75876000)
  10 Word Count Leaf StandardFormName Explicit File Identifier
  11 Word Count  Tree Own Directory Marks a sequence of entries for OWN variables declared in a Procedure Program. These are items which must be added to the Host D[2] Stack.
  12 Word Count Leaf Own Reference List Marks a sequence of syllable pointers to a NAMC or VALC referring to an Own Variable in this procedure. 
  13 Word Count Leaf D[2] Stack Building Code Array
<seg desc>
LengthF = [39:20] (Size in Words of Array)
AddressF = [19:20] (Segment Address in CodeFile of Array)
The <segdesc> locates the Array in the CodeFile. For a given D[2] Stack location, there may be a word in the array which describes certain features of the cell, and gives the cell's starting code address. 
  14 Word Count Leaf Make Array Descriptor Pointers Marks a sequence of syllable pointers to LT48 Operators for making Value Array or FIB Descriptors. One of these is required for each Value Array (such as a Format String), which does not have a D[1] Descriptor, as well as for each File. 
  15 1 Leaf Number of Dimensions (Integer) Number of Dimensions in an Array 
  16 Word Count Leaf Dimension Size List (Integer List) Size of the dimensions of an array. Size of a Fortran Common Block. 
  17 1 Leaf Integer The Segment Dictionary Index of the Value Array Descriptor for an External Procedure.
  18 1 Leaf End of D[2] Code A Syllable Pointer to the Syllable immediately after the D[2] Stack Building Code
  19 1 Leaf First Executable Code A Syllable Pointer to the first executable code syllable of a separately compiled procedure.
  20       Subscripted Variable Pointer (Fortran)
  21       Global Stack Size
  22       Array Length (Segmentation Not Allowed)
  23       LT48 for Common Block Length
  24       References to Double and Complex Items in CommonBlock 
  25 1     Block Exit Pointer
  26       Intrinsic Special Information
  27 1 Leaf Number of Dimensions (Integer) Number of Dimensions (Parameter without lower bounds)
  28       Initial Value of a Variable or Array
  29       Code Copying Starting and Ending Locations
  30       Hex References to OWNS
  31       BCL References to OWNS
  32       EBCDIC References to OWNS
  33       Local Directory
  34 Size of Procedure Directory in Words Leaf Procedure Directory Descriptor
SizeF = [39:20]
AddressF = [19:20]
Segment address of the Procedure Directory and it's total size in Words.
  35       Number of Address Couples (Parameters)
  36       Checking Code for Formal Procedure (Address Couple, MPCW Syllable, First Executable)
  37       Extra Segs for Controlled Variables(PLI)
  38       Initial Code SCW and # of Stack Cells (PL/I)
  39       TimeStamp for Database
  40       First Address Couple of SIB for Database
  41       List of (Structure Name, Structure #, Address Couple) Groups for Database
  42       Level 2 Software Control Word image
  43       Level 2 Epilog or Exception or Statistics PCW image (DCAlgol)
  44       Syllable Pointer to LT48 Operator for making Epilog or Exception PCW below SCW
  45       Transaction Base Creation TimeStamp and Update TimeStamp
  46       List of Formats and SubFormats invoked for Transaction Base
  47       Transaction Base Format
  48       Transaction Base SubFormat
  49       Transaction Base associated with Transaction Record or Record Array
  50       Procedure or Subroutine CompilerInfo Word
  51 Word Count Leaf   Library Template Attributes
  52       Data Dictionary Invocation Directory
  53       Data Dictionary Usage Directory
  54 Word Count Leaf <actualname><type description>

<actualname> in simple form <length byte><name> padded with nulls to the next word boundary.

<type description> from Library Template.
Library Entrypoint Name and Type Description
  55 Word Count Leaf Library Name. Simple form name <length byte><name> Library to which an Entrypoint belongs
  56       Length of DM Temporary Array belonging to Database
  57       Syllable Pointers to LT48 Operators for 2 Descriptors for DM Temporary Array
  58       Output Message Array information for MultiLingual System (MLS)
  59       Critical Block indicators for Algol PROCESS and CALL statements
  60       Syllable Pointer to critical block indicator (NAMC LL,0)
  61 Reference Count Leaf Syllable Pointers Syllable Pointer to LT48 for Array Descriptor
  62 Reference Count Leaf Syllable Pointers Syllable Pointer to LT48 for Array Length
  63       Syllable Pointer to LT48 to Output Message Array
  64       PCW value for Fortran77 Initialization Procedure
  65 LT48 Count Leaf OutputMessageArray LT48 List and <simple form name> N contains the number of LT48 Syllable Words in the list. This is followed by an <identifier length> <identifier>, simple form name, which N does not include. This is another exception.
  66       Fortran77 fix up code for parameters
  67 1 Leaf D1_OffsetF = [15:16] 
D[1] Offset of SAVED_QUERY_TEXT Value Array.
  69 Word Count     SIM Query Code Addresses of Query Numbers
  70       SIM qualifying identifier
  71       SIM Query_Driver Template
  72       SIM List of Indices into Q_D Template for each Entrypoint
  73       LT48 pointer to F77 Heap Vector Offset
  74       Disk Address and Length of SDF Form Record Library Application Record Description or Library Template
  75       Number of Heap Words required for an item in Slice Heap
  76       LT Pointer to LT48 to create a Slice Heap Address variable by emitting the number of Heap Words required for the previous Heap Address Variable
  77       LT Pointer to LT48 to create a Slice Heap Address Variable by emitting the number of words previously stacked (at LexLevel 2) in the software stack.
  78       LT Pointer to LT48 to calculate the total number of software stack words at lex level 2 by emitting (<total number of heap words stacked>-<number of heap words stacked for all heap address variables in original host except the last one>. [46:1] = 0 means use 1xD soft stack, =1 means use 2xD soft stack
  79       LT Pointer to LT48 to calculate the total number of software stack words at LexLevel 2 by emitting the total number of heap words stacked.
 [46:1] = 0 means use 1xD soft stack, =1 means use 2xD soft stack
  80     [0:1] 1 = External
[1:1] 1 = Public
Slice Heap Item Access
  81       LT Pointer to a ZERO operator which will need to be changed to a ONE operator if a Double Slice Heap Item Address Variable is added to the Outer Block (D[2]) (Slice 2xD Heap)
  82       LT Pointer to preamble code (and #of Code Syllables) which is used to check to see if the addresses in the slice software stack should continue in current heap row or the next heap row (Slice 2xD Heap)
  83       LT Pointer (and # of Code Syllables) to the call on Make_2D_Heap. This cod comes after the code for the SCW in the D[2] Stack Building code. The Binder needs to copy this code from the Host and place it after the code to build the SCW. (Slice 2xD Heap)
  84     0 = Tiny
1 = Small
2 = Large
3 = Huge
Slice Memory Model. Tiny and Small are 1xD heaps. Large and Huge are 2xD heaps.
  85       Slice Heap Row Size (Words)
  86       Slice Number of Address Procedures (Host Only)
  87       Slice Procedure Address
  88       Slice LT16 pointer to Procedure Address
  89       Slice Number of calls to Procedure via Address
  90       Slice Formal Call Information
  91       Slice Formal Call Number
  92       Slice Formal Call Index
  93       Slice LT16 pointer call to (FORMAL_CALL_NUM MOD 48)
  94       Slice code pointer to ISOL or BSET
  95       Slice LT48 call to formal call index
  96       Slice LT16 pointer to ROUTINE-ARG_STRIDE
  97       Slice ROUTINE-ARG-INDEX-LOC
  98       Slice ROUTINE-ARG-TABLE-LOC
  99       Slice SLICE-CHECK-TABLE-ID
  100       Slice SLICE-SIRW-TAB-ID
  101       Slice SLICE-SIRW-TAB-INIT
  102       Slice Branch locations in the D[2] Stack Building code
  103       Slice Branch locations in the D[2] initialization code
  104       Slice location of Branch used to start D[2] initialization
  105       Slice Copy of Slice Heap Address Variable
  106       Slice TADS Procedure Number
  107       Slice TADS Procedure Number Reference
  108       Slice TADS Last Procedure Number
  109       Slice Concurrent Execution option
  110       Statistics Epilog identifies the current procedure as an epilog procedure for printing statistics. The next word holds the code address of the end of the epilog procedure, which has EXIT NVLD NVLD. If statistics epilogs occur in multiple subprograms, the Binder overwrites the EXIT NVLD NVLD with a NAMC to another epilog's PCW and a DBUN to link the epilogs so they are all executed.
  111       Slice Double Alignment option
  112 1 Leaf Integer Value of FARHEAP(STACKSIZE) option
  113       Syllable Pointer to LT48 Operator for maximum FARHEAP(STACKSIZE) option
  114 Word Count Leaf <string> <string> If the first string is found in another BINDER_MATCH option, then the 2 seconds strings must match
  115        
  116        
  117        
  118       Structure or Connection Block Type
  119       LT48 Pointer to Connection Library or Structure Block Variable/Array Descriptor
  120 1 Leaf Operand Access
PublicF = [1:1]
InitializedF = [3:1]
Defines Operand Access
  121 1 Leaf Boolean 1= Bind Large Program is Set
  122 1 Leaf Integer Value of $TADS(RESOURCE=<resource value>) Integer Range 20..2000
  123 Word Count Leaf Integer List Each element of the list contains the Segment Dictionary Index of a D[2] Stack Building Code Segment
2         48 Bit Operand
4         96 Bit Operand
6         Single Unindexed Data Descriptor
8         Single Indexed Data Descriptor
10         Double Unindexed Data Descriptor
12         Double Indexed Data Descriptor
14         Unindexed String Descriptor
16         Indexed String Descriptor
18         Untyped Procedure or Subroutine
20         Typed Procedure or Function
22         File
24         Task
26         Pair of data Descriptors (Single Precision, Double Precision) for Fortran Common Blocks and Equivalence
28         Interrupt
30         Message or Message Array
32         Queue or Queue Array
34         Intrinsic Subroutine
36         Intrinsic Function
38         PL/I Variables
40         Database
42         String Variable
44         String Variable Array
46         String Procedure
48         Alternative Item Group
50         Data Dictionary Descriptions
52         Transaction Base
54         Library
56         Library Entrypoint
58         Exported Subroutine or Function
60         ByCalling Subroutine or Function
62         Fortran77 Double Precision Function
64         Fortran77 Heap Vector
66         Cobol CD
68         InterLocks and InterLock Arrays
70         SIM Entity Reference
72         SIM Query Variable
74          
76         Single Item in Slice 1xD Heap
78         Double Item in Slice 1xD Heap
80         Hex Item in Slice 1xD Heap
82         Ebcdic Item in Slice 1xD Heap
84         Single Item in Slice 2xD Heap
           
86         Double Item in Slice 2xD Heap
88         Hex Item in Slice 2xD Heap
90         Ebcdic Item in Slice 2xD Heap
92         Structure and Connection Block Internal Items
94         Global Directory Block
96          
98          
100         Internal to Binder (Skip_It_UC)

Syllable Pointer

An entry in the BindInfo may contain a code reference known as a Syllable Pointer. The layout is described in the Binder at 5012200.

A Syllable Pointer is a PCW with a Tag of 0.

Beta Format.

Beta Syllable Pointer
Field Name Description
[35:3] PSR Syllable index for start of Operator.
[32:13] PIR Word Index for start of Operator.
[18:1] DeltaF Must be 0 for Beta systems.
[17:4] LL LexLevel at which Operator is executed.
[13:1] D0D1Bit 1=D[1], 0=D[0].
[12:13] SDI Segment Dictionary Index for Code Segment containing the Operator.

Version 1 Delta Format.

Gamma Syllable Pointer
Field Name Description
[47:3] PCW_VersionF PCW Version.
[41:13] PWI Word Index for start of Operator.
[28:3] PSI Syllable index for start of Operator.
[25:1] CS Control State Flag.
[23:4] LL LexLevel at which Operator is executed.
[19:4]   Unused.
[15:16] SDI Segment Dictionary Index for Code Segment containing the Operator.

D[2] Stack Building Code Array Cell

A D[2] Stack Building Code Array is an array in the BindInfo which contains a word for selected D[2] Stack Items describing characteristics of the stack cell.

It is described in the Binder at 6021800.

D[2] Stack Building Code Array Cell
Field Name Description
[47:16] D2StkNSylF The number of syllables of code to create the Stack Cell.
[31:3] D2StkPSRF Syllable Index
[28:13] D2StkPIRF Word Index
[15:1] D2StkAlInBit  
[14:1] D2StkInitBitF Initialization
14:1] D2StkFixBrnchsF Branch Fixup
[13:1] D2StkInitCodeBitF Code File initialized Array Item
[12:13]   Segment Number