11.07.2015 Views

Program Logic Manual - All about the IBM 1130 Computing System

Program Logic Manual - All about the IBM 1130 Computing System

Program Logic Manual - All about the IBM 1130 Computing System

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A DO Table entry is made for each DO statementwhen it is detected. As <strong>the</strong> statements following<strong>the</strong> DO statement are scanned, <strong>the</strong> statement numbersare compared with <strong>the</strong> contents of word 5, <strong>the</strong>range limit, of <strong>the</strong> DO Table entries. When <strong>the</strong>range limit is found <strong>the</strong> DO test coding is insertedinto <strong>the</strong> statement string.The DO Table is built from low-to-high-addressedstorage. It is scanned, however, from high-to-lowaddressedstorage. In this manner, nested DO loopsthat violate range limits are detected.Errors DetectedThe following errors are detected in phase 14: 51,52, 53, 54, 55, 56, 57, 58, 59, 60, 61, and 62.PHASE :L5• Scans READ, WRTEE, IF, CALL, and arithmeticstatements for subscript expressions.• Optimizes subscript calculation by means of <strong>the</strong>Subscript Expression Table.• Generates SGTs (Subscript-generated temporarystorage locations) as necessary.Each unique subscript expression is placed into atable called <strong>the</strong> Subscript Expression Table. Eachentry in this table appears as follows:Word Contents1 D 42 I, first dimension subscript index3 D 14 J, second dimension subscript index5 D 26 K, third dimension subscript index7 D 38 /8010, if entry is not used/0010, if entry is used on this statement/0000, if entry was used on a previousstatementAlso, each unique variable of a subscript expressionis placed into a table called <strong>the</strong> Bound VariableTable.As each subscript expression is entered into <strong>the</strong>Subscript Expression Table, it is removed from <strong>the</strong>string. The subscripted variable is <strong>the</strong>n tagged withSGT indicator bits pointing to <strong>the</strong> Subscript ExpressionTable entry.An SGT (Subscript-generated temporary storagelocation) is generated for each entry made to <strong>the</strong> SubscriptExpression Table. The SGT is placed into anSGT Table. The SGT is also placed into <strong>the</strong> SymbolTable and <strong>the</strong> address of <strong>the</strong> Symbol Table entry isinserted into <strong>the</strong> statement in <strong>the</strong> string.For each subscript expression encountered, ascan is made of <strong>the</strong> Bound Variable Table. If one ormore of <strong>the</strong> variables in <strong>the</strong> subscript expression arenot located in <strong>the</strong> Bound Variable Table, <strong>the</strong> subscriptmust be recalculated. Thus, a unique entry is madeto <strong>the</strong> Subscript Expression Table for <strong>the</strong> expressionand an associated SGT is generated.If, however, all <strong>the</strong> variables of <strong>the</strong> subscriptexpression are located in <strong>the</strong> Bound Variable Table,<strong>the</strong> Subscript Expression Table is <strong>the</strong>n scanned todetermine if a duplicate subscript expression is alreadylocated in <strong>the</strong> table. If no equivalent is found,<strong>the</strong> subscript expression is added to <strong>the</strong> table as aunique entry and an associated SGT is generated.If a duplicate expression is found in <strong>the</strong> SubscriptExpression Table, <strong>the</strong> subscript expression is removedfrom <strong>the</strong> string and is replaced by a pointerto its duplicate in <strong>the</strong> Subscript Expression Table.Thus, identical subscript expressions share <strong>the</strong> sameindices of a common entry in <strong>the</strong> Subscript ExpressionTable and <strong>the</strong> same SGT.Whenever a variable is assigned a new value (i. e. ,appears to <strong>the</strong> left of <strong>the</strong> equal sign in an arithmeticexpression, in <strong>the</strong> argument list of a subprogram,etc.), that variable, if found in <strong>the</strong> Bound VariableTable, is removed from <strong>the</strong> table. This removalfrom <strong>the</strong> Bound Variable Table causes all entries in<strong>the</strong> Subscript Expression Table containing that variableto be removed. The associated SGTs are alsoremoved from <strong>the</strong> SGT Table but remain in <strong>the</strong> SymbolTable. The addresses in <strong>the</strong> string of <strong>the</strong> SGTsin <strong>the</strong> Symbol Table also remain.If a statement is encountered containing a subscriptexpression and having a statement number that isreferenced by some o<strong>the</strong>r statement, <strong>the</strong> entire SubscriptExpression Table is cleared and all subscripts,90

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!