IBM System/3S0 Operating System FORTRAN IV (G) Compiler ...

2 downloads 1974 Views 16MB Size Report
The FORTRAN IV (G) compiler is a processing program of the IBM Systeml360 operating system. It translates one or more source modules written in the ...
File No. S360-25(OS) Order No. GY28-6638-1

Program Logic

IBM System/3S0 Operating System FORTRAN IV (G) Compiler Program Logic Manual Program Number 3S0S-FO-520

This publication describes the internal logic of the FORTRAN IV (G) compiler. Program Logic Manuals are intended for use by IBM customer engineers involved in program maintenance, and by systems programmers involved in altering the program design. Program logic information is not necessary for program operation and use: therefore, distribution of this manual is limited to persons with program maintenance or modification responsibilities. The FORTRAN IV (G) compiler is a processing program of the IBM Systeml360 operating system. It translates one or more source modules written in the FORTRAN language into an object module that can be processed into an executable load module by the linkage editor.

order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

This publication provides customer engineers and other technical personnel with information describing the internal organization and operation of the FORTRAN IV (G) compiler. It is part of an inte~ grated library of IBU System/360 operating System Program Logic Manuals. Other publications required for an understanding of the FORTRAN IV CG) compiler are:

Concepts and

Facilitie~,

supervisor and Data Management Instructions, Form C28-6647 Linkage Editor, Form Y28=6'610

Macro-

Proq.!:!!!L_y>gic_~!!!!!!!,

This publication sections:

IBM §yst~m~J~Q~2~~!~!ng-2Y~tem:

Form C28-6535

consists

of

two

Principles of operation, Form A22-6821

Introduction to Control Program Loqic, Program Logic Manual, Form Y28-6605

Any reference to a Programmer's Guide in this publication applies to FORTRAN IY-l§_!n~Jil_Programmer's Guide, Form C28-6817. The fORTRAN IV (G) Programmer's Guide, Form C28-6639, (to which references may exist in this publication) has been replaced by the combined G and H Programmer's Guide. Although not required, the following publications are rE~lated to this publication and should be consulted: IBM System/360 Operation system: §.~g~nt ia!_~££~!!_J1~ihod~L-f!:Qg!.!.m M!~!!,

Form Y28-6604

Logic

section 1 is an introduction that describes the FORTRAN IV (G) compiler as a whole, including its relationship to the operating" system. The major components of the compiler and relationships among them are also described in this section. Section 2 consists of a discussion of compiler operation. Each component of the compiler is described in sufficient detail to enable the reader to understand its operation, and to provide a frame of reference for the comments and coding supplied in the program listing. Common data such as tables, blocks, and work areas is discussed only to the extent required to understand the logic of each component. Flowcharts are included at the end of this section. Following Section 2, are appendixes that contain reference material. If more detailed information is required, the reader should see the comments, remarks, and coding in the FORTRAN IV (G) program listing.

Second Edition (May 1968) This i~ a major revision of', and makes obsolet.e, the previous edition, Form Y28-6638-0, and Technical Newsletters Y2B-6384, Y28-6386, Y28-6388, and Y28-6820. Changes to the text, and small illustrations, are indicated by a vertical line to the left of the change; changed or added illustrations are denoted by the symbol • to t.he left of the caption.

I

The specifications containe·d in this publication, as amended by TNL Y28-6829, dated July 23, 1969, correspond to Release 18 and as further amended by TNL GY28-6841, dated January 15, 1911, correspond to Release 20 of the IBM Systeml360 Operating System. changes are periodically made to the specifications herein; any such changes will be reported in subsequent revisions or Technical Newsletters. Requests for coples of IBM publications should be made to your IBM representative or t.O the IBM branch office serving your locality.

Address comments concerning the contents of this publication to IBM corporation, Programming Publications, 1211 Avenue of the Americas, New York, N. Y. 10020. "

copyright International :Business Machines corporation 196B, 1910

Technical Newsletter

File Number

S360-25

Re: Order No.

GY28-6638-1

This Newsletter No. Date

GY28-6826

November 15, 1968

Previous Newsletter Nos. None

IBM System/360 Operating System FORTRAN IV (G) Compiler Program Logic Manual This Technical Newsletter, a part of Release 17 of the IBM System/360 Operating System, provides replacement pages for IBM S stem/360 0 eratin System: FORTRAN IV (G) Compiler programLOt~C Manua , Form Y T ese rep acement pages rema~n in ef ect for subsequent releases unless specifically altered. Pages to be replaced and/or added are listed below. Pages Cover, preface 19-20 27-32 35-38.1 39-40 45-46 '53-54 67-68 (67.1 added) 69-70.1 71-72 77-78

145-146.1 153-154.1 157-158 177-178 185-186 191-192 221-224.1 225-226 (225.1 added) 229-230.1 253-254

Changes to the text, and small changes to illustrations, are indicated by a vertical line to the left of the change; changed or added illustrations are denoted by the symbol • to the left of the caption. Summary of Amendments New information about innermost DO loops with a possible extended range has been added. The information includes descriptions of two new routines, XTEND LABEL and EXTND TARGET LABEL, and changes to existing routines and flowcharts involved in phase 1 processing. There is also additional information about theONAMELIST table entries and the GET POLISH routine, and a description of the improvements made by the FORTRAN object.-time library in the pro.cessing of BACKSPACE statements. File this cover letter at the back of 1:he publication to provide a record of changes.

IBM Corporation, Programming Publications, 1271 Avenue of the Americas, New York, N.Y. 10020 PRINTED IN U. S. A.

Technical Newsletter

File Number Re: Order No. This Newsletter No. Date Previous Newsletter Nos.

IBM System/360 Operating System FORTRAN IV (G) Compiler Program Logic Manual This Technical Newsletter, a part of Release 18 of the IBM System/~60 Operating System, provides replacement pages for IBM System/360 Operating System: FORTRAN IV (G) Compiler ProgramLo~ic Manual, Form Y28-6638-1. These replacement pages rema1n in effect for subsequent releases unless specifically altered. Pages to be replaced and/or added are listed below. Pages Cover, preface 7,8 13,14 17,18 35-36.1 43-44.1 45,46

49-52 55-58 75-76 113-114 167-1.70 175-176.1 209,210 255-257

Changes to the text, and small changes to illustrations, are indicated by a vertical line to the left of the change; changed or added illustrations are denoted by the symbol • to the left of the caption. Summary of Amendments A description of the compiler statistics messages and the phases and subroutines which generate them is added. Illustrations of the formats of the messages are included. File this cover letter at the back of the publication to provide a record of changes.

IBM Corporation, Programming Publications, 1271 Avenue of the Americas, New York, N.Y. 10020 PRINTED IN U. S. A.

8360-25 GY28-6638-1 GY28·6829 July 23, 1969 GY28-6826 GY28-6847

Technical Newsletter

File No.

S360-25(OS)

Re: Order No.

GY2 8-6 638-1

This Newsletter No. Date:

GY 28 - 6847

January 15, 1971

Previous Newsletter Nos.

GY28-6826 GY28-6829

IBM System/360 Operating System FORTRAN IV (G) Compiler Program Logic Manual e International Business Machines Corporation replacement pages for the publication S stem: FORTRAN IV (G) Com iler er No. GY28-6638- • The specifications contained in this publication correspond to Release 20 of the IBM System/360 Operating System. Pages to be replaced are listed below: Page(s) Cover-2

Summary of Amendment(s) Release notice updated

7,8

List of

211-258

"Appendix F: Object-Time Library Subprograms" has been replaced in its entirety; new information has been added, obsolete information deleted, and existing information expanded and clarified (replacement" pages are 211-258.10)

263-272

Index updated

illustration~

updated

Changes to the text and small changes to illustrations are indicated by a vertical line to the left of the change; changed or added illustrations are denoted by the symbol • to the left of the caption. File this cover letter at the back of the publication to provide a record of changes.

IBM Corporlll;"', Progra';'ming Publicalions, 1271 Av,nu, of Ih, Am'Nclls, New York, N.Y. 10020 PIIINTED IN U. S. A.

CONTENTS

SECTION 1: INTRODUCTION TO THE COMPILER Purpose of the Compiler Machine Configuration Compiler and System/360 Operating System • • • • • • • • • • • Compiler Design • • • • • • Limitations of the Compiler Compiler Implementation '. • • • • • • • POP Language • • • • • • • • • Compiler Organization • • Control Phase: Invocation (IEYFORT) Phase 1: Parse (IEYPAR) ••• Phase 2: Allocate (IEYALL) Phase 3: Unify (IEYUNF) •• Phase 4: Gen (IEYGEN) Phase 5: Exit (IEYEXT) • • Roll (IEYROL) ••••• • • Compiler Storage Configuration •• Compiler Output • • • • • • Object Module • • • • • • • • • Components of the Object Module object Module General Register Usage • • • • • • • Source Module Listing object Module Listing Storage Maps • • • • • • • • • • • Error Messages • • • • Common Error Messages • • • • • Compiler Data Structures • • • • • • • • Rolls ~nd Roll Controls ROLL ADR Table • • • • • BASE, BOTTOM, and TOP Tables • • Special Rolls • • • • • • Central Items, Groups, and Group Stats • • • • • Other Variables Answer Box • .. • • Multiple Precision Arithmetic Scan Control Flags • • • • • Quotes • • • • Messages • • • • • • Compiler Arrangement and General Register Usage • • • Pointers • • • • • • • Drivers • • • • • • • Operation Drivers Control Drivers • • • •

9 9 9

9 9 9 10 10 10 12 12 12 12 12 13 13 15 15 17 17 20 20 20 21 21 21 21 21 22 23 24 24 26 26 26 26 27 27 27 28 29 30 30 31

SECTION 2: COMPILER OPERATION 33 Invocation Phase (IEYFORT) • 33 IEYFORT, Chart 00 33 IEYPRNT, Chart 00A4 • • • • 33 PRNTHEAD, Chart 01A2 • • • • • 34 IEYREAD, Chart 01A4 • 34 34 IEYPCH, Chart 02A3 • PRNTMSG, Chart 03A1 34 IEYMOR, Chart 01D1 • 34 IEYNOCR 34 IEYRETN, Chart 03A2 35 OPTSCAN, Chart AA • • 35 35 DDNAMES, Chart AB

HEADOPT, Chart AC • • • • • TIMEDAT, Chart AD • • • • Output from IEYFORT • • • • • Phase 1 of the Compiler: Parse (IEYPAR) Flow of Phase 1, Chart 04 • • • • PRINT and READ SOURCE, Chart BA STA INIT, Chart BB • • LBL FIELD XLATE, Chart BC • STA XLATE, Chart BD STA FINAL, Chart BE • ACTIVE END STA XLATE, Chart BF • PROCESS POLISH, Chart BG • Output from Phase 1 •• • • • • • • • • Polish Notation • Source Listing • • • • • • • Phase 2 of the Compiler: Allocate (IEYALL) • • • • • • • • • • • • • • Flow of Phase 2, Chart 05 • • • • ALPHA LBL AND L SPROGS, Chart CA • • ALPHA SCALAR ARRAY AND SPROG, Chart CA • • • • • • PREP EQUIV AND PRINT ERRORS, Chart CB • • • • • BLOCK DATA PROG ALLOCATION, Chart CC • • • • • • • • PREP DMY DIM AND PRINT ERRORS, Chart CD • • • • • • • • • • • • PROCESS DO LOOPS, Chart CE • • • PROCESS LBL AND LOCAL SPROGS, Chart CF • • • • • • • • • • • • BUILD PROGRAM ESD, Chart CG • ENTRY,NAME ALLOCATION, Chart CH • • COMMON ALLOCATION AND OUTPUT, Chart CI • • • • • • • • • EQUIV ALLOCATION PRINT ERRORS, Chart CK • • • • • • • • • • • BASE AND BRANCH TABLE ALLOC, Chart CL • • • • • • • • • • • • • SCALAR ALLOCATE, Chart CM • ARRAY ALLOCATE, Chart CN • • PASS 1 GLOBAL SPROG ALLOCATE, Chart CO • • • • • • • • • • • • SPROG ARG ALLOCATION, Chart CP • • • PREP NAMELIST, Chart CQ • LITERAL CONST ALLOCATION, Chart CR • FORMAT ALLOCATION, Chart CS • EQUIV MAP, Chart CT • • • • • • • • GLOBAL SPROG ALLOCATE, Chart CU • • BUILD NAMELIST TABLE, Chart CV • • • BUILD ADDITIONAL BASES, Chart cw • . DEBUG ALLOCATE, Chart CX • • • Output From Phase 2 • • • • • • • • • Error Messages Produced by Allocate Unclosed DO Loops • • • • • • Storage Maps Produced by Allocate • Subprogram List • • • • • • • • • • Cards Produced by Allocate • • • • • Phase 3 of the Compiler: Unify (IEYUNF) Flow of Phase 3, Chart 07 • • • • • • ARRAY REF ROLL ALLOTMENT, Chart DA • CONVERT TO ADR CONST, Chart DB • • • CONVERT TO INST FORMAT, Chart DC • •

35 35 35 36 37 37 38 38 38 39 39 39 39 39 42 44 45 45 45 45 46 46 46 46 46 46 47 47 47 47 47 48 48 48 48 48 48 48 48 49 49 49 49 49 50 51 51 51 52 52 52 52

DO NEST UNIFY, Chart DD IEYROL MorjlJle • • • • • Phase 4 of the Compiler: Gen (IEYGEN) • • • • • • • • • • • • Flow of Phase 4, Chart 08 ENTRY CODE GEN, Chart EA • • PROLOGUE GEN, Chart EB • EPILOGUE GEN, Chart EC • • • • • GET POLISH, Chart ED • • • • • • LBL PROCESS, Chart EF STA GEN, Chart EG STA GEN FINISH, Chart EH • • Phase 5 of the Compiler: Exit (IEYEXTl • Flow of Phase 5, Chart 09 • • • • PUNCH TEMP AND CONST ROLL, Chart FA PUNCH ADR CONST ROLL, Chart FB • • • PUNCH CODE ROLL, Chart FC PUNCH BASE ROLL, Chart FD PUNCH BRANCH ROLL, Chart FE PUNCH SPROG ARG ROLL, Chart FF • PUNCH GLOBAL SPROG ROLL, Chart FG • PUNCH USED LIBRARY ROLL, Chart FH • PUNCH ADCON ROLL, Chart FI • • ORDER AND PUNCH RLD ROLL, Chart FJ • PUNCH END CARD, Chart FK PUNCH NAMELIST MPY DATA, Chart FL • output From Phase 5

53 53 53 53 54 54 54 54 54 54 55 55 55 55 56 56 56 56 56 57 57 57 57 57 57 57

•• 127 APPENDIX A: THE POP LANGUAGE POP Instructions. • • • • • • .127 Transmissive Instructions • • 127 Arithmetic and Logical Instructions .130 Decision Making Instructions. • .131 Jump Instructions • • • • • • • .133 Roll Control Instructions • • • • • • 133 Code Producing Instructions •• 134 Address Computation Instructions • • • 134 Indirect Addressing Instruction • • • 135 Labels. • • • • • • • • • • 135 Global Labels • • • • • • .135 Local Labels. • • • • • .136 Assembly and Operation. • .136 POP Interpreter .136 Assembler Language References to POP Subroutines • • • • • • • • • • • 137 Global Jump Instructions • • • • • • • 137 Local Jump Instructions • • • • • • • 138 APPENDIX RollO: Roll 1: Roll 2: Roll 2: Roll 3: Roll 4: Roll 4: RollS: Roll 7: Roll 8: Roll 9: Roll 10: ~oll 11: Roll 12: Roll 13: Roll 13: Roll 14: Roll 15: Roll 15:

B: ROLLS USED IN THE COMPILER .140 LIB Roll • • 140 SOURCE Roll. • .140 IND VAR Roll • • • • • .141 NONSTD SCRIPT Roll • • 141 NEST SCRIPT Roll • • 141 POLISH Roll. • • • • .141 LOOP SCRIPT Roll • • • • • • • 142 LITERAL CONST Roll • • 142 GLOBAL SPROG Roll. • .142 FX CONST Roll. • .143 FL CONST Roll • • 143 DP CONST Roll •• 143 COMPLEX CONST Roll • • 143 DP COMPLEX CONST Roll • • • • • 143 TEMP NAME Roll • • • • 143 STD SCRIPT Roll. • • .144 TEMP Roll. • • • • • .144 DO LOOPS OPEN Roll • • 144 LOOPS OPEN Roll. • • .144

Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll Roll

1&: 16: 17: 17: 18: 18: 19: 20: 20: 21: 22: 23: 23: 24: 25: 26: 26: 27: 28: 29 : 30: 30: 31: 32: 33: 34: 35: 36: 36: 37: 37: 38: 39: 39 : 40: 40 : 41: 42: 42: 43: 44: 44: 45: 46: 47: 47: 48: 48: 49: 50: 51: 52: 52: 53: 54: 55: 56: 56: 57: 58: 59: 60: 60: 62: 62:

ERROR MESSAGE Roll TEMP AND CONST Roll. ERROR CHAR Roll. • • • ADCON Roll • • • INIT Roll. • • • • DATA SAVE Roll • • • • EQUIVALENCE TEMP (EQUIV

.144 .144 • .145 • .145 • • • • 145 • .145 TEMP) .145 EQUIVALENCE HOLD (EQUIV HOLD) .145 .146 REG Roll • • • • .146 BASE TABLE Roll • • • • • .146 ARRAY Roll • • • • • .147 DMY DIMENSION Roll .147 SPROG ARG Roll • • • • • .147 ENTRY NAMES Roll • • • • .148 GLOBAL DMY Roll • • • • • ERROR Roll • • • • • • • 148 .148 ERROR LBL Roll .148 LOCAL DMY Ro11 • • • • • .149 LOCAL SPROG Roll • • • • EXPLICIT Roll • • • • • • • • • 149 .149 CALL LBL Roll • • • .149 ERROR SYMBOL Roll • • .149 NAMELIST NAMES Roll • .150 NAMELIST ITEMS Roll • .150 ARRAY DIMENSION Roll .150 BRANCH TABLE Roll • • .150 TEMP DATA NAME Roll • .151 TEMP POLISH Roll .151 FX AC Roll • • • • .151 EQUIVALENCE Roll • • • • .151 BYTE SCALAR Roll • • • • .152 USED LIB FUNCTION Roll .152 COMMON DATA Roll .152 HALF WORD SCALAR Roll .152 COMMON NAME Roll • • • • .153 TEMP PNTR Roll .153 IMPLICIT Roll • • • • .153 EQUIVALENCE OFFSET Roll • .153 FL AC Roll • • • • • .153 LBL Roll • • • • • • • • .154 SCALAR Roll • • • • .154 HEX CONST Roll • • • • • .154 DATA VAR Roll • LITERAL TEMP (TEMP LITERAL) • • • • • 155 .155 COMMON DATA TEMP Roll • • .155 FULL WORD SCALAR Roll .155 COMMON AREA Roll • • • • .155 NAMELIST ALLOCATION Roll .156 COMMON NAME TEMP Roll • • .156 EQUIV ALLOCATION Roll • • RLD Roll • • • • • • • • • • • 156 .156 COMMON ALLOCATION Roll .156 LOOP CONTROL Roll • FORMAT Roll • • • • • • 157 .157 SCRIPT Roll • • • .157 LOOP DATA Roll PROGRAM SCRIPT Roll • .158 .158 ARRAY PLEX Roll • • .159 ARRAY REF Roll ADR CONST Roll • • • • • • • • 159 .159 AT Roll • • • • • • • • • .160 SUBCHK Roll • • • NAMELIST MPY DATA Roll .160 .160 GENERAL ALLOCATION Roll • CODE Roll • • • • • _ • • .160

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

Roll 60: NAMELIST MPY DATA Roll • Roll 62: GENERAL ALLOCATION Roll • • • Roll 62: CODE Roll • • • • Roll 63: AFTER POLISH Roll • • • • • • Work and Exit Rolls • • • WORK Roll • EXIT Roll

.160 .160 .160 • 161 .161 .161 .161

APPENDIX C: POLISH NOTATION FORMATS • • 163 General Form. • • • • • .163 Labeled Statements. • • .163 Array References • • • • • • • • 163 ENTRY Statement .164 ASSIGN Statement. • • • 164 Assigned GO TO Statement • • • • • • • • 164 Logical IF Statement. • • • • • • • 164 RETURN Statement. • • • .164 Arithmetic and Logical Assignment Statement • • • • • • • • • • • • • • • 164 Unconditional GO TO Statement .165 computed GO TO Statement • • • • • • • • 165 Arithmetic IF Statement • • • 165 DO Statement. • • • • • • .165 CONTINUE Statement. • • • • .166 PAUSE and STOP Statements • • 166 END Statement • • • • • • • • • • .166 BLOCK DATA Statement. • • • • • .166 DATA Statement and DATA in Explicit Specification Statements • • • • • • • .166 I/O List • • • • .167 Input Statements • • • 167 FORMATTED READ • • .167 NAMELIST READ .168 UNFORMATTED READ • • • • • • 168 READ Standard Unit • .168 Output Statements .168 FORMATTED WRITE • .168 NAMELIST WRITE. , • • .169 UNFORMATTED WRITE • .169 PRINT • • • • • • • .169 PUNCH • • • • • • • .169 Direct Access Statements • • • • • • • • 169 READ, Direct Access • .169 WRITE, Direct Access • • • • • • • • • 170 FIND • • • • • • • • • • .170 DEFINE FILE .170 END FILE Statement • • .170 REWIND Statement • • .171 BACKSPACE Statement • • • • • • .171 Statement Function • • • • • • 171 FUNCTION Statement • • • • • • • • 171 Function (Statement or Subprogram) Reference • • • • • • • .171 Subroutine Statement • • .171 .172 CALL Statement • • • • .172 Debug Facility Statements AT • • • • • .172 TRACE ON • • .172 TRACE OFF • • • • • • .172 DISPLAY • • • • • .173 APPENDIX D: OBJECT CODE PRODUCED BY THE COMPILER. • • • • • • • • .175 Branches. • • ••• • • • • • 175 Computed GO TO Statement. • .175 DO Statement. • • • • • • • • • 175 Statement Functions • • 176 Subroutine and Function Subprograms • • 176

Input/Output Operations • • • • • • • • 177 Formatted Read and Write Statements .177 Second List Item, Formatted • • • • • 177 Second List Array, Formatted • • • • • 178 Final List Entry, Formatted • • • • • 178 Unformatted Read and Write Statements 178 Second List Item, Unformatted • • • • 178 Second List Array, Unformatted • • • • 178 Final List Entry, Unformatted • • • • 178 Backspace, Rewind, and Write Tapemark 178 STOP and PAUSE Statements • • 179 NAMELIST READ and WRITE • • • • • • • 179 DEFINE FILE Statement • • 179 FIND Statement. • • .179 Direct Access READ and WRITE Statements • • • • • .179 FORMAT Statements • .180 FORMAT Beginning and Ending Parentheses .180 Slashes • • • • • .180 Internal Parentheses • .180 Repetition of Individual FORMAT specifications • • • • • • • • • • • 180 I,F,E, and D FORMAT Codes • • 180 A FORMAT Code • • • • • • 180 Literal Data. • • • • • • • .180 X FORMAT Code • • • 181 T FORMAT Code • • • • • • • • • • .181 Scale Factor-P • • • • • • • • • • • 181 G FORMAT Code • • • • • .181 L FORMAT code • • • • • .181 Z FORMAT Code • • • • • .181 Debug Facility. • • • • • • • • • 181 DEBUG Statement • • • • • • • • .181 Beginning of Input/Output .181 End of Input/Output • • • • • • 181 UNIT Option • • • • • • • 181 TRACE Option. • • • .182 SUBTRACE Option • • • • • • • 182 INIT Option • • • • • .182 SUBCHK Option • • 183 AT Statement. • • • • • • • • • 183 TRACE ON Statement. .183 TRACE OFF Statement • • 183 DISPLAY Statement • • 183

r.

.

APPENDIX E: MISCELLANEOUS REFERENCE DATA • • • • • • • • • • • • • • .185 Parse Label List. • • • • • • • • .185 Supplementary Parse Label List. • .185 Allocate Label List • • • • • • • • • • 193 Supplementary Allocate Label List • • • 193 Unify Label List • • • • • e • • • .196 Supplementary Unify Label List. • .196 Gen Label List. • • • • • • • • .198 Supplementary Gen Label List. • • .198 Exit Label List • • • • • • • • • 208 Supplementary Exit Label List • • 208 APPENDIX F: OBJECT-TIME LIBRARY SUBPROGRAMS • • • • • Library Functions • • • • • • Composition of the Library • • System Generation Options • Module summaries • • • • • • Library Interrelationships • Initialization • • • • • • • • • • Input/Output operations • • • • •

.212 .212 .212 .212 .213 .214 .215 .216

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

Define File • ~ • • • • • • • • • • • 218 Sequential Read/Write Without Format .218 Initial Call • • • • • • • • • • • • 218 Second Call • • • • • • • 219 Additional List Item Calls .219 Final Call. • • • • .219 System Block Modification and Reference • • • • • • • .219 Error Conditions. • • • • • • .220 Sequential READ/WRITE With Format • • 221 Processing the Format Specification 221 Direct Access READ/WRITE Without Format • • • • • • • • • • • • • • • • 224 initialization Branch • • • • • • • 224 Successive Entries for List Items .225 Final Branch • • • • • • • • • • • • 225 Error Conditions • • • • • • • • • • 226 Direct Access READ/WRITE With Format .226 FIND. • • .226 READ And WRITE Using NAMELIST .226 Read. • • • • • • • • • .226 Write • • • • • • • • • • • • .227 Error Conditions. • • • • • • .227 Stop and Pause (Write-to-Operator) • • 227 stop. • • • • • .227 Pause • • • • • • • • • • • • 227 Backspace • • • • • • • 227 Rewind. • • • • • • • • • 228 End-File. • • • • .228 Error Handling .228

Compiler-Directed Errors: IHCIBERH •• 228 Program Interrupts • • ~ • • .229 Action for Interrupts 9, 11, 12, 13, and 15 • • • • • .. • • .229 Action for Interrupt 6 • • .229 Library-Detected Errors •• 230 Without Extended Error Handling • • 230 With Extended Error Handling • ' • • • 231 Abnormal Termination Processing .231 Codes 4 and 12 • • • ~ • • • • • • • 231 Codes 0 and 8 • • • ~ • • • • .231 Extended Error Handling Facility • • • 232 Option Table--IHCUOPT • • • • • • • 232 Altering the Option Table--IHCFOPT .232 Error Monitor--IHCERRM • • • .233 Extended Error Handling Trackback--IHCETRCH • • 233 Conversion. • • • • • • • • • • • • 234 Mathematical and Service Routines • • • 234 Mathematical Routines . . . . . . . . . 234 Service Subroutines • ~ • • • • .234 IHCFDVCH (Entry Name DVCHK) • • 234 IHCFOVER (Entry Name OVERFL) • • • • 235 IHCFSLIT (Entry Names SLITE, SLITET) • • • • • • • • • • .235 IHCFEXIT (Entry Name EXIT) • .235 IHCFDUMP (Entry Names DUMP and PDUMP) • • .235 I HCDaUG • .236 Termination • .239 GLOSSARY • INDEX

. ....

• • 259 .263

Order No. GY28-6638-1. page revised 1/15/11 by TNL GY28-6847 ILLUSTRATIONS FIGURES

Figure 1. Overall Operation of the Compiler • • • • • • • • • • • • Figure 2. Compiler Organization Chart • • • • • • • Figure 3. Compiler storage Configuration • • • • • • Figure 4. Compiler output Figure 5. Object Module Configuration • • • • Figure 6. Example of Use of Save Area •••••••••• Figure 1. Roll Containing K Bytes of Information •••• Figure 8. Roll Containing L Bytes of Reserved Information and K Bytes of New Information •••• Figure 9. Roll With a Group Size of Twelve • • • • • • • • • • • • • Figure 10. Roll with Variable Group Size •••••••••• Figure 11. First Group Stats Table • Figure 12. Second Group Stats Table ••• • Figure 13. Scan Control Variables 0









11 14 15 16 11 18 23 24 25 25 26 26 27

Figure 14. Quotes Used in the Compiler. 27 Figure 15. Compiler Arrangement with Registers 28 Figure 16. Calling Paths for Library Routines 215 Figure 17. Control Flow for Input/output Operations • 217 Figure 18. IHCUATBL: The Data Set Assignment • . • 239 Figure 19. DSRN Default Value Field of IHCUATBL Entry 240 Figure 20. Format of a Unit Block for a Sequential Access Data Set • 240 Figure 21. Format of a Unit Block for a Direct Access Data Set 242 Figure 22. General Form of the Option Table (IHCUOPT) . 242.1 Figure 23. Preface of the Option Table (IHCUOPT). • • . • 242.2 Figure 24. Composition of an Option Table Entry •. 242.2 Figure 25. Original Values of Option Table Entries • 242.3

TABLES

Table 1. Internal configuration of Operation Drivers • • • • • • • • 31 Table 2. Internal configuration of" control Drivers (Part 1 of 2). 32 ~dble 3. Rolls Used by Parse • • • 36 fable 4. Rolls Used by Allocate 44 T~ble 5. Rolls Used by Unify 52 Table 6. Rolls Used by Gen • 53 Table 7. Rolls Used by Exit 55 Table 8. POP Instruction Cross-Reference List • • • • • • • • 139

Table 9. Routines Affected by Extended Error Handling Option 212 Table 10. Format Code Translations and Their Meanings • • . • • •• 222 Table 11. IHCFCVTH Subroutine Directory .•...• •• . 234 Table 12. IHCDBUG Transfer Table. 236 Table 13. DCB Default Values • 240 Table 14. IHCFCOMH/IHCECOMH Transfer and Subroutine Table • 242.3

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

CHARTS

Chart 00. IEYFORT (Part 1 of 4) Chart 01. IEYFORT (Part 2 of 4) Chart 02. IEYFORT (Part 3 of 4) Chart 03. IEYFORT (Part 4 of 4) Chart AA. OPTSCAN ••• • • • • Chart AB. DDNAMES......... Chart AC. HE:ADOPT....... Chart AD. TIMEDAT.. • • Chart 04.1. PHASE 1 - PARSE (Part 1 of 2) ••••• • • • • Chart 04.2. PHASE 1 - PARSE (Part 2 of 2) ••••• • • • • • • • Chart BA. WRITE LISTING AND READ SOURCE • • • • • • • • • • • Chart BB. INITIALIZE FOR PROCESSING STATEMENT • • • • Chart BC1. PROCESS LABEL FIELD (Part 1 of 2) • • • • • • • • • • • Chart BC2. PROCESS LABEL FIELD (Part 2 of 2) • • • • • • • • • Chart BD. PROCESS STATEMENT • • • • Chart BE. COMPLETE STATEMENT AND MOVE POLISH • • • • • • • • • Chart BF. PROCESS END STATEMENT • • Chart BG. PROCESS POLISH • • Chart 05. PHASE 2 - ALLOCATE (Part 1 of 2) • • • • • • • chart 06. PHASE 2 - ALLOCATE (Part 2 of 2) • • • • • • • Chart CA. MOVE BLD NAMES TO DATA VAR ROLL • • • • • • • • • • • • Chart CB. PREPARE EQUIVALENCE DATA chart CC. ALLOCATE BLOC~ DATA • • • Chart CD. PREPROCESS DUMMY DIMENSIONS • • • • • • • • • • Chart CEo CHECK FOR UNCLOSED DO LOOPS • • • • • • • • • • • Chart CF. CONSTRUCT BRANCH TABLE ROLL • • • • • • • • • • • • • • Chart CG. ALLOCATE HEADING AND PUNCH ESD CARDS • • • • • • • Chart CH. CHECK ASSIGNMENT OF FUNCTION VALUE • • • • • • • • • chart CI. COMMON ALLOCATION • • • • Chart CK. EQUIVALENCE DATA ALLOCATION • • • • • • • • • • • chart CL. SAVE AREA, BASE AND BRANCH TABLE ALLOCATION chart CM. ALLOCATE SCALARS Chart CN. ALLOCATE ARRAYS • Chart CO. ADD BASES FOR SUBPROGRAM ADDRESSES • • • • chart CPo ALLOCATE SUBPROGRAM ARGUMENT LI STS • • ., • • • • • • Chart CQ. PREPARE NAMELIST TABLES • chart CR. ALLOCATE LITERAL CONSTANTS • .. • • .. • • • • • • • Chart CS. ALLOCATE FORMATS Chart CT. MAP EQUIVALENCE • • • Chart CU. ALLOCATE SUBPROGRAM ADDRESSES ... • • " • • • • •

59 60 61 62 63 64 65 66 67 68 68 69 10 10 71 12 13 74 15 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96

Chart CV. BUILD AND PUNCH NAMELIST TABLES • • • • • • • 97 Chart CWo BUILD BASES • • • • • 98 Chart CX. DEBUG ALLOCATE • • 99 Chart 07. PHASE 3 - UNIFY. • .100 Chart DA. BUILD ARRAY REF ROLL •• 101 Chart DB. MAKE ADDRESS CONSTANTS .102 Chart DC. CONSTRUCT INSTRUCTIONS .103 Chart DD. PROCESS NESTED LOOPS .104 Chart 08. PHASE 4 - GEN • • • • • • 105 Chart EA. GENERATE ENTRY CODE • • • 106 Chart EB. PROLOGUE CODE GENERATION 107 Chart EC. EPILOGUE CODE GENERATION 108 Chart ED. MOVE POLISH NOTATION •• 109 Chart EF. PROCESS LABELS •• 110 Chart EG. GENERATE STMT CODE • • • 111 Chart EH. COMPLETE OBJECT CODE •• 112 Chart 09. PHASE 5 - IEYEXT •• 113 Chart FA. PUNCH CONSTANTS AND TEMP STORAGE • • • • • • • • • • • • 114 Chart FB. PUNCH ADR CONST ROLL •• 115 Chart FC. PUNCH OBJECT CODE • • • • 116 Chart FD. PUNCH BASE TABLE •• 117 Chart FE. PUNCH BRANCH TABLE • • • 118 Chart FF. PUNCH SUBPROGRAM ARGUMENT LISTS • • • • • • • • • • • 119 Chart FG. PUNCH SUBPROGRAM ADDRESSES • • • • • • • • • • 120 Chart FH. COMPLETE ADDRESSES FROM LIBRARY • • • • • • • • • • • • • • 121 Chart Fl. PUNCH ADDRESS CONSTANTS .122 Chart FJ. PUNCH RLD CARDS • • • • • 123 Chart FR. PUNCH END CARDS • • • • • 124 Chart FL. PUNCH NAMELIST TABLE POINTERS. • • • • • • • • • • 125 Chart GO. IHCFCOMH/IHCECOMH (Part 1 of 4) • • • • • • • • • • • 243 Chart GO. IHCFCOMH/IHCECOMH (Part 2 of 4) • • • • • • • • • • 243.1 Chart GO. IHCFCOMH/IHCECOMH (Part 3 of 4) • • • • • • • • • • 243.2 Chart GO. IHCFCOMH/IHCECOMH (Part 4 of 4) • • • • • • • • • • 243.3 Chart G1. IHCFIOSH/IHCEFIOS (Part 1 of 2) • • • • • • • • • • • 244 Chart G1. IHCFIOSH/IHCEFIOS (Part 2 of 2) • • • • • • • • • • 244.1 Chart G2. IHCDIOSE/IHCEDIOS (Part 1 of 5) . . . . . . . . . . . . 245 Chart G2. IHCDIOSE/IHCEDIOS (Part 2 of 5) • • • • • • • • • • 245.1 Chart G2. IHCDIOSE/IHCEDIOS (Part 3 of 5) • • • • • • • • • • 245.2 Chart G2. IHCDIOSE/IHCEDIOS (Part 4 of 5) • • • • • • • • • • 245.3 Chart G2. IHCDIOSE/IHCEDIOS (Part 5 of 5) • • • • • • • • • .246 Chart G3. IHCNAMEL • • • • • • • • 247 Chart G4. IHCFINTH/IHCEFNTH (Part 1 of 3) • • • • • • • • .248 Chart G4. IHCFINTH/IHCEFNTH (Part 2 of 3) • • • • • • • • • • 248.1 D

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

....····. ·· ·· ·· ··

Chart G4. IHCFINTH/IHCEFNTH (Part 3 of 3) Chart G5. IHCADJST • Chart G6. IHCIBERH • Chart G7. IHCSTAE (Part 1 of Chart G7. IHCSTAE (Part 2 of Chart G8. IHCERRM (Part 1 of Chart G8. IHCERRM (Part 2 of IHCFOPT (Part 1 of Chart G9. Chart G9. IHCFOPT (Part 2 of

• 248.2 • 249 • 250 2) • 251 2) • 252 2) • 253 2) .254 3) .255 3) .256

Chart Chart Chart Chart Chart Chart Chart Chart Chart Chart Chart

G9. G10. Gll. G12. G13. G14. G15 • G16. G16. G16. G16.

· •• 257 258 ·• 258.1 · . . · · · . . · • 258.2

IHCFOPT (Part 3 of IHCTRCH/IHCERTCH IHCFDUMP • IHCFEXIT IHCFSLIT • IHCFOVER • IHCFDVCH • IHCDBUG (Part 1 of IHCDBUG (Part 2 of IHCDBUG (Part 3 of IHCDBUG (Part 4 of

· ··· ··· ·· · ·

3)

· · 4) · 4) 4)

4)

• 258.3 • 258.4 • 258.5 • 258.6 .258.7 • 258.8 • 258.9

This section contains general information describing the purpose of the FORTRAN IV (G) compiler, the minimum machine configuration required, the relationship of the compiler to the operating system, compiler design and implementation, and compiler output. The various rolls, 1 variables, registers, pointers, and drivers used by the compiler are also discussed.

PURPOSE OF THE COMPILER The IBM System/360 Operating System FORTRAN IV (G) compiler is designed to accept programs written in the FORTRAN IV language as defined in the publication IBM System/360: FORTRAN IV Language, Form C28-6515. The compiler produces error messages for invalid statements, and, optionally, a listing of the source module, storage maps, and an object module acceptable to the System/360 Operating System linkage editor.

operating System. As a processing program, the compiler communicates with the control program for input/output and other services. A general description of the control program is given in the publication IBM System/360 operati~g system: Introduction to Control Program Logic, Prog~~ Logic Manual. A compilation, or a batch of compilations, is requested using the job statement (JOB), the execute statement (EXEC), and data definition statements (DO). Alternatively, cataloged procedures may be used. A discussion of FORTRAN IV compilation and the available cataloged procedures is given in the publication IBM~~.§.L.oper~ting System: FORTRAN IV (G) Programmer's Guide. The compiler receives control initially from the calling program (e. g., job sche-' duler or another program that CALLs, LINKs to, or ATTACHes the compiler). Once the compiler receives control, it uses the QSAM access method for all of its input/output operations. After compilation is completed, control is returned to the calling program.

MACHINE CONFIGURATION COMPILER DESIGN The minimum system configuration required for the use of the IBM System/360 Operating System with the FORTRAN IV (G) compiler is as follows:

• An IBM System/360 Model 40 computer with a storage capacity of 128K bytes and a standard and floating-point instruction set. • A device for operator communication, such as an IBM 1052 Keyboard Printer. • At least one direct-access device vided for system residence.

The compiler will operate within a total of 80K bytes of main storage. This figure includes space for the compiler code, data management access routines, and sufficient working space to meet other storage requirements stated throughout this publication. Any additional storage available is used as additional roll storage.

pro-

COMPILER AND SYSTEM/360 OPERATING SYSTEM The FORTRAN IV (G) compiler is a processing program of the IBM System/360 1Most of the tables used by the compiler are called rolls. (Further explanation of rolls is given in "Rolls and Roll Controls.")

LIMITAT~2-QF

THE COMPILER

The System/360 Operating System FORTRAN IV (G) compiler and the object module it produces can be executed on all System/360 models from Model 40 and above, under control of the operating system control program. All input information must be written in either BCD or EBCDIC representation. The compiler is designed to process all properly written programs so that the object code produced by the compiler is compatible with the existing mathematical library subroutines. section 1:

Introduction to the Compiler

9

If ten source read errors occur during the compilation, or if it is not possible to use SYSPRINT~ the operation of the compiler is terminated. The operation of the compiler is also limited by the availability of main storage space. The compilation is terminated if:

The compiler is also designed so that reloading of the compiler is unnecessary in order to accomplish multiple compilations.

• The roll storage area is exceeded • Any single roll exceeds 64K thereby making it unaddressable • The WORK or EXIT allocated storage

roll

bytes,

exceeds

its

Note: If any of these conditions occur during the first phase of the compilation, the statement currently being processed may be discarded; in this case, the compilation continues with the next statement.

The primary control and processing routines (hereafter referred to as "POP routines" or "compiler routines") of the compiler are primarily written in machineindependent pseudo instructions called POP instructions. Interpretation of the pseudo instructions is accomplished by routines written in the System/360 Operating System assembler language. These routines (hereafter referred to as "POP subroutines") are an integral part of the compiler and perform the operations specified by the POP instructions, e.g., saving of backup information, maintaining data indicators, and general housekeeping. Control of the compiler operation is greatly affected by source language syntax rules during the first phase of the compiler, Parse. During this phase, identifiers and explicit declarations encountered in parsing are placed in tables and a Polish ~ion fo"rm of the program is produced:(For further information on Polish notation, see Appendix C, "Polish Notation Formats.")

10

The compiler quite frequently uses the method of recursion in parsing, analysis, and optimization. All optimizing and code generating routines, which appear in later phases, operate directly on the tables and Polish notation produced by Parse.

POP LANGUAGE The FORTRAN IV (G) compiler is written in a combination of two languages: the System/360 Operating System assembler language, which is used where it is most efficient, and the POP language. The POP language is a mnemonic macro programming language whose instructions include functions that are frequently performed by a compiler. POP instructions are written for assembly by the System/360 Operating System assembler, with the POP instructions defined as macros. Each POP instruction is assembled as a pair of address constants which together indicate an instruction code and an operand. A statement or instruction written in the POP language is called a POP. The POP instructions are described in Appendix A.

COMPILER ORGANIZATION The system/360 Operating System FORTRAN IV (G) compiler is composed of a control phase, Invocation, and five processing phases (see Figure 1): Parse, Allocate, Unify, Gen, and Exit. The operating system names for these phases are, respectively, IEYFORT, IEYPAR, IEYALL, IEYUNF, IEYGEN, and IEYEXT. (The first level control and second level processing compiler routines used in each phase are shown in Figure 2.) In addition, Move is a pre-assembled work area, IEYROL.

IEYFORT

SYSIN----------->r---;~~~~~----1----->r---~~~~~~1---1----->r--i~;~~;~i~~-l-----> ~ Module Il _____________ Program Il _____________ Phase lI _____________ JI JI JI

ISource Module I listing 1I lI _____________ JI

I

I Parse ~-----------~ I (Phase 1) I I l------T------ J I r-------------, I l--->ISource Module I diagnostics JI I lI _____________ V IEYALL r-------------, I Allocate I

SYSPRINT

r------------ -, r--->IStorage Maps JI I l _____________

I (Phase 2) ~-----------~ l------T------ J I I l--->IESD and TXT I IEYUNF ICards V l _____________ JI

r-------------,

SYSPRINT

SYSPRINT

SYSPUNCH/SYSLIN

r-------------,

I Unify I I (Phase 3) I l------T------ J

I V

IEYGEN

r-------------,

I Gen I (Phase 4) I I l------T------ J I

r-------------, r--->IObject Module I listing I lI _____________ JI

V IEYEXT I r-------------, r-------------, I IObject Module I Exit cards I I (Phase 5) I~-----------+--->ITXT I l _____________ J l------T------ J

I

I V IEYFORT

r-------------,

I I

I I

r-------------,

I IESD, RLD, andl l--->IEND cards l _____________ JI

SYSPRINT

SYSPUNCH/SYSLIN

SYSPUNCH/SYSLIN

Invocation I Phase I

l------I------

J

V

. *.

. * *. . * . *Multiple* . *. NO r-------------, *. Compilations • *--------------> I Control I * • *.* . . *.* • * I Program I l _____________ J *

V

Figure

1.

YES

C9

Overall Operation of the Compiler

Section 1:

Introduction to the Compiler

11

Control Phase:

Invocation (IEYFORT)

The Invocation phase (IEYFORT) is loaded upon invocation of the compiler and remains in core storage throughout compilation. It is entered initially from the calling program, from each module at the end of its processing, and from Exit after compilation is complete. At the initial entry, the Invocation phase initializes bits in IEYFORT1 from the options specified by the programmer for the compilation, opens data sets, and fetches the modules IEYPAR, I EYALL, IEYUNF, IEYGEN, and IEYEXT via a series of LOAD macro instructions. These modules remain in core storage for a series of main program and subprogram compilations unless it is determined that additional space required for tables is not available. When this occurs, modules that precede the active one are deleted, and compilation is resumed. If more space is required, modules that follow the currently active one are deleted. When a module completes processing, it returns to IEYFORT, which ensures the presence of the next module and transfers to it. During initialization for a subprogram, IEYFORT ensures that all modules are loaded. The last entry is made from the Exit phase at the completion of a compilation. When the entry is made from Exit, the Invocation phase checks for multiple compilations. If another compilation is required, the compiler is reinitialized and the main storage space allocated for the expansion of rolls is assigned to the next compilation~ otherwise, control is returned to the calling program.

Parse accepts FORTRAN statements in card format from SYSIN and scans these to produce error messages on the SYSPRINT data set, a source module listing (optional), and Polish notation for the program. The Polish notation is maintained on internal tables for use by subsequent phases. In addition, Parse produces the roll entries defining the symbols used in the source module.

Phase 2:

The ESD cards for the object module itself, COMMON blocks and subprograms, and TXT cards for NAMELIST tables, literal constants and FORMAT statements are produced by Allocate on the SYSPUNCH and/or SYSLIN data sets. Error messages for COMMON and EQUIVALENCE statements, unclosed DO loops and undefined labels are produced on SYSPRINT; on the MAP option, maps of data storage are also produced.

The Unify phase optimizes the usage of general registers within DO loops by operating on roll data which describes array references. The optimization applies to references which include subscripts of the form ax+b, where a and b are positive constants and x is an active induction variable (that is, x is a DO-controlled variable and the reference occurs within the DO loop controlling it), and where the array does not have any adjustable dimensions. The addressing portion of the object ~struction for each such array reference is constructed to minimize the number of registers used for the reference and the number of registers which must be changed as each induction variable changes.

Phase 4:

Gen (IEYGEN)

Gen uses the Polish notation produced by Parse and the memory allocation information produced by Allocate. From this information, Gen produces the code, prologues, and epilogues required for the object module. In order to produce the object code, Gen resolves labeled statement references (i.e., a branch target label) and subprogram entry references.

Allocate CIEYALL)

