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.

entry is found, no new entry is made. The constantoperator, a special code Indicating that <strong>the</strong> followingword is <strong>the</strong> Symbol Table address of a constant,followed by <strong>the</strong> Symbol Table address of <strong>the</strong> constantalready entered is inserted into <strong>the</strong> statementstring in place of <strong>the</strong> constant.If no previous entry in <strong>the</strong> Symbol Table is found,<strong>the</strong> converted constant is added to <strong>the</strong> Symbol Table.The constant operator along with <strong>the</strong> Symbol Tableaddress replaces <strong>the</strong> constant in <strong>the</strong> statement string.The statement string is closed up following <strong>the</strong> alterationof <strong>the</strong> string.Errors DetectedThe following errors are detected by phase 6: 23and 50.PHASE 7• Checks <strong>the</strong> syntax of DEFINE FILE, CALL EXIT,and CALL LINK statements.• Determines <strong>the</strong> defined file specifications.<strong>All</strong> variable names in DEFINE FILE, CALL LINK,and CALL EXIT statements are checked for validityand are added to <strong>the</strong> Symbol Table. <strong>All</strong> valid constantsare converted to binary and are added to <strong>the</strong>Symbol Table.Phase 7 checks to ensure that a DEFINE FILEstatement does not appear in a subprogram.This phase computes <strong>the</strong> file definition specifications,that is, a DEFINE FILE Table consisting ofone entry for each unique file. Each entry consistsof <strong>the</strong> file number, <strong>the</strong> number of records per file,<strong>the</strong> record length, <strong>the</strong> associated variable, a blankword for insertion of <strong>the</strong> file's sector address at <strong>the</strong>time <strong>the</strong> program is loaded for execution, <strong>the</strong> numberof records per sector, and <strong>the</strong> number of diskblocks per file. A count is kept in <strong>the</strong> DFCNT word(word 17) in <strong>the</strong> FORTRAN Communications Areaof <strong>the</strong> number of files defined.Errors DetectedThe errors detected by phase 7 are: 3, 70, 71, 72,73 and 74.PHASE 8• Places variables and integer constants into <strong>the</strong>Symbol Table.• Places parameters from statement function statementsinto <strong>the</strong> Symbol Table.• Replaces operators with pointers to <strong>the</strong> ForcingTable to be used in phase 16.• Converts <strong>the</strong> left paren<strong>the</strong>sis of subscripts to aspecial dimension indicator.Phase 8 checks <strong>the</strong> variable names found in <strong>the</strong> statementstring for validity. Valid variables are addedto <strong>the</strong> Symbol Table. A second check is made to ensurethat all variable names conform to <strong>the</strong> implicitor explicit mode specifications (real and integer).Integer constants are also added to <strong>the</strong> Symbol Table,provided <strong>the</strong>y are unique. However, integer constantsthat are found in subscript expressions arenot added to <strong>the</strong> Symbol Table until a later phase.When adding names and constants to <strong>the</strong> SymbolTable, phase 8 replaces <strong>the</strong>m in <strong>the</strong> string by <strong>the</strong>address of <strong>the</strong>ir respective Symbol Table entries,except if <strong>the</strong>y are found in subscript expressions.The address replacing a constant or name is <strong>the</strong>address of <strong>the</strong> ID word of <strong>the</strong> Symbol Table entryfor that constant or name.Internal statement numbers are located in <strong>the</strong>Symbol Table and are replaced by <strong>the</strong> address of <strong>the</strong>ircorresponding Symbol Table entries; those statementnumbers not found in <strong>the</strong> Symbol Table (i. e. ,not previously entered) are in error.Phase 8 changes <strong>the</strong> ID word of <strong>the</strong> statementfunction statement, until now identical to that of anarithmetic statement, to <strong>the</strong> statement function type.Also, <strong>the</strong> statement function name and <strong>the</strong> parametersof statement functions are added to <strong>the</strong> SymbolTable. These entries in <strong>the</strong> Symbol Table are distinguishedby <strong>the</strong>ir lack of a sign bit in <strong>the</strong> secondword of <strong>the</strong> name.During phase 8, <strong>the</strong> left paren<strong>the</strong>sis on subscriptsis changed to a special left paren<strong>the</strong>sis operator thatindicates <strong>the</strong> order of <strong>the</strong> dimension that follows.This phase also converts all operators, exceptthose in subscript expressions, from <strong>the</strong> 6-bitEBCDIC representation to a pointer value. Thispointer value is derived from <strong>the</strong> Forcing Table. Theconversion is done in preparation for <strong>the</strong> Scan Phase,Section 11. FORTRAN Compiler 85

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

Saved successfully!

Ooh no, something went wrong!