Allocate, which operates immediately after Parse, uses the roll entries produced 12

by Parse to perform the storage allocation for the variables defined in the source module. The addressing information thus produced is then left in main storage to be used by the next phase.

The final output from Gen is a complete form of the machine language code which is internally maintained for writing by the Exit phase.

Phase 5:

Exit (IEYEXT)

Exit, which is the last processing phase of the compiler, produces the TXT cards for the remaining portion of the object module, the RLD cards (which contain the relocatable information), and the END card. This output is placed optionally on the SYSLIN data set for linkage editor processing and/or SYSPUNCH if a card deck has been requested. Additionally, a listing of the generated code may be written on the SYS-

PRINT data set in a format similar to produced by an assembly program.

that

Roll contains static rolls and roll information always required for compiler operations. These are described under the heading "Rolls and Roll Controls" later in this section.

Section 1:

Introduction to the Compiler

13

Form Y28-6638-1 Page Revised 7/23/69 by TNL Y28-6829

r---------·-----·-----------------------------------------------------------------------, r---PRINT AND READ SOURCE

I I I r---START COMPILER I PARSE----I I I I

I I I I I I

STA INIT LBL FIELD XLATE STA XLA TE STA FINAL REGISTER IBCOM PROCESS POLISH L---STA'rEMENT PROCESS-----I ACTIVE END STA XLATE L---STA FINAL END

r---PREP EQUIV AND PRINT ERRORS BLOCK DATA PROG ALLOCATION PREP DMY DIN AND PRINT ERRORS PROCESS DO LOOPS PROCESS LBL AND LOCAL SPROGS BUILD PROGRAM ESD ENTRY NAME ALLOCATION COMMON ALLOCATION AND OUTPUT BASE AND BRANCH TABLE ALLOC EQUIV ALLOCATION PRINT ERRORS FORMAT ALLOCATION SCALAR ALLOCATE ARRAY ALLOCATE 1ALLOCATE-----START ALLOCATE--------I PASS 1 GLOBAL SPROG ALLOCATE SPROG ARG ALLOCATION PREP NAMELIST LITERAL CONST ALLOCATION EQUIV MAP GLOBAL SPROG ALLOCATE BUILD NAMELIST TABLE ALPHA LBL AND L SPROG BUILD ADDITIONAL BASES ALPHA SCALAR ARRAY AND SPROG LITERAL CONST ALLOCATION CALCULATE BASE AND DISP ---DEBUG ALLOCATE r---ARRAY REF ROLL ALLOTMENT UNIFY--------STAltT UNIFY----------i DO NEST UNIFY 1-I CONVERT TO ADR CONST I L---CONVERT TO INST FORMAT

1 1 I I I

r----STAHT GEN

I I

r---MOVE ZEROS TO T AND C ENTRY CODE GEN PROLOGUE GEN L---EPILOGUE GEN

I I

IGEN-----,

I I r--- GET POLISH I L----GEN PROCESS----------i LBL PROCESS I I STA GEN I L---STA GEN FINISH I r---PUNCH TEMP AND CONST ROLL I I PUNCH ADR CONST ROLL I I PUNCH CODE ROLL I I PUNCH BASE ROLL I J PUNCH BRANCH ROLL I I PUNCH SPROG ARG ROLL I EXIT----------EXIT PASS-------------I PUNCH GLOBAL SPROG ROLL I I PUNCH USED LIBRARY ROLL I I PUNCH ADCON ROLL I I ORDER AND PUNCH RLD ROLL I I PUNCH END CARD I I PRINT HEADING I I PRINT A LINE _ I IL-_________•___________________________________________________________________________ L---PRINT COMPILER STA~ISTICS -Figure 14

2.

Compiler Organization Chart

r-------T----------T------------------,

I Load I I I IModule I IContent or I I Name I Components I Function I ~-------+----------+------------------~ Invocation and Low IEYFORT IEYFORT Core control IEYFORTl

Option bits

IEYFORT2

Loads and deletes other modules

IEYROL

Roll statistics (bases, tops, bottoms) Group statistics (displacement group sizes) WORK roll EXIT roll

COMPILER STORAGE CONFIGURATION Figure tions, but component they exist parts of tion 2.

3 illustrates the relative posinot the relative sizes of the parts of the FORTRAN compiler as in main storage. The component each phase are described in Sec-

COMPILER OUTPUT The source module(s) to be compiled appear as input to the compiler on the SYSIN data set. The SYSLIN, SYSPRINT, and SYSPUNCH data sets are used (depending on the options specified by the user) to contain the output of the compilation.

Roll address table IEYINT

POP Jump Table POP machine language subroutines

Roll Storage is Allocated from this

The output of the compiler is represented in EBCDIC form and consists of any or all of the following: Object Module (linkage editor input) Source Module listing Object Module listing

IEYPAR

IEYPAR

Parse phase Quotes and messages

Storage maps Error messages (always produced)

I EYALL

I EYALL

Allocate phase

IEYUNF

IEYUNF

Unify phase

IEYGEN

IEYGEN

Generate phase

Relocatable card images for punching High CorelIEYEXT IEYEXT Exit phase L _______ __________ __________________ J ~

Figure

3.

~

Compiler Storage Configuration

The overall data flow and the data sets used for compilation are illustrated in Figure 4. The type of output is determined by compile time parameters.

Section 1:

Introduction to the Compiler

15

r---------------------------------------------------------------------------------------, r----------------, Error and I

I r---- For all-------------->I I compilations I

Warning I SYSPRINT Messages I Il ________________ (if any) JI

I I I I I

r----------------,

I Object I Option---------->I Module I SYSPRINT lI ________________ JI listing

~----LIST

I I I

SYSIN

I

r---------,

I I

l----T----J

I

I SourcE~ I Module

I I

~----DECK

Option---------->I (ESD, TXT, RLD I SYSPUNCH lEND) Card Images JI l ________________

~

I , V

r-------·--,

I FORTRAN,

'IV (G)

r----------------, IObject Module I

I I

, ,

r----------------,

~->~

'Compiler' l ________ J

I

,, ,,I ,,

IObject Module I Option---------->I (ESD, TXT, RLD, I SYSLIN Card Images JI llEND) ________________

~----LOAD

~----MAP

r----------------, Storage I

Option----------->I

, , ,

,

SYSPRINT

Il ________________ Map JI

r----------------,

, Source I l----SOURCE Option-------->I Module I SYSPRINT I ________________ L Listing JI

Figure

16

4.

Compiler Output

Form Y28-6638-1 Page Revised 7/23/69 by TNL Y28-6829 OBJECT MODULE The configuration of the object module produced by the FORTRAN IV (G) compiler is shown in Figure 5. Entry point--->

r---------------------,I

I Heading

~---------------------~ ISave area I ~---------------------~ IBase table I ~---------------------~ IBranch table I ~---------------------~ ISubprogram argument I Ilists I ~---------------------~ ISubprogram addresses I

.---------------------~ IEQUIVALENCE variables I ~---------------------~ IScalar variables I ~---------------------~ I Arrays I ~---------------------~ INAMELIST tables I

~---------------------~

ILiteral constants I (except those used lin DATA and PAUSE I statements)

I

I

I I

.---------------------~

IFORMAT statements

I

.---------------------~ ITemporary storage land constants

I

I

.---------------------~ L _____________________ J IProgram text

• Figure

5.

I

object Module Configuration

Components of the Object Module The following paragraphs describe the components of the object module produced by the FORTRAN IV (G) compiler. HEADING: The object module heading inclUdes all initializing instructions required prior to the execution of the body

of the object module. Among ot'he:r functions, these instructions set general register 13 (see "Object Module General Register Usage") and perform various operations, depending on whether the program is a main program or a subprogram and on whether it calls subprograms. (See "Code Produced for SUBROUTINE and FUNCTION Subprograms.") SAVE AREA: The save area, at maximum 72 bytes-long, is reserved for information saved by called subprograms. Figure 6 shows an example of the use of this area in program Y, which is called by program X, and which calls program z. The first byte of the fifth word in the save area (Save Area of Y + 16) is set to all ones by program Z before it returns to program Y. Before the return is made, all general registers are restored to their program Y values. BAS~_TA~LE: The base table is a list of addresses from which the object module loads a general register prior to accessing data; the general register is then used as a base in the data referencing instruction.

Because an interval of 4096 bytes of storage can be referenced by means of the mach.ine instruction D field, consecutive values representing a single control section in this table differ from each other by at least 4096 bytes. Only one base table entry is constructed for an array which exceeds 4096 bytes in length; hence, there is a possibility that an interval of more than 4096 bytes exists between consecutive values for a single control section in the table. The addresses compiled into this table are all relative, and are modified by the linkage editor prior to object module execution. Those entries constructed for references to COMMON are modified by the beginning address of the appropriate COMMON block; those entries constructed for references to variables and constants within the object module itself are modified by the beginning address of the appropriate object module.

Section 1:

Introduction to the compiler

17

Form Y28-6638-l Page Revised 7/23/69 by TNL Y28-6829

r------------------------------·--------------------------------------------------------, r----------------, I Subprogram I I

1 IL ____• __________ _ I Figure

8.

Roll Containing L Bytes of Reserved Information and K Bytes of New Information

Special Rolls The WORK roll and the EXIT roll are special rolls in that they are not maintained in the roll storage area, but rather appear in IEYROL with a fixed amount of storage allocated to each. They are rolls 24

CENTRAL ITEMS: The items SYMBOL 1, SYMBOL 2, SYMBOL 3, DATA 0, DATA 1, DATA 2, DATA 3 and DATA 4, two bytes each in length, and DATA 5, eight bytes in length, contain variable names and constants. These items are called central due to the nature and frequency of their use. They occupy storage in the order listed, with DATA 1 aligned to a doubleword boundary. In general, SYMBOL 1, 2, and 3 hold variable names; DATA 1 and 2 are used to hold real constants, DATA 3 and 4 to hold integer constants, DATA 1, 2, 3 and 4 to hold double precision and complex constants, and DATA 1, 2. 3, 4 and 5 to hold double-precision complex constants. GROUPS: While the basic unit of inforwation stored on rolls is a fullword, many rolls contain logically connected information which requires more than a singleword of storage. Such a collection of inforwation is called a group and always occupies a multiple of four bytes. A word of a group of more than one word is someti~es called a rung of the group. Regardless of the size of the group on a given roll, the item BOTTOM for the roll always points to the last word on the roll. Figure 9 shows a roll with a group size of twelve.

4 bytes

r---------------,, I 1st

group \'

r~~~~~~~~~~~~~~1

• GROUP STATS: Since the size of the group varies from roll to roll, this characteristic of each roll must be tabulated in order to provide proper manipulation of the roll. In addition, the groups on a roll are frequently searched against the values held in the central items (SYMBOL 1, 2, 3, etc.,). Additional characteristics of the roll must be tabulated in order to provide for this function. Four variables tabulated in the group stats tables are required to maintain this information. (See Section 2 "IEYROL Module.")

I pOP TABLE I POP Jump Table I I I ~--------------------------------------------~ I 1 POP SETUP I POP Machine Language Subroutines I I I ~--------------------------------------------~ I I I Data for POP Subroutines I ~------------+----.--------------+--------------------------------------------~ I ROLLBR--->I ROLL BASE I Roll Statistics (Bases, Tops, Bottoms) I I I ~--------------------------------------------~ I I I Group Stats (Displacements, Group Sizes) I I I ~--------------------------------------------~ I I I WORK Roll I I I ~--------------------------------------------~ I , I EXIT Roll I I I ~--------------------------------------------~ I I I ROLL ADR Table I I I ~--------------------------------------------~ I I I Roll Storage I

low storage

I I I Roll Storage* I ~------------+------------------+--------------------------------------------~ I CONSTR--->I CBASE I Parse Data Items I I I .--~-----------------------------------------~ I I I Parse Routines I I I ~--------------------------------------------~ I PGB2----->I PROGRAM BASE 2 I Parse Global Jump Table I

I

J

I I I I I

I.--------------------------------------------~ Parse Routines containing assembler J I language branch targets I

1I I

J

I I I

QUOTE BASE MESSAGE BASE

~--------------------------------------------~ Quotes I .----------------~---------------------------~ I Messages I

I

~------------L----.--------------L--------------------

I

________________________

~

PHASE 2: Allocate I ~----------------------------------------------------------------------------~ I PHASE 3: Unify I .----------------------------------------------------------------------------~ I PHASE 4: Gen I .----------------------------------------------------------------------------~ I PHASE 5: Exit I

~-----------------------------------------------------------------------------~ I*Roll storage is allocated in 4K-byte blocks, beginning from the higher end] I of storage contiguous with Parse. Additional blocks are obtained, asl I needed, from preceding (lower) 4K-byte blocks of storage. I L ________.__________ •___________________________________________________________ J • Figure 15. 28

Compiler Arrangement with Registers

high storage

Form Y28-6638-1 Page Revised 11/15/68 by TNL Y28-6826 Compiler routines which contain assembler language instructions and are either branched to by other assembler language instructions or which themselves perform internal branches, follow the global jump table. General register 2 is used as a base register for references to both the global jump table and these routines. Figure 15 shows this register in Parse. General register 3, called POPADR in the compiler code, is used in the sequencing of the POP operations. It holds the address of the current POP, and is incremented by 2 as each POP is interpreted.

POINTERS Information defining a source module variable (its name, dimensions, etc.) is recorded by the compiler when the name of the variable appears in an Explicit specification or DIMENSION statementD For variables which are not explicitly defined, this information is recorded when the first use of the variable is encountered. All constants are recorded when they are first used in the source module.

General register 4, called WRKADR, holds the address of the current bottom of the WORK roll.

All references to a given variable or constant are indicated by a pointer'to the location at which the information defining that variable or constant is stored. ~he use of the pointer eliminates redundancy and saves compiler space.

General register 5, called EXTADR, holds the address of the current bottom of the EXIT roll.

,The pointer is following format:

General register 6, called POPXIT, holds the return location for POP subroutines. When POPs are being interpreted by POP SETUP, the return is to POP SETUP; when machine language instructions branch to the POPs, it is to the next instruction.

a

I byte

I byte

i-word value in the

2 bytes

r---------T----------~--------------------, L _________ TAG ~ __________ OPERATOR ~ ____________________ ADDRESS J

I

I

I

I

where: General register 7, called ADDR, holds the address portion of the current POP instruction (eight bits); it is also used in the deFoding of the operation code portion of POP instructions. General register 8~ called POPPGB, holds the beginning address of the machine language code for the POP instructions and the POP jump table. Figure 15 shows this register, which is used as a base for references/to these areas. General register 9, called CONSTR, holds the beginning address of the data referred to by the compiler routines. This area precedes the routines themselves, and is labeled CBASE, as indicated in Figure 15. This register is, therefore, used as a base register for references to data as well as for references to the routines in the compiler; its value is changed at the • beginning of each phase. General register 10, ROLLBR, holds the beginning address of the roll area; that is, the beginning address of the base table (see Figure 15). The value in this register remains constant throughout the operation of the compiler. General register 11, RETURN, holds return addresses for the POP subroutines. The remaining general registers are used temporarily for various purposes in the compiler.

TAG is a l-byte item whose value is represented in two parts: MODE, occupying the upper four bits, indicates whether the variable or constant is integer" real, complex or logical; SIZE, indica ted in the lower four bits" s pecifies the length of the variable or constant (in bytes) minus one. (See Figure 15.1).

r-------T-------------T-------T-----------, I MODE I Value I SIZE I

I Value

t-------t-------------t-------t-----------~ 0 I Integer I 0 I 1 byte I ) 1 I Real I 1 I 2 bytes I 2 I complex I 3 I 4 bytes I I 3 I Logical I 7 I 8 bytes I I ] 4 I Literal/ I F I 16 bytes I I I I I Hexadecimal I

I

L _______ ~-------------~-------~-----------J

Figure 15.1

TAG Field MODE and SIZE Values

OPERATOR is a l-byte item which contains the roll number of the roll on which the group defining the constant or variable is stored. ADDRESS is a 2-byte item which holds the relative address (in bytes) of the group which contains the information for the constant or variable; the address is relative to the rop of the roll. Section 1:

Introduction to the Compiler

29

The pointer contains all the information required to detennine an absolute location in the roll storage area. The roll number (from the OPERATOR field) is first used as an index into the TOP table. The ADDRESS field of the pointer is then added to the TOP, and the result is handled as follows: 1.

2.

Its entry number field (bits 12 through 19) is used as an index into the ROLL ADR table. field (bits 20 Its displacement through 31) is added to the base address found in the ROLL ADR table. The result of step 2 is the address indicat.ed by the pointer.

Using a pointer whose OPERATOR field cont:ains the value 2 and whose ADDRESS field contains the value 4, and the following tables: ~ple:

TOP

r----T----"T------,

ROLL ADR

o I I I I r---f----f------i

o

1

1

I 2 I

I I 2

I I 20

I I

~---~----~-----~

I I I I

I , I ,

r---------------,I I ~---------------~

I 2 I

I 1000 I

~---------------i

I I I I

I 1 I I

the location 1024 is determined. Note that for larger values in the pointer and in TOP, the entry number field of TOP can be mo~ified by the addition of ADDRESS. In th1s case the result of the addition holds 2 and 24 in the entry number and displacement fields, respectively.

. Since re~ati!e addresses are recorded in po;nters, 1t 1S not necessary to alter a pOl.nter when the roll pOinted to is moved. No~e also that the relative address in the pOl.nt 7r ~ay exceed 4096 bytes with no compll.~a~10n.of the addressing scheme. The only 1l.ml.tat10n on the size of a roll comes a?out because of the size of the ADDRESS f1eld of the pointer: 16 bits permit values less than 64K bytes to be represented.

30

For the purposes of object code generation, the mode and size of the constant or variable is available to influence the type of operations which can be employed, e.g., integer or floating, fullword, or doubleword.

DRIVERS In the generation of Polish notation from the source language statements, "drivers" are also used. These "drivers" are values that are one word long and have the same format as the pointer. The two types of drivers used by the compiler are discussed in the following paragraphs.

Operation Drivers One type of driver is the operation driver, which indicates arithmetic or logicar-operations to be performed. The fields of the driver are: TAG is a 1-byte item whose value is represented in two parts: MODE, occupying the upper four bits, indicates the mode of the operation, e.g., integer, floating-point, complex or logical; SIZE, indicated in the lower four bits, specifies the length of the result of the operation (in bytes) minus one. OPERATOR is a 1-byte item containing a value which indicates the operation to be performed, e.g. 6 addition, subtraction, etc. The values for OPERATOR are larger than the number of any roll, and hence, also serve to distinguish a driver from a pointer • ADDRESS is a 2-byte item which indicates the of the operation driver; its values ten.

containing a value "forcing strength" specified by the range from zero to

The forcing strengths associated with the operation drivers are given in Table 1.

Table

1.

Internal Configuration of Operation Drivers

r--------------T----T--------T------------, I I I AD!2RE §2 J

I I

1

I

1 (Forcing ~ !~~:t I QE~gATQg I Stren'gth)

J

I Dr!.y~!: I .--------------+----+--------+------------~ ISprog2 I 00 I 40 I 00 00 ] ~--------------+----+--------+------------~ 1Power I 00 I 42 J 00 01 I

•lUnary --------------+----+--------+------------1 Minus I 00 43 I 00 02 I

Control Drivers The other type of driver used in the generation of Polish notation is called the control driver. It is used to indicate the type-ol-the-statement for which code is to be written. The control driver may also designate some other control function such as an I/O list, an array reference, or an error linkage •

J

~--------------+----+--------+------------~ I Multiply I 00 I 44 I 00 03 ] .--------------+----+--------t------------~ I Divide I 00 I 45 I 00 03 I ~--------------+----+--------+------------~ I Add I 00 I 46 I 00 04 1 .--------------+----+--------+------------~ I Subtract I 00 I 41 I 00 04 ~ ~--------------+----+--------+------------~ I GT I 00 I 48 I 00 05 1 .--------------+----+--------+------------~ IGE I 00 I 49 I 00 05 I t--------------+----+--------+------------~ I LT 1 00 I 4A I 00 05 I .--------------+----+--------+------------~ I LE I 00 I 4B I 00 05 J ~--------------+----+--------+------------~ I EQ ! 00 I 4C I 00 05 1 .--------------+----+--------+------------~ lNE I 00 I 4D I 00 05 I ~--------------+----+--------+------------~ I NOT I 00 I 4E I 00 06 J ~--------------+----+--------+------------i lAND I 00 I 4F I 00 01 I ~--------------+----+--------+------------~ lOR I 00 I 50 I 00 08 I .--------------+----+--------+------------~ IPlus and Belowl I I I lPhony3 1 00] 3F I 00 09 J .--------------+----+--------+------------~ I EOE4 I 00 I 3F I 00 OA I ~--------------L----~--------~------------i I:tThe MODE and SIZE settings are placed inl I the driver when it is used. I 12 Indicates a function reference. J 13 Used to designate the beginning of ani J expression. I ~4Means "end of expression" and is usedl JI 1L_________________________________________ for that purpose.

The fields of the control driver differ from those of the operation driver in that zero is contained in the TAG field, 255 in the OPERATOR field (thedisting~ishing mark for control drivers), and a unique value in the ADDRESS field. The value in the ADDRESS field is an entry number into a table of branches to routines that process each statement type or control function; it is used in this way during the operations of Gen. The formats of the operation drivers and control drivers are given in Appendix E.

Table 1 lists the operation drivers and the values contained in each field. The control drivers are given in Table 2. The ADDRESS field is the only field given because the TAG and OPERATOR fields are constant. All values are represented in hexadecimal.

section 1:

Introduction to the Compiler

31

Form Y28-6638-1 Paqe Revised 11/15/68 by TNL Y28-6826 -Table

2.

Internal Configuration of Control Drivers (Part 1 of 2)

r----------------------------T------------, I I

I I I

QE!Y~E

I I

~QQ~~~~

I I

~----------------------------+------------~ AFDS I 8 I ~----------------------------+------------~ I ARRAY I 23C I ~----------------------------+------------~ I ASSIGN I 20 I ~----------------------------+------------i I ASSIGNED GOTO I lC I ~----------------------------+------------i I ASSIGNMENT I 4 ~ r----------------------------+------------~ I AT I 68 I ~----------------------------+------------1 I BSREF I 34 I ~----------------------------+------------~ I CALL I 2C I ~----------------------------+------------i I CGOTO I 18 I ~----------------~-----------+------------~ I CONTINUE I 28 I ~----------------------------+------------i I DATA I 3C I

I

.----------------------------+------------i I DEFINE FILE I 44 I .----------------------------+------------1 I DIRECT 10 I 200 I .----------------------------+------------~ I DISPLAY ID I 74 I

.----------------------------+------------1 J DO l 10 ]

.----------------------------+------------~ I DUMMY I 68 I

.----------------------------+------------~

I END I C I r----------------------------+------------~ I END= I 20C I ~----------------------------+------------4 I ERROR LINK 1 I 54 1 r----------------------------+------------~ I ERROR LINK 2 I 58 I .----------------------------+..,..-----------~

I

I

I

ERROR LINK 3 5C L _____________________________ .1. ____________ J

32

-Table

2.

Internal Configuration of trol Drivers (Part 2 of 2)

Con-

r----------------------------T------------, I I I

I I

QE!yer

I I

~Qg~§§

I I

.----------------------------+------------~ I ERR= I 210 I .----------------------------f------------~ I EXP and ARG I 480 I .----------------------------+-------~----~ I FIND I 4C I t----------------------------f------------~ I FORl'flAT I 208 I ~----------------------------+------------~ I FORMAT STA I 30 I r----------------------------+------------~ I 14 I I GOTO t----------------------------+------------~ I IF I 24 I t----------------------------+------------~ I 218 I I IOL DO CLOSE r----------------------------+------------~ I IOL DO DATA I 21C I

r----------------------------f------------i I 10 LIST I 214 I

t----------------------------+------------~ I 60 I

1 LOGICAL IF

r----------------------------f------------i I NAMELIST I 204 I

r----------------------------+------------~ I PAUSE I 38 I t----------------------------+------------~ I READ WRITE I 48 I r-------~--------------------t------------~ I RETURN I 50 I t----------------------------+------------~ I STANDARD PRINT UNIT I 234 I r----------------------------+------------~ I STANDARD PUNCH UNIT I 238 I

r----------------------------t------------i I STANDARD READ UNIT I 230 I

~----------------------------+------------~ , STOP I 64 I

r----------------------------f------------i I SUBPROGRAM I 40 I

.----------------------------t------------~

I

TRACE OFF I 70 I ~----------------------------f------------i I ____________________________ TRACE ON I ____________ 6C L .1. JI

SECTION 2:

This section describes in detail the Invocation phase and the five processing phases of the compiler and their operation. The I~YROL module is also described.

INVOCATION PHASE (IEYFORT) The Invocation phase is the compiler control phase and is the first and last phase of the compiler. (The logic of the phase is illustrated in Chart 00.) If the compiler is invoked in an EXEC statement, control is received from the operating system control program. However, control may be received from other programs through use of one of the system macro instructions: ~AL~, LINK, or ATTACH. IEYFORT performs compiler initialization, expansion of roll storage assignment, input/output request processing, and compiler termination. The following paragraphs describe these operations in greater detail.

IEYFORT, CHART 00 IEYFORT is the basic control routine of the Invocation phase. Its operation is invoked by the operating system or by another program through either the CALL, LINK, or ATTACH macro instructions. The execution of IEYFORT includes scanning the specified compiler options, setting the ddnames for designated data sets, initializing heading information, and acquiring time and date information from the system. IEYFORT sets pointers and indicators to the options" data sets, and heading information specified for use by the compiler. The options are given 1n 40 or fewer characters, and are preceded in storage by a binary count of the option information. This character count immediately precedes the first location which contains the option data. The options themselves are represented in EBCDIC. On entry to IEYFORT, general register 1 contains the address of a group of three or fewer pointers. Pointer 1 of the group holds the beginning address of an area in storage that contains the execute options specified by the programmer (set in the OPTSCAN routine).

COMPILER OPERATION

Pointer 2 contains the address of the list of DD names to be used by the compiler (set in the DDNAMES routine). Pointer 3 contains the address of the heading information. Heading data may designate such information as the continuation of pages, and the titles of pages. If the FORTRAN compiler is invoked by the control program (i.e., called by the system), pointers 2 and 3 are not used. However, if the compiler is invoked by some other source, all pointers may be used. The latter condition is determined through an interrogation of the high order bit of a pointer. If this bit is set, the remaining pointers are nonexistent. Nevertheless, pointers 1 and 3 may exist while pointer 2 is nonexistent; in this case, pointer 2 contains all zeros. During the operation of IEYF0RT, the SYSIN and SYSPRINT data sets are always opened through use of the OPEN macro instruction. The SYSLIN and SYSPUNCH data sets are also opened depending upon the specification of the LOAD and DECK options. The block sizes of these data sets are set to 80, 120, 80 and 80, respectively. These data sets may be blocked or unblocked (RECFM=F, FB, or FBA) depending upon the DCB specification in the DD statements. IEYFORT concludes the compiler initialization process with a branch to the first processing phase of the compiler, Parse (IEYPAR) • From this point in the operation of the compiler, each processing phase calls the next phase to be executed. However, the Invocation phase is re-entered periodically when the compiler performs such input/ output operations as printing, punching, or reading. The last entry to the Invocation phase is at the completion of the compiler operation.

IEYPRNT is the routine that is called by the compiler when any request for printing is issued. The routine sets and checks the print controls such as setting the line count, advancing the line count, checking the lines used, and controlling the spacing before and after the printing of each line. These control items are set, checked, and inserted into the SYSPRINT control format, Section 2:

Compiler Operation

33

and the parameter information and print addresses are initialized for SYSPRINT. If there is an error during the printing operation, EREXITPR sets the error code resulting from the print error. Any error occurring during an input/output operation results in a termination of compiler operation.

PRNTHEAD is called by IEYPRNT after it has been determined that the next print operation begins on a new page. The program name and the new page number placed into the heading format and any parameter information and origin addr'esses are inserted int.o the SYSPRINT format. If an optional heading is specified by the programmer, it is inserted into the print line format. A PUT macro instruction is issued to print the designated line, and all print controls are advanced for the next print operation.

IEYREAD, Chart 01A4 IEYREAD is called by the compiler at the time that a read operation is indicated. It reads input in card format from SYSIN using the GET macro instruction. IEYREAD can handle concatenated data sets. If an error occurs during the read operation, the routine EREXITIN is called. This routine checks the error code generated and prints the appropriate error message.

PRNTMSG, Chart 03Al PRNTMSG is called when any type of message is to be printed. The print area is initialized with blanks and the origin and displacement controls are set. The message is printed in two segments; each segment is inserted into the print area after the complete message length is determined and the length and origin of each segment has been calculated. Once the entire message has been inserted, the carriage control for printing is set and control is transferred to the system to print the message. IEYMOR, Chart 01Dl IEYMOR is called when additional roll storage area is needed for compiler operation. This routine may be entered from any of the processing phases of the compiler. The GETMAIN maCro instruction is issued by this routine and transfers control to the system for the allocation of one 4K-byte block of contiguous storage. The system returns to IEYMOR with the absolute address of the beginning of the storage block in general register 1. Once the requested storage space has been obtained, IEYMOR returns to the invoking phase. If the system is unable to allocate the requested storage, inactive modules of the compiler are deleted. Those preceding the currently active module are deleted first; then those following it are deleted, if necessar}p. Should additional space be needed after all inactive modules are deleted, compiler operations are terminated. When IEYMOR returns to the invoking phase with the absolute address of the storage block in general register 1, the invoking phase then stores the contents of register 1 in the ROLL ADR table. The ROLL ADR table is used by the compiler to record the addresses of the different blocks of storage that have been allocated for additional roll capacity. The contents of the table are later used in IEYRETN for releasing of the same storage blocks.

When a punch output operation is requested by the compiler, control is transferred to the IEYPCH routine. The LOAD and DECK options are checked to determine what output to perform.

IEYNOCR

Any errors' detected during output result in a transfer of control to the EREXITPC, for SYSPUNCH, or EREXITLN, for SYSLIN, routine. The routine sets a flag so that no further output is placed on the affected file.

IEYNOCR is called by PRESS MEMORY (IEYPAR) whenever it is unable to obtain at least 32 bytes of unused storage. IEYNOCR prints the message NO CORE AVAILABLE, branches to a subroutine that checks to see if there are any source language cards to be disregarded, and then exits to IEYRETN.

34

Form Y28-6638-1 Page Revised 7/23/69 by TNL Y28-6829 IEYR~TN,-fh~~1-Ql~~

The compiler termination routine (IEYRETN) is invoked by Exit (IEYEXT) or by one of the input/output routines after the detection of an error. The routine first obtains the error condition code returned by the compiler and tests this value against any previous value received during the compilation. The compiler communications area for the ·error code is set to the highest code received and a program name of "Main" is set in the event of multiple compilations. The routine then checks general register 1 for the address of the ROLL ADR table. Each entry of the ROLL ADR table indicates the beginning of a 4K-byte block of roll storage that must be released. A FREEMAIN macro instruction is issued for each block of storag~ indicated in the table until a zero entry is encountered (this denotes the end of the ROLL ADR table).

The presence of more than one source module in the input stream is checked by interrogating the end-of-file indication and the first card following this notation. If another compilation is indicated, the line, card, and page count control items are reinitialized and all save registers used by the Invocation phase are restored. The number of diagnostic messages generated for the compilation is added to a total count for the multiple compilation and the diagnostic error count is reset to zero. The first processing phase of the compiler, Parse (IEYPAR), is called and the operation of the compiler proceeds as described in the previous paragraphs and those pertaining to the processing phases. If another compilation is not indicated, a check is made to determine if there was a multiple compilation. If there was a multiple compilation, an indication of the total number of diagnostic messages generated for all of the compilations is printed. Also, routine IEYFINAL closes the data set files used by the compiler (by means of the CLOSE macro instruction). The terminal error condition code is obtained and set for the return to the invoking program, and all saved registers are restored before the return is made. Routine IEYFINAL also receives control from other compiler routines when an input/ output error is detected.

OPTSCAN determines the existence of the parameters specifying the compiler options. If options are specified, the validity of each option is checked against the parameter table and the pointer to these options is set once the options have been validated. The program name is noted depending upon the presence or absence of the NAME parameter. However, if these options are not specified, the first pointer of the group of three supplied to the compiler by the system contains zero.

DDNAMES scans the entries made for the names of the data sets to be used by the compiler. The entries corre~ponding to SYSN, SYSIN, SYSPRINT, and SYSPUNCH are checked; if an alternate name has been provided, it is inserted into the DCB area.

HEADOPT determines the existence of the op,tional heading information. If such information exists, its length is determined, it is centered for printing, and then is inserted into the Printmsg Table, with pointer 3 being set.

TIMEDAT serves only to obtain the time and date information from the system and to insert the data into the heading line.

OUTPUT FROM IEYFORT The following paragraphs describe the error messages produced during the operation of the Invocation phase. These messages denote the progress of the compilation, and denote the condition which results in the termination of the compiler. IEY028I NO CORE AVAILABLE TERMINATED

COMPILATION

The system was unable to provide a 4K-byte block of additional roll storage and PRESS MEMORY was entered. It, too, was unable to obtain space. The condition code is 16. Section 2:

Compiler Operation

35

Form Y28-6638-1 Page Revised 7/23/69 by TNL Y28-6829 Multiple Compilations

IEY0291 DECK OUTPUT DELETED

following message appears at the end of a multiple compilation to indicate the total number of errors that occurred. The message will not appear if the compiler is terminated because of an error condition or if the compilation consisted of only one main or one subprogram. Th~

The DECK option has been specified, and an error 6ccurred during the process of punching the designated output. No error condition code is generated for this error. IEY0301 LINK EDI'l' OUTPUT DELETED

*STATISTICS* STEP

The LOAD 'option has been specified, and an error occurred during the process of generating the load module. The condition code is 16.

NO

DIAGNOSTICS

THIS

or *STATISTICS* STEP

nnn

DIAGNOSTICS THIS

IEY0311 ROLL SIZE EXCEEDED where: This message is produced when: (1) The: WORK or EXIT roll has exceeded the storage capacity assigned; or ( 2) Anot.her roll used by the compiler has exceeded 64K bytes of storage, thus making it unaddressable. (This condition applies to all rolls except the AFTER POLISH and CODE rolls.) The condition code is 16. IEY032I NULL PROGRAM This message is produced when an end-of-data set is encountered on the input data set prior to any valid source statement. The condition code is o. IEY0341 I/O ERROR (COMPILATION xxx ••• xxx

TERMINATED]

This message is produced when an input/output error is detected during compilation. If the error occurred on SYSPUNCH, compilation is continued and the COMPILATION TERMINATED portion of the message is not printed. The condition code is 8. If the error occurred on SYSIN, SYSPRINT, or SYSLIN, compilation is terminated. The condition code is 16. xxx ••• xxx is the character string formatted by the SYNADAF macro instruction. For an interpretation of this information, see the publication IBM System/3~Q ~ratin9 System: Supervisor and Dat.a Management Macro- Instructio!!§, Form C28-6647. IEY035I UNABLE TO OPEN

ddnam~

Thi.s message is produced when the required ddname data definition card is missing or the ddname is misspelled. 36

nnn

is the total number of diagnostic messages for the multiple compilation expressed as a decimal integer.

PHASE 1 OF Ttl,E

COMPIL~g_:_E[!RSL.L!.~~I~~g!.

The first processing phase of the FORTRAN IV (G) compiler, Parse, accepts FORTRAN statements in card format as input and translates them. Specification statements are translated to entries on rolls Which define the symbols of the program. Active statements are translated to Polish notation. The Polish notation and roll entries produced by Parse are its Er~m~r~ QutP~t. In addition, Parse writes out all erroneous statements and the associated error messages. Parse produces a full source module listing when the SOURCE option is specified. The following descript~on of Parse consists of two parts. The first part, "Flow of Phase 1," describes the overall logic of the phase by means of both narrative and flowcharts. The second part, "Output from Phase 1," describes the Polish notation produced by Parse. The construction of this output, from which subsequent phases produce object code, is the primary function performed by Parse. See Appendix C for the Polish format for each statement type. The source listing format and the error messages produced by Parse are also discussed. The rolls manipulated by Parse are listed in Table 3 and are mentioned in the following description of the phase. At the first mention of a roll, its nature is briefly described. See Appendix B for a complete description of a format of a roll.

Form Y28-6638-1 Page Revised 7/23/69 by TNL Y2B-6829 Table

3.

Rolls Used by Parse

r-------------------T---------------------, Roll Roll No.

o

No.

Roll Name

Lib----

Source Ind Var 4 Polish 5 Literal Const Hex Const 6 7 Global B Fx Const 9 FI Const 10 Dp Const 11 Complex Const 12 Dp Complex Const 13 Temp Name 14 Temp 14 Error Temp 15 DO Loops Open 16 Error Message 17 Error Char 1B Init 19 Xtend Lbl 20 Xtend Target Lbl 22 Array 24 Entry Names 25 Global Dmy 26 Error L ___________________ 27 Local Dmy

-28 29 30 31 32 33 35 36 37 38

1 2

39 40 41 42

43 44 45 46 53 54 55 56 59 60 63 ~

Roll Name Local-sprog Explicit Call Lbl Namelist Names Namelist Items Array Dimension Temp Data Name Temp Polish Equivalence Used Lib Function Common Data Cornmon Name Implicit Equivalence Offset Lbl Scalar Data Var Literal Temp Format Script Loop Data Program Script AT Subchk After Polish

____________________ _

Section 2:

Compiler Operation

36.1

Form Y28-6638-1 Page Revised 11/15/68 by TNL Y28-6826 FLOW OF PHASE 1, CHART 04 START COMPILER initializes the operation of Parse, setting flags from the user options, reading and writing out (on option) any initial comment cards in the source module, and leaving the first card of the first statement in an input area. This routine concludes with the transfer of control to STATEMENT PROCESS. STATEMENT PROCESS (G0631) controls the operation of Parse. The first routine called by STATEMENT PROCESS is PRINT AND READ SOURCE. On return from that routine, the previous source statement and its error messages have been written out (as defined by user options), and the statement to be processed (including any comment cards) plus the first card of the next statement will be on the SOURCE roll. (This roll holds the source statements, one character per byte.) STATEMENT PROCE:SS then calls STA INIT to initialize for the processing of the statement and LBL FIELD XLATE to process the label field of the statement. On return from LBL FIELD XLATE, if an error has been detected in the label field or in column 6, STATEMENT PROCESS restarts. Otherwise, STA XLATE and STA FINAL are called to complete the translation of the source statement. On return from STA FINAL, if the last statement of'the source module has not been scanned, STATEMENT PROCESS restarts. When the last card of a source module has been scanned, STATEMENT PROCESS determines whether it was an END card; if not, it writes a message. The routine then sets a flag to indicate that no further card images should be read, and calls PRINT AND READ SOURCE to write out the last statement for the source listing (depending on whether the SOURCE option was specified or was indicated as the default condition at system generation time). When no END card appears, two tests are made: (1) If the last statement was an Arithmetic IF statement, the Polish notation must be moved to the AFTER POLISH roll; (2) If the last statement-Was-ofia type which does not continue in sequence to the next statement (e.g." GO TO, RETURN), no code is required to terminate the object module, and the Polish notation for an END statement is constructed. on the POLISH roll. If the NEXT STA LBL FLAG is-off; indicating that the last statement was not of this type, the Polish notation for a STOP or RETURN statement is constructed on the POLISH roll, depending on whether the source module is a main program or a subprogram.

After the Polish notation for the STOP or RETURN has been constructed on the POLISH roll, the Polish notation for the END statement is then constructed. Parse keeps track of all inner DO loops that may possibly have an extended range. Parse tags the LABEL roll entries for those labels within the DO loops that are possible re-entry points from an extended range. These tags indicate the points at which general registers 4 through 7 must be restored. The appropriate LOOP DATA roll groups are also tagged to indicate to the Gen phase which of the inner DO loops may possibly have an extended range. Gen then produces object code to save registers 4 through 7. After processing the last statement of the source module, a pointer to the LOOP DATA roll is placed on the SCRIPT roll, -the IND"VAR:-roll is released;---and;---r¥ the source--module was a main program, the routine REGISTER IBCOM (G0707) is called to record IBCOM as a required subprogram. For all source modules, the information required for Allocate is then moved to the appropriate area, and the Parse phase is terminated.

PRINT and READ SOURCE, Chart BA PRINT AND READ three functions:

SOURCE

CG0837) serves

1.

It writes out the previous source statement and its error messages as indicated by user options.

2.

It reads the new source statement to be processed, including any comment cards, as well as the first card of the statement following the one to be processed.

3.

It performs an initial classification of the statement to be processed.

The statement to be written out is found on the SOURCE roll. One line at a time is removed from this roll and placed in a 120-byte output area from which it is written out. The new statement being read into the SOURCE roll is placed in an 80-byte input area and replaces the statement being written out as space on the SOURCE roll becomes available. Any blank card images in the source module are eliminated before they reach the SOURCE roll. Comment cards are placed on the SOURCE roll exactly as they appear in the source module. The last card image placed on the SOURCE roll is the first card of the source statement following tne one about to be Section 2:

Compiler Operation

37

Form Y28-6638-1 Page Revised 11/15/68 by TNL Y28-6826 processed; therefore, any comment cards that appear between two statements are processed with the statement which precedes them. When an END card has been read, no further reading is performed. The initial classification of the statement that occurs during the operation of this routine determines, at most, two characteristics about the statement to be processed: (1) If it is a statement of the assignment type, i.e., either an arithmetic or logical assignment statement or a statement function, or (2) If it is a Logical IF statement, whether the statement "S"(the consequence of the Logical IF) is an assignment statement. Two flags are set to indicate the results of this ciassification for later routines. At the conclusion of this routine, all of the previous source statements and their errors have been removed from the SOURCE roll and are written out. In addition, all of the statements to be processed (up to and including the first card of the statement following it) have been placed on the SOURCE roll~

.STA INIT, Chart BB STA INIT (G0632) initializes for the Parse processing of a source statement. It sets the CRRNT CHAR CNT and the LAST CHAR CNT to 1, and places the character from column 1 of the source card in the variable CRRNT CHAR. It then determines, from a count made during input of the statement, the number of card images in the statement; multiplying this value by 80, STA INIT sets up a variable (LAST SOURCE CHAR) to indicate the character number of the last character in the statement. The routine finally releases the TEMP NAME roll and sets several flags variables to constant initial values before returning to STATEMENT PROCESS.

-and

LBL FIELD XLATE (G0635) first saves the address of the current WORK and EXIT roll bottoms. It then inspects the first six colUmns of the first card of a statement. It determines whether a label appears, and records the label if it does. If any errors are detected in the label field ur in column 6 of 1:he source card, LBL FIELD XLATE records these errors for later print38

STATEMENT PROCESS ing and returns to (through SYNTAX FAIL) with the ANSWER BOX set to false. Pointers to all labels within DO loops are placed on the XT~~Q_~~~_foll~ Labels that are jump targets (other than jumps within the DO loop) are tagged to indicate to Gen at which points to restore general registers 4 through 7. If the statement being processed is the statement following an Arithmetic IF statement, LBL FIELD XLATE moves the Polish notation for the Arithmetic IF statement to the AFTER POLISH roll after adding a pointer to the label of the present statement to it.

Under the control of STA XLATE (G0636) the source module statement on the SOURCE roll is processed and the Polish n9tation for that statement is produced on the POLISH roll, which holds Polish notation for source statements, one statement at a time. Errors occurring in the statement are recorded for writing on the source module listing.

The addresses of the bottoms of the WORK and EXIT rolls are saved. Then, if the statement is of the assignment type (the first flag set by PRINT AND READ SOURCE is on), STA XLATE ensures that a BLOCK DATA subprogram is not being compiled and falls through to ASSIGNMENT STA XLATE (G0637). If a BLOCK DATA subprogram is being compiled, STA XLATE returns after recording an invalid statement error message. If the statement is not of the assignment type, a branch is made to LITERAL TEST (G0640), which determines the nature of the statement from its first word(s), and branches to the appropriate routine for p~ocessing the statement. The names of ·the statement processing routines indicate their functions; for example, DO statements are translated by DO STA XLATE, while Computed GO TO statements are translated by CGOTO STA XLATE.

With the exception of LOGICAL IF STA XLATE, the statement processing routines terminate their operation through STA XLA'l'E EXIT. LOGICAL IF STA XLATE moves the second flag set by PRINT AND READ SOURCE (which indicates whether the statement "S" is an assignment statement) into the first flag, and calls STA XLATE as a subroutine

Form Y28-6638-1 Page Revised 11/15/68 by TNL Y28-6826 for the translation of the statement "S." When all of the Logical IF statement, including "S," has been translated, LOGICAL IF STA XLATE also terminates through STA XLATE EXIT.

STA XLATE EXIT (G0723) determines whether errors in the statement are of a

severity level which warrants discarding the statement. If such errors exist, and the statement is active (as opposed to a specification statement), the Polish notation produced for the statement is removed and replaced by an invalid statement driver before a return is made to STATEMENT PROCESS. otherwise, the Polish notation is left intact, and a return is made to STATEMENT PROCESS.

section 2:

Compiler Operation

38.1

Form Y28 ... 6638-1 Page Rev~sed 11/15/68 by TNL

Y28~6826

§'IL£:ll!ALL_£h2.tl;~~

STA FINAL (G0633) inGreases the statement number by one for the state@ent just processed. It then dete+~ines whethe~ any Polish notation has been produced on' the POLISH roll; if no Polisn notation is present, STA FINAL returns to STATE~ENT PROCESS. If the statement produced Polien notation of a type which may not close a DO loop, STA FINAL bypasses the check for the close of a DO loop. Otherwise, STA FINAL determines whether the label (if there is one) of the statement corresponds to the label of the terminal statement of a DO loop. If so, the label pointer (or pointers" if the statement terminat~$ seve:t;al DO loops) is removed from the ~~QQ~2-Q£lH roll, which holds pointers to DO loop t:erminal statements until the terminal statements are found. When the statement is the target at a DO loop, extended range checking is continued. DO loops which have no transfers out 9£ the loop are eliminated as extended range candidates. In addition, the nest level count is reduced by one and the' informat.ion concerning the array references in the closed loop is moved from the SCRIP1 roll to the PROGRAM SCRIPT roll. STA FINAL then places the label pOinter (if it is required) on the Polish notation for the statement, and, at STA FINA~ END, adds the statement number to the Polish. Except when the statement just processed was an Arithmetic IF statement, STA FINAL END terminates its operation by moving the Polish notation for the statement to the AFTER POLISH roll. In the case of the Arithmetic IF, the Polish notation is not moved until the label of the next statement has been processed by LaL fIELD XLATE. When the polish notation has been moved, STA FINAL returns to STATEMENT PROCESS.

ACTIVE END STA XLATE (G0642) is invoked by STATEMENT PROCESS when the END card nas been omitted.anq the last statement in the source module has been read. If toe last statement was not a branch, toe :r;Qutine determines whetheJ;!' a subpragra,m oX"· a main program is being terminated. If it is a subprogram, the Polish notation for a RETU~N is Gonstructed; if it i$ a main program, the Polish notat3ron fo~a STOP statement is constructed. I~ th~ l~st statement was a branch, thi16 rQ'U~ine returns without doing anything.

PROCESS POLISH (G0844) moves a count of the number of words in the Polish notation for a statement, and the Polish .notation · for that statement, to the AFrER POLISH rolL.

OUTPUT FROM PHASE 1 The output from Parse is the Polish notation and roll entries produced for source module active statements, the roll entries produced for source module specification statements, and the source module listing (on option SOURCE) and error messages. The following paragraphs describe the Polish notation and the source and error listings. See Appendix B for descriptions of roll formats.

Polish Notation The primary output from Phase 1 of the compiler is the Polish notation for the source module active statements. This representation of the statements is produced one statement at a time on the POLISH roll~At the end of the processing of each · statement, the Polish notation is transferred to the AFTER POLISH roll, where it is held until it is required by later phases of the compiler. The format of the Polish notation differs from one type of statement to another. The following paragraphs describe the general rules for the construction ot Polish nota'tion for expressions. The specific formats of the Polish notation produced for the various FORTRAN statements are given in Appendix C. Polish notation is a method Qf writing arithmetic expressions whereby the tradi· tional sequence of "operand 1 " "operation" "operand 2 " is altered toa functional notation of "operation" "operand 2 " "operand1 . " Use of this notation has the advantage of eliminating the need for brackets of various levels to indicate the order of operations, since any "operand" may itself be a sequence of the form "operation" "operand" "operand," to any level of nesting. Assuming expressions' which do not include any terms enclosed in parentheses, the following procedure is used to construct the Polish notation for an expression: Section 2:

Compiler Operation

39

1.

At the beginning of the expression, an artificial driver is placed on the WORK roll; this driver is the Plus and Below Phony driver, and has a lower forcing strength than any arithmetic or logical operator. (Forcing strengths are given in Table 1.)

2.

As each variable name or constant in the expression is encountered, a pointer to the defining group is placed on the POLISH roll.

3.

When an operator is encountered, the corresponding driver is constructed and it is compared with the last driver on the WORK roll: a.

b.

If the current driver has a higher forcing strength than the driver on the bottom of the WORK roll (the "previous" driver, for the purposes of this discussion)" the current driver is added to the WORK roll and the analysis of the expression continues. If the current driver has a forcing strength which is lower than or equal to the forcing strength of the previous driver, then: (1) If the previous driver is the Plus and Below Phony driver, the current driver replaces the previous driver on the WORK roll (this situation can only occur when the current driver is an EOE driver, indicating the end of the expression) and the analysis of the expression is terminated. (2) If the previous driver is not the Plus and Below Phony driver~ the previous driver is removed from the WORK roll and placed on the POLISH roll, an~ the comparison of the current driver against the previous driver is repeated (that is, using the same current driver, this procedure is repeated from 3).

The sequence of operations which occurs when the analysis of an expression is terminated removes the EOE driver from the WORK roll. EX~Ele-±: The expression A the Polish notation

+

B

produces

where: A represents a pointer to the defining group for the variable A + represents the Add driver. This notation is produced from the top down; when it is read from the bottom up, the sequence described above for Polish notation is satisfied.

operations this Polish

Explanation: The following occur in the production of notation:

driver

is

1.

The Plus and Below Phony placed on the WORK roll.

2.

A pointer to A is placed on the POLISH roll.

3.

An Add driver is constructed and compared with the Plus and Below Phony driver on the bottom of the WORK roll; the Add driver has a higher forcing strength and is therefore added to the WORK roll (according to rule 3a " above) •

4.

A pointer to B is placed on the POLISH roll.

5.

An EOE (end of expression) driver is constructed and compared with the Add driver on the bottom of the WORK roll; the EOE driver has a lower forcing strength, and the Add driver is therefore removed from the WORK roll and added to the POLISH roll (rule 3b2).

6.

The EOE driver is compared with the Plus and Below Phony driver on the bottom of the WORK roll; the EOE driver has a lower forcing strength, and therefore (according to rule 3bl) replaces the Plus and Below Phony driver on the WORK rollo

1.

The analysis of the expression is terminated and the EOE driver is removed from the WORK roll. The Polish notation for the expression is on the POLISH roll.

The expression ExamEle 2: produces the Polish notation

A

+

B

/ C

A B C / +

A B

+

40

which, read from the bottom up, is + / C A.

B

Explanation: occur in the notation:

The following operations production of this Polish

1.

The Plus and Below Phony driver is placed on the WORK roll.

2.

A pointer to A is placed on the POLISH roll.

3.

An Add driver is constructed and compared with the Plus and Below Phony driver; the Add driver has the higher forcing strength and is placed on the WORK roll.

4.

A pointer to B is placed on the POLISH roll.

5.

A Divide driver is constructed and compared with the Add driver; the Divide driver has the higher forcing strength and is placed on the WORK roll.

6.

A pointer to C is placed on the POLISH roll.

7.

An EOE driver is constructed and compared with the Divide driver; since the EOE driver has the lower forcing strength, the Divide driver is moved to the POLISH roll.

8.

The EOE driver is compared with the Add driver; since the EOE driver has the lower forcing strength, the Add driver is moved to the POLISH roll.

9.

The EOE driver is compared with the Plus and Below Phony driver; since the EOE driver has the lower forcing strength, it replaces the Plus and Below Phony driver on the WORK roll, and the analysis of the expression terminates with the removal of one group from the WORK roll.

Example 3: The expression produces the Polish notation

A

/

B

- C

A B

which, read from the bottom up, is - C /

B

A.

1.

A pointer to A is placed on the POLISH roll.

3.

A Divide driver is constructed and compared with the Plus and Below Phony driver; the Divide driver has the higher forcing strength and is added to the WORK roll.

4.

A pointer to B is placed on the POLISH roll.

5.

A Subtract driver is constructed and compared with the Divide driver; the Subtract driver has a lower forcing strength, therefore the Divide driver is moved to the POLISH roll.

6.

The Subtract driver is compared with the Plus and Below Phony driver; the Subtract driver has the higher forcing strength and is added to the WORK roll.

7.

A pointer to C is placed on the roll.

8.

An EOE driver is constructed and compared with the Subtract driver; since the EOE driver has a lower forcing strength, the Subtract driver is moved to the POLISH roll.

9.

The EOE driver is compared with the Plus and Below Phony driver; the EOE driver replaces the Plus and Below Phony driver on the WORK roll and the analysis of the expression is terminated.

POL~SH

Recursion is used in the translation of an expression when a left parenthesis is found; therefore, the term enclosed in the parentheses is handled as a separate expression. The following three examples illustrate the resulting Polish notation when more complicated expressions are transformed: EXE!:£22!2!! 1. A-B*(C+D) 2. (A-B)/(C*D) 3. X/Z/(X-C)+C**X

Polish Notation

~BA----

/*DC-BA +**Xc/-cx/zx

The following should be noted with spect to the exponentiation operation:

/ C

Explanation: occur in the notation:

2.

The following operations production of this Polish

The Plus and Below Phony driver is placed on the WORK roll.

re-

• Exponentiations on the same level are scanned right to left. Thus, the expression A**B**C**D is equivalent to the expression A**(B**(C**D». • Two groups are added to the POLISH roll to indicate each exponentiation operation. The first of these is the Power driver; the second is a pointer to the group on the global subprogram roll (GLOBAL SPROG roll) which defines the Section 2:

Compiler Operation

41

required exponentiation routine. Thus, the expression A ** B produces the following Polish notation: Pointer to A Pointer to B Power driver Pointer to exponentiation routine The concept of Polish no·tation is extended in the FORTRAN IV (G) compiler to include not only the representation of arithmetic expressions, but also the representation of all parts of the active statements of the FORTRAN language. The particular notation produced for each type of statement is described in Appendix C. Once an entire source statement has been produced on the POLISH roll, phase 1 copies this roll to the AFTER POLISH roll and the processing of the next statement begins with the POLISH roll empty.

is catastrophic, at least to part of the statement being scanned. The second technique is a jump to an error recording routine, such as ALLOCATION FAIL or SUBSCRIPTS FAIL, which records the error and jumps to FAIL. The third technique is the use of one of the instructions, such as IEYCSF or IEYQSF, which automatically jump to SYNTAX FAIL if the required condition is not met. SYNTAX FAIL also exits through FAIL.

If the statement being processed is active and errors have been detected in it, FAIL removes any Polish notation which has been produced for the statement from the POLISH roll, replacing it wit.h an error indicator. FAIL then restores WORK and EXIT roll controls to their condition at the last time they were saved and returns accordingly.

Source Listin'J The secondary output from Parse is the source module listing. If a source listing is requested by the user (by means of the option SOURCE), source module cards are listed exactly as they appear on the input data set with error messages added on separate lines of the listing. If no source module listing is requested, Parse writes only erroneous statements and their error messages.

Some translation routines modify the action of the FAIL routine through the use of the IEYJPE instruction so that FAIL returns immediately to the location following the IEYJPE instruction. The translation routine can then resume the processing of the statement from that point.

The follo'lllring paragraphs describe the error recording methods used in phase 1, the format of the source listing and the error messages generated.

FORMAT OF THE SOURCE MODULE LISTING: Error information for a source module card containing errors appears on the listing lines immediately following that card. For each error encountered, a $ sign is printed beneath the active character preceding the one which was being inspected when the error was detected. The only exception would be in the case of a SYNTAX error. In such a case, the $ sign undermarks the character being inspected when the error is detected. The listing line which follows the printed card contains only the $ sign markers.

ERROR RECORDING: As a rule, Parse attempts to continue processing source statements in which errors are fou.nd. However, certain errors are catastrophic and cause Parse to terminate processing at the point in the statement where the error occurred. Statements which cannot be compiled properly are replaced by a call to the FORTRAN error routine IHCIBERH. Throughout Parse, three techniques of error recording are used. The first of these is used when the error is not catastrophic. This method records the character position in the statement at which the error was detected (by means of IEYLCE, IEYLCT, or IEYLCF instructions> and the number of the error type on the ERROR roll; after recording this information, Parse continues to scan the statement. The second and third techniques of error recording are used 'when the error detected 42

The next line of the listing describes the marked errors. The errors are numbered within the card (counting from one for the first error marked); the number is followed by a right parenthesis, the error number, and the type of the error. Three errors are described on each line, for as many lines as are required to list all the marked errors on the source card.

The following is an illustration of the printed output from phase 1:

DIMENSION.ARY(200), BRY(200) CRY(5,10,10) $ 1) IEY004I COMMA

IF (AA + BB) 15, 20, 250000 $

1)

IEY010I SIZE ARY(J) = BRY $ $ 1) IEY002I LABEL 2) IEY012I'SUBSCRIPT GTO 30 $

1)

IEY0131 SYNTAX

ERROR TYPES: The types of errors detected and reported by Parse are described in the following paragraphs. For each error type, the entire message which appears on the source output is given; the condition code and a description of the causes of this error follows the message. IEY0011 ILLEGAL TYPE: ~his message is associated with the source module statement when the type of a variable is not correct for its usage. Examples of situations in which this message would be given are: (1) ~he variable in an Assigned GO TO statement is not an integer variable; (2) In an assignment statement, the variable on the left of the equal sign is of logical type and the expression on the right side is not. The condition code is 8.

!§~QQ7.!_!Q_£Q~f~!£!: The name of a variable or subprogram is used improperly, in . the sense that a previous statement or a previous portion of the present statement has established a type for the name, and the present usage is in conflict with that type. Examples of such situations are: (1) The name listed in a CALL statement is the name of a variable, not a subprogram; (2) A single name appears more than once in the dummy list of a statement function; (3) A name listed in an EXTERNAL statement has already been defined in another context. The condition code is 8. !~~QQ~! __ ~~~Q£~!!Q~: Storage assignments specified by a source module statement cannot be performed due to an inconsistency between the present usage of a variable name and some prior usage of that name, or due to an improper usage of a name when it first occurs in the source module. Examples of the situations causing the error are: (1) A name listed in a COMMON block has been listed in another COMMON block: 2) A variable listed in an EQUIVALENCE statement is followed by more than seven subscripts. The condition code is 8.

IEY009I ORDER: The statements of a source module are used in an improper sequence. This message is produced, for example, when: (1) An IMPLICIT statement appears as anything other than the first or second statement of the source module: (2) An ENTRY statement appears within a DO loop. The condition code is 8.

able;-CO~MON-block;-NAMELIS~,

IEY0101 SIZE: A number used in the source module does not conform to the legal values for its use. Examples are: (1) The size specification in an Explicit specification statement is not one of the acceptable values: (2) A label which is used in a statement exceeds the legal sIze for a statement label: (3) An integer constant is too large. The condition code is 8.

4.

IEYOll1 UNDIMENSIONED: A variable name Indicates-an-arraY-7I;e., subscripts follow the name), and the variable has not been dimensioned. The condition code is 8.

IEY0021 LABEL: This message appears with a statement which should be labeled and is not. Examples of such statements are: (1) A FOR~mT statement; (2) The statement following a GO TO statement. The condition code for the error is o. IEY0031

NAME

LENGTH:

The name of a varior subprogram exceeds six characters in length. If two variable names appear in an expression without a separating operation symbol, this message is produced. The condition code is IEY004I COMMA: A comma is supposed to appear in a statement and it does not. The condition code is O. IEY005I ILLEGAL LABEL: The usage of a label is invalid for example, if an attempt is made to branch to the label of a FORMAT statement, ILLEGAL LABEL is produced. The condition code is 8. IEY006I DUPLICATE LABEL: A la.bel appearing in the label field of a statement is already defined (has appeared in the label field of a previous statement). The condition code is 8.

IEY012I SUBSCRIPT: The number of subscrIpts--used--In- an array reference is either too large or too small for the array. The condition code is 8. IEY013I SYNTAX: The statement or part of a statement to which it refers does not conform to FORTRAN IV syntax. If a statement cannot be identified, this error message is used. Other cases in which it appears are: (1) A non-digit appears in the label field; (2) Fewer than three labels follow the expression in an Arithmetic IF statement. The condition code is 8.

Section 2:

Co~piler

Operation

43

Form Y28-6630-1 Page Revised 7/23/69 by TNL Y28-6829 IEY014I CONVERT: In a DATA statement or in an Explicit specification statement containing data values, the mode of the constant is different from the mode of the variable with which it is associated. The compiler converts the constant to the correct mode~ Therefore, this message is simply a notification to the programmer that the conversion is performed. The condition code is o. The source module IEY0151 NO END ~ARD: The does not contain an END statement. condition code is o. IEY0161 ILLEGAL STA.: The statement to which it is attached is invalid in the context in which it has been used. Examples of situations in whi~h this message appears are: (1) The statement S in a Logical IF statement (the result of the true condition) is a specification statement, a DO stabement, etc.; 2) An ENTRY statement appears in the source module and the source module is not a subprogram. The condition code is 8. IEY0171 ILL:EGAL STA. WRN A RETURN I statement appears in any source module other than a SUBROUTINE subprogram. The condition code is o. IEYOl8I NUMBER ARG: A reference to a library subprogram appears with the incorrect number of arguments specified. The condition code is 4. IEY0271 CONTINUATION CARDS DELETED: More than 19 continuation lines were read for 1 statement. All subsequent lines are skipped until the beginning of the next statement is encountered. The condition code is 8. IEY0331 COMMENTS DELETED: More than 30 comment lines were read between the initial lines of 2 consecutive statements. The 31st comment line and all subsequent comment lines are skipped until the beginning of the next statement is encountered. (There is no restriction en the number of comment lines preceding the first statement.) The condition code is o. IEY036I ILLEGAL LABEL WRN: The label on thIS-nonexecutable-statement has no valid use beyond visual identification, and may produce errors in the object module if the same label is the target of a branch-type statement. (Only branches to executable statements are valid.) This message is produced, for example, when an END statement is labeled. The message is issued as a warning only. The condition code is 4. 44

IEY037I PREVIOUSLY DIMENSIONED

WRN.:

The

array--flagged--has-~een-prevIously dimen-

sioned. The dimensions that were given first are used. Examples of this error are (1) a DIMENSION statement defining an array with a subsequent COMMON statement defining the same array with new dimensions, or (2) array dimensions specified in a Type statement and also. in a subsequent DIMENSION and/or COMMON statement. The condition code is 4. IEY038I SIZE WRN.: A variable has data initializing values that exceed the size of the scalar, the array, or the array element. Examples of this error are (1) the specification REAL A/'ABCDE'/ where A has not been previously dimensioned (i.e., A is a scalar), or (2) the specification DATA A(l)/7H ABCDEFG/ where A has been previously dimensioned. The condition code is 4.

PHASE 2 OF THE COMPILER:

ALLOCATE (IEYALL)

Phase 2 of the compiler performs the assignment of storage for the variables defined in the source module. The results of the allocatiQn operations are entered on tables which are left in storage for the next phase. In addition, Allocate writes (on option) the object module ESD cards, the TXT cards for NAMELIST tables, literal constants, and FORMAT statements, and produces error messages and storage maps (optionally) on the SYSPRINT data set.

The following paragraphs describe the operations of Allocate in two parts. The first part, "Flow of Phase 2," describes the overall logic of the phase by ffieans of narrative and floweharts~

The second part, "Output from Phase 2," describes the error messages and memory maps which are produced on the source module listing during the operation of the phase, as well as the ESO and TXT cards produced. It also describes the types of error detection performed during Allocate.

Rolls manipulated by Allocate are listed in Table 4, and are briefly described in context. Detailed descriptions of roll structures are given in Appendix B.

Form Y28-6638-1 Page Revised 7/23/69 by TNL Y28-6829

Table

4.

Rolls Used by Allocate

r-------------------T--------------------, IRoil IRoIl INo.

Roll Name INo. Roll Name Source 1 39 Halfword I 5 Literal Const I Scalar I 7 Global Sprog I 40 Common Name I 14 Temp 1 41 Implicit I 15 Do Loops Open I 42 Equivalence Offset 1 18 Init t I 19 Equiv Temp I 43 Lbl I 20 Equiv Hold I 44 Scalar I 21 Base Table I 45 Data Var I 22 Array I 47 Common Data 'Iemp I 23 Dmy Dimension I I 24 Entry Names I 48 Namelist Allocation 1 25 Global Dmy I I 26 Error Lbl 1 48 Common Area I 27 Local Dmy 49 Common Name Temp J 28 Local Sprog 50 Equiv I 29 Explicit Allocation I 30 Error Symbol 52 Common I 31 Namelist Names Allocation I 32 Namelist Items 53 Format I 34 Branch Table 60 Subchk I 37 Equivalence 68 General I 31 Byte Scalar Allocation I 38 Used Lib I Function I _______________ 39 Common Data ____ ____________________ J1 L

1 1

~

~

section 2:

Compiler Operation

44.1

Form Y28-6638-1 Page Revised 7/23/69 by TNL Y28-6S29 FLOW OF PHASE 2, CHART 05 START ALLOCATION (G0359) controls the operation of the Allocate phase. The primary function of this routine is to call the subordinate routines which actually perform the operations of the phase. The operation of Allocate is divided into three parts: the first part performs initialization; the second part (called pass 1) makes an estimate of the number of base table entries required to accommodate the data in the object module; the third part actually assigns storage locations for the object module components, leaving indications of the assignment in main storage for use by subsequent phases. The first part of Allocate's operation is performed by calling the routines ALPHA LBL AND L SPROG, PREP EQUIV AND PRINT ERRORS, BLOCK DATA PROG ALLOCATION, PREP DMY DIM AND PRINT ERRORS, PROCESS DO LOOPS, PROCESS IBL AND LOCAL SPROGS, BUILD PROGRAM ESD, ENTRY NAME ALLOCA~ION, COMMON ALLOCATION AND OUTPUT, and EQUIV ALLOCATION FRINT ERRORS. After return from EQUIV ALLOCATION PRINT ERRORS, START ALLOCATION initializes for and begins pass 1. The variable PROGRAM BREAK, which is used to maintain the relative address being assigned to an object module component, is restored after being destroyed during the allocation of COMMON and EQUIVALENCE.. The groups in the BASE ~ABL~-f0ll

IEYF05

• • •

.. '"

• • :

··:::···1······· .

.:~~:~~!~.-.-~~~: ····E2··········



'---1

04

... E3

*oo

: •••• C4 ••••••••• :

*.

.*

SYSTEM OPEN FOR SYSLIN

·......T....·. ...

.INITIALIZE SAVE' : REGISTERS :

. . . . . . . r...... 1 .... ······03·.·.·.····· *0

'INITIALIZE BASE. : REGISTERS :

F2

.

. . ·. T....·.

YES

SCAN COMPILER OPTIONS

:

: •••• B4 ••••••••• :

.'. •

' . LOAD OPTION •

: ...... 02 ••••••••• :

• • •

C3

IEYPRNT

.......1'......

·

SYSTEM OPEN • FOR SYSIN AND • SYSPRINT •

. * .'

• ENABLE • • INTBRRUPTS BY •

·

:

.·····83···········

: •••• B2 ••••••••• :

I

• •••• A4 ••••••••••

• INITIALIZE • • TIME AND DATE • • INFORMATION •

:

• INITIALI ZE • AND SET SAVE : REGISTERS

IEYPRNT

IEYFOl

IEYFORT

'f"..

.... G4

.. ..

.....

YES.

...

•• ---->* 05 •

.'. ••

... ..

...

: •••• Gs ••••••••• :

.

NO . ' CARRIAGE •• YES • ADVANCE • ---*. CONTROL=O •• -------->.LINE COUNT ONE •

0*

...

'"

'.;::...............::::::::i........

H4

. '. *0

••

•' MAX ' . YES' • ' . LINES USED •• ---->. 05 •

·0

*.

....

... 0"

•• • •••

• NO

::::::---->1 : •••• J4 ••••••••• :

• STORE LINE • • COUNT INTO • : SYSPRT FORMAT :

......·T·. . . ·····K"··········

• SET. • ••• KS ••••••••• • PARAMETERS AND • • RETURN • • PRINT ADDRESSES.-------->. TO COMPILER •

:.. ~::~.::::::..:

.................

Section 2:

Compiler Operation

59

IEYFORT (Part 2 of 4)

Chart 01. ERLXITPR

·

..... "'. AI+- .................. ..

EREXITPR

.

PRNTHEAD

IEYREAD

··

• •••• A2 •••••••••• •

. .

PRNTr!£AD



.... **

V

·····81··········

... SET • EHrlOR CODE .KESULTI NG FROM : PRINT ERROR

• ... ... :

••••••••••• ** ••••

L>:~i; . ·... .

IEYMOk

·····el·········. :

IEYNOR

:

••••••• * •••••••

: •••• D1 ••••••••• : • ISSUE GET~~IN • .FOR 4K 3YTE:C; OF.1

.SET PAGt: COUNT • ... • INTO HEADING • FORMAT

.

.. ••• .. B4·· .... •••••• .. SET BASE • AND SAVE • • REGISTERS • • •• + •• + •••• + ••• +++

• • :

-----------t

• RETURN • wITH • NON-POSITIVE .CONDITION CODE

PRINT ClEADING

.+*.+ •• + •• * ••

"'

•••••••••••• * •• *.

..:+

······Hl···· . ·· .... ·..........................

60

..

COU:~T

1'0

...



···*·G2*·***··*·+

.TERMINAL ERROR. .. CODE ..

•* .*

..

j"0

I V

C3

...

*.

*. *.

o, •• ':OAD OPT! O~ ••

*.

*.*.*.*.**** •••••

v

SET FLAG TO TURN OFF SYSPCH

•e* •••••••• ** •••••*

I

.*

*,

*

NO

v

* *

o,o,.o,

..

I

RETURN TO COMP I LER

e •• _ •• e*_ ••••••

I

* •• * • YES

······CS··**_···_·.. V

V

****C4****.*ee •

..

SET ERROR CODE VALUE

*

_••• ***. * .....

. ..

....

.

•••••••••••• ** •••

..

.*.**02 ••• ******-

.

.

.SET UP BAD CARD. .AND ABORT COMPo, • MESSAGES •

V

••••• E 1****.*** •• • PRNTMSG

03A 1.

*-*-*-*-*-*-*-*-* PRINT ERROR

:•••• :~~~~:~ ••• *:

I

.*

I

V

*-*-*-*-*-*-*-*-* PRINT MESSAGES

.

•• * ••••••••••••••

.....I

*.

*.

.....Fl·········· * •

* •

·03 • .. *A~.

i

I ..... .... C;* . v

*

.*

*****05·····*····•

*•

o,.•• 1YES

SET FLAG TO .. .. TURN OFF LOAD * LINKAGE * *

.*

*.** •••••• * •••••••

v (::)

I

·.*.·ES·········· .. .

v *··.*E3***··****·

V

o,SET • PARAMETERS ** * AND ADDRESSES • * FOR SYSPCH *

.. SET ERROR * • CODE FOR LINK. : EDIT OUTPUT ..

...-.... ..........I _

_

• ••• *.*.*.**.****

I

V

** *

V

******F3·**·*·***** SYSTEM PUT ROUTINE INSERTS PARAMETER

SET *TERMINAL ERROR * * CODE •

........•..••.... • *

Io.

* •• *

v

V

V

*•

NO

•· ••• E2*········· .PRNTMSG 03A1 • •

03 LOAD

•• FILE •• TERMINATED

• •••••• **** ••••••

II

I

.* •

***.*

G3 •

v

SETUP B A D . CARD IMAGE MESSAGE

·01



I

EREXINOS

••••• 01 •••• ** •• **

·

*._ .. __ .......... *.*

..

v

*.

•• •• ERROR CODE 0

*.

I

V

**.**85·** ** •• *e. * ..

:SAVE REGISTERS:

*** •• **** •• ***.*.

I

•••

V

.. ** ... *84"" .*e* **.* * •* * RESTORE

INITIALIZE • BASE AND SAVE • REG I STERS •

v

Cl

IEYF70



·

EREX I TPC

•• e . . . . . . . . . . . . .

• • I

V

• •

··.·AS···· .. ····

:. :: . :->1

*****83***·*****-

*

*

•• ** ••• *.* •••

I

***

EREXITPC

SYSTEM • PUT ROUTINE. INSERT FILE • PARAMETERS

1

I .* •••••

*

B4

* -

..

..:~~~;~~;~o,.

·· ... I ***. * G3 o,->

****

V

IEYF60

•*

.*

.*.

G3

*•

*•

*.

NO

". DECK OPTION . * 1

*. *.

* •• * -

.* .*

v

YES

**_o, ..

*

.. .*** "

I

v

.o,.

•*

H3

DECK

:

"

NO

I

*.

I

" RESTORE"" :SAVE REGISTERS

".

.,,'''--1

V

V

" "

*.

.OBT A I N ADORESS " OF BLOCK TO " " RELEA5E

.".................."

V

u

I

...

....... H3·········· ""

I I

I

........ if .. .. F4 * - )

v

." ".

I

I

OECK

*.

I I

H5 :

: ........ F4 .. ** ........ :

v

.".

G3

."

*.

" RE-INITIALIZE " "LINE, CARD AND" " PAGE COUNT "

RETURN

..........

". ".SPECIFIED." OPTION ''',

v

IE'(R60

SYSTEM PUT ROUTINE WRITE " MESSAGE "

. ····K 1***··**··..

G3 : ... ..

I :->1 ..... ** ...

*.

* •• * .. VE5

v

••••

:

• ••••••••• ** ......

V

*..*

G3

IEYFNL05

" ", " "

v : ...... J2 ••• * ••••• :

I

62

··**"

J

•••• :

RELEASE STORAGE

*.

I

* •• * .. YES

E4

.. "*"""

V

v

••

"ISSUE FREEMAIN .. .. FOR OATA S[T " • STORAGE.

v

" " ..*****.****.-•••

* •••• **** ••••••••

I

E4 : ,

." *.

PRINT DATA SET STATUS ME SSAGE

:

I

V

····*05**···*·**.. ..

03A5"

:":~~,,;!~~~!~!,,,,:

NO

I

I I I

I I

FREE STORAGE "--, USED BY SYSIN" I

:

..

.. TO. "

.***.** •••• *** .....

*-*-*-*_*_*_4_*_*

" "

v . ............ F3.......................

V

COMPUTE "SIZE OF AREA " BE FREED

I

.* ".

""

V

IEYR50.".

*.

V

**·**(5**··******

"

**.*

*.

I

v

"FREEf'OOL

I

***··F2*······***

"

SET CARRIAGE CONTROL

.*

*.

I I I

:

*:

."

E3

I

..**.04 .... ******.

03A5"

"

LOAD DATA SET BUFFER AODRE.SS

..** ••• _••••••••••

".~:SLlN lJUTP~!'''1

** •• *** .. ***** .. ***

V

PLACE 2ND " SEGMENT I N " PRINT BUFFER :

*....

v

.".

..

ISSUE CLOSE " FOR SYSIN AND" SYSPRINT "

" "

I

I

I

V

·****Gl*********·

""

:"""*~!;~!~""""": I

v

*·**·B5·****~**·*

.. ****C4*****· .. ·**

FREE STORAGE USED BY

I

I

:

**** .. ****.*** I .****. I

IEYFNLIO

*-*-*-*-*-*-*-*-4

" "

C4

FREEPOOL

*""",," :,,::,,:->1

I

*FREEPOOL

GET CONDITION .. CODE RETURNED " BY COMPILER "

I

: G3:

*****03."."'......

..

V

I v

v

V

:

PRINT DATA SET STATUS MESSAGE

""*"

• *** ..............

*****02*********·

" "

.*

ISSUE CLOSE FOR SYSL I N

.. ·***AS********· .. "

.... *** .. B4 ** ....... * ** ......

V

*****C2**********

FREE POOL

*. NO

v

...

I I *····C3*···*4 •• **.. "

I

I

...

I

YES

I

V

." .*.

DECK

I

"

*****Cl**********

A4

* ••• ~~6~~~D . *' *--1 it. .' I * •• * v .. YES ••••

." LOAD ". NO ". OPTION ."--, ".SPECIFIED." I

****.*** ••• ** ...... *.

I

...

I

*****82*****"*"'*·

** *

.*

1 v

V

"

V

** ..... ****** ......... .

I

V

""

"

"*--, " Iv

.. ··**A3* ....... •• .. • .. •

I

I

A4

"

" RE-INITIALIZE " BASE ANO • " "SAVE REGISTERS" " FOR COMPILER " * TERMINATION "

.**** .... *** .. * .....

*****81**********

I

IEYFINAL

****A2+********

***.

"..

• SET ERROR • "COOE FOR RETURN" .. TO CALLER "

I v

..

................. "

.." ".". " H2 "

"

I

I

······Js·········. V

RETUilN

OPTS CAN

Chart AA.

I

PRS20

..

****A2********* OPTSCAN

V

*****A3**********

*

*

*

* *

* SET INDICATOR * *IN POINTER FOR * COMPILER *

***************

*

*****************

I

I

v PRS22

V

83

*****82**********

* * .. GET .. *PARAMETER LIST * * LENGTH *

.*

*.

.

,

*.

* *

****

.. E3

ANY

*.

** ..

•• *.

.*

02

.*

v .*. *.

*. * •• *

-.

*

* *

: E3 **** OPTSIO

*CENERATED NAME * OR PGM NAME *

*

..

*****************

I

V

*****F3**********

.*

.*

*.

*•

*

************.*.**

*

v

.***

..

.. *

03 ..

****

*.

*

.*.v *.

PARAM

...

IN TABLE

* •• * ...

* .. .. A3 ..

v

*..

... *.

YES.* ,

.*

..J2

I I

.*

." .*. WAS

OPTS20

*.

*. YES

****

...

NAME OPTION .*------->* *. GIVEN .* *

••• * * NO

****G4********* RETURN

***************

I

C3 * ...

*

I

V

*****H3***'*******

*

*

*

INSERT SYSTEM * NAME *

**

*

*

**** '* ** .. ***** .... **

I I

I

PREPARE + CONVERT LINECNT

....I

...

************.*.*.

*****Jl********** it

TABLE

.*

G3

*..*

v

NO

L I NECNT ". NO .. PARAME TERS * SPECIFIED ... ------->*SPECIFIED WITH *

PRS30

*

I

*.

-*--*H2--.-"'-._.... COMPARE ...

I I V

J

:->1

v

*.

* •• *

I

v

I

*

..

* YES

II

I V *****E3********** * OBTAIN * * SYSTEM *

~

*..* * •• *

I

I

•* •

PARAM

I

*

* * ************.****

... ...

I

I

* **** ..

*

...

.*

*

I

*****************

NO

•* PROGRAM *. YES *. NAME .*, *.SPECIFIED.*

*.

II


it

"'****03**********

*.

I :....".1.......:

.*

*..*

*****85* ** ** ** * **. YES

* •• *

** ..... *

*****************

I II

*.

I

:*::* :-> I

I :* I GNORE O~~~ ~OC~~~~ : ANY OVER* 1

....

LINECNT= *. QUOTE

it

AREA

PRSOUT

I :....".1.......: *

.-.

.*

*****************

I*.~~MMA PRESE~!.*

II

.*------>*.

V

*

* •• * ... YES

I

.*

YES

PRS25

OPTIONS .* *.SPECIFIED.*

v

*..*

.*

84

.*

NO

:*~: . :-> I ~::::~~~i:i~::~"~

I

•*

NAME= OUOTE

*.

* •• YES *

I NO.*

*.

.. **"*..

v .*. *•

PRS23

....

.*

*.

****4************

C2

.-.

I

v

*. .* ...

.

*

*** .. J 3*" ** * ** .. * flETURN

*

NO

v

.. **** * 03 * * *

*

Section 2:

Compiler Operation

63

Chart AB.

DDNAMES

.--:.::.:l "

·· . ·A2·***····· DDNAMES

*

v

.. INSERT "ENTRY INTO DCB : FOR SYSIN



... *******.****.

I

I

v

1

I

... ****.**********

POINTER TO SIXTH ENTRY

I I

.

v

*if*"*C2**********

.*

" DB TA IN .. "LENGTH OF DATA. .. SET NAMES

*.

* 1·* . . . . . ***.

...

*.

".

... ... .. -

II

DOES

.... ... "

NO

-,,-*---------..1'

. ..

YES

.

ADVANCE LIST POINTER TO F uiST ENTRY

" .

I

1

V

• ... ···E4***** ... ****

I I .·I···E]····. •·· .

" RETURN"

I

V

..*MOVE

"

POINTER TO" SEVENTH ENTRY :

:

"............. ***** ••••"

I

•*

I I

*.

I

...

I I

*.

.. " :

:.... "::* :->1

•• H2·· .. ••• .. ••• ...·'· .. .. MOVE POINTER TO FIFTH ENTRY

V

• ·**.H4·· ••

...................

:

..

I

_. -

,,_

DOES

...

EX 1ST

*. NO

.4

It.

.*

* •• " YES

....I .. V

A4

...

..

RETURN

" .. :

··.** .

• •••••••• ***.**

v

64

YES

DDNMOUT

..

• " - - > , , H4

..

"

....

...

.. ..

.....

... ***************

I

"

..... I

.*

NO

. * - - > * H4

" INSERT "ENTRY INTO DCB : FOR SYSPCH

V

"..

*.

.*

V

..

.................

*.

.. .*.

I

INSERT "ENTRY INTO DCB : FOR SYSLIN

ENTRY

*.

DOES

•". . .··.G4· ••• ••· ... "•

··***G2**······**

""

.. _

."

"

v

.*

I.

V

F4

ENTRY EXIST

I

•*

YES

"ENTRY INTO DCB .. " FOR SYSPRT "

I

J2

"

"..**···04."******** .... INSERT

I

..

..

....

I

...... E2*.** ....... ** ..

..

. " - - > * H4

I

I !

.

*. NO

.*

V

.... *.

••.• ':IST EXIST

*.

...

ENTRY EXIST

"

-" -*. 02

it.

DOES

v

~.

I .... v

C4

1

...

··*.*·.

1

••• "• •• **B4" MOVE

I

.. .** ......

.. " :

- •• **.************

I

I

..

..

···**A4******"··'" ..

:

Chart AC.

HEADOPT ****A2*********

*

HEADOPT

**

************·It**

I

I

V

*****B2********** ** OBTAIN LENGTH ** * * OF HEADING * OPTION * *****************

I

v

.*. *. C2

****C3********* .* *. NO * * *.HEADING LIST .*-------->* RETURN * *. EXIST .* * * *..* *************** *. .* * YES I

I V

*****02**********

**

SET UP * CENTERING OF * PAGE HEADING

** * *

****************** I

I

V

*****E2**********

* *FORCE 119 CHAR ** LIMIT FOR * OPTIO"lAL HEADING *****************

I I

V

*****F2********** * SET * *HEADING ORIGIN * *AND LENGTH INTO* *PRINT MSG TABLE*

* * *****************

I II I

V

****G2********* * ** RETURN ***************

Section 2:

Compiler Operation

65

Chart AD.

TlMEDAT **iI'*A2*********

* * TIMEDAT * * * *************** * I

V

*****82********** * SET UP * * UNIT * * SPECIFICATION * *FOR TIME OF DAY*

* * *****************

V

*****C2********** * GET * * TIME AND DATE * * FROM SYSTEM * * SUPERVISOR *

* * *****************

I

V

****~D2**********

** INSERT * TIME INTO * HEADING LINE

** * *

* * *****************

V

*****E2********** ** INSERT ** *DATE INTO LINE *

*

*

* * *****************

I V ****F2********* * * RETURN * *

* *************** *

66

Form Y28-6638-1 Page Revised 11/15/68 by TNL Y28-6826 • Chart 04.1.

PHASE t - PARSE (Part 1 of 2) G0630

·.··A2········* ** IEYPAR ** • **.* •••• ***.*** *

** ••

* B4 * • ••• **

1

START COMPILER

***·*B4·*·******* .STA FINAL- BEA2. *-*-*-*- *-.-*-*-* *COMPLT POLISH. * *CLOSE DO LOOPS.* • MOVE POLISH. • .***************.

.

*



•• ****.**.*.*****

1

·*****C2*.··*.****· READ ONE CARD INTO • INPUT AREA •

THIS IS THE FIRST CARD OF THE FIRST STATEMENT. INITIAL COMMENTS ARE WRITTEN OUT IN THIS OPERATION.

* •••• ****.***

* -*-*-*-*-*,-*-*. PRINT OLD STMT * AND ERRORS * READ NEW * •• ** •• ******

1

GO'"

* ** ··F2*· *. *. *.* * * STA INIT-BBA2 * *-* -*-*-* -* -. -.-* * INITIALIZE • • FOI\ NEW ** • STATE~£NT ************.****

Gom 1 * * * **G2 * ** * * * * ***

*LBL XLATE BCA2* • -.-*-*-.-*-*-.-* * PROCESS LABEL * * * FIELD AND COL 6 * * * *. ** ** ••• *.*.* * *

j .*.

H2 •. • * LABEL *. YES. * OR *.• * COL 6 •• ERRORS ••

-_.. !

.. ..



•• *.

-_.. ! *.*.* * E2

*

*.. * v

. *.

*.

YES

. *.

...r*.. .. .. •.

)*

*• F4 ** .**. AT COMPLETION OF PRINT AND READ

~~U~~~6E~§~6 I~

ON SOURCE ROLL.

.*

.1 NO

C5 *. .• . * LAST * . *. NO *.STMT AN ARITH.*--•• IF ••

•. •.. *. *

[*

•.

.***

* .. *. * * YES

j

GO""

*****DS******.··* .PROC POL BGA2*

.-._.-.-.-.-.-.-.

• COPY POLISH • • ROLL TO AFTER • • POLISH ROLL • ••••• ****.**** •••

.*

NO

1 ***** * ·***·F4*.*******·

•• *

SET INDICATOR ** FOR READ * • COMPLETE *

·········1········. ···**G4··**···.** .PRT/RD SRC-BAA2* • -*-*-.-*-.-.-*- • *PRINT OLD STMT • • AND ERRORS. • * READ NEW STMT •

·*......1*·······

.... • •

• •• •BS ••• •

* .. *

****.. * E2 *

..

D4 *. LAST *. •• --*. STMT FLAG = • * • (END CARD). •

1

";~;;~5*;~~!~~;**

1 . * . *.

YES.. . *

*• E2 .-> * ***.* *

G0631

1

:*::*:

C4 •• LAST •. NO.. STMT OF •• SOURCE MODULE .• *. PROCESSED.·

*

1

STATEMEN'l' PROCESS

BS •• YES.. WAS •• --* • THERE AN END •• *. CARD •*

* .*** *

* •• * ·D2 **.* ** ***. * TURN ON FLAGS * * INDICATING * *FIRST STMT AND * • PREVIOUS PRINT * COMPLETE * • **.** ••••• ****.** ****

• B5 •

!

G0633

··**·B2······*·**

•* PROGRAM •* ·INITIALIZATION *

·

··.... ...... .. ...! ..

· .

1* NO

--.. .... .... 1 *..• :.:;.: 1. # 063003

•••

ES *. YES.. LAST •• STATEMENT A •• •. BRANCH .•

....

*

NO



G0642

**··*FS*········* .ACT END ST BFA2.

.-*-.-*-.-.-.-.-. * BUILD • .RETURN OR STOP • • POLISH • **** ••••• ** •••• *.

1

00""

*·*·*G5·····*·*·* .STA FN END BED~ • .-.-*-*-.-*-.-.-. .COMPLETE POLISH. * WITH STMT CNT • AND MOVE * •

;::::;::1*·····*·*

·..... · ·

. .

# 063004 ..···HS.*****.··· * PLACE * • END DRIVER ON * * POLISH •

Go.::······1········

*

G0636

.-.-.-*-.-.-.-.-.

•• ··*JS.······.·* .STA FN END BED5. • COMPLETE POLISH. * WITH STMT CNT • • AND MOVE • * •• * ••• * •••••••••

*··**J2··***··*** *STA XLATE- BDA1* *-.-*-*-*-*-*-*-. * PROCESS * ENTIRE • • STATEMENT * * * ••• * •• *.*.******

!

*•

1

•• *** .oli.2.

**** B4 **

• B2·

• *

***** *



section 2:

Compiler operation

67

Form Y28-6638-1 Page Revised 11/15/68 by TNL Y28-6826 • Chart 04.2.

PHASE 1 - PARSE (Part 2 of 2)

•••••

• •••• • • B3 • ••••• •

·01102· • B2.

•••

.. J... .. .. .. .. .. B2

11

. . ..................

631U ••• B3.t •••••••

•• XTEND •• YES • CLEAR RESli:RVE • •• LBL ROLL ••-------->.MARK FROM XTEND • • • RESERVED •• • LBL ROLL •

: . ; : . :->1. NO ~

••••• •

063118 .·.··C2· •• ••••••• • REMOVE • • GROUP FROM .XTEND LBL ROLL •



• ..ON SCRIPT ROLL,. •• EMPTY • • • RELEASE • •• •• • IND VAR ROLL • ••

02

•••

••

••

'0 0:0

········1········

1 .... .. .. E2

•••

••

~063119

.. . . --1 .... .. .. .. .... E3

•••

••

Ell

•• END •• YES •• TEMP •• YES •• OF DO LOOP •• -------->.. ROLL EMPTY ••

•.

..... Fl.......... •

! • •

GR~~O~~OM WORK ROLL

.•

.*

or

F2 ..



•• GROUP ••



•• POINT. •

:l.

1063581.'.

••

. ' IS '. LABEL • • PR2VIOUS •• •• TARGET . ' ••••

NO . '

.

....F3···.·····• RETURN (EXIT TRUE) • ••••••••••••••



0'. .... '. .. .-------->..····G3·.·.·..··.

.' •

.

'.

CHAR A ZERO

•• YES 0



R2TURN (EXIT TRUE)

• •

•••••••••••••••

•••• ' .. ' • NO

1 • ........ 1'.......:•

(SYNTAX FAIL' ·····H2·········· • SYNTAX MSG TO • • ERROR. ROLL. •

:A~S~~ ~8~fs

·····J2·········· • ........ 1"......• • • • •

SCAN TO NEXT NON-BLANK CHARACTER

• • • •

:

···.K2······.··

:

(EX~T~SE)

•••••••••••••••• • Section 2:

Compiler Operation

70.1

Chart BD.

PROCESS STATEMENT

G0636

* *

*

·***AI"**"***·* * STA XLATE

***************

*****A2**********

..*

...

...

...

.*

A3

.*. *.

*.

SAVE * .* ASSIGN- *. NO *------->* LOCATIONS OF *------->*. MENT TYPE . * 1 * * WORK AND EXIT * *.STATEMENT.*

*.. .. ..... *

i

*****************

.*.

YES

V

*****B2********** *****61*********.

*

*

RETURN

***************

:

*

·**·C2··***·*·· * RETURN • • ** •••• * •• * ••••• •

*. *.

POLISH .* ••

Dl

NO· •• -------->.

THIS FLAG ON INDICATES ONE OF THE STATEMENTS WHICH MAY NOT TERMINATE 00 LOOPS

•. ••

..

*. . *

.•

••• "'* *

..

..

.••

El •. .• DATA ON •. NO • • THE DO LOOPS . *-------------------------------~-----------------------*.OPEN ROLL ••

*.

.. ..

.*

r~

• •



PUT POINl'ER • LABEL ON POLISH.

TO

.... ....

· . •••••••••••••••••••

i

1. E1 •

72

PUT STM'l' NUMBER ON POLISH

• • •

...____________________J

1

NOTE THE TEST COMPARES STA LBL PNTR .WITH THE GROUP FROM THE ROLL

• •

. •• E4 .. . •• Y E S . ····E5········· • •• . THIS STMT •• AN ARITHMETIC •• -------->. RETURN • •• IF.· • ............. . •

••• • *. ••• 1\063377 Gl •• G2 *. G3 *. *****G4****** ••• * .••• .*.. .• *. • * •• THIS *. YES •• INNER •• NO •• ANY *. NO * CLEAR * •• STMT TARGE'I' • *------.-->*. DO CLOSED •• --.------>* • TRANSFERS OUT •• -------->*XTEND LBL ROLL * •. OF LOOP •• •• FLAG •• •• OF LOOP •• • • •• •• •• ON .* • . . • • • SEE •. .• •. .• * .. * ••••••••••••••••• NOTE

: B4 : *...

.

G0634 • •••• 05 ••••••••••

.

·····F4·········· .MOVE POLISH F O R . . • STMT TO AFTER .------->. • POLISH ROLL • •

.

.I:

STA FINAL END

1'0

• ····Fl·······'**· * MOVE ONE • * * • G~OUP OFF THE • * ROLL • ••• * •• * •••••••• *.

·

YES

•. ... *............• •. ...............•.

:.::.:->1. NO 1\ Ob330l

·

1· . . .-------->.

• ••• *04..........

YES * . JUMP FLAG ON •• ------ ----------------------.---------------------------->

*.

•·BE ••••• ·D5 • •• •

................. 1

.063378

• •••• J3 •••••••

_____ •



:C~E~N~HGogN· • *

*. BRANCH *.

*. .*

*

I

.*

.*

****B3*********

RETURN

*

*

***************

NO

v

.*

.*. *. C2

*****C3**********

*.

*

.*SUBPROGRAM *. NO * *. BEING • *--------> * *.COMPILED .* *

*.

I

* •• *

.*

YES

BUILD STOP POLISH

*

* *

*

******************* I

*****02********** v * * ****03********* * PLACE * * * * RETURN DRIVER *-------->* RETURN * ON POLISH * * *************** *****************

Section 2:

Compiler Operation

73

Chart BG.

PROCESS POLISH G0844 i·***A2********* PROCESS ** * POLISH * ***************

*

II

V

*****B2********** ** ** GET NUMBER * OF WORDS ON * * POLISH ROLL *

* *****************

I,

V

*****C2********** ** PLACE ** *COUNT ON AFTER * * POLISH ROLL * ******************

I I

V

*****02********** ** COPY POLISH ** * ROLL TO AFTER * * POLISH ROLL *

* * *****************

I

V

*****E2**********

* * **RELEASE POLISH ** *

ROLL

*

* *****************

I v

****F2********* ** RETURN **

* ~************** *

74

Form Y28-6638-1 Page Revised 7/23/69 by TNl Y28-6829 • Chart 05.

PHASE 2 - ALLOCATE (Part 1 of 2)

G0359

THE ROUTINES CALLED IN PASS 1 DETERMINE THE NUMBER OF BASE TABLE ENTRIES

~RUUID

OBJECT MODULE

~U',JSPER-

FORMING SOME INITIAL ALLOCATION

Section 2:

Compiler Operation

75

Form Y28-6638-1 Page Revised 1/23/6~~ by TNL Y28-6829 • Chart 06.

PHASE 2 -

ALLOCATE (Part 2 of 2)

----------t ·····BII ••••••••••

:REL~~~A~gLLS, : DOUBLE~ORD

• • •

• • •

. · . ·T··. ·. BOUNDARY FOR BASES

••••• CII.··· •••• • •

• CALCULATE BASE • • AND DISPLACEMNT. • FOR TEMP AND • • CONST ROLLS •





...::......1"...... .-.-.-.-.-.-.-.-. ........1........ ••• ··011 ••••••••••

• BLD AD

BS-C~A2



BUILD 3 BASES. FOR TEMP AND • • CONST AREA

• • •

•••• ·EII ••••••••••



• PREPARE FOR • UNIFY PRASE

• •• • •

•• ........ 1"......

·••••••••••••••••.• • • •• FII •••••••••



76

IEYUNF



RELEASE ROLLS

Form Y28-6638-1 Page Revised 11/15/68 by TNL Y28-6826 • Chart CA.

MOVE BLD NAMES TO DATA VAR ROLL

GOSII3

• • •

....A3··.······

••• ·A1····.· ••• ALPHA • LBL AND L • SPROGS •

. . . 1··. .

• ALPHA • SCALAR ARRAY • AND SPROG

.......1'......

••••• Bl •••••••••• • RELEASE DATA • : g~Rp~~k~ERS~ : • NEW GROUP ON •

........1'....... • •••• C3 ••• • ••••••

••••• C1·· •• • •• • ••

• •

• • •

:• TO LBL ~~IN¥kR : ROLL. •

;:~::;~:l·········

••••• • ••• ••

••

D1 •• •• ENTIRE ••

~S

ALPHA L SPROG • •••• 02 •••••••••• • SAVE DATA VAR • .ROLL POINTER AS.

•· •. H~C~~~~D .• '·-------->:• •• •• .•... E1..........

• •

Pg~~U!k~ FUNCTIONS

:•

········1········

'"1"=0

• •



••••• D3 ••••••••••

.A/D VAR RL-CAFII. .-.-.-.-.-.-.-.-. • MOVE • • SCALAR NAMES TO. .DATA VAR ROLLS •

········1········

.•....E3····.··...•



• • ········1········

• •

········1········

········1········

••••• •

•••• •• •Gil ••••• ••

••••• •

SET UP POINTER TO SCALAR ROLL

. .... E2 ......... . ••

•• ••

• MOVE NEXT LABEL. • SET UP • T.O • • POINTER ROLL • DATA VAR ROLL • •

• 01 •

••

·. ·. ·1. ·. .

• •

••••• • • •

·r·

• BII •

••••• B3 •••••••••• • SAVE • • DATA VAR ROLL • • • POINTER AS • POINTER TO • • SCALARS •

:.~~,t.¥I'.lSit;:

• SAVE POINTER • TO LABELS.

• • •

·.·.·BII···· •••••• .A/D VAR RL-CAFII. .MOVE SUBPROGRAM. • NAMES TO • • DATA VAR ROLL •

.-.-.-.-.-.-.-.-. ········l········ • ••• ·CII·· •••••••• • SAVE DATA VAR • .ROLL POINTER AS. • POINTER TO • • USED LIBRARY • • NAMES •

········1········ ·····DII •••••••••• .SET UP POINTER • • TO USED LIB • • FUNCTION ROLL •



•••••••••••••••••••

!

•• •••• • Gil •

••••• •

• SAVE DATA VAR • .ROLL POINTER TO. ARRAYS • •

F3··········• •. ....SET UP • PO:::NTER TO • ARRAY ROLL • • • ········1········

• • •



• •• ·FII.· ••••••• • ALPHA TO • • DATA VAR ROLL •

::~~:;::'I....... •



••••• •

.-.-.-.-.-.-.-.-. ••••• G3 ••••••••••

• A/O VAR RL-CAFII.

•• ARRAYMOVE NAMES TO •• • DATA VAR ROLL •

........1'....... •.•.·J3.·•.•.••..• • • SET UP POINTER • TO GLOBAL • • • SPROG ROLL •

V

.... ....

r

········1········ ••••• H3· ••••••••• • SAVE DATA VAR • • ROLL POINTER AS. • POINTER TO • • GLOBAL • • • SUBPROGRAM

...

Gil •• •••• • •••G5 •••••••• • •• ENTIRE •• Y E S . • •• ROLL •• -------->. RETURN • ..PROCESSED.· • •

...............

• ••• ·HII •••••••••• • MOVE NEXT NAME • • (8 BYTES) • •• DATA TO VAR ROLL ••

········1········•



•• •••• •• ••G4 ••• •

• • ········1········ •• •••• • BII • ••••• •

Section 2:

Compiler Operation

77

Chart CB.

PREPARE EQUIVALENCE DATA

G0362

.*....

* .. *~~~~ *~~~;~*** ... * *

AND PRINT ERRORS

*************......

A2

.*. *.

* .....

... ****A3****ir ... *** ...

NO

* - - - - > ... EQUIVA LENCE . " - - - > * * *. DATA .* *

**. .* •• * *YES

... ****. :

RETURN

***************

I

:->1

82

****

v

*****82********** • CALCULATE ... OFFSET FOR * EQUIVALENCE ... VARIABLE AND

* ... ... ...

:****~~~~~~*****:

I

.". *. *. V

.*

C2

*****C3**********

...

...

•* BAD *. Y E S " ... DEFINITION .*--->*RECORD NAME AS ... *. .* ... ERROR ... *..* ... .... • * *****************

*.

I

.. NO

I I 1. NAME + ERROR *. ROLL.. • TYPE

...__ it • • • __ * __ "'_._._...

•• **. .** * NO

...I

I

. . V

.***

V

*36101

•* • *

G2

BECAUSE ALL EQUIV DATA MUST BE IN COMMON

••

:

F2 :

*•

*. YES'" .. *.DATA ON ,ROLL .*-->* F2 * *. .* ......

*.

MORE

.* * •• * • NO

I

V

····**J2****·····** PRINT BLOCK DATA ERRORS

* •••• * •••• ***

I

V

*****• ·06 .. 84. • • •

RELEASE ROLLS

Section 2:

Compiler Operation

79

Chart CD.

PREPROCESS DUMMY DIMENSIONS G0.365 • • "

··."'A2**"******

PREP DMY 0 1 M . AND PRINT " ERRORS •

•••• ** .... **** •••

I I

1 V

** .... *82 ... ••• ... *** ... •

"

INITIALIZE POINTER TO APPRO ROLL

*..

I I

• *.**. :

CHECK DIMENSION

DMY

:->1 .... **

v

...

*.

•••

...

C2

G0367 ....

ALL ARRAYS

*.

*. ... "

YES

....

.*---->*.

...

ANY GLOBAL

... *.

02 NEXT



I

:

••

... *.

DUMMY

"D!~ENSIO~;." -. ... ...

03

NO

.*--,

I

." ". OF

•* ••

•*

E2

*.

ARRAY

*.

*.INCOMMON

*..*

. .

"

I

ANY"

"

PNTR TO ARRAY" ON ERROR ROLL *

I

AS

" " "

" 03 "

••

E4

..•

"

PREPARE " .TO PROCESS NEXT" ARRAY

..

... **-***_.** ••• ***"

I

.... I v

" "-

C2

." -

"

-* -**- "

._.*

"

""*.

#36704

.*

..... " 03 " ... ..

*-> I • I

A

I I

v

E4

.".

*.

ANY

.-MORE

#36705

*.

ARRAYS-.

".WITH DMY

*. IN THIS •• LIST .* ... •• * "

YES

I

.*

E5

.".

YES

*•

MORE

"NXT ARRAY-MUST" *aE DMY I N SAME " "LIST OR IN COM-"

:.:~~.~~~*~~~~~*:

I

I v

"

" E4.""

*•

- •

DUMMY."

LISTS

*..*

* •• * "

NO

*"L,,*

V

*** •• F4*-**"**".. • CHECK DMY DIM"

"

NO

.*

."---->". *. .*

DIM

****

V

*** ••• .. *

ITEMS ROLL

,,*L,,*

"'·*·"G2**·*·*****

80

IF

U4** ••

RECORD MARKER ON NAMEL J S r

*->1 "I

*36602

It

DMY

..

** •• * .. *******,*...

*.** ••• **** •••• ** I * I it

...

*

NO

RECORD ARRAY NAME ERROR

G2

"

WITH DMY DIM

I

n

"

."--->".. .*

YES

"

********.• ******** I .. **** .. I

NO

CLASSIFY NXT

*.

..

---->" :

I I

..

v

it • • • •

••

• ..... E3* ....... ·... ***

"****F2**********" " "

*. YES

* •• *

......

* •• *

~

#36703

*.

V

A DUMMY OR

"

*.

END A DUMMY

•••• LIST ••••

.. G2 ..

.".

RETURN

** ..... *-* _.

.*...

\I

.". 03

v

YES

****C5*********

.

" ---" ->"

YES

:-> I

... - . ' .

••

ERRORS

"j

*36702

."ARRAY HAVE

PR I NT

Io..* ... •• -

NO

V

.

.... NO .... - - - - >

*. OUMMIES .*

*

•*

"

·*****C4**********.

... .

. . . . ..

"..

I I

G0418

••• C3

...

•• PROCESSED..

....

C4

"

C2

#036601

.. --

"

..

C4 "

*

.*

Chart CE.

CHECK FOR UNCLOSED DO LOOPS G0371 "****A2********* PROCESS * DO LOOPS ***************

I I I

V

*****B2**********

**

** FLIP THE * DO LOOPS OPEN * ROLL * * ***************** **** :

C2

I :->1

* **** * V #037101 .*. #037102 C2 *. *****C3********** .* DATA *. * * .* ON THE *. NO *SET UP HEADING * *.DO LOOPS OPEN.*-------->* FOR DO LOOPS *. ROLL.* * ERROR LIST * *. . * *

* * *****************

YES

I I

V

I

V

*****D2**********

******D3***********

** MOVE BAD ** *LABEL TO ERROR * * * LBL ROLL

PRINT * DO ERROR LIST

*

******************

v .*.

I

E2 *. .* UNDE- *. .*FINED MARK *. YES *. ON LBL ROLL . * 1

*.

* •• * *

I

.*

PRINT ERROR LBL ROLL

*************

I II

*.

*

V

****E3********* RETURN ** * *************** *

**

.*

v

NO

****

** *

I

C2

** *

V

*****F2**********

** SET UNCLOSED * * *DO MARK IN LBL * ROLL GROUP * *

*

*

*****************

I

v

**

*

C2

**

*

Section 2:

Compiler Operation

81

Chart CF.

CONSTRUCT BRANCH TABLE ROLL

G0372 .... **A2 ..... ·.. • ...... • .. • "PROCESS LBL AND' : LOCAL SPROG "

.. ***** ... ** ... * .......

.. **** "

I

.. 84 ...

I

V

" "

FLIP THE LBL ROLL

..

C2

**.....

"* •• *.* .. *.********

J

I

:->1

•• ....

I

v

1037201

.*

V

.". C2

".

DATA

••

ON THE LBL



"SET UP HEADING" .. FOR UNDEFINED" " LABELS ..

*----,

I

.... • * ..

·····C4····*····· " "

*. NO

".".ROLL . " . "

v

YES

.......

"" Bil .." " **** "

I

I

V

V

** ........ 02 ... **** .. ***u

" "

•• ** •·.. 04·· .... ** *.*.*

..

MOVE LABEL TO WORK ROLL

*

.. .. ..

"***********.*****.. "

"

V

.*

".

••

.".

*.

LABEL DEFINED

*..*

*****E3**.*"*.***

..

..

YES " SET FIRST 1/2 * .*------->".. GROUP BYTE OF LABEL" TO ZERO ... ... .. ************-****

". ....

*. •• "

.

_037202

*.

NO

V

" "THE "

FLIP LOCAL ROLL

"

I

"I "->1 " ...... " IV

I

"

V

Fil

*037207

.".

*.

*..* I I

.. **** " "

"

.*

G3

.". ••

*.

*.

* •• * ..

H3

I " ,,->II

*037203

V

""

..

.*

.*

..

."1 NO

.. :

"

.***

..

K3

..

.. I

V

"MAKE NEW BRANCH" .. TABLE ROLL .. " ENTRY AND RETURN PTR " TO IT "

••• * ... ** •••• *.****

*****.****** .... **

I

I

I

I

V

V

·····J4······· .. ··" ..

.... • .... J3 .... • .... • .. •• .. • REPLACE " .. LABEL GROUP " 'W I TH PO I NTER TO. " BRANCH TABLE "

.. PUT POINTER " "ON COMMON DATA" .. TEMP ROLL ..

·............. __.........."

..

4 ••••••

V

I

..

..

**** .......

MOVE

"

" :: GROU~O~~ TEMP : ,

....

*• ................ **"

vI

:

82

**** •••• **

I ....... .. "

:*::":-> I

-

C2 :

I

V

···*GS·****··*·

*".*"*"*"""""*"

**·**H4*****·****

*

..•

..

I I I

*

"MAKE NEW BRANCH" .. TABLE ROLL ENTRY AND RETURN PTR " TO IT "

*037205 V ••• ... ·K3* ..

I1 ****....

MOVE N E X T " " • GROUP TO "RETURN"

"...

·****H3***** ..........

,,-""

I

1 1

CENTRAL AREA

v

YES

..

.. ROLL • ****.*** ••••• ****

II *.

COpy THE

"COMMON DATA

."------->""THE TEMP ROLL TO " LOCAL SPROG"

YES

V • • • • • G4 • • • •

•" JUMP ". ".TARGET LABEL

THE TAG FIELD OF THE POINTER STILL INDICATES THE TYPE OF LABEL

..

NO

* •• * "

..

*****FS***** •• ***

." ON THE ". ". LOCAL SPROG ROLL.*

:~~:~:*~~~*~~~~*:

K3

*03720B

F4 *. .* DATA *.

CLEAR it FIRST BYTE OF it LABEL .. GROUP-MOVE TO ..

"

" SPROG" ..

" * ...... * •••• **** ••

""'***F2********** " " " "

PRINT ERROR LBL ROLL

I I I ····*E4**······· .."

I

E2

PRI NT UNDEFINED LABEL LIST

**.**********

I

II •*

..

COpy TEMP ROLL TO LBL ROLL

" "

"

:

V

*****84**·*******

.. *.**************

.. **......

I

*037206

.•

*****82*"*******'»

"

"

"

F4

..

"

Chart CG.

ALLOCATE HEADING AND PUNCH ESD CARDS G0374

*

·***A2···****** BUILD * PROGRAM ESD

:

••••••••••••• ** *

:

*

84 :

****

I

V

V

*****84*********-

·****B2**********

*

*

*

*

SET * UP FOR LD ESD :

• :

INITIALIZE

* * *****************

* ***.*.***********

1

V

******C4*********** •

PUNCH PROGRAM NAME AS LD ESD

*************

•*

02

v .*. *.

*****03*********.

DATA * . . * SET UP * • * ON ENTRY *. NO * PROGRAMMER * *. NAMES .*------->*SPECIFIED NAME * *. ROLL.* * IN CENTRAL *

*..* * •• * * YES

11037401

...

..

I

*************.***

**~***

I

V

*****E2**********

*.FL I P

THE ENTRY * * *NAMES ROLL AND * *MOVE ONE GROUP * * • OFF *****************

* *

G2

* ...

·

.*.**ES**********

..

..

*****************

1

V

******FS*****~·***4

*

PUNCH ANY REMAINING ESD CARDS •

*************

I

1

I

. ** * *

*037406

*.

*****************

I

V

*****G4**********

* ADD • BLANKS TO * • • NAME. ADD ENTRY. • CODE TO PROG * * BREAK *

V

*

·***GS********* RETURN



*

*****************

1 V ******H4***********

1 V *****H2********** PUT PROGRAM NAME IN PUNCH BUFFER

.*. *. v

E4

... COpy .. .* DATA LEFT *. NO • COMMON NAME •• ON ENTRY .*------->* TEMP ROLL TO * *. NAMES .* *ENTRY NAME ROLL* .*

V

*****************

*

****

*037405

* MOVE GROUP TO * CENTRAL AND COMMON NAME TEMP ROLL

* PUT J SYMBOL * *IN FIRST BLANK * : OF NAME :

*

I

:->1

i'"

*****G2**********

**

E4

*****F4**********

*****************

V

:

* •• *

• SAVE * .GROUP ON COMMON* *NAME TEMP ROLL.* ADD BLANKS TO NAME *

(::::-,1

:*****~~;:~*****: .*****

*..*

1 V *****F2**********

1037402

1 V *****04*********-

• ADD • • LENGTH OF • INITIAL PRDG • .CODE TO PROGRAM*

PUNCH ESD

*****************

*

PUT ESD IN BUFFER-PUNCH IF COMPLETE

****~~~~*****

*

I

V



1 V ******J2***********

*

PUNCH PROGRAM NAME *

* *

**** E4

* *

*

PUNCH REMAINING ESD

*************

I

V

* **** • * B4 * * *

Section 2:

Compiler Operation

83

chart CH.

CHECK ASSIGNMENT OF FUNCTION VALUE GO 376

"

• ... ·A2***··**·· FNTRY

NAME

**:;;~;:!!~~ ••.

.... "

I

I I I v

.*

82

... *.

." ".A

.*.

."

...

SOURCE ". SUBPROGRAM

...... "

... *.A

~037603

.*

C2

... ".

NO

"

... ."---->".. •*

• ... ·33 ..·• ...... •• ... • RETURN

....

YES"

... .*---->.... ."

··.·C3·

V

1 •••••••

..

"

"

.****.** •• * ••••• *

I

I V

I



'SET UP HEAD I NG " FOR FUNCTION .. ERROR LIST

4-

,,->1

I

" IV E2

V

··***·E4**· .. •·.. ·****

". -It •

.. " DA TA ON ... NO ".. THE' E>lTRY • "----. "NAMES ROLL."

*.

... ... . ...

*

PRINT FUNCTION ERROR LIST

YES

I I I

I

"" " 84 .. ""

I ..... F2··········* *

I

V

V

"

"MOVE NEXT GROUP" * TO THE COMMON .. "NAME TEMP ROLL ..

......................" "

..

"

G3

••• *F4·*·****** RETURN

*..

..

I

G2:

.".

*.

I

#037602 :I.

... ...

V

• • • • • G3 • • • • •' .......

...

..

• " SCALAR ". ". WITH SAME ". NAME."

YES

.*

..

" S E T MOOE OF SCALAR IN .. POINTER

.*------>"

.."

................ .

"

I

NO

I I I

I

V

··*·····..

• ••• ·H2· .. .. REGISTER NAME • OF ENTRY FOR .. ERROR LIST

"

* •

......... ......... "

I

·····H3· . ••······ V

*

PUT POINTER *ON COMMON NAME TEMP ROLL "

I

I

V

..

ADO

..

" SCALAR ROLL " *GROUP FOR ENTRY' " NAME - DEF I NE *

" .................

....

* G3 .. * * ••• *

..

" ..

..

II

II

·····J2··········

*"

.." *.* *.* ........... .

I I

84

" "

• •• **** •••• **** ..."

.".

•*

*

I

*037601

.*

··*·

• •• ·*D4**·.,.** ..

.... *.** ••• * ••••" E2

SYMBOL ON EOU I VALENCE ROLL

V

~OLL

~...

** •• *C4 **.* *. *** .. * * " PUT A MARKER " " ..

RETURN

FLIP .. ENTRY NAMES"

,."."

I

V

I

*.

I ·····02· . *~·*··*· " *~

*

I

NO

.. "rHL ..

*



: •• ~:~;;*~~;;.**:

StJl:3ROUTINE

.... *

1:34

··.··04*·······** * COpy THE * * COMMON * "NAME TEMP ROLL * * TO THE ENTRY •

YES

." .*.

....

V

•• •• ·J3 •••• **· •••

*

* ADD SCALAR " *TO EQUIVALENCE" * ROLL

.. .... ******.**.** ••

I ...... V



..

*

~2

*

...

*

ALL TO

ENTRY NAMES A FUNCTION ARE EQUIVALENCED

PRINT ERROR SYMBOL ROLL

chart CI.

COMMON ALLOCATION G0377

"

****A2********* COMMON " ALLOCATION

***:~~*~~!~~!****

"" "

I

I

v

"

.".

.*

C2

*.

: ....... *~~;i~ ** .. **:

I

V

#037709

..

CLEAR

I

v

"" MOVE NEXT "NAME TO COMMON " AREA ROLL " "

"

.*********** ••• **

:"::":-J .*

•*

"

v

[2

*.

END OF

£'3

.*

*. YES

"I V

.*

.... E3

*.

MORE

*.

.*

* •• *

...

...... * •• *

.. NO

ALREADY ON COMMON ALLOCATION ROLL INDICATES THIS

.*

*.

•*

F2

I I

*. *.

NEXT

.*

*. NO

IN

". ANOTHER ." ".BLOCK."

.*--,

I

I

F3 ... NEXT

LAST

".::LOCAT~~."

I

I

I

1 V ···**G2*.****.***

1

I " I I 1:

#40104

*.

.*---->

.*

..

PRINT ANY PARTIAL LINE

..·*C4 ..

·····*** "

RETURN

*.* .. *.******** ..

NO

V

.". * •

02 NEXT • " ARRAY IN ". YES ". COMMON EQU I v •• " - - , ".~~ DUMM!"..

•*

*•

I

* •• * ..

NO

""

I

"

v * .. *. H2

"" "

V

*****E2**********

"

"

ALLOCATE " STORAGE AND " "RECORD LOCATION"

" *** •••• *.*.***" •••

I V

*****F2*··*******

" • " "

·

ENTER • INFO IN ARRAY • MAP. PRINT " COMPLETE LINE.

••• ***********.*."

1

.... " *G2*·········" V

" CALCULATE AND " "RECORD BASE PTR" "AND DISPLMT IN • .. CENTRAL "

***.* ••••••••••••

:,,::" :->I *.*. V

'040102

•••

•*

•* ". *.

H2

*•

PASS

1

*.

*•

.* * •• * .. NO

*. YES .* . " , v

••• *

" " ..

I

K2

".. "

····.*J2····**·**· V

"" REPLACE GROUP ""• ON ROLL .. " " •••••••••••• ** •••"

::::::->1 .... " ·K2*·········"

*040103

v

" PREPARE " "TO PROCESS NEXT", " ARRAY •

"** •• * •••••••

**... .... " " "

v

:

C2 :

Section 2:

compiler Operation

89

Chart

co.

ADD BASES FOR SUBPROGRAM ADDRESSES G0402 ****A2********* * PASS 1 GLOBAL * *SPROG ALLOCATE *

* *************** *

I II

V

*****B2**********

** *

ALIGN TO FULL WORD BOUNDARY

** * *

* * *****************

I

V

*****C2********** *DETERMINE BASE * * * PTR AND * DISPLACEMENT * *FOR PRESENT LOC*

*******************

I I

V

*****02********** * COMPUTE * * LENGTH OF * * OBJECT MODULE * *SUBPROGRAM ADR *

* * *****************

I V

*****E2********** *COMPUTE LENGTH * OF OBJECT * MODULE * * * SUBPROGRAM * ADDR * * *****************

I V

****F2********* * RETURN ** ***************

90

BUILD ADDITIONAL BASES

chart CP.

ALLOCATE SUBPROGRAM ARGUMENT LISTS GO~~2

* *

****A2********* SPROG ARG. * ALLOCATION *

* *************** *

v .*.

B2 *• •* *. ****B3********* .* ZERO *. YES * * *. ARGUMENTS • *---------> * RETURN *

*.

*..*

.*

* •• *

*

*

***************

*

NO

I V

*****C2********** ** ** ALIGN TO A * FULL WORD * BOUNDARY * *

*******************

V

*****02********** * DETERMINE AND * * SAVE BASE PTR * * AND DISPLACE- * *MENT FOR START * * OF ARGUMENTS * *****************

V

*****E2********** * INCREASE * * PROGRAM BREAK * * BY SIZE OF * *ARGUMENT LISTS *

* * *****************

V

*****F2********** ** CONSTRUCT ** * REQUIRED BASE * * TABLE ENTRIES *

*******************

V

****G2********* ** ** RETURN

* *************** *

Section 2:

Compiler Operation

91

chart CQ.

PREPARE NAMELIST TABLES G0443

·.·.·A2*········.

.. ..

PREP

"

NAMELIST ••••••••• * ...... •

I

I I

·.•·.·82···. ······ V

"

.*

• FLIP NAMELIST .. • NAMES AND • • NAMEL I ST t TEMS ..

••

: •••• *~~~i~ ••••• : C2

••••

*.

B4



B4

...vI

••

*.

* •• *

....

1044307

*.

• •••• C3 • • • • • • • • ....

..... " COpy THE ." DATA •• NO "COMMON DATA -• • ON THE NAMES • " - - - > , , TEMP ROLL TO ". ROLL.. "NAMELIST NAMES

** . . ** ••

" " .. ..

... ROLL • •••••••••••••••••

C4

.".

.". ···02···. ······. ALLIGN TO FULL WORD BOUNDARY

I

.

V

···*OJ···· .. *·** ..

..

RETURN

"

:

*

I

V

" .. • ..

................... I "I :->1 v

41044306

*.

• ••• *H3 . . . . . . . . . . ..

....

...

NO

MOVE

MARKER

"SYMBOL TO NAMELIST " ALLOCATION

..

."---->"

:****.~~~;* ••

*. * •• *.* "

J2

.~

....

YES

I

****·J3···*·····*"* V

" •

DEFINED

".

... ... ..

"

YES ." . " ,

••

" INCREASE if .. PROGRA,.. BREAK .. BY ENTRY SIZE"

I

v

NO

....... ..

,

..

I

""

I

84

·.···K2·········· "..

.. ..

"

"

REGISTER" .. VARIABLE AS A *--, " SCALAR

••••••• * ••••••

: •••• ~~*:~~~ •••• :

..

V

"I

*....

._.v

" .. "

92

**.:

I

• * ALREADY "'. *.

• • ****

NO

**.**04 ... ** ...... ***

I

ENTRY

************ ...... ***

V

:.*.!;~~.~~~; ••• :

" INCREASE " PROGRAM BREAK "BY 16 PUT ZERO " ON WORK

...

" *.** ..

V

"OETERMINE BASE " POINTER AND "DISPLACEMENT " FOR PRESENT

• •• *"'cs********·*

* •• *

~** ...... ** ........

" MOVE if "NAMEL I ST NAMES .. • ROLL GROUP TO " " " COMMON DATA

H2

05 : 11044304

*.

v

I ·····E2··········

:

:

I

iII· • • • • • __ . . . . . . . . . ...

..

v ... * ........

*..* *

·

YES

." *. " DETERMINE " •• ". YES .. NUMBER OF " ". AN ARRAY •• ------->*DIMENSIONS FOR * *. ." " SIZE OF TABLE"

I

.. YES

+

'.1

*.

.*

v

v

C2

.*

I

:->1

*044301

*.

A SCALAR

... NO

........ I :

....

"

B4

"..

"

(2

"

..*

**** " H2 :

chart CR.

ALLOCATE LITERAL CONSTANTS G0444

****A2********* *L I TERAL CONS T. ALLOCA TI ON :

* :

* **** •

***************

:

I

I

·

I

.

V

V

******84***.******·

*·***82*********·

* INITIALIZE • .PTRS TO LITERAL. * CONST ROLL *

MOVE LITERAL .TO OUTPUT AREA • PUNCH I F CARD * CORRE.CT *

*****************

.**.*********

I

.**.** :

C2

****

#044401 THE PRESENT POINTER IS COMPARED TO A POINTER TO A NEW GROUP

84 :

•* ".

:->1v C2

I

.*. ••

.*

V

..• *** *C4 ** ** ** *** .. PUT BASE PTR •

*.

*

ALL *. YES CONSTANTS .*, * .PROCESSED. *

*.

i

... • *

. ..

AND • .DISPLACEMENT ON* • LITERAL CONST

*

:* •• **~~;;.****.:

v

NO

I

(::":

V

*

V

:

.* .... *D2 * ... *** **** *

• * *

COMPUTE AND SAVE PTR FOR NEXT GROUP ON

* *

I

* • •

.*

I

****

* •• *

V

THROW AWAY OLD POINTERS

......

*..*

****

:** •• E4***** ••• *:

lI044404

PAUSE •• •• OR DATA •• YES. * •• STMT LITERAL •• - - > * C2 •

*

E4

*

.*. * •

*.

:

* *

V

E2



C2



:*.***~~;;******:

•*

.... **

•••••• **** •••••••

NO

I

...I V

V

*. *. *. Y E S " .* .* .. *. PASS 1 • *------->* RETURN *. .* .. *..* •••••••••• ****. * •••

:****F2 ••• ******:

F4



INCREASE * * PROGRAM BREAK * *BY NO. BYTES IN.

: •••••:;;! •••••• :

··**FS*··.·····

j"0

I V

·····GZ···*······ • DETERMINE BASE • PTR AND * DISPLACEMENT * FOR PRESENT * LOCATION

V

·*·*·*G4 ••••••• * •••

*

PUNCI-t ANY PART IAL CARD

*

PUNCH REMAINING TXT CARD

*.*.***********.*

...I

I

V

•* •

.*

H2

PASS

..... *.

*. 1

....

V

*.

.*.*.

*

*--,

I

* •• *

.. YES

I I

lI044402

····H4·***··.· . * *

NO

RETURN

. •

••••••••••••• **

v

••••

:

*



B4

:

V

·····J2·········· .THROW * PTR AND • • THIS

AWAY BASE01 SPLMT • PTRS TO LITERAL

·................. I .... V

. . *



*

C2 •

Section 2:

Compiler Operation

93

chart cs.

ALLOCATE FORMATS G0445

.

**"'«A2*******"· FORMAT ALLOCATION

.

........... ***** ....

I

I

v

144502

... ** *84"""""""'" * .. * ** NOTE

:****82****.****: SET POINTER TO FORMAT ROLL

BUILD FORMATS

,-->*

ADO I T I ONAL :BASES REQUIRED

*.* ..... * .. * •••• ***

************4****

I

"""*",, :

C2

H446~;"" •*

:->1

.~.

C2

".

*.

.*

.-. C3".

II

I

~

*•

V

••• **C4 . . . . . . . . . . .

.

•" DATA ". NO .* PASS ". YES ". TO PROCESS ... ------->*. 1 OPEHATION .*

*.

*..*

.*

*.

* •• * "

I

*..* * •• *

.. """" ,,-> " I

YES

"

..

..

1044501

·**** .....

*.

..

************* .. ***

03

*.

*.

-,., YES .- ' ' ' , ••

v

Til OUTPUT AREA PUNCH XF CARD COMPLETE

.... .ft**_ •• " •• _

.CALCULATE BASE .. .. AND • DISPLACEMENT * FOR FORMAT

"••• ** ........ ** •••••..

I

I

:** •• G3.** ......... : V

.. REBUILD .. FORMAT ROLL :WITH BASE PNTR

I

V

.. *.... * .. C2 "

"

V

·····*H3····· .. ••··• ..

PRINT FORMAT MAP. IF OPTION SPECIFIED

..............

..

..

..

94

.. :

•••••• * ••••••••••

I

"

PUNCH ANY DATA LEFT ON .. tXT CARD

• .. ***.05* ** .**'* * * '*. PRINT MAP LINE. REMAINING

------->

I I

I

V

..

*************

V

**** MOVE ·*"...

****83*********

...

RETURN

"

..*******.*.***

" YES

I

V

******C2***********

PRINT HEADING FOR EOUIV MAP

I

V

... ····02****·· ... •••

"DETERMINE DELTA" "FOR EOUI VALENCE" " ADDRESSES DCB .. " TO BASE TABLE .. " SIZE ..

••• ****.*****.-.*

I

V

..

..

·*·**E2**·****···

FLIP THE .. EOUIV .. :ALLDCATION POLL:

**.**************

" .:->1I :

F2

*.**

*044101

v

....

'044102

• COpy • COMMON NAME • TEMP ROLL TO • EOUIV ALLO• CATION ROLL

." EQUIV ". NO ". ALLOCATION ."

*.

*.

ROLL

* •• *

.*

.*

• • • • •

••••••••• ** ••••••

.. YES

I .

I

V

V

DATA 1 HOLDS THE ADDRESS OF THE VARIABLE

V

···**F3***·······

F2 •• • -DATA ON--.

··.·*G2·········· .. ..

.. .·····G3··········

.................

.*** ••••• *** •••••

.. .. ..

MOVE NEXT GROUP TO CENTRAL. INCREASE ADDRESS

.UPDATE PROGRAM. : BREAK :

..

I

I

V

V

·····*H3····***····

: •• **H2*** ••• ***: .. ENTER INFO IN • • MAP. PRINT IF • : LINE COMPLETE :

..

•••••• * •• * ••••• **

I

····*J2·········· V

·

PRINT PARTIAL LINE OF MAP

.............

I

V

····J3*········

.DETERM INE BASE • • POINTER AND • DISPLACEMENT • : FOR VARIABLE :

.................

RETURN

.

•••••••••••• * ••

I

V

·····K2*·········

.. PUT GROUP .. FOR VARIABLE ON COMMON • NAMES • TEMP ROLL

• • ., • •

.................

. ... V

.. ••F2** •



****

section 2:

compiler Operation

95

Chart

cu.

ALLOCATE SUBPROGRAM ADDRESSES G040:S

"•

U·· . A2··· . . •• . •• . GLOBAL SPROG

.. u • • :;;~;~!~

••••

..

I

I . ·.··82·**······· V

it

..

• • •

·

FL I P THE GLOBAL SPROG ROLL



. •

•••••• ******** ......

•..... " I :

C2

..'.....

*040301

.*

:-> I v

C2

.".

*.

*040303

**.**C3*.........

*.

..

COPY COMMON

**.··C4**·*******

.....

..

," DATA ON *. NO "DATA TEMP" "FLIP . , THE GLOBAL • ,,---->.. ROLL TO . - - - - > . THE USED LIB it. SPROG ." .. GLOBAL SPROG " "ROLL •• ROLL .* ... ROLL ...

* •• * ..

I

.....................

***************_ ...

I

YES

:...... ** :->1 it

I

"

04

v *11.**02*.* ... * .. * .. 4

•••

04

• • MOVE NEXT "CROUP OFF ROLL • TO CENTRAL

v

lI040304

."

i

V

V •••

, it.

....

."

*. ....

*.

*****E3*"'*·******

*. ...

DUMMY

.... -... "

I

.*

..

..

YES'"

...

. " - - - - > " I N S E R T ZERO TAG" .. VALUE ...

.*

*.

E4

*.

I

it

" " "

SPROG ALLOCATE AND OUTPUT

: •• *~~~;~ .~;~*.*: I

I

V

....

.*

.*****1:5*********** .. • NO '''/

I

*****F4**********

"

I I I I I

MARK GROUP FOR INLINE FUNCTION

if

PUNCH PARTI AL ESD CARD

*************

I

.....

I

V

"

I

j3 :

V

.*.*.**********

if H3

V

·····H3 .

* if

II V

·** .... • ... • ..• ALLOCATE

" STO~AGE FOR if " ifAODRlSS RECORD." " P~INT LIST if

: ... *~~~;~*;;~ •• *:

... *.*..,,->1

I I

"



J3

I I

if

·····J3 ...... ··· ..... V

..•

puT

GROU~

..if

"ON COMMON DA T A .. • TEMP ROLL if

if .. if

96

"

RETURN

if

"

I

V

***·**FS***********

if

...



"

.. ****GS*********

I I I

C2

H3

••• *** ••• * .. ***.*.

:

**** •••••••••••••



..

....

PUT GROUP • .ON COMMON DA T A • • TEMP ROLL •

if

****

....

V

······G2··*··**···. ....

• •• **********

v

YES

I

V

·

.. PRINT PARTIAL if LINE OF SPROG .. LIST IF .. REQUESTED

.*

1

I

1< I

I I

*.

* •• *

!

" ALLOCATE " STORAGE FOR "ADDRESS RECORD • (PRINT LIST)

*****************

YES

I NL I NE FUNCTION

..

·•·· . F2*···· . ···•

*040302

• .. If.

NO

I I V

*040308

• ... ***05**********

".

* •• *

I

it.

#040307

* COPY COMMON .. .* DATA ON *. NO "DATA TEMP •• THE USED LIB • * - - - - > * ROLL TO •• ROLL." • USED LIB ".." .. FUNCTION ROLL ..

if

• "

I E2

*.

.......

.... 04

if

• "

SPROG ALLOCA TE AND OUTPUT

.

Chart

cv.

BUILD AND PUNCH NAMELIST TABLES G0405

.* ..... A2 ** -_ ••• _..

*

BUILD NAMEL I ST

*

*****!:~;~*****

** *

I II

*.

*.

l::J2

#40506 -.

DATA ON

*. *.

NAMELIST NAMES -.ROLL .*

...... *

.*



NO"

****EJ3********-

*-------> *

.. __ ititititit • •

MOVE FIRST 4 WORDS OF I TEM ENTRY TO CODE ROLL AND PUNCH

"

*._."'_

* "

*

FL I P *NAMELIST NAMES * AND NAMELIST * ALLOCATION

ROLLS

* * *

...

THE LATTER HOLDS THE ITEMS FROM THE NAMEL I ST LIST

..

.... -- -* .............. * *-

*

v

PRINT HEADING FOR NAMFLIST MAP IF

.J.

:*****~~;~* ** **.:

I

*

I

v

#040501

.*

.* *.

...

I

*->1

E2

*

** * *04 **** *** ***

• * MOVE ALL * DIMENSION * "FACTORS TO CODE*

*

**~;~~~;!;~** *

£2

• *.

*

#040505

...

L>ATA LEFT ON NAMEL 1ST NAMES •• ROLL

... * ... I

...

I

I

v

-* **** *****

•• _it ••

v .*. *.

.* VARIABLE AN *..*---, NO *. ARRAY.* I ... .* I * •• * v .. YES ***'* I * * I * J2 • I * *

I *

C4

")I..

I

*02



I

V

*--

*

")1.** ** ** ** ** ** *** *

I

-_ ... **C2"" -- _. *--*

**

V

~****B4**********

...

RETURN

YES

..

** *

I

• *. .*

84

I

v

.*

*.*.

*.

.*

:

-*-*-E3---** •• _-"

*

*. NO * • *------->*

.*

* ..

COpy COMMON DATA TEMP ROLL TO NAMELIST NAMES ROLL

v ****

*

J2

:

H4

*'* *

*

-*-_ . _-.*. __ . _._-

YES

I I

I

v

V

............ *F 2"''''''''''''''''''''''''' ENTER NAME +

******F3***********

*

LOC IN MAP LINE PRINT IF LINE COMPLETE

*

--*----------

_. *-*-*------

I

I I I

I I

v

*_ .... ** ** ....

.......... *G2 * PUT BASE AND * DISPLACEMENT * OF NAMELIST * TABLE ON COM* MON DATA TEMP

PUNCH A NO PR I NT REMAINING INFO IF REQUESTED

V

*

* *

****G3********* RETURN

* --_ •• *.******** *

_._--*-*-----_._.*

*'* *

I

I

****

I

V

V

*****H2**********

·****H4**********

*

*

* * *

MOVE NAMEL 1ST NAME AND 2 WORDS OF 0 TO CODE ROLL AND

: ........... ~~!~~!

.. *.-. * *

* * * *

• •.UPDATE

-*._ . . :

.***

v

• **** *

V

#040502

:

J2 ... • -DATA ON-. •• NAMELIST NO *. ALLOCATION .*--, ROLL •• I

THE NO ANSWFR INDICATES EITHER NO DATA OR A MARKER

*.

*.

*.

...

I

.itv __

* •• .. * YES

I v -_it• *

...

*

84

*

*

II

I II .*.

*

*

* ** ** ** ** ** ** ** **

*->

J2

*

PRGGRAM BREAK

* * •

H4

****

E2

:

****

* * *

...

*

section 2:

Compiler Operation

97

Chart

cw.

BUILD BASES G0438 * * *

****A2********* BUILD * ADDITIONAL * BASES * *************** ****

I

* * * B2 *->\ * **** *

V

*****B2********** ** OBTAIN ** *PRESENT PROGRAM* * LOCATION *

* * *****************

I

v

.*. * • C2

•* *. ****C3********* .* MAX FOR *. YES * RETURN * *. LAST BASE • * - - - - > * * *. .* ... * *. .* *************** *. • * * NO

I

V

*****02********** ** INCREMENT ** *BASE ALLOCATION*

*

*

* * *****************

V

*****E2********** * * REGISTER NEW BASE * ALLOCATION * *****************

I

v

****

** B2 ** * **** *

98

Chart

cx.

DEBUG ALLOCATE G0545

****A2********* "

DEBUG ALLOCATE

" "

" "I :->,

:

82

**** •* •" ".ON

*.

82

.v".

*.

*****63*****."'.* • ... ...

*.

DATA ". NO "INVERT " INIT ROLL ."------->*THE SUBCHK ROLL"

*. * •• * .'" "

.*

...

...

*

...

*****************

YES

I

"to""""

I

:

C3

****

V

*****C2********** " MOVE * VARIABLE NAME *OFF OF ROLL TO " CENTRAL AREA

* * " *

.*

*.

" " *****.***********

•*

*.

:-> I C3

v .". *•

" .... ' . .** "

I .".

02

V

I

*****************

I

I I :****E2*~*******: I

V

INIT

•"

~gLl~ ~~EL

•*

E3

.". * •

MATCHING

*•

".

NO

"G~~g~y O~o~tO~!L " ,

1

:.....~:!~:.....:

I

I I

*. * •• *.* * YES

I

I

II

V

.*

.*. *. F2

V

ARRAY ·.ROLL

* •• * *

I

*****F3**********

*.

." MATCHING ". GROUP ON

*.

" SET " "THE SUBCHK BIT " " IN TH~ GLOBAL * :DMY ROLL GROUP:

". NO .*-,

.*

.-

YES

"**"" **"

1

V

* "

SET THE INIT BIT IN THE ARRAY ROLL GROUP

•*

*

*.

G3

*.ROLL

.*

.-

NO .",

I

I

v

* :

****

"

C3 :

V

*****H3******·***

*.

.* MATCHING *. NO "GROUP ON GLDBAL", ".DMY ROLL ."

"' •• *

*. ".

.. YES

V

.". *.

.".v * •

ARRAY

1*TEMP CNT = LOOP" *.TEMP CNT ." * TEMP CNT *

*. .... * .* ..

YES

.... .... I

:

100

E2

....I *.*. V

V

*

* :

"

: C4 :

*00 NEST UN.DDAZ*

*

*.**

*"

*

EZ

"

"

*

OBA2

*****.** ... **-**.

"

Chart DA.

BUILD ARRAY REF ROLL G0145

• •

•••• A2 ••••• • •• •

ARRAY REF ROLL ALLOTMENT

*******.*******

X

*****B2*****····*

• GET * BEGINNING * ADDRESS OF * *ARRAY REF ROLL.

X

·.*··C2·*·**·****

**

GET ADDRESS * OF PARSE SAVE AREA

*

X

**

* •

.".

D3 *. .*NO. OF it. ***"04"******** * .* ENTRIES *. YES * * * ••••.••• X*. EQUAL ZERO .* •••••••• X* RETURN ... *. .* * ... *..* *************** * .. * * NO

*****02**********

" GET NUMBER " OF ARRAY REF * ROLL ENTRIES

"" E2 *... * . * * . x••••••••••••••••••••••••• 1fl45~i** X *"**"E2"**"*"""**

** "* LOAD GROUP *INDICATED WITH" "INITIAL ZEROS " ** .. ***************

x

".*"*F2"""**"**.*

F3

.*.

*.

ALL *. * ••• F4 •• ** ••• ** INDEX TO •• ENTRIES •• YES • NEXT ENTRY * •••••••• X*. PROCESSED .* •••••••• x. RETURN * • POI~T ON ROLL. •• .• •*

*..*

*********** ••••

. . *

*

E2

*

*

Section 2z

compiler Operation

101

Chart DB.

MAKE ADDRESS CONSTANTS "

..

"

A4

...

I

"

* ... ** A2** ** ** ** .. CONVERT TO ADR CONST

""FOR "

IN DA TA

"

34

"

• *GRP

UP POINTER" FOR LOOP " CONTROL ROLL

".

ROLL

*.

"

..

I

.*

... • *

" . F4 ..

V

"****C3********** ... ..

...

FOR

GEN

...

.*

*****C4.*·"-·******

""SET

"•

"

"

POINTER TO NEW GROUP ON CONS T RGLL

* ADR

*

................. -....*

"

I

NO

I

*****02*********· INCREASE POINTER

IEYGEN

"

I

"

·

*****04****·*·**·

V

.****03*********.

"

"

I

I

V

"

"

" PLACE BASE AS • "NEW GRP ON ADR " CONST ROLL • "

"

*****************

I I

I

I

V

*****E2**********

"··**E4**·*···**·

I

V

"INCREAS[ PTt-! ilV. " TEMP LOC FOR " .LOCPS BY 4 ANu .. • PUT ON ADR *

"

"

" MOVE "BASE INFO TO

"

WO~

"

"

..

" •

•*

.". ".

#11304

*•

" • " :

I i

.... *

YES ."----

REGISTER i~.



"i'~O

*

II

I

I

j

I

.... *

NO

J: ORD ". *.

I lI011302

"

I

"

*.**

.... Alt

PRUNE WO

. ..

NO

v

:

V

:***.J3** ............ :

EQUAL TO *. Y E S " OR LARGER • ,,---->* *. THAN 0 .* ..

... .'"

. :

*.. •

I

" ..* 'I. .*

." ••

C2

>1

.•H'·:·....

*.

I

.iI

.* *. YES ".TAG FIELD = 0 . " - - - - - - - >

V .".

···**

.. v_... *.. *

I

• * ·;}GENERAL ••••

.*

V

REPLACE t3ASE WITH TEMP PTR ON LOOP ceNTROL ROLL

I

V

"

:

•• *. C2

• • " "

........ -........... .

II

G2-*-..

*.

*-> I • I I

NO

1

".

"I

.****F4.** ••

• " REFER TO ". YES ". TEMP AND ."----------. ". CONST ." ".ROLL ." "

~

I

F4



v

F2

CON~T

.** •• * •• **** •• ~**

I

102

..

"

:



v ****

."

I

•" POINTER ". YES "SET UP OATA " ".OUTSIDE ROLL . " - - - - > " A N D INITIALIZE"

"

NO

I

... * .. * v lIo 1130 1 .". C2 *. .* ....

*.

I I

."

II

"I

*.

YES

.*---,

••

.... *

,,->\

"

...

"".ATCHES ••

•• ON ADR CCNST

" .**************** C2

3

... ." . ...

V

*****82*********·

"""*",,

" " • •

*********.*.*****

I I

"

"

dASE ([VEN CODE

01 SPLACEMENT)

"

I

""SET

V

*****A4******···* "

* ... ** ... ***** ....... *

" "

I

lI011103

G0113

THE WORD DOES NOT CONTAIN AN AREA CODE AND DISPLACEMENT INDICATING A NEED FOR A TEMPORARY LOCATION

Chart DC.

CONSTRUCT INSTRUCTIONS GO 112 * *

****A2 ******** * CONVERT TO * INST FORMAT *

* *************** *

I

V

*****82********** * GET * * REG RUN OFF * *ARRAY REF ROLL * * FROM POINTER *

* * *****************

I

V

.*. * • C2

•* *. ****C3********* .* GENERAL *. NO * * *. REG. NOTED • *--------> * RETURN * *. .* * * *..* *************** *. * • YES *

I V

*****02********** ** MASK ** *REG. RUNG VALUE*

* * ******************

I

V

*****E2********** * PLACE * * VALUE IN R2 * * POSITION FOR * * INSERTION ON * * ROLL * *****************

I

V

•*

.*. * • F2

•* *.*.

*.

RI g~

* •• *

*•

*. R2 .*.*~

•*

*11 RI

i

v : *::*:

* **** * V

*****G2********** ** SHIFT ** * VALUE TO RI * * POSITION *

******************* ****

I

: H2 :->1 * **** * V *****H2********** **INSERT VALUE IN** * ZERO RUNG OF * *ARRAY REF ROLL *

******************* I

V

****J2*********

** RETURN ** * *************** *

Section 2:

Compiler Operation

103

Chart DD.

PROCESS NESTED LOOPS

.. ..

...

.

..

A3

..

1

I

GO 115

V

........ A3·.. ·••• ***4.*

·.. ..................

*"'.*A2**·*·4 •••

..



1 1 1 1

.. • *

1 1 1 1

* *->1 • 1

BZ

*

RESERVE NEST SCRIPT ROLL

DO NEST UNIFY"

I

1

. ····83· . **.* ••••..

V

V

. ·····82··········* *

"..

"INITIALIZE LOOP* .. TEMP CNT AND • NEXT LEVEL "

COpy

SCRIPT

..

'ROLL ONTO NE~T • SCPIPT ROLL

.. ..

• .......... ******.*

0

••••••••••••• ** •• 1 1

! I

V

...... fI

*c 2"""" .......... ..



..

C3

*

PLACE IND. ·VAfI. CO[FF. OF * NEST IN WO

."1('

*

••

* .......... ......... .•

*.

!

CONVERT ARRAY OFFSETS



.*

..

ALLOCAT!ON



*

"COEFF. ON NEST" * SCR r PT •

VAR.

..

! I I1

V

··· .... 03·····**· ....

.. PLACE INITIAL' "HEG. COUNT AND •

IND.

..

*** ... ** .... **** .......

NO

** •

* .... *.* ••• *. * ......

..

V

·

***··04· .. •• .. ••• .. RE

TUI~N

• ............... ** .. .

I I1

I1

....V -II.

·....."

1

·····E2······ . ·*** V

* * * * ..

*..*

*SET OUTER l.OOP YES ·It CONTROLS AND • "---->" DETERMINE .. SCRIPT

*.

1 1 1 1 1

V

·

.. .. ·**C4**·****·.· ".

..

·····02··········

*

... =1

LEVEL

* •• *

I

•*

• *.

NEST



COMPARF • NEST LEVEL OF .. LOOP WiTH .. PREVIOUS NEST. LEVEL *

U2

w-

.................. I " •

F2 *->1

*

1



*

V1

#011502

.*

•*

F2

.*.

•-I.

..

*•

IS

*.

NL2

••

l.ESS

... ... ... ...

NO

NL 1

*

..

.*-->*

·

..

HZ

..

** •••

• •• fI ...

THAN

**----.

F4

* • *



....

1 1

V

.

F4····. *·· ... **

PUT POINTER TO ARRAY. OFFSET IN WO

* •••••••• ** .•• *.* ••*

YES

1 1

!1

...

••• G2

*.

...

• ' NL2 '. NOT EQUAL •• TO NL 1

*.

... ... •

* *

... ........ G3* ..' ........... ..

...

...

' . YES • PLACE IND VAR • . " - - - - > * O F INNER NESTED. • LOOP IN wo 0

.. * ....... * ........... .

NO

0->1

.. •••• ..

1

·

V

.

.... *li2······ .....

#011503

SET NEST l.EVEl. INDICATOR

!

v

PLACE NEST .. LEVEL ON ·PROGRAM SCRIPT

• *

"····H4·····*···* * SET * AVAILABLE *REGISTER COUNT * FOR SCRIPT * EXPRESSION

·····J2··········*

• PLACE NEST • l.EVEL ON .. .PROGRAM SCRIPT.

: •• * •• ~~;; •••••• :

..

....

V

·"··*J3·········· * * • PUT IND "VAR COEFFICIENT" " IN WI *

! .... F4

.. •

...................

I I

..

V

J4

.* •

*.

...

.

• •••• JS* • • • ** ••••

..

.* MORE *. YES *SET NEST LEVEL .. *.NESTED LOOPS . * - - - - > * T O PROCESS NEXT" -.

*.

.. * .-.* I

••

-

LOOP

I

NO

.** •

*.. *

* F2 ..



..

................. ** ••

V

V

•.. ..



1

1 1

..

104

"

I

1

A3

V

"

1

..

• •• ** •••••••••••• 1 1

.. ••• .. H3·· . . . . . . . . .

I

.

DETERMINE SCR I PT ALLOCATION

1 1

V

I ....

V

I !

: .... **~~~'; •••••• :

1

v

·····G4····.·.·· " ...

!1

1 1

0

HZ

...

I

#011504

V

•*

*

*

..

*

.... * F2

..

..

*

Chart 08.

PHASE 4 - GEN

· . •

*

*

···*A2*···*****

:

IEYGEN

*



:

I I

v *** ... *82"" ** .... ****

******.*.*****.*.

·

I

*

G0515 "

*

I

I

G0496

I

1
* STATEMENT * ROLL TO WORK .NUMBER ON CODE ROLL • ROLL •

........ ** .. ** **** ** **

G0499

REMOVE AND PROCESS LABEL

*****84**********

-

INITIALIZE

V

--*_ ... _-*_._---I I

*

I

STAfn GEN

*

*****A4··******** :~~~.~~~L;-;~:~:

***********.***

·



I

G0493

G0491

A4

****

• *

:*;~!;~~~;*;~~;*:

* * *

I I

* I -->1

F2

*

G0712

V

.. ** ... *F 2 * ............. **.*

POLISH NOTATION IS ON AFTER POLISH ROLL

:~;~*~~~!:~-;~:~:

GEN PROCESS

MOVE POL ISH FOR STMT TO POLISH ROLL

-



... ** .. ** .... * ** ** ** .... I

I

v

*** **G2**'" ***.* ... -

• MOVE • STMT NUMBER • • • FROM POLISH TO • STORAGE • •

***** **.* **** *. **

I I

·

.

V

*****H2***·***···

*MOVE NEXT GROUP. • FROM POLISH • • ROLL TO WORK

: ••••• ~~~;.*.***:

I

•*

•* .••

J2

.•.v * •

*•

*.

NO

*.LABEL POINTER'*I

*.

* •• * ..

• ..

YES

I ··...... v



A4

.*

. . v *.* ..

:

C4

:

*

Section 2:

Compiler Operation

105

Chart EA.

GENERATE ENTRY CODE G0499

"

****A2 *** ...... *** ... ENTRY CODE GEN

* •••

.*.* ... *** .. ******

"

1

I I 1

•*

82

:

....v *.

V

*.***83*'11-.******-

....

...

..

."

SOURCE ". NO " P U T MAIN .. SUBPROGRAM ."-------->*PROGRAM HEADING" ". ." * ON CODe ROLL ..

*..* * •• *

V

SET UP

I

SET UP SAVE AREA LOCATION AT CURRENT LOC

..

....

02

*.

-.

.. ..... "

1

*****E2*~********

" BUILD A LABEL " " " RECORD INIT. " PGM LOC BUILD" " CODE TO EXIT " .. FOR LABEL ..

1

I I 1

1
1 " ......... * V1

"

I ··**··· "

.049903

"

.*

*.

." •

.*

D4

*.

ALL GROUPS

*.

*. YES * • *-------> *

*.PROCESSED.·

.....* ...... * •

I1 I

·

V

*** ... *E4"'''''''''''''* ****

..

• REDUCE .COUNT OF GROUPS. .. TO PROCESS *

I

V

"*

INSERT "PROGRAM NAME .. CODE

"

" IN" ..

..

...... ********** .......

" .,

:***;~~;*~~~; ... *:

I

" PUT CODE .. FOR ENTRY ON CODE ROLL "

..

.......... * ......... **

I I1

• ..... ·*H2*** ..... •• .. • ...

"

GE!IIERATE ADDRESS " CONSTANT .. FOR PROLOGUE .. +EPILOGUE

"

..

...... ** ••• ** ... ** ....

I V

..

...... ·*J2*··***··· ..

BUILO SAVE .. .. AREA AD CON .. : CODE FOR EXIT:

........'.*** ••• *****

I

.. " .... ...... ****.*** ••• I

*.·"*H4*****"··**

.. BUILD INITIAL .. PROGRAM ENTRY • AD CON CODE

.

.. B4 .,

.. .. ..

I

V

....**.*J4 ............ • .. "• ..

GENERATE PROLOGUE +EPILOGUE ADCO"lS



"

........ *** ........ **

I . ..... .. V

V

., .* .. * .,

106

..**··*G4····**····..

V

V

.

I 1

PUT CODE FOR INITIAL SUBPROGRAM ENTRY ON

..

*.*.****.********

V

V

GENERATE

·

I

I *****G2*******··· "

.

V

*** ...'F4" ••• *4 * ....... • INSERT * .. ENTRY NAME IN • CODE * "

..

..

.. 04

..

..

****D5***·*"'*·~

RETURN

*******.*******

NO

1

I

*·"***F2**********

..

NO

********j********

I

..

..

I I

i NO I I

RETURN

..... * ••• *******

" REDuCE .. "COUNT OF GROUPS" .. TO PROCESS ..

I

*. * •• *.*

****85********-

...*.**(4*****.***·..

****03· ...

RETURN

*. Y E S "

*..*

V

"

*.

*****.*********** 1

I

."NO. GROUPS *. YES ". ON ENTRY • "--, ".NAMES = I." 1

....

ALL

I

• * .. **************

V

.".

V

V

*****C3*********·

.. " .. INITIALIZE A " "POINTER TO THE" ., ENTRY NAMES " .. ROLL "

84

GROUPS • *-------> * ".PROCESSED." ..

**************.*. 1

YES

*****C2**********

I .".

.*

".

.*

...

I

#049901

:

1 1

~.A

"

"

84

*

Chart EB.

PROLOGUE CODE GENERATION GOS04

.. ****A2********* .. :

PROLOGUE GEN

"

* .... *** ••• ******

"" "

I

v

V

*****B4*********· " PUT LOCATION " OF CLOSE OF " PROLOGUE IN ENTRY NAMES "

:***.B2*********: "

INITIALIZE POINTER TO ENTRY NAMES

***~~ .. ;*~~~~~***:

:*****~~ii***.**:

I

I

*OS402 v :****C4.********:

V

*****C2*********·

"INITIALIZE CNT " "OF GROUPS TO BE" " PROCESSED ON " ENTRY NAMES "

"

:*::":->1 ****

OS0401

.".

*.

I

v

"

" D2 "

*.

.... *GR~b~s "' .... YES ".

*._.***._ .. *._.**

....-

v

02

:****C5*********:

UPDATE" "CLEAR" POINTER TO "------->,, BASE REGISTER • ENTRY NAMES " "TABLE"

•• ****~~~;***.*.*

******~~ .. ;*******

*

" "

134 "

PROCESSED

*..*

.*

.. ****03********* ... ...

"

RETURN

• ,,---->"

* •• *

"

***************

" NO

1

V

*****E2********** *****E3********** .. ".. BUILD A " "LABEL" .. REDUCE COUNT " "OF GROUPS TO BE"---->"INSTRUCTION FOR" " PROCESSEO" "PROLOGUE"

"

*****************

:,,::,,:, "

1

v *****F2********** "CONSTRUCT CODE " " FOR LOADING " .. ARGUMENTS. IF " ANY .. "

"*****************"

.". v

.*

F3

*.

*•

•" DEBUG ". NO "UNIT SPECIFIED."--,

".

*- ••.•

a-

."

I

I

I

" YES

I

1

V

*****G2********** .. CONTRUCT CODE " "FOR COMPUTATION" OF DUMMY " .. "DIMENSIONS. IF " ANY " .. *****************

I

I

*****G3*~******** ... BUILD DEBUG " .. LINKAGE. UNIT" " CODE AND UNIT" " NO. IN CODE "

:·····:~l~······:

I

II

I

v

V

*****H2********** " CONSTRUCT " CODE FOR CLOSE OF PROLOGUE

I

lIS0414

.".

.*

H3

".

*•

• " SUbTRAC~ ". NO ". SPECIFIED

*.

*.

* •• *

.*

.*

..

."-->"...

" F2 ..

'

..

" YES

I

v

"" "

**** B4

"" "

1

V

*****J3********** " BUILD .. " DEBUG LINKAGE " " AND SUI3TRACE " " START CODE ON .. CODE ROLL " ..

******** •••• ** •••

I

v

****

"" F2 "" " ***. "

Section 2:

Compiler Operation

101

Chart EC.

EPILOGUE CODE GENERATION GOS08

·

****AZ··· ••



·*.* .

EPILOGUE GEN

*.

82

• *S~BPROGRA~· •• YES

'.

#050803

• •••• 83 ........... .

:

OBTAIN NO.

ENTERING TO .* •••••••• X* OF GROUPS TO ' . PROCESS .* PROCESS

.... • .NO ...

·· .. .... . .*.

...

• C3 •• X.

*** ••

X

C2.···.· ......

" SE T .. • LABEL " *INSTRUCTION FOR. • MAIN PROGRAM .. ENTRY •

..............•.. X

······02.···.·· .. ·

.BUI LD CODE FGR .." .. CLOSE OF • EPILOGUE OF • MA I ~j PROG

................. X

.· ... E2····.···.· * • BUILD • • MAIN PROLOGUE' • CODE •

X

•• •• F2··· ....... .

RETURN

H050eOl

*.

C3

....

• •••• C4 . . . . . . . . . . .

.... .. ... . .. • NO

X

·.··.·03········ ..."

X

•• ... 04.·· ..... **

.SET BASE TABLE" .AS REQUIRED FOR* EP I LOGUE • •

RETURN

x

...... E 3 •••••••••• "BUILD INSTRUCT" • FOR DUMMY • "ARGUMENT VALUE • .. TRANSFER "

F3

.".

••

*050802

• ••• *F4 . . . . . . . . . . .

•• ENTRY.. • DEFINED ". NO • PRUNE " " • '. AS SCALAR •••••••••• X.LAST ENTRY FROM ••••• X. Gl .. '. • .. • WORK RO LL * • *

*•

.. G 1 •

*.

*. .. .. ALL ". YES .. PRUNE • GROUPS .* ......•. X.LAST ENTRY FROM. *.PROCESSED.' • WORK ROLL •

.*

...

....

..

.. YES

·.. ..... .. "

X

fi 50804

Gl

..

. ' ·SUBTRACE·· •• NO • SPECIFIED ••, •••• X.



INSTRUCTION AND CL EAR ACCUMULA TOR

"* ...

x

.. ····G4* •••••••• *

:BUILD CODE FOR: CLOSE OF .. EP I LOGUE OF

: ••• *~~~~~~~** •• :

·····Hl···X .. ··, .. · BUILD DEBUG LINKAGE A~W.

~~ST~~§~S



: .•.. x:

IRETURN) • •..••.....•.....•

108

• (;4

·····G3·········· BUILlJ LOAD

G4

*05084;*

••••



G4 :



Gl •

"

"

X

••••• H4*** ••••• ••

..

..

.***

"DECREASE NUMBER• • • OF GROUPS TO . . . . . X. C3 • • PROCESS • • •

• ... *

Chart ED.

MOVE POLISH NOTATION G0712

**

****A2********* GET POLISH

**

* *************** *

I V

*****62**********

* *SET UP POINTER ** *TO AFTER POLISH* * ROLL * ******************

V

*****C2**********

*

COPY.POLISH FOR STMT TO POLISH ROLL

**

* * *****************

I I

V

*****02**********

* *UPOATE

* *

* CONTROLS* FOR AFTER * POLISH ROLL *

* * *****************

I V

*

****E2 *******·11* RETURN

*

***************

Section 2:

Compiler Operation

109

Chart EF.

PROCESS LABELS G0493

.. ****A2********* .. "

LBL PROCESS

****** ... **** ... *.*

"

I

..

"

I

83

,

"4-

..

V

V

*****82*********·

··***83*****···*·

""

"MAKE LABEL FOR "DEBUG CODE-PUT "BRANCH ON CODE ROLL •

"

STORE POINTER " "TO LABEL IN STA* " LBL BOX "

" " " "

"......... ** •• ********

"..

I

II

I

I

.* ".

.*

*.

*.

...

*.

."

NO

• "--,

II

"f"

*.

TABLE

I

...

...

*.

SPECIFIED

...... I

*..*

... ,,----> *.

NO



YES

........ **D4 .. • ** ****.* " PUT DEt:luG * * LI~KAGE FOR * .. TRACE ON CODE * * ROLL •

.

.......... * ......... ..

I

I

V

*PUT POINTER TO .. * MADE LABEL ON * .. AT ROLL-WORD * 3 OF GROUP *

*

.*.

TRACE

I

****·E3.*****"***

II'

C4

.*

I

.. .. .. " *

*****************

I

~.::~:;;:;;;::"~

"

.*

V

V

.. MAKE LABEL "FOR NEXT INST* RUCTION - PUT " LABEL CODE ON CODE ROLL "

*

*

·*··"'03****"***"·

JlUMP TARGET

".

il49305

I I

v

..

I

V

.". *.

..

V

"PUT POINTER TO .. " MADE LABEL ON " " " AT ROLL-WORD 2 OF GROUP it ..

02

C4

"

*****C3********"*

I

***.

..

V

... •• .. E4** .... ••• .. • .. PUT BINARY LABEL ON CODE ROLL

•• *****.*********

I

I

1


..

**.*

*

V .".

t49302

....

.*

J2

*STMT.

*.

*.

NO

v

***.

YES

*.

AT

...

....

*... C4

* ..

..

4-

FIRST W0RD OF AT RCLL CROUP IS COMPARCD WITH STA L8L BOX

NO

FOR T H I S . " , LABEL .*

...

... ..

.*

v .*.* ..

"

:

C4

:

""

..... . 83

v

.***

YES

I

110

'*,

*.

•• .4-

"

4-

I

v .... - .. *F 3*"'.*" *** **

** ***F 2 ** ..... ** *** *

V

"

••• .. F4· .. ••••••• RETURN

*

·***cs·******·· 4-

*

...

RETURN

** .. ** ....... *.****

Chart EG.

GENERATE STMT CODE G0544

G0515

****A2********* * * STA GEN * *

* *

****A4********* TERMINATE * PHASE

* ***************

* *************** *

I

I

I

v .*.

V

B2 *. .* STMT *. .* FUNCTION *. YES *. MADE LABEL .*---. *. PTR = 0 .* *. .*

*****84**********

** ** PREPARE *FOR EXIT PHASE *

*

*

*

* * *****************

*. .*

II

NO

I

V

*****

v .*. C2 *•

*09 *

* A2*

* *

• * STMT * • • * FUNCTION *. YESV *. DRIVER ON .* *. WORK .* *. .*

TO PHASE 5EXIT

*. .*

j""

V

*****D2********** * BUILD * * CODE FOR * * STATEMENT * * FUNCTION MADE * * LABEL * *****************

1 .. * 1 ........

v

# 049603

.... 82

...

... DATA *• •* ON DO ... NO •• LOOPS OPEN .*---. *. ROLL.* it.

.... ....

*

I

• ...

v

YES

........

1

* ...*

I Iv

E3

..* ..

C2 .... • ............ .. ............. .... .. MOVE

.

"GROUP OFF ROLL ..

..

.****** •• 02

*********

II

....v

...

• it

#049601 • ........ 03 ............

*.

* .... .. it

... POINTER = ... N O . .. ".LABEL OF THIS •• --------> .. REPLACE OROUP .. ... STMT." .. ON ROLL ..

..**4.*.***********

.... * • . * .... .. YES

I

.......

II

:..

v

# 049602

I

......... E2....................

E3 ........

1 I

:-> II .. 1

V

...

.. ........ E3 .................. .. * *

._***************

***** ••• *********

...

.. CONSTRUCT" "00 CLOSING CODE" .. ON CODE ROLL

I1

.. RESET TEMP .. POINTERS AND .. ACCUMULATORS

I

1 I

.. ... v



..

II

B2 •

V ........ F3 ..............

* ..

.. ... _•• *** ... * ...._..... * ..

112

RETURN

.

Form Y28-o638-1

Page kevised 7/23/69 by TNL Y28-6829 • Chart 09.

PHASE 5 - IEYEXT

G0381

··.................

~~;;;------!

.-.-.-.-.-.-.-..-. • •••• BSE A3 •• •••••••• .PCH RL-FOA2 •

• ···A2·········



EXIT PASS

·•••

1



• PCB OBJ MOD • :BAS~L6A¥~~b REC:

G.,~~······l········

.

.•••

·····B2··········



INITIALIZE

-----------!

•• • •• BR B3 •••• ••••••• .PCH RL-FEA2 .PCB OBJ MODULE •

-.-.-.-.-.-.-.-.



:REC~~DT~~E1NFO:

•••••••••••••••••

········1········

.-.-.-.-.-.-.-.-.

.

G"02

1

• LISTS RECORD RLD INFO •

G""

.-.-.-.-.-.-.-.-.

G•• : : · · · · . .

• •

r·······

.-.-.-.-.-.-.-.-.

·····F3.·.······· .PCB LIB RL-FBA2 •

.. .. ........

• COMPL SUBPRGR • • ADDRESSES AND • • RECORD RLO •

G.,::······I········

.-.-.-.-.-.-.-.-.

•••• ·G3·········· .PC8 ADCON-FIA2 •

•• ····G2··········· • PRINT HEADING • • FOR LISTING •

• PCS ADR CONST • .ANO RECORD RLO • • INFO •

••••••••••••• G••

.-.-.-.-.-.-.-.-.

••••• 82··.······· • PC8 CD RL-.... •

~:····"r·······

. :~""·T"""

·····S3 ••••• •••••

.PCS RLD RL-FJA2 • .-.-.-.-.-.-.-.• • • •

• PC8 ALL OBJECT. :pggDI ~g ~S :

• PUNCS OBJECT .MOD RLD CARDS

......1'21' ....... G• •

........t:::::____ •pli

.

.-.-.-.-.-.-.-.-•

F2 •• •• OBJECT •• • • LISTING •• NO •• REQUESTED •• ---

·····J2·········· • RECORD STORAGE • •• 0 RE~RBD FOR •• NO OLE COMiILil • • • STATISTICS

1 * *

* •••

v

*····E2····*·····

*

•• INCREMENT * POINTER •* ••••••• * •••••• *.*

•• ••

V

• •••• F2·········· .MOVE NEXT GROUP. • FROM ROLL TO • • BUFFER. PUNCH • IF CARD • • • COMPLETE •

•••••••••••••••••

I

v

• •••• •

02 • •• •••• •

114

PUNCH * ANY PARTIAL CARD •

..*.......

*••

V

** •

*···E3.* •• •• ••• RETURN

•• * ••••••••••••

•*

it

PUNCH PARTIAL TXT CARD

Chart FB.

PUNCH ADR CONST ROLL G0383

** *

****A2*********

** PUNCH ADR CONST ROLL * ***************

V

*****B2********** * DETERMINE BE- * *GINNING ADR OF * * TEMPORARY STG * AND CONST * * AREA * * ***************** :*::*:->1

* **** * V *038301 C2 *• •* *. ****C3********* .* DATA *. NO * * *.ON ADR CONST .*-------->* RETURN *

.*.

*.

i

*..*

.*

*. . *

*

***************

*

YES

V

*****02********** * INITIALIZE * * LOCATION * * COUNTER FROM * * POINTER AND * * BEGINNING ADR * *****************

V

*****E2********** * PLACE AREA * CODE FROM * * * ADR CONST * * ROLL ON * RLD ROLL * *****************

V

*****F2**********

**

SET LOC CTR ** *INTO RUNG 1 OF * RLD ROLL * *

* * *****************

V

*****G2********** * PUT LOCATION * * FROM ADR CONST ROLL IN OUTPUT * AREA * *****************

WO TO TXT CARD

V

******H2*********** * PUNCH PARTIAL * CARD

PUNCH PART I AL TXT CARD

* *************

I

v ****

** C2 ** * **** *

Section 2:

Compiler Operation

115

Chart FC.

PUNCH OBJECT CODE

****A2*********

" "

*

PUNCH CODE ROLL

**.*****I *.*****

" "

"...

I I I

"

I

**··.82····*····· INITIALIZE LOCATION COUNTER + CODE ROLL POINTER

"

84

I

... ." .*. ... C2

**· ..

··C3· . •••·•• .

PUNCH ANY ."oATA STILL ". NO " TO BE .*----> REMAINING ·.PROCESSED."PART I AL CARD

... ... "

• ..

.-1.*** .. * ...

YES

I I I

C4

."

"

*.* •

*.

.****cs**********

I

* •• *

·*·"oJ*****···· RETURN

,,*~"*

""""*"D4"~***""""""

"

"

:

MOVE I NSTR TO " OUTPUT AREA "PUNCH IF FULL"

******** ... ****

I

I

I ... *.

-.*. " " v

v

...

A

" C2 "

• •••• E3* ......·***** ••

YES"

"

"

..

•• ". S~~~~~~NT." • "---->:STORE ~;';MIN S T A : ,

*.

* •• * ..

...

..

..

I

.........................

v

NO

••

..

if.

"

" C2 "

F2

.*

"

... *.

". *.

A

-.PROGRAM

...

... ... . ..

*.



" *** .·F4*****· ... ***

...·• ..... F3.· ..... • .. •·.... YES

..

I:::IREAK.*---->

.*

PUNCH ANY REMAINING "PART I AL CARD

"REINITIALIZE " "LOCATION COUNTR* ---->" TO 1 ST FULL "---,

"

I

*

."

." .

.. ...... .

"

•" ". A CONSTANT ...

"

"

I I

.

". YES "MOVE TO OUTPUT" • ,,------> AR[A PUNCH IF

...

·CARD COMPLETE-

I

NO

v

.... *

" :

"

C2 :

\

v

H2

." . ...

*.****H3********.* •

• "

". MOVE DATA TO AN ". YES "OUTPUT AREA *. INSTRUCTION •• - - - - > PUNCH IF ".." COMPLETE ."

".

... "...NO."

I

I

" :

I

v

.*.*

"

C2 :

v

...

..

...

J2

." .*.

...

**···*J3tt .... ** ....... ....

YES

-.LIST FLAG ON . * - - - - >

...... "

I v " "

..

116

84

v

""

I v

G2

I

:W~Rgo~~iE~R~~MP: *********.*******

"

NO

."

..

LIST

CODE

I

v

NO

"...

.. "• "

**.* 84

".. "

.. * " " "

*****************

NO

I

I

V

NEXT INSTRUCTION

E2

J

...

***.****.********

A ". " DEFINE LABEL .* LABEL ". YES " O N BRANCH ". INSTRUCTION . " - - - - - - - > " TABLE ROLL 1= ". ." " NECESSARY PUT ".." " IN LIST AREA

I

V

.*

...

"

v

.* •

**

"

****.02**"··****GET

...

...

LNO

*->1

*.

...

*..* * •• *

*

" Iv

*.

*****85**********

." CONSTANT *. YES " STORE ". DEFINITION • *----->" LOCATION ". ." "COUNTER

I

.. ....... "

.". *.

.·ADDRESS·.

"

*** ••••• ** •••• ***

.. C2

.*.*I

".. "

v

V

"

84

****

"

C2 "

"

"

C2 :

Chart FD.

PUNCH BASE TABLE G0399

****A2********* PUNCH * BASE ROLL

***************

I II I

V

*****B2********** **

INITIALIZE BASE TABLE LOCATION COUNTER

**~**************

I

I

V

*****C2********** ** INITIALIZE ** *POINTER TO BASE* * TABLE ROLL *

* * *****************

I

I V

*****02********** SWEEP BASE aRANCH ROLL

* INITIALIZE ** *TXT CARD OUFFER*

*

****************** I I

****

** *

* E2 *-> *

G0400

•*

I I

v .*. E2

*•

******E3***********

*•

•* ALL *. YES * *. ROLL .*--------> *.PROCESSEO.*

....

PUNCH ANY PARTIAL CARD

.... .... .* * NO I

I

I

V

*****F2********** * INCREMENT * *POINTER TO ROLL*

*

*

*************

*

* * *****************

.

I

V

****F 3********'1-

* * RETURN * * .************** *

I I I

V

*****G2**********

** RECORD ESO •* * + LOC COUNTER * ON RLO ROLL * * *****************

I I I

V

"****H2**********

**

MOVE GROUP TO ** *BUFFER PUNCH IF* * CARD COMPLETE *

* * ***************** I

I v ** *

**** E2

** *

Section 2:

Compiler Operation

117

chart FE.

PUNCH BRANCH TABLE G0400

****A2********· PUNCH * BRANCH ROLL



********** •••• *

I

I I I

V

*·.·*S2********** ** INITIALIZE * BRANCH TABLE * LOC COUNTER

** *

* ********.*.*.*.**

I V

·****C2**********

*

INITIALIZE ** POINTER TO * • BRANCH TABLE * •_ •••••• ROLL * *********.

I I

V

**·**D2··*****·** iI

SWEEP BASE BRANCH ROLL



INITIALIZE * ilTXT CARD SUFFER*

iI

•*

*

* ***************** **** :

E2

* ***.

#040001

I :->1 * E2

.*.V

******E3***********

.* ALL *. YES * *. ROLL .*--------> *.PROCESSED..

*. • * * NO

*************

II

I

I I

I

II

V

*****F2********** **

INCREMENT ** *POINTER TO ROLL* *****************

I

I V

*****G2**********

*

** RECORD ESD *AND LOC COUNTER* * ON RLD ROLL *

* * **-**************

V

*****H2********** * MOVE * * GROUP TO * * BUFFER, PUNCH * IF CARD * * * COMPLETE * *****************

I v

*** ...

** E2 **

* **** *

118

PUNCH ANY PARTIAL CARD

V

*

****F3********* RETURN ***************

* *

Chart FF.

PUNCH SUBPROGRAM ARGUMENT LISTS G0402

****A2********* " "

PUNCH SPROG ARG ROLL

"

***************

I

v

**.-

** ...... *62 ** ** .... "INITIALIZE LOC." " COUNTER. TXT " CARD OUTPUT " AREA AND

*****~~!~!~~*****

I

"*""",, :

C2

****

:->\

#40201

.* ".

.*

C2

v .*.

".

******C3***********

*.

ALL *. ROLL • ".PRDCESSED."

*.

* •• * "

I

YES

,,---->

...

• ...

PUNCH ANY REMAINING "PART I AL CARD

PUNCH PARTIAL TXT CARD

"

*************

NO

I

I

V

*****02*********-

"

V

"

.****03*********.

" INCREMENT " :POINTER TO ROLL:

"

RETURN

I

v

E2

.". *.

*****E3**********

." ". ." ". ". ". GROUP=O .* .

" YES

"---->:

*.."

"

* •• *

MOVE GROUP TO TXT

O~0~~~ ~~EA

" :,

":

I

*

I v

CARD COMPLETE"

**********.******

.. NO

****

"

C2 :

V

40203

.... F2

." •

*_._

:****F3*********:

." TEMP ". ". AND CONST • ". POINTER ."

*.

..... * "

1040204

YES

" COMPUTE APPROPRIATE "LOCATION

,,----> "

.*

"

*****************

NO

I

I

V

: ...... **G 2"'" ** ** **

*:

COMPUTE APPROPRIATE LOCATION

**** *** *. ** *.*.**

I 1* .. ." ...

DATA THF ROLL

"

I

#040304 ".

NO

• .. ··C3* .. ••••• .. •



RETURN

"

" MOVE TO OUTPUT "AREA. PUNCH IF " CARD COMPLETE

" ° "

. _ ..... if . . . . . . . .

YES

I

I

v

V

TURN

OFF

.*

..

MOVE NUMBER

LSD TO RLD

~~

*

... • *

I~OLL

! ! II

YES

I

__"________J

V

···.·F2*·········" " "

" ................ *.* ........"

G2

•* •

...

!I.SUUPROG.

...

...

YlS

FLAG.*--,

ON

".

I I

."

... "

I

v

NO

I I

..

"

V

.

...... *H2· .. • . . . . . . . . .. S TORL LOCATION IN LOC. COllNH"R

"................................. I I

II

:* ....

I

V J2 • • • • • • • • • :

INITIALIZE OUTPUT ARlA. TlIRN ON

: .~;I~~~~~ ;.~~:~ .. :

!

...... V

".. "

84

"

"

"

It

RETURN

"

...

PUNCH PARTIAL CARD

"

.. 1{. . . . . . . . . . . . . . . . . . . . . . . . . . ..

DETERMINC LOCATION OF "5UI3PGM ADORE * ADDRESS FROM * * RLD GROUP

•*

...

.* • tiS

•• ROOM

*****************

I .*.

-**I

** *

I

#41603

*SET ESD NUMBER * PUNCH RLD * * *FROM AREA CODE * ROLL * B2 *-->* AND PUT IN * * * * RLD CARD * IMAGE *

* * *

85

V

V

*****B2*********-

#41601

.***

:

..

v - .. *85 :

**** ..

** -·-*E3--·_·---* RETURN

.-

.*.

->*.ROOM ON CARD

--._

r

*--- * I

*

:

.I

* •• *

E4 :

.....

*.

..~.

*.

.* YES

.*--,

_•. -

NO

I

V

******F4*****·****** *

PUNCH AN RLD CARD

******i******

-·w.

I I

I V I **** 1* *

I:

I

**--

E5 *. ROOM

* •• *

..

..--

NO

II

H2 :

****

,

I

V

I I :*****F5**********. I I I

t

.. SAVE NEW ESD .. NO.

*

******.*~**.** •••

1< _ _ _ 1

I

1

\

I

.41602

*.

YES .*FOR NEw LSD-. r--*' NO. ON CARD .*

I

V

V

*****C4********** *PLACE PREVIOUS *

******GS**.***'***.

.. VALUE IN CARD .. .. MARKEu FOR * .. CONTINUATION

:**:~~*~~~:!;****

*

PUNCH A'I RLD CARL>

I

1

I

I

.*.*

V

V

* C2 *• ..

*



Section 2:

..

..



.*.*

. *

C2 ..

Compiler Operation

123

Chart FK.

PUNCH END CARDS G0424

****A2*********

*

PUNCH END CARD

I

II I

I v *****82**********

*

* *SET UP END CARD*

*

*

* ***************** I

I

I I v ******C2***********

* PUNCH END CARD

*

-II

****** ...... **** I

II I I I

V

****D2*********

*

RETURN

*

*************** *

124

Chart FL.

PUNCH NAMELIST TABLE POINTERS G0564

****A2*********

" PUNCH " NAMELIST MPY " DATA

.**************

" " "

""

B4

""

" **** "

I

1

v

.". " . B2

V

*·****84*******·***

_.-·OATA ON*-"_ NO ".NAMELIST MPY ".DATA ROLL."

.****83*********.

.*------->" "

*..* * •• *

RETURN "

*************.*

j'"

PUNCH THE TXT CARD " *********.***

I

v

V

:****cz.********:

:****C4*********:

"CALCULATE NEXT " ADORESS IN TEMPORARY " " STORAGE AREA

INCREASE " TEMPORARY " "STORAGE POINTER"

" " " "

"***.*.***********"

*****.***********

I

::::::-,1

"" "

v

#056401

*****02*********-

" MOVE LOCATION" " Of' POINTER " " FROM NAMELIST " MPY DATA " "

*~**

" "

02 "

:*****~~~'*******:

I

v

E2

.*

".

.".

Jo •

.-

*.

*.

****E3********* NO'"

ANYTHING • ,,-------> " ". MOVED ." "

*..* .... *

RETURN

...

***************

" YES

I

v :****F2*********: "INITIALIZE TXT" " CARD TO LOAD " " LOCATION

:***!~~!;!!~~***:

I

v

*****G2**********

" SET " " UP RLD ENTRY " FOR WORD IN " :NAMEL I ST TABLE :

.*.**.*******.***

1

v

:****H2******.**: "MOVE MULTIPLIER" " TO TEMP AND " CONST ROLL :

**** •••• ** •••••••

I

···**J2**···· .••." " V

" MOVE " "POINTER TO TXT" : CARD IMAGE :

*.*** •• *.** ••• ***

I

V

"" "

** ...

" "

B4 "

Section 2:

compiler Operation

125

APPENDIX A:

This appendix deals with the POp· language, the language in which the FORTRAN IV (G) compiler is written. The parts of the appendix describe this language in the following way:

THE POP LANGUAGE

The mnemonic codes for the POP instructions are of the form IEYxxx. In the following discussion, the characters lEY are omitted from the mnemonics in the interest of ease of reading, and only the xxx portion of the code appears.

• The fi£st part describes the POP instructions, which are grouped according to their functions. TRANSMISSIVE INSTRUCTIONS • The second part describes the labels used in the routines of the compiler. • The third part discusses the assembly and operation of the compiler, as it is affected by th~ use of the POP language. This part ends with a crossreference list giving the mnemonic for each instruction, the hexadecimal code which represents it, and the instruction group in which it is described.

The instructions described in. this section are primarily involved in moving information from place to place in storage. APH G:

Assign and Prune Half The upper halfword of (WO) --> the lower halfword of G, where G is a storage address; the upper halfword of G remains unaltered; the BOTTOM of the WORK roll is reduced by four, thus pruning WOe

POP INSTRUCTIONS ARK G: For the purpose of describing their operation, the POP instructions have been divided into groups according to the primary function which they perform. Where a particular POP instruction pertains to more than one group, it is described in the group which discusses its most important functions.

(WO) --> P + (G), where P is the address defined by the pointer in Wi and G is a storage address; the BOTTOM of the WORK roll is reduced by four, thus pruning the value assigned and keeping the pointer. ARP G:

2.

3.

Parentheses are used to indicate "the contents of;" thus (G) stands for the contents of storage address G, where all addresses are fullword addresses. The arrow is used to indicate transmission in the direction of the arrow; (G) + 1 --> G reads: the contents of storage address G, plus one, are transmitted to storage address G.

ASK G:

Assign to Storage and Keep (WO) --> G, where G is a storage address; the BOTTOM of the WORK roll is unchanged.

ASP G:

Assign to Storage and Prune CWO) --> G, where G is a storage address; the BOTTOM of the WORK roll is reduced by four, thus pruning the current WOe

Wn (n=1,2,3, ••• ) refers to the BOTTOM, BOTTOM-l, ••• etc., words on the WORK roll.

It should be noted that in many cases the address field, G, of the instruction contains a value other than a storage address (for instance, a roll name). In most of these cases, the symbolic reference which is used is defined in the program by means of an EQU card.

Assign Relative to Pointer (WO) --> P + (G), where P is the address defined by the pointer in Wi and G is a storage address; the BOTTOM of the WORK roll is reduced by eight, thus pruning the current WO and Wi.

In the descriptions of the instructions, the following notational conventions are employed: 1.

Assign Relative to Pointer and Keep

BOP G:

Build on Polish The control driver G is built on the POLISH roll, where the G field of the instruction is the lower eight bits of the ADDRESS portion Appendix A:

The POP Language

127

of the desired driver. (The TAG field of the pointer contains zero, and the OPERATOR field contains 255.) CAR G:

EAW G:

ECW G:

EOP G:

ETA G:

Copy Plex On plex pointed to by the pointer G is -the number of the target roll, except for the first word of the plex (which holds the number of words in 'the plex, excl usi ve of itself). The BOTTOM of the WORK roll is reduced by four, thus pruning the pointer. The BOTTOM of roll G is increased by four for each word moved; the BOTTOM of the original roll is unchanged.

FET G:

in Wo is copied to roll G, where

FLP G:

FRK G:

Fetch

Flip

Fetch Relative to Pointer and Keep

FRP G:

Fetch Relative to Pointer (P + (G» --> wa, where P is the address defined by the pointer in wa and G is a storage address; the BOTTOM of the WORK roll is unchanged; thus, the pointer is destroyed. Fetch Half

Extract Address The ADDRESS portion of (G) --> WO, where G is a storage address; the

128

Extract Tag

(P + (G» --> wa, where P is the address defined by the pointer in wa and G is a storage address; the BOTTOM of the WORK roll is increased by four; thus, the pointer remains in Wi.

FTH G: EAD G:

Extract Operator

Invert the order of roll G, where G is a roll number, word for word.

Copy Relative to Pointer Copy roll S to roll G, where G is a roll number, beginning with the group indicated by the pointer in WO, to the BOTTOM of the roll. The roll number S is also provided by the pointe:r:' in WO. The BOTTOM of roll S is decreased by the number of bytes moved. The BOTTOM of roll G is increased by the number of bytes moved. The BOTTOM of the WORK roll is unchanged: thus, the pointer remains.

Effective Constant Address to Work

(G) --> wa, where G is a storage address; the BOTTOM of the WORK roll is increased by four.

The

CRP G:

Effective Address to Work

TAG portion of (G) --> TAG portion of wa, where G is a storage address: the BOTTOM of the WORK roll is increased by four.

The number of words on roll G --> WO, where G is a roll number: the BOTTOM of the WORK roll is increased by four. CPO G:

is

The OPERATOR portion of (G) --> WO (right adjusted), where G is a storage address; the BOTTOM of the WORK roll is increased by four.

Clear and Add

Count

roll

G --> WO, where G is a storage address which refers to a constant under a constant base. The BOTTOM of the WORK roll is increased by four.

Clear WO: (G) --> WO, where G is a storage address; the BOTTOM of the WORK roll is unchanged. CNT G:

WORK

G --> WO, where G is a storage address; the BOTTOM of the WORK roll is increased by four.

Copy and Release copy roll G, where G is a roll number, to roll T, and release roll G (i.e., restore it to its condition before the last reserve): the number T is found in WO: the BOTTOM of the WORK roll is reduced by four. If roll G is in the reserved state when this instruction is executed, the instruction sets its BOTTOM to (TOP) minus four: if the roll is not reserved, BOTTOM is set to (BASE).,

CLA G:

BOTTOM of the increased by four.

The lower halfword of (G) --> upper halfword of wa, where G is a storage address; the lower half-

word of WO is set to zero; the BOTTOM of the WORK roll is increased by four. lAD G:

The count of errors of the associated with the message 1S increased by one, and the MAX STA ERROR NUMBER is updated as required. If (ANSWER BOX) = false, the instruction does nothing. severi~y

Insert Address The ADDRESS portion of (G) --> the ADDRESS portion of the pointer in WO, where G is a storage address; the BOTTOM of the WORK roll is unchanged.

lOP G:

error.

LGP G:

Loads the group specified by the pointer in WO into SYMBOL 1, 2, and 3, DATA 0, 1, 2, 3, 4, and 5. The number G is the number of bytes to be loaded; if G=O, the entire group is loaded. The BOTTOM of the WORK roll is unchanged; hence, the pOinter remains in WOe

Insert Operator G --> OPERATOR portion of the pointer in WO, where the G field of the instruction is the desired OPERATOR value; the BOTTOM of the WORK roll is unchanged.

ITA G:

Insert Tag TAG portion of (G) --> TAG portion of the pointer in WO, where G is a storage address; the BOTTOM of the WORK roll is unchanged.

ITM G:

LSS G:

MOC G:

Last Character Error

Last Character Error if False If (ANSWER BOX) = false, the last character count and the address G --> ERROR roll, where G is the address of the message for the error. The count of errors of the severity associated with the message is increased by one, and the MAX STA ERROR NUMBER is updated as required. If (ANSWER BOX) = true, the instruction does nothing.

MON G:

Move on (WO) --> roll G, where G is the roll number; the BOTTOM of roll G is increased by four; the BOTTOM of the WORK roll is decreased by four.

NOG G: Number of Groups The number of groups on roll G --> WO, where G is the roll number; the BOTTOM of the WORK roll is increased by four.

LCT G: Last Character Error if True If (ANSWER BOX) = true, the last character count and the address G --> ERROR roll, where G is the address of the message for the

Move on Code G halfwords, where G is an even number, are to be moved from the WORK roll to the CODE roll. A word containing a special value in the first two bytes and the number of words transferred in the last two bytes are first placed on the CODE roll. G/2 words of infoIwation are then moved from the WORK roll to the CODE roll; the BOTTOM of the CODE roll is increased by four for each word placed on the roll; the BOTTOM of the WORK roll is reduced by four for each word moved from the roll. A location counter is increased by the number of bytes of object code placed on the roll.

The last character count and the address G --> ERROR roll, where G is the address of the message for the error. The count of errors of the severity associated with the message is increased by one, and the MAX STA ERROR NUMBER (which indicates the highest severity level of errors for the present statement) is updated as required. LeF G:

Load Symbol from Storage Loads the (G and G+4), where G is a storage address, into SYMBOL 1, 2, and 3, and DATA O.

Insert Tag Mode Mode portion of the TAG field of (G) --> mode portion of the TAG field of the pointer in WO, where G is a storage address; the BOTTOM of the WORK roll is unchanged.

LeE G:

Load Group from Pointer

NOZ G:

Nonzero A nonzero value --> G, where G is a storage address. Appendix A:

The POP Language

129

PGO G:

ZER G: Zero

Place Group On A group from SYMBOL 1, 2, and 3 and DATA 0, 1, 2, 3, 4, and 5 --> roll G, where' G is the roll number, by group status; the BOTTOM of roll G is increased by group size.

PGP G:

Place Group from Pointer The group in SYMBOL 1, 2, 3, DATA 0, 1, 2, 3, 4, and 5 is placed on a roll according to the pointer in WOe The number G is the number of bytes to be moved; if G=O, an entire g:coup is moved; the BOTTOM of the WORK roll is unchanged.

PLD G:

o --> G, address.

ADD G:

2,

Add

Add Four to Storage (G) + 4 --> G, where G is a storage address.

Pointer to New Group AND G:

DIM G:

DIV G:

Divide (WO) / (G) --> G, where G is a storage address; the remainder, if any, from the division is lost; a true answer is returned if there is no remainder; the BOTTOM of the WORK roll is unchanged; hence, the initial contents of WO are destroyed.

lOR G:

Inclusive Or The inclusive OR of (WO) and (G), where G is a storage location, is formed, and the result is placed in WOe The BOTTOM of the WORK roll is unchanged; hence, the initial contents of WO are destroyed.

(MPAC 1 and MPAC 2) --> G and G+4, where G is a storage address. This instruction performs a doubleword store.

Interchanges CWO) and (G), where G is a storage address; the BOTTOM of the WORK roll is unchanged.

Diminish (G) - 1 --> G, where G is a storage address.

Precision Store

Switch

And (G) AND (WO) --> WO; that is, a logical product is formed between (G) and (WO), and the result is placed in WOe The BOTTOM of the WORK roll is unchanged; hence, the initial contents of Wo are destroyed.

Place on Code The data located at storage address G+4 and following is to be moved to the CODE roll. The number of halfwords to be moved is stored in loca'tion G and is an even number. A word containing a special value in the first two bytes and the number of words of data in the last two bytes'iS first placed on the CODE roll. The indicated data is then moved to the CODE roll, and the BOTTOM of the CODE roll is increased by four for each word placed on the roll. A location counter is increased by the number of bytes of object code placed on the roll.

130

storage

(G) + (WO) --> WO, where G is a storage address; the BOTTOM of the WORK roll is unchanged; hence, the initial contents of Wo are destroyed.

Builds a pointer to the first byte of t,he next group to be added to roll G, where G is the roll number, and places the pointer in WO; the BOTTOM of the WORK roll is increased by four.

SWT G:

a

The following instructions are primarily designed to perform arithmetic and logical manipulations.

~>

PST G:

is

ARITHMETIC AND LOGICAL INSTRUCTIONS

AFS G:

POC G:

G

Precision Load (G and G+Ll) --> MPAC 1 and MPAC where G i c· a storage address.

PNG G:

where

LLS G:

Logical Left Shift CWO) are shifted left G places; the result is left in WO; bits shifted out at the left are lost, and vacated bit positions on the right are filled with zeros.

LRS G:

(WO) are shifted right G places; the result is left in WO; bits shifted out at the right are lost, and vacated bit positions on the left are filled with zeros. MPY G:

MOA G:

QSA G:

Subtract (WO) - (G) --> WO, where G is a storage address; the BOTTOM of the WORK roll is unchanged; hence, the initial contents of WO are destroyed.

TLY G:

SAD G:

SBP G:

These instructions inspect certain conditions and return either a true or false answer in the ANSWER BOX. Some of the instructions also transmit stored information from place to place. character Scan with Answer If G = (CRRNT CHAR), the scan arrow is advanced and a true answer is returned; otherwise, the scan arrow is not advanced and a false answer is returned. LGA G:

Load Group with Answer The group from the BOTTOM of roll G, where G is the roll number and roll G has been flipped, is loaded into SYMBOL 1, 2, 3, DATA 0, 1, 2, 3, 4, and 5 (as many words as necessary); if the roll is empty or if the group is a marker symbol, a

Search by Stats from Pointer Search the roll specified by the pointer in WO, beginning with the group following the one specified by the pointer for a group which is equal to the group in the central items SYMBOL 1, 2, 3, etc., according to the group stats values stored at locations G+4 and G+8 (these values are in the same order as those in the group stats tables). The roll number multiplied by four is stored at location G. If a match is found, return a true answer, replace the pointer in WO with a pointer to the matching group, and continue in sequence. If no match is found, return a false answer, prune the pointer in WO, and continue in sequence. This instruction is used to continue a search of a roll accordin9 to group stats values other than those normally used for the roll.

DECISION MAKING INSTRUCTIONS

CSA G:

Set on Address If G ADDRESS portion of the pOinter in WO, return a true answer; otherwise, return a false answer.

Tally (G) + 1 --> G, where G is a storage address.

Quote Scan with Answer If the quotation mark (s,equence of characters) beginning a·t storage address G (the first byte in the quotation mark is the number of bytes 1n the quotation mark) is equal to the quotation mark starting at the scan arrow, advance the scan arrow to the next active character following the quotation mark, and return a true answer; otherwise, do not advance the scan arrow and return a false answer.

Product Sign and Prune The exclusive OR of (WO) and (G), where G is a storage location, replace the contents of G; the BOTTOM of the WORK roll is reduced by four, thus pruning WOe

SUB G:

Move off with Answer If roll G, where G is the roll number, is empty, a false answer is returned. Otherwise, the BOTTOM of roll G is reduced by four, pruning the word moved; the BOT'rOM of the WORK roll is increased by four; a true answer is returned.

Multiply (G) * (WO) --> WO, where G is a storage address; the BOTTOM of the WORK roll is unchanged; hence, the initial contents of WOare destroyed.

PSP G:

false answer is returned; otherwise, a true answer is returned; the BOTTOM of roll G is reduced by group size.

Logical Right Shift

SBS G:

search by Stats If the roll, whose number multiplied by four is in storage at location G, is empty, return a Appendix A:

The POP Language

131

false ans'wer. Otherwise, search that roll against the central items SYMBOL 1, 2, and 3 and DATA 0, 1, 2, 3, 4, and 5, as defined by the group stats values stored at locations G+4 and G+8 (these values are in the same order as those in the group stats tables); if a match is found, place a pointer to the matching group in WO, increase the BOTTOM of the WORK roll, and return a true answer; if no match is found, return a false answer. This instruction is used to search a roll according to group stats values other than those normally used for that roll. SCE G:

*

SNZ G:

SOP G:

SPM G:

If the mode portion of the TAG field of the (G) = the mode portion of the TAG field of the pointer in Pl, where G is a storage addess, return a true answer; otherwise, return a false answer. SPT G:

Set on Polish Tag If the TAG field of the (G) the TAG field of the pointer in Pl, where G is a storage address, return a true answer; otherwise, return a false answer. Search If roll G, where G is the roll number, is empty, return a false answer; otherwise, search roll G against the central items SYMBOL 1, 2, and 3 and DATA 0, 1, 2, 3, 4, and 5, as defined by the roll statistics; if a match is found, place a pointer to the matching group in WO, increase the BOTTOM of the WORK roll, and return a true answer; if no match is found, return a false answer.

SRD G:

Set if Remaining Data If roll G, where G is the roll number, is not empty, return a true answer: otherwise, return a false answer.

Set if Less or Equal STA G: If (WO) S (G), where G is a storage address, a t:rue answer is returned; otherwise, a false answer is returned. The comparison made considers the two values to be signed quantities.

132

Set on Polish Mode

Search from Pointer Search the roll specified by the pointer in WO, beginning with the group following the one specified by the pointer in WO, for a group which is equal to the group in SYMBOl. 1, 2, 3, DATA 0, 1 ••• , etc., by roll statistics. If a match is found, ret:urn a true answer, replace the pointer in WO with a pointer to the matching group, and jump to G, where G must be a local address. If no match is found, return a false answer, prune the pointer in Wo (reduce the BOTTOM of the WORK roll by four), and continue in sequence.

SLE G:

Set on Operator If G OPERATOR portion of the pointer in WO, return a true answer; otherwise, return a false answer.

SRA G: SFP G:

Set if Nonzero If (G) * 0, where G is a storage address, return a true answer; otherwise, return a false answer.

Set on Character Key If (CRRNT CHAR) displays any of the character keys of G, where G is a character code whose bit settings describe a group of characters, return a true answer; otherwise, a false answer is returned; in neither case is the scan arrow advanced.

Set if Not Equal If (WO) (G), where G is a storage address, a true answer is returned; otherwise, a false answer is returned.

Set i.f Character Equal If G = .(CRRNT CHAR), return a true answer; otherwise, return a false answer; in neither case is the scan arrow advanced.

SCK G:

SNE G:

Set on Tag If the TAG portion of (G) = the TAG portion of the pointer in WO, where G is a storage address, return a true answer; otherwise, return a false answer.

STM G:

The JPE FLAG is set to nonzero, and a jump is taken to G, which may only be a local address.

set on Tag Mode If the mode portion of the TAG field of the (G) = the mode portion of the TAG field of the pointer in WO, where G is a storage address, return a true answer; otherwise, return a false answer.

JRD G:

This instruction manipulates a pOinter in WOe If the ADDRESS field of that pointer is equal to 0 (pointing to the word preceding the beginning of a reserved area), the ADDRESS field is increased to four. If the ADDRESS field of the pointer is equal to any legitimate value within the roll, it is increased by group size. If the ADDRESS field of the pointer indicates a location beyond the BOTTOM of the roll, the pointer is pruned (the BOTTOM of the WORK roll is reduced by four), and a jump is made to the location G, which must be a global address.

JUMP INSTRUCTIONS

The following instructions cause the normal sequential operation of the POP instructions to be altered, either unconditionally or conditionally. See the sections WLabels W and wAssembly and operation n in this Appendix for further discussion of jump instructions. CSF G:

Character Scan or Fail JSB G: (CRRNT CHAR), advance the scan arrow to the next active character; otherwise, jump to SYNTAX FAIL. I~

JAF G:

Jump if Answer False

Return information is placed on the EXIT roll; jump to G, which is a global address. JUN G:

Quote Scan or Fail

Jump if Answer True If the quotation mark (sequence of characters) beginning at storage address G (the value of the first byte in the quotation mark is the number of bytes in the quotation mark) is equal to the quotation mark starting at the scan arrow, advance the scan arrow to the first active character beyond the quotation mark; otherwise, jump to SYNTAX FAIL.

If (ANSWER BOX) = true, jump to G, where G is either a global or a local address; otherwise, continue in sequence. One of two operation codes is produced for this instruction depending on whether G is a global or a local label. Jump on Work If (WO) = 0, decrease the BOTTOM of the WORK roll by four and jump to G, where G is either a global or a local address; otherwise, reduce word 0 by one, --> WO, and continue in sequence. One of two operation codes is produced for this instruction, depending on whether G is a global or a local label. JPE G:

Jump Unconditional Jump to G, which is either a global One of two or a local address. operation codes is produced for depending on this instruction, whether G is a global or a local label.

QSF G:

JOW G:

Jump to Subroutine

G

If (ANSWER BOX) = false, jump to G, where G is either a global or a local address; otherwise, continue in sequence. One of two operation codes is produced for this instruction depending on whether G is a global or local label. JAT G:

Jump Roll Down

XIT

Exit Exit from the interpreter; the code which follows is written in assembler language.

Jump and Prepare for Error ROLL CONTROL INSTRUCTIONS The following values are saved in storage: the location of the next instruction, the last character count, the BOTTOM of the EXIT roll, and the BOTTOM of the WORK roll.

These instructions are concerned with the control of the rolls used in the compiler. Appendix A:

The POP Language

133

POW G:

Prune off Work

BIM G:

Reduce the BOTTOM of the WORK Koll by four times G, where G is an integer, thus pruning G words off the WORK roll.

REL G:

The instruction indicated by G, where G is an instruction number which indicates the class of the instruction only. For---example, LOAD INSTR as opposed to LE INSTR is built on the CODE roll, where WO contains a pointer to the second operand. A pointer to the accumulator which holds the fiTst operand is contained in the variable CRRNT ACC. The instruction mode is determined by inspecting the TAG fields of the pointers; the BOTTOM of the CODE roll is increased by eight; the BOTTOM of the WORK roll is reduced by four, thus pruning the pointer. A location counter is lncreased by one for each byte of the generated instruction.

Release Restore roll G, where G is the roll number, to the condition preceding the last reserve; this sets BOTTOM to (TOP) reduced by four if the roll is reserved, or to (BASE) if the roll is not reserved; TOP is set to the value it had before the reserve.

RSV G:

Reserve Reserve roll G, where G is the roll number, by storing (TOP) (BASE) on the roll, increasing BOTTOM by four, and setting TOP to (BOTTOM); this protects the area between BASE and TOP, and allows ascending addresses from TOP to be used as a new, empty roll.

CODE PRODUCING INSTRUCTIONS These POP instructions construct object module code on the CODE roll. Each object module instruction constructed results in the placing of a 2-word group on the CODE roll. The instruction generated, in binary, is left justified in this group. In the case of halfword instructions, the remainder of the first word is filled with zero. The second word contains a pointer to the instruction operand, except in the case of 6-byte instructions when the last two bytes of the group contain the value zero. BID G:

Build Instruction Double The instruction indicated by G, where G is an instruction number which indicates the exact instruction to be generated, is built on the CODE roll, where WO contains a pointer to the first operand and WI contains a pointer to the second operand. The BOTTOM of the CODE roll is increased by eight. The BOTTOM of the WORK roll is reduced by eight; thus, both pointers are pruned. A location counter is increased by one for each byte of the instruction.

134

Build Instruction by Mode

BIN G:

Build Instruction The instruction indicated by G, where G is an instruction number which indicates the exact instruction to be built, is constructed on the CODE roll. The WORK roll holds from zero to three words of information required for producing the instruction. For instructions requiring no operands, nothing appears on the WORK roll. For instructions requiring one operand, a pointer to that operand appears in WOe For two operand instructions, a pointer to the first operand appears 1n WO and a pointer to the second operand is in Wi. For input/output instructions, Wi holds a constant whic~ becomes part of the instruction. For storageto-storage move instructions, W2 holds the length. The BOT'rOM of the CODE roll is increased by eight to reflect the addition of the group. The BOTTOM of the WORK roll is reduced by four for each word of information found on that roll; thus, all the information is pruned. A location counter is increased by one for each byte of the instruction.

ADDRESS COMPUTATION INSTRUCTIONS The POP instructions whose G fields require storage addresses may be used to refer to WORK roll groups, provided the storage address of the desired group is first computed. This computation must be performed at execution time, since the location of WO, for example, varies as the program is operated. The instructions in this category perform these computations and jump to the appropriate POP, which then operates using the computed address.

WOP G:

W1P G:

WO POP

LABELS

compute the address of the current WO and jump to the POP indicated by G, where G is a POP instruction which normally accepts a storage address in its G field.

In the POP language, storage locations containing instructions or data may be named with two types of labels, global labels and local labels. Global labels are unique within each phase of the compiler (but not from one phase to another); these labels may be referred to from any point in the phase. Local labels are also unique within each phase (but not between phases); however, these labels may be referred to only within the global area (that is, the area between two consecutive global labels) in which they are defined.

Wi POP compute the address of the current Wi and jump to the POP indicated by G, where G is a POP instruction which normally accepts a storage address in its G field.

GLOBAL LABELS W2P G:

W2 POP compute the address of the current W2 and jump to the POP indicated by G, where G is a POP instruction which normally accepts a storage address in its G field.

W3P G:

W3 POP compute the address of the current W3 and jump to the POP indicated by G, where G is a POP instruction which normally accepts a storage address in its G field.

W4P G:

W4 POP compute the address of the current W4 and jump to the POP indicated by G, where G is a POP instruction which normally accepts a storage address in its G field.

The global labels which appear on a System/360 assembler listing of the compiler are distinguished from local labels in that the global labels do not begin with a pound sign. Most of the global labels are of the form Gdddd, where each d is a decimal digit and the 4-digit value dddd is unique for the global label. Labels of this form are generally assigned in ascending sequence to the compiler routines. All remaining global labels are limited to a length of seven characters. In contrast, the routine and data names used throughout this publication are limited only to a length of 30 characters. A comment card containing the long name used here precedes the card on which each global label is defined. In addition, the longer name appears as a comment on any card containing a POP instruction which refers to the global label. Example: G0336 STA GEN FINISH G0336 IEYMOA G0494 MOA DO LOOPS OPEN ROLL

INDIRECT ADDRESSING INSTRUCTION Indirect addressing is provided for POP instructions whose address fields normally require storage addresses by means of the following instruction. IND G:

Indirect The address contained in the storage address INDIRECT BOX is transmitted to the POP indicated by G, where G is a POP instruction which requires a storage address in its G field, and a jump is made to that POP. The POP "G" operates in its normal fashion, using the transmitted address.

Explanation: The second card shown defines the global label G0336. The first card, a comment card, indicates the longer name of the routine, STA GEN FINISH. The second card, contains a reference to the label G0494; the longer form of this label is DO LOOPS OPEN ROLL, as indicated by the comment. Occasionally, several comment cards with identical address fields appear in sequence on the listing. This occurs when more than one long label has been applied to a single instruction or data value. The long labels are indicated in the comments fields of the cards. Appendix A:

The POP Language

135

Example:

• •

ACTEST

AC TEST

ACTEST

TESTAC

ACTEST IEYSOP G0504 SOP FL AC OP MARK

Explanation,: The three cards shown define the global label ACTEST. One long form of this label is AC TEST, as indicated by the comment on the first card. The second card indicates that the name TESTAC has also been applied to this location, and that it also corresponds to ACTEST.

LOCAL LABELS All local labels consist of a pound sign followed by six decimal digits. If the preceding global label is of the form Gdddd, the first four digits are identical to those in the global name. The remaining two digits of the local label do not follow any particular sequence; they are, however, unique in the global area. The local label is defined by its appearance in the name field of a card containing a POP or assembler language instruction. Example:



G0268

G0268 PROCESS SCALAR ROLL IEYSRD G0432 SRD SCALAR ROLL

#026811 IEYJOW #026821 #026802 IEYITA G0359 ITA CED TAG MARK Explanation: The global label G0268 is defined by the second card in the sequence shown. The next two cards define, respectively, the local labels #026811 and #026802. III addition, the third card in the sequence contains a reference to the local label #026821, which is presumably defined elsewhere within the global area shown here.

ASSEMBLY AND OPERATION The compi.ler is assembled with each POP instruction defined as a macro. Unless "Quick Link" output has been designated to the macro by means of the assembler instruction SETC 'QLK', the resulting code 136

consists of two i-byte address constants per POP instruction. This 16-bit value represents an 8-bit numeric operation code and an 8-bit operand or relative address. The definition of the 8-bit operand or relative address varies according to the POP instruction used. Roll numbers appear in this field for instructions requiring them. For instructions which refer to storage locations relative to CBASE (see "Compiler Arrangement and General Register Usage") or to other base addresses, the word number relative to the appropriate base is used. The format for jump instructions is discussed in the following paragraphs. When Quick Link is specified, machine language instructions are generated for the following POP instruction. (See "Assembler Language References to POP Subroutines.")

POP INTERPRETER The assembled POP code is interpreted by a short machine language routine, POP SETUP, which appears with the POP subroutines at the beginning of the compiler. POP SETUP inspects each pair of address constants in sequence, and, using the 8-bit operation code as an index into the POP jump table, a table which correlates operation codes for the POPs with the addresses of the POP subroutines, transfers control to the appropriate POP subroutine. Thus, on encountering the hexadecimal value 081A, POP SETUP indexes into the POP jump table (labeled POPTABLE) at the eighth byte, counting from zero. The value found at this location is 0158 (hexadecimal); this is the address, relative to the base of the POP jump table, of the POP subroutine for the POP numbered 08 (IEYSUB). When this value is added to the beginning address of the POP jump table, the absolute address of IEYSUB is produced, and POP SETUP performs a branch to that location. IEYSUB then operates, using the relative address lA (which it finds in general register 7, ADDR), and returns via POPXIT, register 6; in this case the return is to POP SETUP, which then continues with the next POP in sequence. The register POPADR is used to keep track of the location of the POP being executed. This sequential operation can be interrupted by means of POP jump (branch) instructions, which cause an instruction other than the next in sequence to be operated next. The XIT POP insr~'~~iop

also alters the sequence by causing the interpreter to release control, performing a branch to the assembler language instruction following the XIT. This device is employed to introduce assembler language coding into the compiler routines when this is more efficient than the use of POPs. Assembler language sequences sometimes terminate with a branch to POP SETUP, so that it may resume the execution of POP instructions.

Thus, the instruction IEYJUN G0192J is assembled as 5002, for example, where the global jump table begins:

r--------,

G0075J I G0111J I

G0192J I

ADDR, ONE-CBASE (0, 0) POPXIT,FETQ function

of

the

B02 I

~--------~

I I I

In some of the routines of the compiler, the operation of POP SETUP is bypassed ry assembler language instructions which make direct reference to the POP subroutines. In these sequences, a pair of machine language instructions performs the function of a single POP instruction. For example, the instructions

accomplish the instruction

752 I

~--------~

ASSEMBLER LANGUAGE REFERENCES TO POP SUBROUTINES

LA BAL

5AO I

~--------~

POP

I I I

On encountering this instruction, POP SETUP loads its address field (02), multiplied by fOUI: (08), into the register ADDR. It then jumps to the POP subroutine for IEYJUN. The IEYJUN subroutine uses ADDR as an index into JUMP TABLE, finding the value B02. This value is placed in the register TMP and a branch is made to the location defined by the sum of the contents of TMP and the contents of CONSTR, which holds the location CBASE. Thus, if the location CBASE is lOBO, the location branched to is 1BB2, the location of the routine labeled G0192, and the instruction at that location is operated next.

IEYFET ONE but bypass the operation of POP SETUP. The IEYFET routine, (referred to by its label FETQ) returns, via POPXIT, to the next instruction. Note that the first instruction of the pair sets ADDR to the correct value for the operand of the IEYFET operation; this would be done by POP SETUP if it interpreted IEYFET ONE.

I

since the POP subroutines for global jumps branch directly to the target location, the instruction at that location must be a machine language instruction rather than a POP. Moreover, all jump target rout.ines which contain local jumps must reset POPADR to reflect the new location. Thus, routines which are jump targets and which are written in POPs begin with the instruction BALR

POPADR, POPPGB

GLOBAL JUMP INSTRUCTIONS The labels referred to in POP global jump instructions, jump instructions which branch to global labels, always end with the character J. These global labels refer to the global jump table, a table whose fullword entries contain the relative addresses of global labels which are the targets of branches. Each phase of the compiler has a global jump table. The table is labeled JUMP TABLE.

which sets POPADR to the location of the first POP instruction in the routine and branches to POP BASE, the address of which is held in POPPGB. At POP BASE, the contents of POPADR are saved in LOCAL JUMP BASE, POPXIT is set to the beginning location of POP SETUP, and POP SETUP begins operating. For the sake of brevity, this instruction is coded as BALR

A,B

in some routines. References in POP global jump instructions to the global jump table are assembled as relative word addresses in that table. Each entry in the table contains the address, relative in bytes to CBASE, of the label whose spelling is identical to that of the global jump table entry except that it does not include the terminal J.

Routines in which the POP instructions have been replaced by pairs of assembler language instructions and which contain local jumps begin with the instruction BALR or BALR.

A,O POPADR, 0 Appendix A:

The POP Language

131

instead of the instruction given above, since the branch to POP SETUP is not desired. Because global jump targets begin with this machine language code, it is not possible for POP instructions to continue in sequence into new global routines. When this operation is intended, an IEYXIT or an IEYJUN instruction terminates the first routine.

I LOCAL

JUMP INSTRUCTIONS

POP local jump instructions, jump instructions which transfer control out of the normal sequence to local labels~ must occur in the same global area as the one in which the local label referred to is defined. The address portions of POP local jump instructions are assembled to contain the distance in halfwords from the beginning of the global area plus two to the indicated local label. This value is a relative halfword address for the target, where the base used is the location of the first POP instruction in the global area.

Decimal Location Label 100 G0245 102

120

140

138

Explanation: The local jump instruction illustrated at location 140 is assembled so that its address field contains the location of the label #024503 (120), relative in halfwords to the beginning location of the global area plus two (102). Thus, the address field of the IEYJUN instruction contains the value 09.

Symbolic Instruction BALR A,B IEYCLA G0566

#024503 IEYLGA G0338

IEYJUN #024503

Hexadecimal Instruction 062A

When the POP local jump instruction is interpreted, the contents of the location LOCAL JUMP BASE are added to the address field of the POP instruction to produce the absolute address of the jump target. LOCAL JUMP BASE is set to the beginning address of the global area plus two as a result of the BALR instruction which begins the global routine; this function is performed at POP BASE, as described in "Global Jump Instructions."

When local jumps are performed directly in machine language, the relative addressing described above is also used; in this case, however, the base address is in the register POPADR as a result of the BALR instruction heading the routine.

9A12

5809

POP instruction mnemonics are listed Table 8.

in

Table

8.

POP Instruction Cross-Reference List

r-------------------------------------------T-----'--------------------------------------, Instruction Group Hex Instruction GrouE Hex Mne:,monic ~e!!!2ni£ Arithmetic/Logical Arithmetic/Logical Arithmetic/Logical Transmissive Transmissive Transmissive Transmissive Transmissive Code Producing Code Producing Code Producing Transmissive Transmissive Transmissive Transmissive Transmissive Transmissive Decision Making Jump Arithmetic/Logical Arithmetic/Logical Transmissive Transmissive Transmissive Transmissive Transmissive Transmissive Transmissive Transmissive Transmissive Transmissive Transmissive Indirect Addressing Transmissive Arithmetic/Logical Transmissive Transmissive Jump (global) Jump (local) JAT Jump (global) Jump (local) JOW Jump (global) Jump (local) JPE Jump JRD Jump JSB Jump JUN Jump (global) Jump (local) LCE Transmissive LCF AA Transmissive LCT ___________________________________________ A8 Transmissive i ADD AFS AND APR ARK ARP ASK ASP BID BIM BIN BOP CAR CLA CNT CPO CRP CSA CSF DIM DIV EAD EAW ECW EOP ETA FET FLP FRK FRP FTH lAD IND lOP lOR ITA ITM JAF

04 BC B4 A4 86 OE 12 14 7E 7C 7A 60 1A 06 1C B2 62 24 26 8E B8 2E 18 18 30 32 34 46 84 10 AE 36 D2 38 8A 3A AO 4A 56 48 54 4E SA 52 82 50 4C 58 00

LGA LGP I.LS LRS LSS MOA MOC MON MPY NOG NOZ PGO PGP PLD PNG POC POW PSP PST QSA QSF REL RSV SAD SBP SBS SCE SCK SFP SLE SNE SNZ SOP SPM SPT SRA SRD STA STM SUB SWT TLY

wop

W1P W2P W3P W4P XIT ZER

9A 80 98 B6 BO 5C 9E 5E OA 1E 3E 22 9C 90 20 94 16 92 8C 2A 2C 64 66 6A BA 96 28 6E A6 70 74 72 6C A2 AC 76 78 68 3C 08 OC 42 C8 CA CC CE DO 44 40

Decision Making Transmissive Arithmetic/Logical Arithmetic/Logical Transmissive Decision Making Transmissive Transmissive Arithmetic/Logical Transmissive Transmissive Transmissive Transmissive Transmissive Transmissive Transmissive Roll Control Arithmetic/Logical Transmissive Decision Making Jump Roll Control Roll Control Decision Making Decision Making Decision Making Decision Making Decision Making Decision Making Decision Making Decision Making Decision Making Decision Making Decision Making Decision Making Decision Making Decision Making Decision Making Decision Making Arithmetic/Logical Transmissive Arithmetic/Logical Address Computation Address Computation Address Computation Address Computation Address Computation Jump Transmissive

___________________________________________

Appendix A:

The POP Language

139

APPENDIX B '.

ROLLS USED IN THE COMPILER

This appendix describes each of the rolls used in the compiler, giving the group size, the structure and content of the information in the group, and the roll number. Each roll is described as it appears in each of the phases of the compiler. This information is useful in observing the actions taken by the various phases, since a significant portion of the work performed by the compiler is the construction and manipulation of information on rolls.

10) indicates either in-line (including which generation routine must be used) or that a call is to be generated (when the flag is equal to zero). This roll is used and then destroyed by Allocate.

ROLL The rolls are ordered in this appendix as they are in storage, by roll number. In some cases, a single, number is assigned to several rolls. In these cases, the rolls with identical numbers are presented chronologically, and the overlay of one roll on another indicates that the previous roll is no longer required when the new roll is used. The group stats values for rolls with the same number are always identical. The roll number is the entry number in the roll statistics tables for the appropriate set of statistics; that is, the roll number multiplied by four is the relative address of the correct entry in the group stats, BASE, BOTTOM, and TOP tables.

1:

SOURCE ROLL

This roll holds source module statements while they are being processed during the operations of Parse. The roll is not used by any later phase of the compiler. Source statements appear on this roll one card column per byte. Thus, each card of a source statement occupies 20 groups on the roll. The group size is four bytes. The sta tement A(I,J)=B(I,J)*2+C(I,J).*2 would as:

therefore

appear on the SOURCE roll

4 bytes

ROLL

0:

r---------T----------T----------T---------, I bib I bib I

LIB ROLl!

~---------t----------t----------t---------~

This roll contains one group for every name by which a library subprogram can be referred to in the source module. The roll is contained in IEYROL and remains unchanged in size and in content throughout compilation. The group size for the LIB roll twelve bytes. Each group has the form:

is

r-----------·------·-----------------------,

I FOr an: "array;:! 'IHCFCbMH/' :tHcECOMHi;repeat's :theprocess:, emptying the a'tray~ el!ement "'by'.'elemerit~\" After adjusting ii!!j" ,bu'fferr'po±nt'er' :SO it pOints to either thEfl tri~xt :,data'itemor thehexteinpty space, IHCFCOMH/IHCECOMH returns to the' compilergenerated code.

"

PREVIOUS OPERATION--READ OR WRITE:

In'this the unit block in existence. The DECB is set to indicate the proFer action (either"'te'tid or write). If 'this 'is a, write'req-uest, control is :re'turned" to ' IHCFCOJ!ll'H/IHCECOMH with buffer address ana "length. If;iJt is a read" request, the' READ' inacrb is 'i~su:ed to fill the buffer, and the address'andlength of the data'that was read'is passed 'back to IHCFCOMH/IHCECOMH.

case;~he-data-set-Is-already-open and

PREVIOUSOPERATION"'-B~~KSPA'C~':

tibn'

is

The procedure is the same:; as for the first list item, with these exceptions. When IHCFct>MfLI'IHCECOMH is) pfodess1.ng: 'a "read req,uesl:.'· a:J!fd!fiirid'B lit has'~mI1t.ied~ the buff~ er, it calls IHCFIOSH/lHCEFliOS ,'to it'sue another READ ma,cro and refill it. If do\Jble 'bUff'ering" \ ;t's~'i-n:: eflecti\'! IHCFt06KY I,HCEFIOS: ipass~s ''tl1e 1~ ,'address'! of the other btlff.r(afte:r" iCh~c){inqthe. R'EAD:\,The' 'Oper'li-

slme' ~~~ 'fdt,,~pr~vious Operatio'n-~Rea'd or wti te"' deScribe8' above, except that priming of buffer(s) may be needed. ~,Ithe

I '

PREVIOUS "OPERATION--END FILE:' IHCFIOSH/ IHCEFIOS must first 'close the' existing datia' set, and, process a new one. 'To proce's's a" new data set, IHCFIOSH/IHCEFIOS' increments' the sequence'humber of the DONAME field in~ the old DCB: for examp'le; FT14FOOl is' changed to FT14FO 02" 'The OP'EN procedure described' above under' "No'" Previous opera;;..' tion" is then, followed .. , (The librarty assumes the user has a FTnnF002'DD card fo'r this new data set.) The' usual read or' write procedure is used. PREVIOUS OPERATION--REWIND: The data set has-been-closed;-and-mn6tlbe reopened. The procedur~ is the same as' that described,': under "NO Previous Operation," beginrtihg' after th~' creating of the unit block~ In'allof the above cases, IHCFIOSHI IHCEFIOS returns to IHCFCOMH/IHCECOMH~'which saveS" the buffer pointer and 'length, and' then returns 'to the co~piler~generated code. ' '",

. .'d

second Call

.;

", , .. j

~;. _

1

I

I' , ~

',:,':'.

I

j

.;; I

,.

"

i

,

~~,

,"

,"

..~

:1

Fina'i I"

Call I)

P

,f

~

,~

.• r •

.~

:,'

.

.. , !

, : Ft)r a' 'it'ead operat.ion; the :fual.tl' pro~ratfl i passes control't.o 'IHCFCOMH/IHCECOMH' which passes control on to IHCFIOSH/IHCEFIOS. If IHCFIOSH/IHCEFIOS finds that, for this data set, physical records are larger than logical records, it simply returns to IHCFCOMH/IHCECOMH, which returns' '''to "the> compiler-generated object code. If physical records are shorter than logical records;) ;'IHCFIOSR/IHCEFIOS 'issu~li; 'READ 'Ina,erOS until: "it reaches' the"'~end:bf')theIGgica'l:: record. : ThHf posit.ions :the; ;devit:!e, at;: the, beginning of tlie" next logical"record,'r.iti preparation: 'for sUbsequent "'F()~TAAN 'R~Al>: re9u:ests' fot this-unit.;'" I.',

" .: i

~.



:

:: F'()r~', a': w'ri t'e'

i

,.~~.{

, 'When' :'" I HCFCOMR"'lHCECOMH' ,; is "processing a write request and finds itih~~1G~illed the buffer, it calls IHCFIOSH/IHCEFIOS to issue the ,: ac,t.ual 'WRITE macro';; "Ifi'dbuble i)'uff e'rJ. ing is in effect, IHCFIOSH'IIH
. i~ ':

The compiler-generated " code calis' IHCFCOMH/IHCECOMH, ',passing 'irtformatiort: about ,the first item in the I/O list' (its: address, type, whether it is a variableior' array,etc.)~If this is ,a read, requese' for a. variable, IHCFCOMH/IHCECOMH takes t:he' proper number of bytes 'from' the buffer aria:' moves them to 'the tndicated ',address. ':'For'~ an array" IHCFCOMll/IHCECOMHrepeats" the' process, filliri9 ,tHe arrayelertte!nt "by ele~ mente If this 'is awri te requestfor'fl ' variable, IHCFCOMH/IHCECOMH takes the' item from the indicated address and moves i t

,J

I·.~

.'

f.

':1 ~; -"

!. ~ . ,;. ','~

" : ' ~ ,

operation,

IHCFCOM'H/IHCECOl'JH giv'~s: corftrol to l'HCFIOSH(:JHeEFIOS~''If the,: dat~ "set"is unblocked.'; or i;f, , it' i's"blocked and' the 'buff'er i,s: "full,: ,tHCFIOSJl/IHtEFI{)S~, issues' a final WRITE mac't'o.';,;, ;':,:,,'," ~i:": ,,;,r No.

GY2~-6638-1,

page revised 1/15/71 by TNL GY28-6847

If the user passes any other number, IHCFDUMP chooses 0 (hexadecimal) default format. The procedure is identical for PDUMP, except for two things:

as

a

DUMP and

• if DUMP finds an input/output corrective action routine is in process, it functions normally~ PDUMP, however, instead of processing, goes to section ERR904 in IHCFCOMH/IHCECOMH to print prror messaqe 904 and to terminate load module ex~cution. (An input/output corrective action routine in process is indicated by the first byte of SAVE in IHCFCOMH/IHCECOMH set to anything other than X'FF'.) • after normal processing, DUMP goes to the IBEXIT section of IHCFCOMH/IHCECOMH to terminate load module execution: PDUMP, however, returns to the caller for continued execution. IHCFDUMP uses IHCFCVTH and IHCFIOSH/ IHCEFIOS to assist in its operations. After getting the address of IHCFIOSH/ IHCEFIOS from IHCFCOMH/IHCECOMH, IHCFDUMP branches to initialize for printing. It next moves a section to be dumped into the IHCFIOSH/IHCEFIOS buffer, and determines the format type requested.* It passes this information to the FCVZO part of IHCFCVTH ('Z' output), for conversion. Lastly, it branches to IHCFIOSH/IHCEFIOS to print out the line. IHCFDUMP loops in this manner until it exhausts the calling list. If, during the printing, IHCFIOSH/ IHCEFIOS indicaies it has encountered an input/output error, IHCFDUMP skips the remainder of its work. \-

IHCDBUG has a single entry point-DEBUG#--which is the head of a branch table. This table is outlined in Table 12. Table 12.

1

Iplace-I to I Iment ISection I

236

I

Function of Routine

o

TRACE

Pass label of statement I to be traced I

4

SUB'IREN

Pass subprogram entry

8

SUBTREX

Pass 'RETURN' on subprogram exit

12

UNIT

Initialize reference output

16

INlTSCLR Pass data for initialized variable

20

INITARIT Pass data for initialized artay element

24

INITARAY Pass data for initialized array

1

name

data number

on

I

set for

SUBCHK

Pass data on array element

32

TRACEON

Turn on trace switch

36 .

TRACEOFF Turn off trace switch

40

DISPLAY

Display referenced items

44

STARTlO

Begin input/output operation

28

L ______

*IHCFDUMP I"xpects tl.e format type requested to correspond to the format of the data in main storage. Therefore, asking it to print out an INTEGER variable in REAL format, for example, will result in a garbled dump.

I

~------+--------+-------------------------~

48

IHCDBUG is called by the compilergenerated object code to implement most user DEBUG requests. Generally, IHCDBUG assembles debug information and uses IHCFlOSH/IHCEFIOS to write it out. lHCDBUG may also have occasion to use IHCFCVTH (for data conversion), IHCNAMEL (to produce DISPLAY requests), IHCUATBL (to obtain the default object error unit number), and IHCFCOMH/IHCECOMH (in which to store user reqisters).

IHCDBUG Transfer Table

r------T--------T-------------------------, IDisIBranchesl

referenced

I

IENDlO lEnd input/output I ________ I opera tion ____ - __________________ _

~

~

In addition to the 13 routines listed in the branch table, IHCDBUG uses the following subroutines: • OUTITEM, which puts a data item into DBUFFER • OUTNAME, which puts the name of an array or variable into DBUFFER • OUTINT, which converts an integer to EBCDIC • OUTFLOAT, which puts a floating-point number into DBUFFER • OUTBUFFER, which controls the output operation for DBUFFER • ALLOCHAR, which moves a character to a save area • FREECHAR, which extracts a character from a save area • OUTPUT, which transfers DBUFFER to IHCFIOSH/IHCEFIOS for printing

Order No. GY28-6638-1, page revised 1/15/71 by 1NL GY28-bf47

The following items in IHCDBUG are initialized to zero at load module execution time: • DSRN, the data set reference number • TRACFLAG, the trace flag • IOFLAG, the input/output in progress flag • DATATYPE, the variable type bits Whenever information is assembled for output, it is placed in a 77-byte area called DBUFFER. The first character of this area is permanently set to blank to specify single spacing. The next seven characters are the string--DEBUG--to prov1de a labeL tor the output. The functions sections are:

of

the

various IHCDBUG

TRACE If TRACFLAG is off, control is returned immediately to the caller. Otherwise, the characters 'TRACE' are moved to DBUFFER, the section OUTINT converts the statement number to EBCDIC and places it in DBUFFER, and control is passed to OUTBUFFR. SUBTREN The characters 'SUBTRACE' and the name of the program or subprogram are moved to DBUFFER and a branch is made to OUTBUFFR. SUBTREX The characters 'SUBTRACE *RETURN*' are moved to DBUFFER and a branch is made to OUTBUFFR.

and places a left parenthesis, the element number (converted to EE,CDIC by subroutine OUTINT), and a right parenthesis in DBUFFER following the array name. A branch is then made to OUTITEM. INITARAY If IOFLAG is on, the character X'FF' is placed in DBUFFER, followed by the address of the argument list, and a branch is made to OUTBUFFR. Otherwise, a call to INITARIT is constructed, and the routine loops through that call until all elements of the array have been processed. SU13CHK The location of the array element is computed. If it falls within the array boundaries, control is returned to the caller. If it is outside the array boundaries, SUBCHK places the characters 'SUBCHK' into DBUFFER, and computes the element number. OUTINT converts this number into EBCDIC and moves it into DBUFFER. OUTNAME moves the array name into DBUFFER. Finally, OUTBUFFR is called. TRACEON TRACFLAG is turned on (set to nonzero), and control returned to caller. TRACEOFi •. DIRECT ACCESS, .-------->0 •• •• '. .' '. •• • FRf.SH READ '.

• •

' . . •

"l"~HITI::

' . . •

··.·~O

.: tH" :. ••••

Hi' '. '.

•• ., • 'BUFFER FULL'. YES '. YET •• ----•• ••

••••• H3.......... •

j ....Kl.........

....... .... ....



•••••••••••••••••

·..................

HII



1) • • • •

If!

."

......... j •

It • • • • • • •

J2 •. • •••• J) •••••••••• •••• .DIOCS. • •••• JII ••••••••• •• ' . YES .-.-.-.-.-.-.-.-.. • --> •• ~~RECT ACCE~~,'--------): WM~f~UT :RETURN TO MAIN:

·. I .... ·K2·········· .-.-.-.-.-.-.-.-. ' ... .' .

NO

.



'FIOCS. • • MOVE CORRECT • .-.-.-.-.-.-.-.-. ~AMOUNT OF DATA' .--------).FROM BUFFER TO • FRESH READ' '. LIST ADDRESS •

• •

••••• J l . . . . . . . . . . • • 'MOVE LIS'l' ITEM' : INTO BUFFER:

·

t)l

:::1'· ~o

'.

::~::

.:::: ... ........ j . :.... :-> "4 •••••••••• I)

"1"~0

.FIOCSM

...................

...............

l .... ->: ....

Jl :



............ ..... .. L>:'....::':

'RETURN TO MAIN • • • • •

WRITE OUT BUFFER

• •

Appendix

F~

Object-Time Library Subprograms

2-43.1

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

Chart

IHCFCOMH/IHCECOMH (Part 3 of 4)

GO.

FSTOP

101

.'.

'.

••

FPAUS

• •••• 102 •••••••••• I.





• • LOAD MODULE'. N O ' • ' . IN FOREGROUND •• -------->.ISSUE WTO MACRO' e. .' • •

*. I

•• '

.'

• • •••••••••••••••••

.'.

'.

' .. '

.....................

.' .'

• •

1., •

..

' '.. .

.1::::---------------------------. -..-.. --------__ ..J' '"

•••• J2 •• • ••••• • 'RETURN TO MAIN' • PROGRAM •

·................

243.2

00

,

·······1·······

• •

ISSUE WTOR MACRO

. ........I::::::::----------------·

• •

.

• •••• AS •••••• ,••••

r" ·····S,,·········· · .

······Sl·...·...... ··.................. MESSAGE TO TERMINAL

A"

'. '.

r~

• •

.

....

• • LOAD MODULE'. NO • ' . IN FOREGROliNO.o-------->.

• •

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

chart

GO.

IHCFCOMH/IHCECOMH (Part 4 of 4)

.

IBFINT : ........ A4" ............... :

·.................................. r:;SUE t;PIE

1

.. ........ fL~""""""""" .. :1{!::TLlfn Tu MAIN:

..............................

·



fiTAF

..............................

.

..

j ........ ·C4 .................. .. • FIOCSM •

.°-.-.-.-.-.- ..... -.°

·................................. •

-.-.-.- ..... -.-.- . ·............................. .. ·A~·

°IHCERRM

OPEN O&T!::(,T f:RfWR UNIT

..



..

1

.......... a~·"""""··""



............... T(, Mil I il

CLl)S!:: FI LE.S



0

:

.. . . . . . 011 . . . . . . . . . . . . . . . . . . . . . ..

I

:•... c, ......... : oDELET!:: HIC.'IDJST • : IF LOIIDt.D •

·

(I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

: ........ i

°•

.

• FIUcsn • +-+-+-+-+-+-+-+-.

I

"1 . . . . . . . . . . . . . . . . . :

....... p4+ .............. ..

•O"E1lJfW



ERROR SUMMARY :

:

j

j

: ........ 84 .................. : I~;SUE

....... ............. .

IBEX IT

Ol'ANl'~.L

::1'11-. AN".

·............................. .. •

:.'ll1r:



..

j •••• '·;'1 •••••••••

·................. .. kl·.TIIRN I'll :.1 II' I-t< V (:: .• 1{

Appendix F:

• 0

Object-Time Library subprograms

243.3

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

Chart

IHCFIOSH/IHCEFIOS (Part 1 of 2)

Gl.

·····A11I········· ................:-------------_>

--OETERMiNE-oPERii:rioN-TYPEiNiTiii:LiZii:TiON------jFiNiTREAD WRITE DEVICE MMIPULATION FINAL CALL

FlOCS.

.....

NOTE:

THIS MODULE IS CALLED BY I HCFCOMHI IHCECOMH FOR USER-REgUESTED SEillENTIAL 1/0, ~~~ ~tssIM~Rwk!nNG: ROUTINES

FI •.

'..

.

.'

j •

NO

• •••• H5 ••••••• ,••• 'IHCERRM'

'---1 :.'-'-'-'-'-0-'-+-'. YES

ERR~Ik~~¥I\GE :---

1:~: :-::r ::~;: [~~~~~~~~~~~~

CR2 ••••• J ) . . . . . . . . . . : READ A BLOCK

FIO~~r •• JII..........

:H~M~Tlc~~~~~Io{

: R~~gk50~~~~~" :

:

: ••..•.•.•.••.•. :

: .•• r~. ~~~~~~ .•. :

::::: :->1

1 0" 0.... ...............

INVERT • ••• OK) ••••••• 'INVERT BUFFERS • • • AND DECBS IF • • :O~T~u~iiR~UBLE: :

0"

·········1·· . .·····. ··.... .. .... Gil •

I •

I.

NO

.'. HII '. •••• . ' 1/0 ERROR ' . o. IN lOS . "

WRITE

'. f'AO



'.

' . SPECIFIED •• ••••

....

'.

••

G!l

o:'H~~E~NR~2~ ·:.!~~----->.:~~E ,&~~t;~~::.!~~

.'

: :

Gil

:~~~:: .::" :->1

1

OPENRW

'.

Dl'TEIU'IINZ • I:PR~~E~6f>p~~§s SW: •• •• • ERROR SUMMARY •

.·....*--! ·02 • B4

EOFM : •••• B3 ••••••••• :

CTLRTN

o.B4

0 .0

RWND : •••• 85 ••••••••• :

*0.0

·..................

' '.. . .'

... ··Cl··········

.....J........

.....J.::::...

·....... ...........

.f................

................ .

.................

'. .'

I"

••

.

.

••••

j

D1

1/0

'. ERROR ••

NO

COR~~~TED '. .' •• • +-----------------1 '. • .'YES

.... l->:

ISSUE CLOSE WITH REIU.AD OPTION

• + •

I

j

• •••• 0).. ••••••••

• •• ··04 ••••••••••

t • FREE 1/0 • RUFFERS t'OR t THIS DATA ~;ET

t ADJU"T THE • tHECPTR TO POIN1 • • TO PHECEDIN(, t ·LOGICAL HF.COkLJ •

• t

·.................. 1................... *-----

t

I

---------->

·01 •

.. ..

.

• • ISSUE. • ••• C~ ••••••••• • • APPROPIHATJ:: • • • • • NUMBER OF' BSP • • RETURN * • • (Ph'fSICAL.. • • • BACKSPACE I • • •••••••••••• '••

1

••

...................

WRITE LAST. EOF •• DETERMINE .0 RfW • RECORD .* • •• 1 'fPE 0* *

• • ISSU!:; CLOSE • (T'fPr;=TI WITH • LEAVE OPTION •

• DATA MANAGEMENT. • RETRY • APPROPRIATE • • • NUMBER OF TIMES.

.•.

• • •

Jij ••

..... E2··········

+-+-+-.-.-.-.-.-. ·............... ... • IHCERRM

. .............. .

• • •• ·E3·.·.·.··· RETURN TO • • ERROR MESSAGE .-------->.CALLJ::R AT ElHWH· IHC21RI. • OFn;ET • •

L_ _ _ _ _ _ _

·... ·Eq········· . :

............... RETURN

I IF EXTENDED I ERROR HANDLING

rI~H~~~~~'

L __ ~~~~~~ ___ _

....

...... ..0 HJ '.

.·.··HII.····· ....

..... J3..........

.....

·02 •

• H3 .--~

"r . . . .1'. . ..

• • CURRENT. 0 t IF EXTENDUJ • •• UNIT THE •• YES .ERROR HANDLING • • o~~E~~1 ~RRO~. 0·- ----- -- >:PR~~E~~"p~tL~W: • 0 o. • J::RROH 5UMMAk'f •

•••. ~~~~~.;~....

...............

:!~:~~~.-.-.-.-:

.

:CALL~~F:iTERROR:

DIOCSII



DASREAD







GET DSRN

c2

•••

..

. . ..................

••

• •••• C3 ••••••••••

•• IS RECORD •• NO .OBTAIN ADDRESS • •• IN BUFFER • ·-------->·OF INPUT BUFFER.----------·-------

i

02 ., ••••• 03. •••••••• • ..... 04 •••••••••• •• •• • • • INSERT RELATIVE. , . IS THIS A ., Y E S . • .RECORO NO, INTO • ..FIND REQUEST •• ----• READ A RECORD BLKaEFA OR • •• ,. • • • BLJ(REFB FIELD •

.................. . ................... ....

.. .. ....

.:~i:·..

.....

·03 • El •

:!'~~~._._._._:

..... ...

• EXAMINE • -->.JFCBIN02 FIELD • IN JrcB • •

CHNOT

->.

••••• 1t1 •••••••••• ---------

ERR~cHrfAGE

••••• J2· •• • •• •••• • ~ JOB FILE.

· . ·........1"....... ... .. .. .0 .......... .. l . . ....

CKOISP ·····03··········

~~~"T""'"

r

:

¥:p:



• NO

:0~2:

i

••

I).

•••••

GETUB ·····H2··.······· • CONSTRUCT UNIT • • BLOCJI:. INSERT • • ADDR or UNIT •

..................-------->. .. ... .. ---1 .. ...... 1 ... .. .. .. .. .... ....

•~ •• YES ---->·.WRITE REQUEST ••

...

NO

........ j .

·····F4 .. ·.···.·.

, . PREVIOUS ., YES -->.. OPERATION •• •

........

o

• UPDATE. • ••• FS ••••••••• • ASSOCIATED. • RETURN TO • • VARIABLE SO CALLER • .THAT IT POINTS • • • .TO NEXT RECORD • • ••••••••••••••

.,

.. .. .. ..

··r

.-------->.,

·.................. .... .. .... ---1 G2

,., E4 ., ••••• ES •••••••••• •• ., • UPDATE ASSOC • •• IS THIS A ., YES • VARIABLE SO • FIND REQUEST •• -------->.THAT IT POINTS. ., •• • TO RCD JUST • ••• • • READ •

.........

-->.

• •• ··F2 ••••••• ••• • PLACE BUFFER • • POINTER AND • • BUFrER SIZE IN .----• REGISTERS •

J1

l.

.•..

• • .SET FIND SWITCH. -->. OFF

···.KS·····.··· RETURN TO • CALLER •

• 04 • • JS •

Appendix F:

Object-Time Library Subprograms

.245.1

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

Chart

G2.

IHCDIOSE/IHCEDIOS (Part 3 of 5)

.... .... .--1 003 0

o Bl •

0

BSAMOPEN

······B3···........ .··.................

v

OASWRITE.

: ..... Bl* .......... :

• OPEN DCB FOR • NEW DATil SET o

• • •

·................... ,,~m 1..··.·· •·····Cl··,~ LKI:.A'l'l:: AND

• oFORMT NEW DATA-

·................... :SE~fu¥~I~c~~AM:

..

\

1

: ••• +D1 ••••••••• :

...... ........... .. • CLOSE DCB FOR • : • DATA SET

:~I:·...->1 ·...·····1-.:1 ....••••••

'WRITE A RECORD •

SECONDARY ENTRY

j

·····C3···· .....:. __

·····C2·.· •••.•••

• INSERT ADOR OF • • IlLKREFB INTO • -->.DECBB SKELETON. • IN UNIT BLOCK • • IF TWO BUFFERS.



.................

i:~>'l .. . D2

..

'. ' .

.................

·····03·1........ .

..

'INSERT I.MESSAGE IHC222I. ..

'..

'.. '.. ..' ..

'..

..

I'"

.INITIALIZE FILE. • VIA FIOCSII

••••• F3" •••••••• .WRITE NAMELIST • • NAME •

1 ·.... ·G)*········· . ·........1"........ • IMPLEMENT WRITE. .USING NAMELIST •

--~

...

• TERMINATE JOB •

·..... E2*·········. • GI VE ERROR • .MESSAGE IHC22lI.

·..... Fl'·········.. ·..................

······03········· ..................

··................. • •• 'H)*' •••••••



RETURN



······Jl········ ... · . ;:~ ~:;::1::::::::----------------····Kl·········.. ··............... • IMPLEMENT READ • • USING NAMELIST •



RETURN



Appendix F:

Object-Time Library sUQprograms

247

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

Chart

G4.

IHCFINTH/IHCEFNTH (Part 1 of 3)

······1.3········· ................. •

MITHII



1 ..... ······B3·.·.· . ·.................. • OBTAIN • 'UITERRUPT CODE •

j

.' . ' • C3

--------------------., '..'.' NO, •

IS

'. "

n.n;~~~¥~

.

I •• '

.'

.• '

'---1 YES

.....

.

003 •

• • F~'

1 DETERMINE INTERRUPT TYPE

-SPEC i rlcATIoN ----------SPEC ---DATA FX-PT. OVERFL. FX-PT. DIVIDE FL-PT. SIGI'!. DEC. OVEkFL. DEC. DIVIDE EXP. OVERFL. EXP. UNDEHFL. FL-PT. DIVIDE

SPEC

.

.

RETURN ALEItT FXOVC ALERT A LF. R'l" DVCHJ( FPOVF FPUNF DVCHK

t'XiJVC

.'.

Ft

'"

'.

.. . '. .'

YES •

• ' IS IHCADJST'. YES '. LOADED •• ---

'. .,.

-----------------0.

j

· . ·.................. :

LOAD IHCI'.DJST :

1., CODE AFFECTED, .--•• ,.

,. NEW •• •, INTERRUPT ·,OCCURRED ••

'. .'



1

.'. .. '••. • .IS BI.lUNDARY ••

'.

·......

••••• :

.:

ERR~~cf.iij¥"GE :



• o.

'. '.. .' ..' o YES

.... H2··········

"ADD INDICATION • TO MESSAGE •

---->,'



····K2·········

................

'.CALL IBEXIT TO • • TERMINATE JOB • "

lI ERROR IF EXTBHDED IlANDLING lxs NOT PRESENT, l IHCEIUIM ENDS

L_~~~~

___ _

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

Ga.

Chart

........ ....

IHCERRM (Part 1 of 2)

........ ....

• Al •

IHCERRE ·····Al·.·· ••• • •• ---- .. -------------------• • I CALLED BY IBCPCOMH/ :IN~~A~~'Y: IIHCECOMH FOR ERROR • • I SUMMARY DURING LOAD

I.c:. ·l·. . : L~_~~~:~~__ :· ·. ·l·····: L~__________ •••• ·B1····· •••••

•.SAVE



----f"----------------

REGISTERS. : AND k~SAVE :

II CALLED BY LIBRARY ROUTINE I DBTBC'l'lNG

· · · . r·. . · ·····C1·········· • MAKE INITIAL •

:CAH;ri°B~~~1I :

• ADDRESS I • ••

.. ... .. .. .. .. .. D1

!

!

••••• Al.......... • PRINT •

• •••• A5 •••••••••• • •

:T~~C~£lg~T~UE:



:GfIs~O~~~i ~~:

ENTRY MESSAGE.



l~~~~::r·····: •••••

• •••• Bs •••••••••• • • • GET NUMBER OF • : ENTRIES :

••••• Cl.......... .IHCETRCB • :-.-.-.-.-.-.-.-: .GIVE TRACEBACK •

• •••• cs •••••••••• • •

:······r··..·:

~:~~:;:T·····:

:E~R~U~~RT~rS:

• ENTRY • ••

..···..T..·····

03.•.. .. . . ...... 011.......... . . . .05... .. .. . .. . .. . . . . .. . . . .. .. .

• • ENTRY FOR •• YES. • •• SUMMARY •• ---->. 1.5 •

•• FREE BUFFER •• Y E S . • •• AREA •• -------->.ISSUE PREEMAIN •

•• ANY ERRORS •• NO •• OF THIS TYPE •• ---

c' ....

·}~-------------;;;;;~;!:::::::::.TBAT ERROR NO. • •• ' . TABLE ••• :18 NOT IN TABLE:

·········l··;ii::· ->:

NUMBER

..... •• .

••

:.::.: ··1··~0 .....Xs..........

....

• •••• •

:~~ iMr:d~Y:



••••

YES ••

r---··MORE ENTRIES.· •• •• • .' •

G2..

..····n··········. ·········1········.

: •



•• J5

••

•'

···l··~S

PRINT LINE

::....D:i~¥.,:g:RIO

:......T......: •

~

. . ·. ·F:::::---

Al :

~



GET E X I T : ADDRESS I F . SPECIFIED.

:



RETURN

:

• ••••••••••••••

• 02 •

• Al·

Appendix F:

Object-Time Library Subprograms

~53

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY2S-6847

Chart.

GS.

.... ·......--L.,

IHCERRM (Part 2 of 2)

·02 •

• Al

.

o. ·

,

Al

.,

~~IT G~e~~ES~.

*. '.

0

YES t ________

.' . •

,

>: •

.

SET SPECIAL EXIT SWITCH

• :

................ l ....... •



->: .~~.:

• NO

1.,

+.

Bl

.

••••• A2" •••••••••

'.

1/0 ERROR t,

·0

• •••• B2 ••••••••••

,. t, tPRltlT EXECUTION. , . CONTINUE ., NO .TERMINATING om:. t, (BAfED ON , t ________ >tTO ERROR COUNT t t, COUNTS t ,t • MESSAGE •

.

.

'. *. .' .

i

• t ••• t :

l->::~t·.

YES

:->[

Cl

• •••

,.

IlJ ••

v

Cl

.

•••••••••••••••••

, +.

•• "'e2* •••••••••

• ••• -C3' •••••••••

, . PRINT., • • NO , . MESSAGE " YES .GET ADDRESS AND. ___ t, (BASt'O ON ,.-.,------;.. LENGTH OF : MESSAGE: • , t ~OUNTS ~ . ' •

'

t

PRINT MES~AGE • SET ME~;bAGE. PRlIlTED • INDICATlCiN :

.-------->..AND

..................................

... '

:

,.,v--- ----. ------ --- --- ------ ----- -- .-------- -- -_____ .J ,.-,------->. ------->. '. .' . . . 'f~-:::::r.......

.V1

••••

: •••• 02 ••••••••• :

, • hUNT ., •, llUFFER .,l'lJNTENTS , .

YES

: •••• 0) ••••••••• :

"GET ArlDRFSS A N D . " LEllr,TH O~' •. PRINT .CURRENT DUFFER. •

B\J~'fER



_ _ - ------.:::::::::.:.:::. _--_--::

\1

••• ··.:

.C'.

• .~.l •••• : •••• 1:.2 ••••••••• : :~~~.~¥~t~· , . l'RACE:BACI< ., YES tRl::~OVE UNf: SAvr. .-.-.-.-.-.-.-.-. RE.AREA FROM ('HAIII.--------~. • •• , • • • • CALL 1 RAl r,; •

..

. .'

'.

:':.;. :->I

. ...

••••

·

.

. . .................. ..................

t.

'. '. .' 4'

..

..

:.~~.

RI::TlIRN CODl::. TO 1 •

.................

G2



II

'.

1

·.................. .•••.• t->: ... . II~,FH

,

:

'.

H2

.,







'.

t.

'. '. .' . •

.



NO

······J2····I .......

·...................

·

j

••• 'K2' ••••••

.'



•• 0



...................

.'

. G4

~'R~:l::MAIN·

,. TAKE ., n;:: • REt.I!'TI:.R!' AND • •• SPl::CIAL I::XIT ,"-------->.TURN U~'~' l::NTfl,( • !iWl1'CH



j ••• tJ J ••••••••• • EXIT 1'0 • :SPECIFIW POINT:

...............

..

t_

.-.>

.'



'.

I •• 1

H4

.

••••••••••••• III.

. :

. . '!. t.

NO

t.

••••

Yt.~

:

...1

.,

••••• •

H~ • • • • • • • • • •

..................

.. ., ,. . •

(;2 :

0





, . USER EX IT., '( E~ • PRI NT MESHAGE • •• TAKEN , •• -----, -".INDICATING USER.' ., •• • FIXUP • ,

. j

l->: ·G~...

NO

...... :

· . ·............... . · .. . l ...... • •••• J" ••••••••••

• PRINT MESSA\;t; • • INDICATING • .:;TANDARO FlXUP •

o

III'

:

PH I NTEU , " t-.

- >.

RETURN

n

0

M.!::!;SA(jl:.





ft ••

t

•. :

1

• (;4





• . . . . . . t •••••••••• • RI:.~,T(JHt:; U!,FH!j •

t.

I

RI::lNITlALIZl:: FlOC!;"

: . . . . . .; j • • • • • • • • • :



.TURN OFt' ~:NTHY • : :';WITCII •

254

(~q

. . . '. Co-_____ ___ ::::::::r.......

• •

t.XIT :

(i4

.,

.

,

,-t_._t_t_t_t

:"ALI.

• ••••••••••• t ••••

• :

,.FREE 8UF~'ER., Y E S . •• AREA •• -------->.I~SUI:.

: •••• ill ••••••••• : I-t·



• • :

CHAlN

.~'luCSN

------>.

·02 •

: •••• (;1 ••••••••• :



:

.... t',,··········..... . . ..-.-.-.-.-.-.>: ................. . · ....

F2 ••••••••••

.St;T RETURN CODE' TO 0

••••

YE~;

I

'S~:T

.. .'---1 . ................... .... ·· .. '--t.. .. • ••••

'.

•• lJSl::1! EXIT " NI) Rl::f,;UE!>TEO ,.- ..

-->..

~"

N()

v

fo'l

·..... ...........

Rk:['TOHl:: ONE >.• SAVE ARl::A TO



G2 •

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-b847 Chart

G9.

···..11.......4 ...

IHCFOPT (Part 1 of 3)

.......... .•. ·01 • • 11.2 .--~

········11.1·.·•••••••.. .................

ERRSET

• SAVE REGISTERS •

11.2 •• • .NO. OF ••

• •••• 11.3 •••••••••• • • : • MESSAGES •

.:.~~y~~G~~ OO.:.~~ ______ >: SE~RI~tR~oTO ••

•• I.

+... ' •

· 1 . ·.................. .;~. :_>[ ·:.... . .-.-. -. -.-. -. -. -. .................

.'





•••••••••••••••••

YES

t . ·····A4......... • STORE NO. Of' • MEsSAGES TO .PRINT IN TABLE • ENTRY

·........1".......

····.B1········ ••

.'

• GET ERROR • • NUMBER AND SAVE. • IT •

.. •













I~~------------.-:::::]. . . .

·····CII···.······. ·GETENTRY

.-.-.-.-.-.-.-.~



· 1'........ ........

..

• GET TRACEBACK • INDICATIUN • •

·02 •

IGNORITM D2 ••• •• •• •• •• FIRST •• • ·TABLE ENTRY.. NO •• TIME •• YES •• MODIFIABLE •• -------->.. THROUGH •• •• •• •• (SWITCH.·

.. .. .j '" ••

••

··.::r-l

YES ' •• •• •• •• ERROR •• CONDITION 212 •• •• ••

.. .. ON)



••

H5 •

••

:~E'~~~~Lt-._._:

03'

--------> •.

).::

·····E1·········.

.

I ... .. •

i r---.' .. .. .. ..... ·l .... . ..

. . ................. .. .I.. .. .. .. .. .. ....

'

E3

• ••

'..

••••

PARAM!;TEHS •• • ..~UPPLIED



."

• •

....

'. ..

r . +"

'.. ..' . '

.

.

'..

.

• •••• E~ ••••••••••

'. = • •• -------->. •• •

GT . ' ---'. CODE 2 ••

I NDICATi:. TRACEBAl:K HEQUESTk-D



...............:

:

i"

.02 • - >. B1 •

Fl·.

••

EU

YES

•·02 E2.•

..

·

. ·'. '.. ' .. '.. ......

••

:;;1 X

04

.. YE.S •• CODE LT OR •• ---.. EQ TO 0 ••

on

NO ••••

• GET NO. OF •• ·ERRORS ALLOWED

· . .·................ • •••• F4 •••• •• ••••

YES •• PARAMETER •• --- •• LT OR EO TO 0 ••

INDICATE NO TRACEFIACK

i"0

-----. ----'1

·... ··Gl· ..........

• :

:ZE.ROE~~5lfs~ ALL:

. . -- - --::i~~~- -- - - - - -: ::::::i........ ..

Yt:S . '

---'.

.GETENTRY

H4

••

ZERU

'.

'..

. ..'

'. ' .

.

••

.'

• ····H'>· •••••••••

.UPDATE ERR lle • • • BY ONE (TUI.

r ...'

- -:: : : r. . . ·

• STORE ADDRESS • 'IN TABLE ENTRY'

......·T....·. • GET NUMBER OF • • MESSAGES TO • • PRINT •

K4

••

.. •

•• NO. •• • ••• • .MESSAGES TO •• YES. • •• PRINT LT OR •• ---->. 1.2 • ••• ~Q TO

....1 ··.... ......

+,

. ·' .

FIilS'! TIm:

·' .



'THROU\.i1l SWl Tell • • ON) •

••••• J . . . . . . . . . . . .



?'.

..

·

·····J1·········· .-.-.-.-.-..-.-.

J'>

...

••

•• ERROR •• •• NUMBER GT •• NO t. MAXIMUM Tv bE•• -,--] ••

.. ..

CHANGElJ •• ••

•• YlS

Ii ••••

l ....... .... ·



.. ..

.02 •• Cl • ->. E2· •

t. t,

.; .FI~~~ofil;~E '; .~~ ___ J ..SWITCH uN.'

••••••

+,

...

+... ' •

YES

.J.. ·..

NO

Ali

• •••• 85 ••••••••••

+.

c------------------------------------------------::

I



••

.. •

I.

01···..

.. .

·..

+.

• GET ADDRESS OF • • ENTRY FOR THIS • • ERROR NO. •

Kl

BU

•• NUMBER G'l •• n;s • INDICATE Pt. ALL ~IESSAGE.S •

NEXT · · · · · C l · · · · · · · · •• • FINDENTR •

••



• • •

'02 •

• 11.1·



Appendix F:

Object-Time Library Subprograms

255

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

chart

IHCFOPT (Part 2 of 3)

G9.

.... .--t ·..... ·02 • • Ai

••• Ai •• •••• •• •• YES •• ERROR 212 •• •• •• ••

l'i::'::1·' ~o

.... ..... B1.......... ........1"...... • GETENTRY • • -.-.-.-.-.-.-.-. • GET UPPER RANGE.



"



········1·········

········1·········

·····A"·········· .• • ··........ . · 1"......

.....B2..........

..... B3 .•........

.......:r.......

....·..T. . ·.

·····B"···.··· ...• •

ERRSAV • •••• A2.......... • •••• A3 •••••••••• ·GETENTRY.. •

.-0-.-.-._._._._.. 0.-------->0

.

GET CONTROL • .SAVE REGISTERS • CHARACTER·· • INDICATION·· •

• •

• INDICATE NO • • • CONTROL. • GET ERROR .CHARACTER TO BE. •• NUMBER .....n _ T0 BE • • SUPPLIED.. CHANGED·· • •

••••• C1.......... • TURN ON SWITCH • • INDICATING. • FIRST TIME. THROUGH •

·..... ............ 1 ·····01··········

• •

STORE UPPER RANGE AS • MAX IMUM TO BE • CHANGED

• • • •

·................. .... . l.

->.·01H5 • •

..

.0

C2 •••• •• -. NO •• EQUALS CODE-1 •• --• • ••

'.

'1;" .'

: . . . ~~~~~~;~ . . . . : • CONTROL. -CHARACTER TO BE. : SUPPLIED:

........... ...... ~oi; :-->1 ....

• • • • •

•••••

Cl •••••••••• .FINDENTR-

ERRSTR

.SAVE REGISTERS •



GET ERROR NUMBER

• ••

........1"...... ·.···C,,··· .. ·····

• FlNDENTR



.. . . . 1"....... ·......·T....·.. .-.-.-.-.-.-.-.-.

.GET ADDRESS OF • • TABLE ENTRY •

: . . . . 03 . . . . . . . . . : .GET ADDRESS OF • WHERE TO SAVE • : ENTRY :

................. 1

. - . - . - . - 0 •• - . - •••

:GE+A~JRl~R~F

..

Oil

0·.

••

.'

.. ..

I.

•• ENTRY •• MODIFIABLE I.

.'

:

.0•• NO---->.•

. . . ·1. . ·. . . . . . . . . ..

··.................

······F"··········. ··..................

. . .:~ll£I~~I i~~~~

NO

... ...

..•.................: J

' . ' YES

11. ·:.:;. .....·..

.

D)

..

•• SPECIFIED.·

'..

• PRI NT NAME OF • .CALLING ROUTINE.

NO

•• ERROR •• NO •• CONDITION 217 •• --•• OR 218 ••

'.

1 ······CII.••.•.•••• . ·..................

'.. • ..'YES

1..

.

••

.:

..

.TR~gE~r~CK.: .~~~ _____

'. '..

1

'. (0 ..

.

..

>:.

.·······1·······

........ .......

Fli .. •• .. ' TABLE '.

•• SIZE •• NO •• EXCEEDED OR •• --•• LOOP •• •• FOUND. •

i

F5 .. •• . . . .•

•• ·'G], •• •••••• RETURN TO ItsEXIT WITH ABORT CODE

.0

'. .'

.......... .....

.: .::.: -->.•

i

'. .'

..

"s ::::::

: •••• G4 ••••••••• :



0.··--1

•• EXTENDED •• •• ERR HANDLlNG •• PRESENt ••

"s

• • •

~JH:i i1ai~T

'.

'.

•••• Fle •••••••• .RETURN TO EXIT • : ADDRESS :

.: ..

• •••• E5 ••••••••••

.".

• POINT TO NEXT. • HIGHEST LEVEL .CALLING ROUTINE.

..INDICATE 1/0 IN. : PROGRESS :

........1'.......

·..... Fl*·········. • OBTAIN ADDRESS • • • OF ARGUMENT LIST • •

·..................

I

·••• ·'Gi'··· ••••••.

·........["....... • SELECT SYSTEM • • Ol1l'PUT DEVICE •

· . ·.................. 1 ······J1·········· . ·····Hl··········

•.INITIALIZATION MAKE •• • CALL TO FIOCS_ •

·......·T....·.. • SKIP A LINE VIA. • FIOCS_ •

·····K1·········· ·................. .. .... . l->. • SAVE START OF • • RECORD AND .COMPUTE END OF •• RECORD



...... A2 •

Bli

................... ·····C2··········• ··................... ·:·~;·:->I ..... ..... . ·····D2···· · . ·..................

0

.'

E2

·1

..

.~

.RESET ARGUM~NT • • POINTER.

'. ••

.

'. ' .. ' .

.'

YES •• -----

.

••• B5 ••••••••••

..

.

..-. C~



02 •

: •••• 0] ••••••••• :

.......... .......... ··...J.....

••

.. *... .... ..

l->..·........·.

.SET FOIt END OF • --->. ARGUMENTS •

r. . . ·.

NO •• IS THIS A •• ---.. DUMP ENTRY ••



YF.S

...······

····D~ IBEXIT



...............

• --- - ----- --- ---t

• TEkMINATJ:: J03 •

• J2 •

••

•• ONLY ONE •• ARGUMENT

*.

. .

........

··....c"........... ··•.................•

GETARG

• •

••

.. ..1.. :..

INITIALIZE • • ARGUMENT SWITCHO. SWITCH • •• EXHAUSTED. • • •

••

: •••• E1 ••••••••• :



• DUMP DESIRED LOCATION(SI •

:BETWEEN LIMITS : •• LIMIT.· • •

'

... '

................ .

·······G2···· ........ ·. . ·. T....·.. • RESET FOR • SECOND LIMIT

• .. ·.................. .. .........1'......... •

SET J=l



.TURN OFr SENSE • LIGHT •

••

I LE 0

'. '.

••

...

RETURN

• ••• 1(" •••••••••

" ., NO •• ----.' .'

• •



Appendix F:

...............•• RETURN



object-Time Library subprograms

258.3

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

Chart G14.

IHCFOVER

······A)·········.. ·. ·. T...... •

.

...................... SET J=2



.. . .83.... . . •



PROCESS ARRAY • ELEMl::NT •

NO . '

1

. ,·0

.

C2

.,

'. ' .

o. .'

---., END OF ARRAY

'. ·0

' .. '

······A3···........

SUBCRK

.,

o.

·........1'........ • COMPUTE • • LOCATION OF • • ARRAY ELEMENT •

,

.,

B3 ., , • ELEMENT· , ,.LOCATION LE •• NO •, MAX ARRAY •• --• , LOCATION.·

.. ' .. ' ..

:

............... RETURN

:

·04 • ->. B1 •

.. ··'E2+·········

• TURN IOFLAG OFF. • AND INSERT • • AODRES!; OF .: .. .. ·04 •

B4 ••

.SET TRACE FLAG. • ON •

•····Sll ••••...•• •



...............•



RETURN



l'" . ··.····C3········· ............... •

RETURN

·.................. • MOVE' SUBCHK' • INTO DBUFFEk



.0110 SKIPPED' Tv. • D8UFFER • ·011 • BII •

->.

• • • • • :

B4 ••

Appendix F:

Object-Time Library Subprograms

258.7

Order No. GY28-6638-1, page revised 1/15/71 by TNL GY28-6847

Chart G16.

IHCDBUG (Part 3 of 4)

······Al··········..

STARTIO

.................. SET CURRENT AREA FULL

• •

I

v

: •••• 81 ••••••••• :

• SET IOFLAG TO • • INDICATE I/O IN. ,. PROGRESS •

·..................

I

·····el··········

.SET CURBYTLC TO. o ADDRESS OF • • LOCATION OF • • FIRST MAIN •

..... ........ ... . •

BLOCK

• •

SAVE IOFLAG INFORMATION

I

....... ....... .

:

• •

······B2...1·......· ·........... ..... • SET IOF :,AG TO • • ENABLE FUTURE • • DEBUG C.\LLS •

"

"'

1

. ".

C2 •• • •••• Cl •••••••••• •••• ·----OUTPUT---- • • "ENOllGH MAIN •• NO • WRITE MESSAGE • •• STORAGE TO • *--------)" 'SOME DEBUG • ". SAVE INFO.. .OUTPUT MISSING'.

.

'. ' .. ' .



·····01········· . RETURN

··. PRINT A LINE •

1 ······G4.········. . ·.................. .RESTORE RETURN • .POINT AND BASE • REGISTER •

..INDICATE DEBUG •• •• • OUTPUT •

'. '.

DATA TYPE

-

page revised 1/15/71 by TNL GY28-6847



0 •• 0 •

SAVE AREA



0

··... ..... .... .....

:

•• "1