MI00091 C_Compiler_Montitor_System 2_CMS 2_For_Use_With_AN_UYK 7_Computer_Aug75 C Compiler Montitor System 2 CMS For Use With AN UYK 7 Computer Aug75
MI00091-C_Compiler_Montitor_System-2_CMS-2_For_Use_With_AN_UYK-7_Computer_Aug75 MI00091-C_Compiler_Montitor_System-2_CMS-2_For_Use_With_AN_UYK-7_Computer_Aug75
User Manual: MI00091-C_Compiler_Montitor_System-2_CMS-2_For_Use_With_AN_UYK-7_Computer_Aug75
Open the PDF directly: View PDF .
Page Count: 702
Download | |
Open PDF In Browser | View PDF |
mrIJIJO'lI-(! ·M·5035, VOLUME II USER'S REFERENCE MANUAL (U) FOR COMPILER, MONITOR SYSTEM·2 (CMS·2) FOR USE WITH AN/UYK·1 COMPUTER COMPILER, ASSEMBLER, AID INSTRUCTION REPERTOIRE FLEET COMBAT DIRECTION SYSTEMS SUPPORT ACTIVITY San Diego, California 92147 THIS CHANGE SHOULD BE INCORPORATED INTO TilE BASIC PUBLICATION. DESTROY SUPERSE~ED PAGES. REVISED: 16 NOVEMBER 1973 CHANGE: 16 AUGUST 1976 M-5035 Change 5 Volume n LIST OF EFFECTIVE PAGES Insert latest changed pages; disp'ose of superseded pages in accordance with applicable regulations. NOTE: On a changed page, the portion of the text affected by the latest change is indicated by a vertical line, or other change symbol, in the outer margin of the page. Total number of pages in this manual is 681 consisting of the following: tChange No. Page No. Title •. 4 .. A - D •• ii Blank iii - v •. vi II-4-2 •• II-4-3 •• II-4-4 - 11-4-6. 11-4-7 - II-4-16 •.• 11-4-17 • II-4-18. n-4-18A - II-4-18B II-4-19 - II-4~20 II-4-21 - II-4-22 II-4-23 - n-4-24 ••. II-4-25. 11-4-26. II-4-27. II-4-28. II-4-29 - II-4-33 II-4-34. II-4-35 ••. II-4-36 •••• II-4-37 - II-4-40 II-4-41 - II-4-42 II-4-43 - IT-4-59 II-4-60 ••••••• II-4-61 - 11-4-62 II-4-63 ••• 11-4-64. II-4-65 ••. II-4-66. II-4-67 - II-4-68 IT-4-68A •••••• II-4-68B Blank II-4-69 •• II-4-70. II-4-71 - II-4-72 5 o 1 • • • • • o . .. .. 3 5 viii viliA 4 4 viiiB Blank ix 4 4 5 2 5 xvi xvii - xviii • • • 11-1-1 - 11-1-9. n-1-10 Blank. 11-2-1 •••••• •• II-2-2 - 11-2-24 • 11-2-25 - 11-2-26 II-2-27 ••••• II -2 -28 Blank • II-3-1 - II-3-3 •••• 11-3-4•• 11-3-6 ~ ••••••• II-3-6 •• 11-3-7. II-3-8 •• II-4-1 •••• 2 ·. ·. ·. ·.. ·. ·. ·. ·.. • .. .. • o 3 o .. . ... . . .. . ... o o 4 o 4 o o o . .... 3 o 1 3 o o t zero in this column indicates an original page. A o 3 o 5 o o 5 2 o 5 o .. 4 '5 5 .. . ... .... 3 o 3 .. . . '0 xv •• .. . .. . . . . o vii •• . . .. · . · . ·. .. . . . . .. .. ·... x. .. · . . ·. xi . . . . ·. xii ••• · ... xiii ·... xiv .. ·. tChange No. Page No. 3 o 2 o 3 2 3 o .. . 5 o 5 5 5 5 o 5 M-5035 Change 5 Volume IT LIST OF EFFECTIVE PAGES (contd) II-5-1 - II-5-2 •• II-5-2A••••• II -5 -2 B Blank II-5-3. 11-5-4 •• 11-5-4A. 1I-5-4B Blank II-5-5 •••• II-5-6 •• 11-5-7 •. II-5-8 - II-5-10 11-5-11 - II-5-12 II-5-13 •••••••• 11-5-14 - II-5-17 II-5 -18 ••• 11-5-18A •• 1I-5-18B Blank •• 11-5-19 - II-5-20 II-5-21 ••••• II-5-22. U-5-23 - U-5-25 ••• 11-5-26 - II-5-27 •••••• II-5-28 •. II-5-29. II-5-30. II-5-31 ... I1... 5-32 II-5-33 - 11-5-38. II -5 -3 9- .II -5 -40. • • • II-5-41 - II-5-44. ••••••• II-5-45 - II-5-46•••• II-5 -47 ••••••• U-5-48 - II-5-79 II -5 -80 Blank. • • II-6-1 - II-6-4 •• II-6-5 - 11-6-7 •• II-6-8 - II-6-9 •• II-6-10 ••••••• II-6-11 - U-6-15 II-6-16. II-6-17 ••• . . .. . ... .. 4 4 4 ·. · .. •• ·. ·. R-6-18 - II-6-22 II-6-23. II-6-24 •.•• ' ••••• 11-6-25 •• ; •. II-6-26. 11-6-27 •. II-6-28. II-6-29 - II-6-30 II-6-31 ••••••• 11-6-32 - IT-6-34 II -6-35 •...• II-6-36 Blank. II-7 -1 - 11-7 -3 •• II-7-4 - II-7-5 •• II -7 -6 - n -7 -7 • • H-7-8 •• H-7-9 •• H-7-10. n-7-11. ll-7-12. II-7-12A - 1I-7-12B U-7 -13 - II-7 -16 II-7-17. II-7-18 •• 1I-7-19. U-7-20 - n-7-21 II-7-22. II-7-23.,' • II-7"':24. II-7-24A •. II-7-24B •• II-7-25 - II-7-26 II-7 -27 •.. II-7 -28 ••. TI-7-29. TI-7-30. II-7-30A ~ 1I-7-30F' II-7 -31 - II-7 -33 •. 11-7 -34 Blank II-8-1 - 11-8-2 •. II-8-3 . . . . . . . . II-8-4 - ll-8-5 •• 3 4 4 4 3 1 2 o 3 1 · .. .......... ... . . . .. .. · .. ··.. ... . . .. . ... . . ·. ·. . .· .. ·. .. ·· .. ... o 5 5 5 5 o 5 o 3 o 5 .. o 5 o 3 o 3 o 4 4 o 2 .. . No. No. No. No. tChange Page tChange Page o 4 o 1 2 t Zero in this collU1lJ1 indicates an original page. B . .. . .. . ... . ..... . ... · .. o 2 o 1 o 2 1 o 1 o 3 3 · ... · .. · ... · .. · .. . .. o 5 4 5 o 5 2 3 4 o · ... · .. · . . .. . ... ·· .. · .. . . . ·. 2 o 2 o 3 5 4 4 5 3 o .. . 2 1 5 5 5 5 o ... 1 o M-5035 Change 5 Volume n LIST OF EFFECTIVE PAGES (contd) tChange No. Page No. n-S-6 •.•••••• IT-S -7 - IT-S-ll '••••••••• IT-S-12 Blank ••.•••••••.•• ll-9-1 •••••.•••••••••••• IT-9-2 - IT-9-3 •••••••••••• U-9-4 • ••••••••••••••••• U-9-5 - ll-9-6 ••••.••••.•• ll-9-7 •••••.•••••••••••• IT-9-8 •••••••••••••••••• IT-9-9 - IT-9-l6 ••••••••••• 11-9-17 ••••• "•••.•••••••• IT-9-lS - n-9-2l •••••••••• IT-9-22 Blank •••••••••••• IT-lO-l - IT-lO-2 •••••••••• IT-IO-3 ••••••••••••••••• IT-lO-4 - IT-lO-5 •••••••••• IT-lO-6 - IT-IO-lO •••••••••• IT-lO-ll . . . . . . . . . . . . . . . . . IT-lO-12 - IT-lO-13 ••••••••• IT-lO-14 Blank ••••••••••• IT-ll-l ~ IT-ll-lO •••••••••• IT-II-II - IT-ll-l2 ••••••••• IT-11-13 - ll...;11-14 ••••••••• IT-ll-l4A - IT-11-14B ••••••• ll-11-15 - ll-11-22 ••••••••• IT-11-23 •••••••••••••••• IT-l1 ~24 ••••••" •••••••••• ll-11-25 . . . . . . . . . . . . . . . . . 11-11-26 "•• , IT-11-26A - IT-11-26B ••••••• II-11-27 -IT-11-3l . . . . . . . . . . ll-11-32 - n-11-49 ••••••••• IT-11-50 •••• " ••••••••••• 11-11-51 - ll-11-69 ••••••••• IT-l1"-70 ••••• "••••••••••• IT-11-7l - n-11-74 ••••••••• IT-11-75 - IT-11-76 ••••••••• IT-11-77 - II-II-SO ••••••••• 11-11-81 ••• eo • • • • • • • • • • • • IT-11-82 - IT-ll-S3 ••••••••• n-11-84 •••••••••••••••• n -12 -1 - IT -12 -4 • • • • • • • • • • • o • • • • • • "• • • • • • • tChangc No. Page No. 11-12-5 ........., ......•. ~~~ .. 11-12-6 - 11-12-34 ....•.. ~ ~ .. 11-12-35 - 11-12-50 .......... . 11-12-51 - 1I-12-54 ..••. ~ .. ~. 3 o o ~ 11-12-55 .•............. ~ •.. ~ ... ~~ o 11-12-56 11-12-57 11-12-69 11-12-73 11-12-79 11-12-83 11-12-84 11-12-85 11-12-89 11-12-90 11-12-95 2 1 3 o 2 o 2 o 3 o 5 o 3 o A-I A- 2 A-3 A-4 B-1 ................., .•... - 11-12-68 .••••..... - 11-12-72 .•••... ~ .. - 11-12-78 ••••.•.. ~. - 11-12-82 ..•••..... ..................... . ...................... . - 11-12-88 .•.•..•... ........•...••• ~ .•... - 11-12-94 ..••...... - 11-12-110 ..•...... ........•...•....•••...•... ••••••••••••••••••••••••.. •••••••••••••• ~ •••••••••.• Blanl<: •••••••••••••••• - B~2 ••••••••.••••••••.•. " t! ••• B-3 B- 4 - B- 6 •••••••••••••••••••• B- 7 •••••••••••••••••••••••••• 1 B-8 - B-12 .•.....•...••...... B-13 - B-14 ......•....•...... B-15 - B-16 .....•....••...... B-17 - B-18 ...........•...... B-19 - B-20 .......... ~ •...... o o 1 o 5 o 1 o 1 o 1 5 1 5 1 o 2 o 5 5' o 5 o o 3 3 5 o 5 o 5 o 5 o 1 5 3 5 B- 21 •••••••••••••••••••••.••• C-1 ••••••••••••••••.••••.•..• C-2 - C-6 •••••••••••• ~ ••••••. o 3 D-1 D-2 5 2 o 2 5 2 5 '2 5 2 5 2 5 0 B-22 - B-28 ....•.....••...... ........................... E-1 - E-2 •••••••••••••• ~. E-3 - E-4 ••••••••••••••••••.. E- 4A ••••••••••••••••••••••••• ill ••• E-4B Blank ................... . E- 5 - E-6 ............. ~ .•...... E- 7 .......................... . E-8 ••••••••••••••••••••••••, •• E-9 - E-10 •...•.....•.., ..... . E-lOA ••••.•••••••• ~ _ • • ~ . • , • • .0 E -1 DB ••••••••••••••• ~.• E-l1 •..... ill • • _ •• II!, e. . . . . . . . . . . . . . . . . . . . E-12 - E-14 .•........••...... E-15 - E-17 ....•..•.. ~ • . ~ . . . . t Zero in this column indicates an original page. c 5 o 3 3 5 5 5 5 4 3 4 4 5 5 3 5 M-S03S Change 5 Voltune II LIST OF EFFECTIVE PAGES (contd) tChange No. Page No. E-18 ~ E-19 .., ...... ~f!i 4t.,., E-20 - E-24 ....... ~ ......... ~ .. . .•• , F-l ••• - •••••••• , •• . . . . . . . I! • • , •••. ~ F-2 • • • • • • • •' • • • • G-l - G-8 .................... , .. ~ , H-l H- 2 BlaI1k ........ . . . . . . . . . . . . . II. • • • • • • • • • • • • • . • . • • • II! • • lilt • • , t!. • , f!i • .. _", ~. . . ~ • •• • • 1-1 - 1-3 ..•.....•.•.••.•. , •• 1-4 .................. ~., ....... . 1-5 - 1-24 ........, ......... ., .. 1-25 1-26 1-31 1-32 1-35 1-36 . . . . . . . . . . . . . , ••.•• ·0 •.•••.••• - 1-30 .•.••..•...••.••.• - 1-34 ••.•.•...•••••. ~ •• ................• _.tt. .. .. ~ Blank ..•...•.•.••••.•..• K-1 - K-IS K-16 Blank ••.••••••••••• Page No" 2 3 o 5 o 3 o 2 5 2 5 2 5 2 5 5 5 5 t zero in this column indicates an original page. D tChange No. M-5035 Volume II FOREWORD This is,.Revision 1 of Volume II of the two volume User's Reference Manual for Compiler Monitor System (CMS-2) for use with AN/UYK-7 Computer. This volume contains a description of the languages recognized by the Compiler and Assembler, including a comprehensive description of macro generation. It also contains a complete functional description of the AN/UYK-7 Computer Instruction Repertoire. (Volume I describes the Monitor, Loader, Librarian, Peripheral Utilities, and System Operation.) Revision 1 incorporates changes 1, 2, and 3 to the original document (NA VSHIPS 0967-028-0060). The reader will find the changed pages clearly indicated throughout the volume. A document related to Volume II is the Compiler Monitor System-2(CMS-2) User's Reference Manual, Volume I, M-5012. This document describes the CMS-2 language as it is used in the preparation of programs for the CP-642Bhosted CMS-2/XCMS-2 compilers. i/ (ii blank) M-5035 Volume II RECORD OF CHANGES I CHANGE NO. DATE TITLE OR BRIEF DESCRIPTION ENTERED BY -1 I ----.-J i I I I t i i'i M-5035 Volume II TABLE OF CONTENTS Paragraph Ti tIe SECTION 1 INTRODUCTION 1.1 1.2 1.3 1.3.1 1.3.2 1.3.2.1 1.3.2.2 1.3.2.3 1.3.2.4 1.3.2.5 1.3.2.6 1.3.2.7 1.4 1.4.1 1.4.2 1.4.3 Purpose and Scope Applicable Documents System Capabilities Hardware Requirements. Software Components Monitor Object Code Loader Librarian Peripheral Utilities Compiler Assembler System Tape Generator System Operation System Load and Initiation Standard Input Processing Standard Output Processing I 1 ~1-1 11-1-2 . 11 -l-:J 11-1-3 11-1-5 II -1-6 11-1-6 11-1-7 11-1-7 11-1-7 11-1-8 11-1-8 11-1-0 11-1-0 11-1-9 11-1--9 SECTION 2 INTRODUCTION TO THE CMS-2 LANGUAGE 2.1 2.2 2.2.1 2.2.1.1 2.2.1.2 2.2.1.3 2.2.2 2.2.2.1 2.2.2.2 2.2.2.2.1 . 2.2.2.2.2 2.2. :~ 2.3 2.:~. 1 2.:~.1 •1 2.:i.l.2 2 .:~. 2 2.:~.2. ] 2.:~. 2.2 2.3.2. :i Major Features of CMS-2 Program Structure Organization and Classification of Identifiers Forward and Backward References Local and Global Definitions External References and Definitions CMS-2 Elements System Data Designs System Procedures Local Data Designs Procedures Range of Identifiers Declarative Statements Program Structure Declaratives Procedure Structure Declaratives and Linking Reentrant System Procedures Data D(~(:1arations Swi tch(~s Variables Tables iv 11-2-1 11-2-1 11-2-3 11-2-3 11-2-3 11-2-4 11-2-5 11-2-7 11-2-8 11-2-9 11-2-9 11-2-9 11-2-10 11-2-10 11-2-13 11-2-14 1 I-2-}() 11-2-17 11-2-17 11-2-17 M-5035 Volume II TABLE OF CONTENTS (Continued) Paragraph SECTION 2 (Continued) 2.3.2.4 2.3.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.6 Arrays Compiler Directive Declaratives Uynamic Statements Expressions Statement Operators Special Operators High-Level Input/Output Statements Program Debug Facilities 11-2-20 11-2-20 11-2-24 11-2-24 11-2-24 11-2-25 11-2-26 11-2-27 SECTION 3 BASIC DEFINITIONS 3.1 3.2 3.2.1 3.2.2 3.2.2.1 3.2.3 3.2.3.1 3.2.3.2 3.2.3.3 3.2.3.4 3.3 3.4 3.5 3.5.1 3.6 CMS-2 Alphabet Symbols Operators Identifiers Statement Label Constants Numeric Constants Hollerith Constant Status Constants Boolean Constants Delimi ters Statements Comments Special Comments Source Card Format 11-3-1 11-3-1 11-3-2 11-3-2 11-3-3 11-3-3 11-3-3 11-3-4 11-3-5 11-3-6 11-3-6 11-3-6 11-3-6 11-3-7 11-3-8 SECTION 4 DECLAR AT IVES 4.1 ':l.l.l 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 Program Structure Declaratives System Declarative (SYSTEM) Head Declarative (HEAD) End Head Declarative (END-HEAU) System Data Design Declarative (SYS-UU) End System Data Design Declarative (END-SYS-DD) System Procedure Declarative (SYS-PROC) v II-4-1 II-4-2 II-4-2 11-'1-~} 11-4-4 11-4-4 11-4-5 M-5035 Volume II Change 3 TABLE OF CONTENTS (Continued) Paragraph SECTION 4 (Continued) 4.1.,7 4.1.8 4.1.9 4.1.1U 4.1.11 4.1.12 4.1.13 4.1.14 I 4.1.15 4.2 4.2.1 4.2.1.1 4,,2.2 4.2 .. 3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.8.1 4.2.8.2 4.2.8.3 4.2.9 4.2.10 4.2.10.1 4.2.10.1.1 4.2.1U.l.2 4.2.10.1.3 4.2.10.1.4 4.2.11 4.2.11.1 4.2.11.1.1 4.2.11.1.2 4.2.11.2 4.2.11.2.1 4.2.11.2.2 4.2.11.2.3 Reentrant System Procedure Declarative (SYS-PROC-REN) Local Data Design Declarative (LOC-DD) Local Data Design Declarative (END-LOC-DD) Automatic Data Design Declarative (AUTO-DO) End Automatic Data Design Declarative (END-AUTO-DD) Procedure (PROCEDURE) and End Procedure (END-PROC) Declaratives Function (FUNCTION) and End Function (END-FUNCTION) Declaratives End System Procedure Declarative (END-SYS-PROC) End System Declarative (END-SYSTEM) Data Declarations Variable Declaration (VRBL) Parameter Declaration (PARAMETER) Table (TABLE) Declaration Field (FIELD) Declaration Item-Area (ITEM-AREA) Declaration Subtable (SUB-TABLE) Declaration Like-Table (LIKE-TABLE) Declaration End-Table (END-TABLE) Declaration Packing Rules No Packing (NONE) Medium Packing (MEDIUM) Dense Packing (DENSE) Overlay (OVERLAY) Declaration Data Referencing Table Referencing Whole Table Referencing Item Referencing Field Referencing Item-Area Referencing Transfer Declaratives (Switches) Statement Switch (SWITCH) Declaratives Index Swi tch Item Switch Procedure Swi tch (P-SW1TCIf) Declaratives Index Procedure Swi tch Double Procedure Switch Item Procedure Switch vi 11-4-6 11-4-6 11-4-7 11-4-7 11-4-8 11-4-8 11-4-11 11-4-13 11-4-14 11-4-14 11-4-15 II-4-18A 11-4-19 11-4-25 11-4-30 11-4-31 11-4-34 11-4-35 11-4-37 11-4-38 11-4-38 11-4-39 11-4-40 11-4-44 11-4-44 11-4-45 11-4-45 11-4-47 11-4-49 11-4-50 11-4-50 11-4-50 11-4-53 11-4-55 11-4-55 11-4-56 11-4-58 M-5035 Change 5 Volume II TABLE OF CONTENTS (Continued) Paragraph Title SECTION 4 (Continued) 4.2.11.3 4.2.12 4.2.13 4.3 4.3.1 4.4 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5 Switch Referencing Local Indexes Data (DATA) Declaration Control Declaratives Mode (MODE) Declaration System Linkage External Definition (EXTDEF) Operator External Reference (EXTREF) Operator Transient Reference (TRANSREF) Operator Local Definition (LOCREF) Operator Applications of EXTDEF, EXTREF and TRANSREF 11-4-59 11-4-59 11-4-61 11-4-62 11-4-63 11-4-64 11-4-65 11-4-66 11-4-66 11-4-67 11-4-68 SECTION 5 DYNAMIC STATEMENTS 5.1 5.1.1 5.1.1.1 5.1. 2 5.1.3 5.1.4 5.2 5.2.1 5.2.2 5.2.3 5~2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.3 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.4 Expressions Arithmetic Expressions Fractional Significance in FixedPoint Operations Relational Expressions Boolean Expressions Literal 'Expressions Functional Modifiers Absolute Value (ABS) Modifier Bit (BIT) Modifier Character (CHAR) Modifier Count (CNT) Number of Bits· Core Address (CORAD) Modifier File Position (FIL) Modifier Record Position (POS) Modifier Record Length (LENGTH) Modifier Procedure Linking Procedure Call Function Call Return (RETURN) Statement Executive (EXEC) Statement Procedure Switch Call Replacement Statements vii 11-5-2 11-5-2 11-5-3 11-5-5 11-5-6 11-5-8 11-5-9 11-5-10 11-5-10 11-5-12 11-5-13 11-5-14 11-5-14 1r-5-15 11-5~15 11-5-15 11-5-16 11-5-18 11-5-19 11-5-22 11-5-23 11-5-26 I M-5035 Volume II Change 4 _ TABLE OF CONTENTS (Continued) Para&!:a}2h Title Page (Continued) 5.4.1 5.4.1.1 5.4.1.2 5.4. 1.3 5.4.1.4 5.4.1.5 5.4. 1. 5. 1 5.4. 1. 5. 2 5.4.1. 5.3 5.4.2 5.4.3 5.4.4 5.5 5.5.1 5.5.2 5.5.3 5.6 5.6.1 5 .. 6.2 5 6.2 .. 1 5.6.2.2 5.6 2.3 5.6.2.4 5.6.3 5. 6~ 4 5.6.5 5 6.6 5.7 5.7.1 5.7.2 5.7 .. 2.1 5.7 .. 2.1.1 5.7.2.1.2 5.7.2.103 0 0 0 5.7.~.2 5.7.2.3 Assignment (SET) Statement Arithmetic Assignment Statement Literal Assignment statement Status Assignment Statement Boolean Assignment Statement Multiword Assignment Statement Multiword Table-to-Table Assignment Statement Multiword Item-to-Item Assignment Statement Single Word-to-Multiword Assignment Statement Exchange Statement (SWAP) Shift (SHIFT) Operation Pack (PACK) Operation Control Statements GOTO Statement Name GOTO Switch Name STOP Statement Decision Statements Logical Decision Statement Table Search statement FIND Statement Search Decision Statement Table Search Format Table Search Examples Validity Decision Statement . Parity Decision Statement' ELSE Statement Nested Decision Statements Statement Blocks BEGIN Block VARY Block VARY Statement Index Clause WHILE Clause UNTIL Clause Resume (RESUME) Statement End Vary Statement (END) viii II-5-26 II-5-27 II-5-31 II-5-32 . II-5-33 II-5-35 II-5-35 II-5-36 II-5-36 II-5-38 II-5-39 II-5-40 11-5-41 II-5-41 II-5-42 II-5-45 II-5-45 IT-5-46 II-5-48 II-5-48 II-5-50 II-5-51 II-5-52 II-5-54 II-5-55 II-5-56 II-5-58 IT-5-59 II-5-60 II-5-61 IT-5-62 II-5-64 U-5-65 IT-5-66 II-5-66 II-5-67 1\'1-5035 Volume II Cha~e' 4 TABLE OF CONTENTS (Continued) ParagraEh 5.7.2.4 5.7 03 5.7.3.1 5.70 3. 2 5.7.3.3 Title (Continued) Examples of VARY Blocks FOR, Block FOR Statement Value Block FOR Block Examples Page II-5-67 II-5-72 II-5-73 II-5-76 11-5-77 SECTION 6 INPUT/OUTPUT STATEMENTS 6.1 6.1.1 Input/Output Operations INPUT Statement viliA/ viiiB Blank II-6-1 II-6-4 M-5035 Volume II Change 4 TABLE OF CONTENTS (Continued) Paragraph Title SECTION 6 ( Continued) 6.1.2 6.1. 3 6.2 6.3 6.3.1 6.3.2 6.3.3 6.3.4 6.4 6.5 6.5.1 6.5.2 6.6 6.7 6.8 6.8.1 6.8.2 OUTPUT Statement FORMAT Declaration Encode and Decode Operations Nonstandard File Control FILE Declaration OPEN Statement ENDFILE Statement CLOSE Statement Device State Checking Device Positioning Positioning by Files Positioning by Records File and Record Position Determination Record Length Determination Device Identification Operations DEFID Statement CHECKID Statement 11-6-7 II-6-8 II-6-15 II-6-18 II-6-20 II-6-24 II-6-24 II-6-26 II-6-26 II-6-28 11-6-28 11-6-30 II-6-31 II-6-32 II-6-33 11-6-33 II-6-35 SECTION 7 COMPILE-TIME SYSTEM FACILITIES 7.1 7.2 7.3 7.3.1 7.3.2 7.3.3 7.3.4 7.3.5 7.3.6 7.3.7 7.3.8 7.4 7.4.1 7.4.1.1 7.4.1.2 7.4.1.3 7.4.1. 4 7.4.2 7.4.2.1 7.4.2.2 7.4.3 7.5 7.5.1 7. 5.2 Accessing the Compiler Major and Minor Headers Options Header Statement SOURCE Option OBJECT Option LISTING Option MONITOR Option NONRT Option Two-Level Diagnostics MODEVRBL Option STRUCTURED Option Allocation Header Statements Pooling statements LOCDPOOL Statement TABLEPOOL Statement BASE Statement DATAPOOL Statement EQUALS Statement Defining a Tag Establishing Relative Locations NITEMS Statement Library Retrieval Header Statements LIBS Statement Retrieval Selection Statements ix II-7-1 II-7-3 11-7-5 11-7-6 II-7-7 II-7-10 II-7-11 11-7-12 II-7 -12 11-7 .... 12 1I-7-12A • 1l-7-12B II-7-12B 11-7-14 II-7-16 II-7-17 II-7-18 II... 7 -19 11-7-20 11-7-21 11-7-22 11-7-22 II-7-23 11-7-23 M-5035 Change 5 Volume II TABLE OF CONTENTS (Continued) Paragraph Title Page SECTION 7 (Continued) 7.5.3 I 7.5.4 7.5.5 7.6 7.6.1 7.6.2 7.6.3 7.6.4 7.6.5 7.6.5.1 7.6.5.2 7.6.5.3 7.6.5.4 7.6.6 7.6.7 7.6.8 . Correcting Elements During Library Retrieval DEP Statement Key Specification Miscellaneous Header Statements SYS-INDEX Statement MEANS Statement EXCHANGE Statement DEBUG Statement CSWITCH Declarations CSWITCH Selection Declaration CSWITCH Brackets CSWITCH Deletion CSWITCH Example EXECUTIVE Statement CMODE Statement SPILL Statement II-7-24B 11-7-25 11 . . 7-25 II~7-27 11-7-27 11-7-27 ·11-7-28 11-7-29 11-7-30 11-7-30 II-7-30A lI-7-30B II-7-30B 11-7-31 11-7-32 11-7 ... 32 SECTION 8 DEBUG STATEMENTS 8.1 8.2 8.3 8.4 8.5 Display Statement Snap Statement Range Declaration Trace Statement Procedure Trace (PTRACE) 11-8-2 11-8-5 11-8-7 11-8-9 11-8-11 SECTION 9 DIRECT CODE 9.1 9.2 9.2.1 9.2.2 9.2.2.1 9.2.2.2 9.2.2.3 9.2.2.4 9.2.2.5 9.2.2.6 9.2.3 9.2.4 9.2.5 9.2.6 9.3 Direct Code Statement Format Direct Code Statement Repertoire Direct Code Directives Constants Decimal Numbers Octal Numbers Floating-Point Numbers Character Strings Scaled Decimal Numbers Scaled Octal Numbers Data Expressions Literals Direct Constant Entries Instruction Expressions Processing Conventions x 11-9-1 11-9-2 11-9-2 11-9-6 11-9-6 11-9-7 11-9-7 11-9-8 11-9-9 11-9-9 11-9-10 11-9-11 11-9-11 I1-9-i2 11-9-15 M-5035 Change Volume II TABLE OF CONTENTS Paragraph (Continued) Title SECTION 10 COMPILER OUTPUTS 10.1 10.2 10.3 10.4 10.5 10.6 Source Listing Format Source and Mnemonic Listing Format Local Cross-Reference Listings Global Cross-Reference Listing Symbol Analysis Format Compiler Error Summary 11-10-1 11-10-2 11-10-4 11-10-5 11-10-6 11-10-12 SECTION 11 ASSEMBLER 11.1 11.1.1 11.1.1.1 11.1.1.2 11.1.1.2.1 11.1.1.2.2 11.1.1.2.3 11.1.1.2.4 11.1.1.2.5 11.1.1.2.6 11.1.1.2.7 11.1.1.3 11.1.1.4 11.1.1.4.1 11.1.1.4.2 11.1.1.5 11.1.2 11.1.3 11.1.4 11.1.5 11.1.6 11.1.7 11.1.8 11.1.9 11.1.9.1 11.1.9.2 11.1.10 11.1.11 11.1.12 11.1.13 11.2 11.2.1 Assembler Functions Input Language Structure Label Statements Fields Subfields Omission of Subfie1ds Statement Continuation Statement Terminatioti and Notes Blank Card Images Language Structure Summary Notations Used In This Section Coding Control Statements Comments . Printer Page Control Directives Addressing Sections Segmentation Assembly Base Addresses Conditional Assembly Library Usage Macros Expressions Assembler Generation Full-Word Half-Word Temporary Storage Assembler Output Assembly Ti~e Allocation Linking Control Card Start Assembly (ULTRA) xi 11-11-1 11-11-2 11-11-2 11-11-5 11-11-5 11-11-5 11-11-5 11-11-6 11-11-6 11-11-6 11-11-6 11-11-7 11-11-7 11-11-7 11-11-7 11-11-8 11-11-8 11-11-8 11-11-9 11-11-9 11-11-10 11-11-10 II-II-II 11-11-11 11-11-11 11-11-11 11-11-11 11-11-12 11-11-12 11-11-12 11-11-12 11-11-12 M-50a5 Change 3 Volume II TABLE OF CONTENTS (Continued) Paragraph SECTION 11 (Continued) I I 11.2.2 11.2.3 11.2.4 11.3 11.3.1 11.3.1.1 11.3.1.2 11.3.1.3 11.3.1.4 11.3.2 11.3.2.1 11.3.2.2 11.3.2.3 11.3.3 11.3.3.1 11.3.3.2 11.3.3.3 11.3.3.4 11.3.3.4A 11.3.3.5 11.3.3.6 11.3.3.7 11.3.3.8 11.3.3.9 11.3.3.10 11.3.3.11 11.3.3.12 11.3.3.13 11.3.3.14 11.3.3.15 11.3.3.16 11.3.3.17 11.3.3.18 11.3.3.19 11.3.3.20 11.3.3.21 11.3.3.22 11.4 11. 4.1 11.4.1.1 11.4.1.2 Stop Assembly (OFF) Disable Object Output Code (OFO) Sample Deck Using Control Cards Source Statements Label Field Labels Address Counter Declaration Leading Asterisk (*) Half-Word Instruction.Labels Operation Field Processor Instruction Mnemonics Input/Output Controller Command Mnemonics Directive Mnemonics Directives ABS Directive BYTE Directive CHAR Directive DO Directive EMBED Directive END Directive EQU Directive EVEN, ODD Directives FORM Directive LCR Directi ve LIBS Directive LIB Directive LINK Directive LIST, ELIST, and NOLIST Directives LIT Directi ve LLT Directive PXL Directive RES Directive RF$ 'Directive SEGEND Directive SETADR Directive WHD Directive TAGTBL Directive Mac ro Sta tement s MACRO and END Directives Para forms Starred Labels Within Macros xU 1I-11-14B 1I-11-14B 11-11-15 11-11-15 11-11-15 11-11-16 11-11-18 11-11-18 11-11-18 11-11-19 11-11-20 11-11-20 11-11-20 11-11-21 11-11-21 11-11-21 11-11-22 11-11-23 II -11-25 11-11-26 II-11-26A II-11-26B 11-11-27 11-11-28 11-11-29 11-11-29 11-11-31 11-11-32 11-11-33 11-11-34 11-11-35 11-11-35 11-11-36 11-11-37 11-11-38 11-11-39 11-11-40 11-11-40 II -11-40 II -11-42 11-11-45 M,-5035 Change 2 Volume II TABLE OF CONTENTS (Continued) SECTION 11 (Continued) 11.4.1.3 11.4.2 11.4.2.1 11.4.2.2 11.4.3 11.4.4 11.4.4.1 11.4.4.2 11.4.4.3 11.4.4.4 11.4.4.5 11.4.4.6 11.5 11.6 11.6.1 11.6.2 11.6.3 11.6.4 11.6.5 11.6.6 11.7 11.7.1 11.7.2 11.7.2.1 11.7.2.2' 11.8 11.8.1 11.8.1.1 11.8.1.1.1 11.8.1.1.2 11.8.1.1.3 11.8.1.1.4 11.8.1.1.5 11.8.1.1.6 11.8.1.1.7 11.8.1.1.8 11.8.1.2 11.8.1.2.1 11.8.1.2.2 11.8.1.2.3 Operand Field Other Macro-Oriented Directives NAME Directive GO Directive Summary of Macro Usage Special Consideration When Coding Macros Comments Labels on a Macro Reference Line Address Counter Declarations Within a Macro Externalizing Labels Macro Reference Lines Complex Macros Address Counter Declarations Expression Statements Labels Address Counter Decimal Number Octal Number Floating Point Number Fixed Point Number Data Modes Literals Data Words Constants Character Strings Operators Symbols Arithmetic Operators ~~ (Positive Exponentiation) *- (Negative Exponentiation) *1 (Binary Exponentiation or Scaling) * (Arithmetic Product) I (Arithmetic Quotient) II (Covered Quotient) + (Arithmetic Sum) - (Arithmetic Difference) Logical Operators ** (Logical Product) , ++' (Logical Sum) -- (Logical Difference) xiii 1 I -11-~5 lI-11-J6 11-11-16 11-11-48 11-11-49 II-II-50 I I-II-50 11-11-50 11-11-:11 11-11-31 II-II-53 II-l1-~3 II-II-54 11-11-35 II-II-56 II-II-56 II-ll-!l7 II-II-57 11-11-:18 II-II-59 II-II-59 II-II-59 11-11-60 11-11-60 11-11-61 11-11-62 11-11-63 11-11~65 11-11-65 11-11-65 11-11-66 11-11-66 11-11-67 11-11-67 11-11-67 11-11-67 11-11-68 11-11-68 11-11-68 11-11-68 M-5035 Volume II Change 5 TABLE OF CONTENTS Paragraph (Continued) Title SECTION 11 (Continued) I 11.8.1.3 11.8.1.3.1 11.8.1.3.2 11.8.1.3.3 11.8.2 11.8.3 11.8.4 11.9 11.9.1 11.9.2 11.9.2.1 11.9.2.2 11.9.2,.3 11.9.2.4 11.9.2.5 11.9.2.6 11.9.2.7 11.9.2.8 11.9.2.9 11.9.2.10 11.9.2.11 11.9.3 11.9.4 11.9.4.1 11.9.4.2 11.9.4.3 11.9.4.4 11.9.4.5 11.10 11.10.1 11.10.2 11.10.2.1 11.10.2.2 11.10.3 11.10.4 11.11 11.12 Conditional Operators = (Equal) > (Greater Than) < (Less Than) Operator Priorities Parenthetical Grouping Re10catabi1ity Assembler Outputs Side-Sy-Side Listing, Error Codes Express i on (E) Duplicate (D) Undefined (U) Instruction (I) Relocation (R) Truncation (T) Overflow (0) Name (N) Level (L) Floating Point (F) Warning (W) Generation Formats Listing of Labels Level 0 Leve 1 1 LLT Sample Listing Undefined Labels Cross Reference Listing Assembler Diagnostics and Status Assembly Errors Assembler Internal Errors Core Overflow Level Overflow Library Call Errors Peripheral Errors Source Deck Organization Special Considerations 11-11-68 11-11-09 11-11-69 11-11-69 11-11-70 11-11-71 11-11-71 11-11-73 11-11-73 11-11-73 11-11-73 11-11-73 II -11-74 lI-11-74 11-11-74 11-11-74 11-11-74 11-11-74 11-11-75 Ir-11-75 U-11-75 11-11-15 11-11-76 11-11-76 11-11-76 11-11-76 11-11-76 11-11-77 11-11-77 11-11-77 II -11-79 11-11-79 11-11-79 11-11-79 II -11-79 11-11-80 11-11-83 SECTION 12 INSTRUCTION REPERTOIRE 12.1 12.1.1 12.1.1.1 AN/UYK-7 Computer Functions Register Format and Usage Program Address Register xiv 11-12"'1 11-12-2 11-12-2 M-5035 Volume II TABLE OF CONTENTS (Continued) Paragraph SECTION 12 (Continued) 12.1.1.2 12.1.2 12.1.2.1 12.1.2.2 12.1.2.3 12.2 12.2.1 12.2.2 12.2.3 12.2.4 12.2.5 12.2.6 12.2.7 12.2.7.1 12.2.7.2 12.3 12.3.1 12.3.2 12.3.3 12.3.4 12.3.5 12.3.6 12.3.7 12.3.8 12.3.9 12.3.10 12.3.11 12.3.12 12.4 12.4.1 12.4.2 12.4.3 12.4.4 12.4.5 12.4.6 12.4.7 12.4.8 12.4.9 12.4.10 12.4.11 Addressable Registers, Control Memory Modes of Operation Interrupt State Task State Active Status Register AN/UYK-7 Instruction Formats Format I Instructions Format II In~tructions Format III Instructions Format IV-A Instructions Format IV-B Instructions Indirect Word I/O Commands Formats Normal Mode ESI Mode Symbolic Conventions f - Function Code Designator a - Arithmetic Code Designator k - Operand Interpretation Code Designator b - Index Register Code Designator i ~ Indirect Address Code Designator ~. - ~ase Register Code Desig~ator y - Operand Code Designator f2t f3, f4, - Subfunction Code Designators m - Shift Counter Field . m - Monitor Interrupt Cod~ Designator c - Chain Flag Code Designator j - Channel Number Computer-Instruction Repertoire Load and Store Instructions Arithmetic Instructions Jump Instructions . Instructions Involving Comparison Operations Instructions Involving Logical Operations Shift Instructions Instructions Referencing Control Memory Interrupt Handling Instructions Miscellaneous Instructions Extension Mnemonics Input/Output Instructions xv 11-12-3 11-12-8 11-12-8 11-12-8 11-12-9 11-12-12 11-12-12 11-12-13 11-12-13 11-12-14 11-12-14 11-12-15 11-12-16 11-12-16 11-12-17 11-12-17 11-12-17 11-12-17 11-12-22 11-12-25 11-12-25 11-12-25 11-12-25 11-12-20 11-12-26 11-12-26 11-12-26 .11-12-20 11-12-26 11-12-3S 11-12-41 II -12-~*> 11-12-57 11-12-02 11-12-68 11-12-71 11-12-79 11-12-84 11-12-92 11-12-98 M-5035 Change 2 Volume II TABLE OF CONTENTS Paragraph (Continued) Title APPENDIX A CHAR ACTER CODES APPENDIX B SUMMARY OF SYSTEM STATEMENTS A-I B-1 APPENDIX C SUMMARY OF SERVICE ROUTINE CALLING SEQUENCES C-1 APPENDIX 0 CMS-2 COMPILER RESERVED WORD LIST D-l APPENDIX E COMPILER ERROR MESSAGES AND LIMITS E-l APPENDIX F SUMMARY OF ASSEMBLER ERROR CODES F-1 APPENDIX G AN/UYK-7 CONDENSED REPERTOIRE . APPENDIX H CMS-2 SYSTEM TAPE DUPLICATION APPENDIX I SYSTEM MODIFICATION CMS-2 KEYWORD INDEX xvi G-l H-1 I-I M-5035 Ch H n~Jf' 4 Volume II L1 ST OF 1LUJSTH AT] ONS Figure I-I 2-1 2-2 2-3 2-4 2-5 2-6 2-7 2-8 :.!-<) 2-10 2-11 2-12 2-13 2-14 5-1 6-1 7-1 11-1 11-2 11-3 11-4 ll-S 11-6 11-7 1l-B 11-9 11-10 Ti t Ie Typical Minimum Configuration CMS-2 Compile-Time System Structuring of Data Designs and Proceuurps Source Deck Forms System Procedure Design Range of Program Identifiers CMS-2 Program Structure Declaral ivps A Compile-Time System Struc1un~ Statement Execution Flow Involvin~l Pro(,t't\url' Calls Table Structure Fi('lt! Assignments for a Tablp Tab 1(' S tor age S eq U(~ncp Parent Table Relationships A Three-Dimensional Array Array S 1 or age Sequenc(~ VARY Flow Input/Output Data Flow Element s of a Compi le-Timt' Sys tern Assembler Pass 1 Data Flow Assembler Pass 2 Data Flow Sample Deck Using Control Cards Sample Deck to Assemble ,Load, and EXt'cUl1' a Single Program Sample Cr os s -He f e f('ncp Li s 1 i n~1 Source Dt'ck Oruanizalion for a Singlt' Prouram Source Deck Organization for Asst'mblinu Using Library Input Source Deck Organization for Two or Mort' U(~ppnden t ('roU rams 0 r S(~gn1t'n t s Source Dpck Organizat ion for Two or ~lorl' Independent Programs or S(~~)ml'nt s Source Deck Assembly Tinw Allocat ion ~ I 1-1--1 11-2-·1 1 1 -~-() 11-2-7 11-:2-0 }1-:2-1u 11-:2-1] 11-:2-1:2 11-:2-1'-1 II-:2-HI II-:2-1q Il-:2-Jt} J l-:2-:2J I 1-:2-:2:2 11-:2-:2:{ I 1-.-)- 63 I 1 -()-:~ 11-7-:2 11-11-:1 I 1-11--1 11-11-1.-) I 1-11-1 -;- 1I-II-7t' II -1 1-{,I) I I-II ....U I 11-]]-l\:2 I I -I 1-tl:2 I 1-1 I _n:~ I M-5035 Change 4 Volume II LIST OF TABLES Table • 4-1 4-2 5-1 5-2 5-3 5-4 6-1 7-1 9-1 11-1 11-2 11-3 11-4 12-1 12-2 12-3 12-4 12-5 12-6 12-7 Ti tie Examples of Variable Declarations Examples of Type-a Fields Arithmetic Operators Relational Operators Boolean Operators Truth Table CMS-2 Operating System Standard Files Equals Expression Summary Instruction Sub-field Valid Forms Operators and Priorities of Operators Data Modes for Operator Items Relocation of Binary Items Single and Double Precision Expressions Central Processor Control Memory Address Assignments AN/UYK-7 Computer Modes of Operation Active Status Register Instruction Repertoire Symbol Definitions General Operand Interpretation (Memory To Ar i t hme tic) General Operand Interpretation (Arithmetic To Memory) General Operand Interpretation (Normal Replace Instruction Interpretation) xviii 11-4-20 11-4-32 11-5-2A 11-5-6 11-5-6 11-5-8 11-6-2 11-7-20 11-9-19 11-11-6 l 11-11-65 11-11-72 e II~11-72 11-12-4 11-12-8 11-12-9 11-12-19 11-12-23 11-12-23 11-12-24 M-5035 SECTION 1 INTRODUCTION 1.1 PURPOSE AND SCOPE This user's reference manual contains the information operators who wish to use or control the operation of (CMS-2) developed for use with the AN/UYK-7 Computer. Group developed this system for the Department of the Command, under contract number N00024-70-C-1142. required by programmers and the Compiler-Monitor System Univac Systems Programming Navy, Naval Ship Systems This manual consists of two volumes with contents as follows: Volume I - Moni tor, Loader, Librarian, Peripheral Utilities, and System Operation - contains descriptions of command formats recognized by the Monitor, Loader, Librarian, and Peripheral Utilities. This volume also contains descriptions of calling sequences required to reference Monitor service routines and descriptions of operator commands recognized by the CMS-2. Volume II - Compiler, Assembler, and Instruction Repertoire - contains a description of the languages recognized by the Compiler (both high level and low level) and the Assembler, including a comprehensive description of macro generation. Volume II also contains a complete functional description of the AN/UYK-7 Computer ~nstruction repertoire. While this manual contains comprehensive descriptions of command syntax, calling sequences, and messages generated by various components of the system, detailed descriptions of the functions performed by each component, the interfaces between the components, and functions performed by the hardware are all beyond the scope of this manual. 11-1-1 M-5035 1~2 APPLICABLE DOCUMENTS The following documents augment the content of this manual to provide a complete description of the Compiler-Monitor System 2 (CMS-2) developed for the AN/UYK-7 Computer: NAVSHIPS 0967-029-5430 Consists of" five parts containing Program Specification for the basic functional specifications Compiler-Monitor System for each of the five major components in the system: for use with the AN/UYK-7 Computer. Part 1 - Compiler Part 2 - Librarian Part 3 - Monitor Part 4 - Loader Part 5 - Peripheral Utilities NAVSHIPS 0967-029-5440 Consists of five parts containing Program Design Plan for the detailed descriptions of Compiler-Monitor System functions performed by each of the for use with the AN/UYK-7 five major components in the system: Computer. Part 1 - Compiler Part 2 - Librarian Part 3 Monitor Part 4 Loader Part 5 - Peripheral Utilities NAVSHIPS 0967-051-6291 Contains the hardware description AN/UYK-7 Digital Data Computer of the computer used by the system. Un j \' ac DSn Doc umen t, PX 3699A Contains the hardware description UNIVACu 1532 Input/Output of the I/O console used by the Console Technical Description system. Univac DSD Document, PX 3662 Contains the hardware description UNIVAcID 1540/1541 Magnetic of the magnetic tape units used Tape IJnits Technical Description by the sys tern. 11-1-2 M-5035 Univac OPO Document, UP2543, Rev I, UNIVA& 1004 Card Processor Reference Contains the hardware description of the card reader, card punch, and high-speed printer used by the system. 1.3 SYSTEM CAPABILITIES CMS-2, also referred to as the system, provides optimum utilization of the AN/UYK-7 Computer and associated peripherals in a serial batch proces'sing environment. The system is user oriented and designed to optimi~e the capabilities,of the system for all users. Its major features are: 1. Provides the simplest possible operational characteristics consistent with the full utilization of the system. 2. Provides a simple yet flexible means of generating, storing, and updating computer programs at the individual installation. 3. Provides a broad and easily utilized system of program construction, manipulation, and debugging aids. 1.3.1 Hardware Requirements The system operates on an AN/UYK-7 Computer and its associated peripherals. The ~inimum equipment required to efficiently operate the system consists of: I. AN/UYK-7 Computer with 3 memory banks. 2. UN IV AcE> 1004 Card Reader, Punch, and Printer or equlv·alent. 3. Six UNIVAOV 1240 or 1540 Magnetic Tape Transports or equivalent. 4. UNIVAC® 1532 Input/Output Console and Keyboard or equivalent. Figure 1-1 illustrates a typical minimum configuration. 11-1-3 M-5035 AN/UYK-7 Computer with 48K of Memory 1004 Card Reader Punch, and Printer 1532 I/O Console and Keyboard I I I I I t r---I I I I IL___ _ Figure 1-1. Typical Minimum Configuration .I 1-1-4 * Optional addition M-5035 1.3.2 A Software Components s~ftware component of CMS-2 is a program which is designed to perfQrm a specific function (e.g., compile a program, build a library) using an external data-base (e.g., source, object code). The component is designed to operate under the Monitor (a component that performs control functions) which determines its final operational allocation and provides it with a centralized input/output capability. Thus, a component represents a module in the system which may be tailored to operate ·under the Executives with . little anticipated change in the logic. These changes would necessarily reflect the idiosyncrasies of the particular executive, notably in the area of the Executive call. CMS-2, for the initial development, consists of the followi ng components: 1. Monitor 2. Object Code Loader 3. Librarian 4. Peripheral Utilities 5. Compiler 6. Assembler 7. System Tape Generator The system utilizes magnetic tape as the system storage medium. The tape format effectively provides the features which follow: 1. Efficient run time retrieval of programs. 2. Independent system initialization. 3. Potential system expansion. 4. Total system delivery. 5. Complete sys!~em update, maintenance and reproduction. The system storage medium consists of two parts: and 2) the system library. 11-1-5 1) the operational library M-5035 The operational library contains the Monitor and components which make up the system; in addition, it contains directory information required for locating programs on the operational library, for relocatable loading (not initruction modification), and for initating execution. This library occupies the first file on the system tape and is wiitten in a format compatible with the NDRO . bootstrap routine. The Monitor and the directory information are loaded when the bootstrap routine is initiated from the computer control console. This provides the independent system initialization. The system Library contains the following: 1. Object code of all run time routines (implicit) 2. Object .code of all intrinsic built-in routines. J. Object code of Monitor and all components. 4. Compools of selected data designs for Monitor and components. 1.3.2.1 0 Monitor The Monitor (described in Volume I, Section 2) is a serial batch processing operating routine utilizing a single AN/UYK-7 unit processor. Major functions available through the Monitor are requested by the user through control cards described in Volume I, Section 2. The Monitor includes the Centralized Input! Output Module which supports I/O on the various devices attached to the AN/UYK-7. The Monitor also provides for handling of all classes of processor interrupts and interfaces to allow user programs to access vital interrupt inform~tion (e.g., flo~ting point error). The Monitor is responsible for retrieval of components from the operational library on the system storage medium (system tape). It also maintains system core allocation algorithm. 1.3.2.2 Object Code Loader The Object Code Loader (described in Volume I, Section 3) pe~forms instruction modification to object code produced by the CMS-2 Compiler and CMS-2 Assembler. The Lvclder allows optimum code to be generated by the AN/UYK-7 language processors by combining independently compiled program segments under a common base register or registers, thus reducing the number of base register manipulation instructions which must be executed • .11-1-6 M-5035 1.:\.2.:\ l.ibrarian The Librarian (described in Volume I, Section 4) provides a convenien.t, f!asyto-use method of storing, ~etrieving, and updating both source statements and rclocatable object code. The Librarian is capable of u~dating (i.e., adding. deleting, changing) both entire elements or individual items within an element. 1.3.2.4 Peripheral Utilities The Peripheral Utilities (described in Volume I, Section 5) provide a variety of functions for manipulating data files on the peripheral devices. These functions include: 1. Position specified magnetic tape at the start of a file (designated by a file mark). 2. Position specified magnetic tape at the start of a record within a file. 3. Transfer tape data into memory (read tape). 4. Transfer memory data onto tape (write tape). 5. Compare the contents of two tapes and print out any differences. 1.3.2.5 Compiler The Compiler (described in Volume II Sections 2 through 10) accepts both high and low level languages. The high level language is statement oriented and the low level is computer instruction mnemonic oriented. These languages describe the desired program, and the Compiler generates object code data that the Object Code Loader places into memory as an executable program. The Compiler input is called source code and the Compiler output is called object code. lI-I-7 M-5035 1.3.2.6 Assembier The Assembler (described in Volume II, Section 11) accepts a computer instruction mnemonic oriented language that gives the programmer absolute control of the structure of his program. In addition, the Assembler provides programmers with a level of assistance beyond that normally associated with ~n assemblf!r class of language processors. The assembler accepts programmer definitions of pseudo-operations (called Macros) and then uses the definition whenever tht> programmer references the pseudo-operations. As with the Compiler, the Assembler input is called source code and the Assembler output is called obj ec t code. 1.3.~.7 System Tape Generator The System Tape Generator (described in the System Programmer's Manual), provides an easy-to-use method of updating system tapes that have a directory scheme identical to the CMS-2 tape. The System Tape Generator accepts input that contains the necessary data to change tape directory information (e.g., number assigned to a new, component, names of 'new records. names of records to be deleted), and then, in conjunction with the Object Code Loader, generates a new system tape complete with required directories. 1.4 SYSTEM OPERATION System operation consists of initiating the system, preparing inputs to the system, and accepting outputs. 1.4.1 System Load and Initiation System loading is initiated using the AN/UYK-7 Magnetic Tape Hardware Bootstrap Program. The resident Monitor is loaded at a specified location dependent on' the number of operable memory banks currently available. The necessary allo- cation-dependent words in the resident Monitor are then initialized. The Monitor's data and the operational library directory for the Monitor are then loaded from the system tape, and the Monitor requests the current time, date, operating mode (open or closed shop), and standard selections of input/output devices. Any other flags or variables maintained by the Monitor and requiring initialization are preset. 11-1-8 M-5035 1.4.2 Standard Input Processing Once initiated, the Monitor starts reading card image data from the standard input device. This device is normally the card reader; select(~d howf~'/('r, Ihc Monitor accepts commands to process data from either magnetic tape or t.he I/O console as standard input data. In each of these cases, the input data must be in card image format. The data read from the standard input device consists of: 1. Monitor control cards which contain commands to the Monitor inclu(ting commands to load and activate other system components or user programs. 2. Inputs to an activated system component or user program which contain both commands to the program and input data to be processed by the program. In general, when the Monitor pas~es control to either an(Ither system component or user program, the component or program (as applicable) starts reading data from the standard input devices; for example, the card images following the image commanding the Monitor to load and activate the Compiler make up the source code input to the Compiler. On the other hand, most of the card images following the image commanding the Monitor to load and activate the Librarian are commands to the Librarian directing its manipulation of data stored on magnetic tape. 1.4.3· Standard Output Processing The system has three basic outputs: I. Standard output consisting of object code cards normally produeed on the card punch. The Monitor accepts a command to place this data on magnetic tape in obj ec t code card image format instead of punchiny cards. 2. Hardcopy output consisting of high-speed printer-oriented data, such as program listings, normally produced on the UNIVAC\!!) 1004 High Speed Printer. The Monitor accepts a command to place this data on magnetic tape in printer format instead of printing the data. 3. Console messages consisting of up to 72 characters of operatororiented data (request to mount a tape) typed out on the I/O console. II-I-9/II-I-IO Blank M-5035 Change ·t SECTION 2 I~TROUUCTION ~.l MAJOR fE~rURES Of TO TilE CMS-2 LANGUAGE CMS~2 CMS-2 is a problem-oriented compiler language developed to meet the needs of real-time data processing and scientific applications. Its major featur\~s are described below: a• I C MS-2 permits program modularization and adherence to the concepts of structured programming. b. Input to the CMS-2 Compiler is statement-oriented, rather than card-oriented o The source card format is free-form and may be arranged for user convenience. c. A broad range of data types is definable in CMS-2. These types include fixed-point, floating-point, Boolean, Hollerith (character), and status. d. CMS-2 permits direct reference to, and manipulation of, character and bit strings. e. Programs may include segments of symbolic machine language, referred to as direct code. The remainder of this section presents a number of definitions, discusses various concepts fundamental to the CMS-2 language, and presents a summary of the specific capabilities of the language. 2.2 PROGRAM STRUCTURE A CMS~2 program is composed of an orderly set of statements. These statements are composed of various symbols that are separated by delimiters. categories of symbols are processed: Three operators, identifiers, and constants. The operators are language primitives assigned by the Compiler to indicate 11-2-1 M-5035 specific operations or definitions within a program. Identifiers are the unique names assigned by the programmer to data units, program elements, and statement labels. Constants are known v~lues, and may be numeric (decimal or octa}) , Holleri th strings, status values, or Boolean. CMS-2 statements are written in a free format and terminated by a dollar sign. Several statements may be written on one card, or one statement may cover many cards. A statement label may be placed at the beginning of a statement for reference purposes. Tht! c~llection of program statements developed by the programmer for input to the CMS-2 Compiler is known as the source code for a program and is composed of the following two basic types of statements: 1. Declarative statements - Provide basic control information to the Compiler and define the structure of the data associated with a particular program. 2. Dynamic statements - Cause the Compiler to generate executable machine instructions (object code) for a program. These instructions, when executed at program run time, manipulate the data to solve the desired problem. Declarative statements defining the data for a program are grouped into units called data designs. Dat~ designs consist of the precise definition of temporary and permanent data storage areas, input areas, output areas, and special data units such as program switches. The dynamic statements that cause manipulation of data or express calculations to solve the programmer's problems are grouped into procedures. These data designs and procedures may be further grouped or classified to form elements of a CMS-2 program. At compile-time, the CMS-2 Compiler recognizes a system as any collection of program ~l~ments that may be compiled as an entity independent of any inter- facing proyram elements. eXf!Cut jon package or j A compile-time system may comprise an entire t may be only a small part of a large program. 11-2-2 M-5035 Before presenting any further discussion concerning the classification and grouping of procedures and data designs into elements and the combining of these elements to form systems, several concepts fundamental to the CMS-2 language must be explored. 2.2.1 Organization and Classification of Identifiers The CMS-2 Compiler uses several conventions to classify data definitions and program identifiers that are defined in a user's program. These techniques assist the programmer in structuring his program and simplify the development and maintenance of the programs. 2.2.1.1 Forward and Backward References The order in which definitions and references to these definitions appear in the source input to the Compiler is quite important. defined in data designs. All data units are Within the data design where it is defined, an identifier may generally be referenced either before it is defined (a forward reference) or after it is defined (a backward reference). However, references to data from outside a data design can only be backward; that is, the data must have already been defined before it can be referenced. Since data definitions always appear in data designs, and since data references usually appear in procedures, procedures generally fOllow the data designs defining the data referenced by the procedure. References to statement labels within procedures and calls to procedures may be forward or backward, but must obey the following local/global limitations. 2.2.1.2 Local and Global Definitions The Compiler further structures the referencing of identifiers by classifying all identifiers in a program as either local or global. Local definitions are those identifiers that can be referenced only from within the system element where they are defined. Global definitions are those identifiers that can be referenced both from inside the element where defined and from outside by subsequent system elements in the source input stream. 11-2-3 M-5035 Figure 2-1 is a pictorial representation of a CMS-2 compile-time system consisting of three elements: A, B, and C. Since a definition in the CMS-2 language is said to be local if it is valid only within a single element of the system, any definition valid within element B of Figure 2-1 is said to be local to element B. A global definition in the system of Figure 2-1 is valid within elements A, B, and C. An alternative definition of the term "system" can be derived from this localglobal concept, i.e., a system is the largest global area within a CMS-2 compilation. System Figure 2-1. 2.2.1.3 CMS-2 Compi Ie-Time System External References and Definitions The CMS-2 Compiler provides the capability of compiling one or more elements of a large system independently. For. example, all three elements of the system of Figure 2-1 could be compiled together as a single compile-time system. Alternatively, elements A and B could be compiled together as a 11-2-4 M-5035 eompi l(~-timc system and then element C could be compi led separately as another compil(!-time syst(~m. The compiler-produced output in each case is the computf!r- executable instructions (object code) for the various system elements. Later, the object code for element& A, B, and C may be combined by a relocatable linking loader program and executed together. Presumably, there is some cross-referencing of data and procedures between the three elements of our example. In order to compile element C separately, any references made by element C to definitions in elements A and B must be handled in a special manner by the Compiler and the Loader. References of this type are called external references because they involve definitions that are external to element C and, in this case, external to the compiletime system as well. Those definitions in elements A and B that are referenced externally by element C are called external definitions because they are definitions that are available to elements external to A and B. There are various ways in which definitions and references may be declared external. In some cases the Compiler will automatically treat a definition or a reference as being external. In other cases, external references and definitions must be explicitly declared by the programmer. It should be noted that only global definitions may be externally referenced or defined. Local definition~ are never valid outside, or external to, the element in which they are defined. 2.2.2 CMS-2 Elements As described in the previous paragraphs, data designs may be grouped OT classified to form elements, of a CMS-2 program. One or more elements then make up a co~pile-time system. The ordering and content of program elements is subject to the rules governing range and classification of definitions. The two types of elements within a compile-time system are system data designs and system procedures. System data designs contain global data definitions. System procedures contain one or more procedures and may also include local data design packages. A local data design, as the name implies, contains data definitions that are local to the system procedure in which the local data 11-2-5 M-5035 design appears. This structuring of data designs and procedures into program elements within a system is illustrated in Figure 2-2. I System System Procedure Procedure Local Data Design Figure 2-2. The hi~rarchy System Data Design ~ Structuring of Data Designs and Procedures shown in Figure 2-2 indicates that, within a system, system data designs are equal in importance to system procedures; they are the program elements of a system. Keeping in mind the restrictions against forward referencing, a source deck may take various forms, as illustrated in Figure 2-3. The technique illustrated in Figure 2-3 (A) is dften used program. i~ constructing a Since definitions within a system data desi9n are global to the balance of the system, system procedures may appear in any order following the system data design(s) defining the referenced data. Interspersing data designs and procedures as in Figure 2-3 (8) (e), however, has an advantage, especially in a large system, of maintaining data definitions in meaningful groups close to the associated procedures. Note that Figure 2-3 illustrates several examples of a compile-time system, but these systems might be only a small part of an entire execution patkage. In addition, each compile-time system of Figure 2-3 might be further broken doWn into two or more compile-time systems. In this manner, corrections may be made to a particular system procedure, which may then be recompiled without compiling the entire execution package again. 11-2-6 M-5035 System System Data Design D~ta De~ign System Procedure System Procedure System System Procedure System Data Design System Procedure, System Data Design System Procedure System Procedure System Procedure System Data Design System Procedure System Procedure System Procedure A B C ~ Figure 2-3. Source Deck Forms System data designs and system procedures are the smallest program units that may be compiled individually. A compile-time system may consist of a single system data design or system procedure, but it cannot consist of a single local data design or procedure. 2.2.2.1 System Data Designs Data designs contain descriptions of the attributes of the various data units (e.g., tables and,variables) and their relationship to each other. As the Compiler processes these descriptions, it assigns and reserves core storage locations for subsequent references to the data units. Data designs may contain value information as well, which will cause the object code to preset the data. Co~piler 11-2-7 to generate M-5035 Definitions within a system data design are global to the system. all automatically externally defined by the Compiler. They are There is, therefore, no need to specifically externally define any data within a system data design. 2.2.2.2 System Procedures· System procedures are composed of procedures and local data designs. A system procedure usually contains one procedure with a name identical to that of the system procedure name. of that system procedure. This procedure is known as the prime procedure The prime procedure entry point is automatically externally defined by the Compiler and is global to the system. Other system procedures, and data designs may reference prime procedures at will. Thus, the prime procedure of a system procedure is considered a global procedure (hence, the term system procedure). A system procedure may contain more than one procedure, as illustrated in Figure 2-4. Local Data Design "' Procedure A System >Procedure Procedure B Local Data Design Procedure C ..I Figure 2-4. System Procedure Design For example, the system procedure of Figure 2-4 contains three procedures and two local data designs. If this system procedure were named "B", procedure B would be the prime procedure of the system procedure and its name would be 11-2-8 M-5035 global to the entire system. However, procedures A and C, along with the data units of the two data designs, would be local to the system procedure and could not be referenced from outside the system procedure. 2.2.2.2.1 Local Data Designs. The difference between system data designs and local data designs is that, while system data design definitions are global to the system and automatically externally defined, local data design definitiops are local to the system procedure within which they are contained; any necessary external definitions must be explicitly indicated within the data design. In addition, a local data design may not be compiled separately from its associated system procedure. The local data design is intended to be used for the definition of data units referenced only by the procedures within its system procedure. The use of local data designs reduces the possibility of duplication of data names in a large system because of their limited range of definition. 2.2.2.2.2 Procedures. Procedures contain CMS-2 statements and machine- language statements. They may not contain data definitions or data values for previously defined data. Procedures contain the statements from which the Compiler generates the instructions that actually perform the steps necessary to the solution of the problem. They must be included withiri a system procedure element at compile-time. 2.2.3 Range of Identifiers As can be seen from the previous discussions, the organization of CMS-2 statements into system data designs and system procedures to form the elements of a program is closely related to the rules concerning classification of identifier definitions and references. These rules on the range of identifiers (i.e., local/global definitions and forward/backward references) are summarized i'n Figure 2-5. 11-2-9 M-5035 Range Within Which They Can Be Referenced Identifiers Global Prime Procedures Throughout the compile-time system. Data defined in a System Data Design Within thnt system data design and in all system elements that follow. Local Procedures Within the same system procedure. Data defined in a Local Data Design Within that local data design and the remainder of the system procedure containing t.he local data design. All Statement Labels Within the system procedure. Local Figure 2-5. 2.3 Range of Program Identifiers DECLARATIVE STATEMENTS The CMS-2 declarative statements provide the Compiler with information about program structure and"data element definitions. result in executable code. pr"'.lr~:-;l Declaratives generally do not Declaratives are classified in three categories: structure declaratives, data declaratives', and Compiler directive (or program control) declaratives. 2.3.1 Program Structure Declaratives ln the development of a CMS-2 program, the dynamic and data definition statements arc organized into procedure and data design packages. CMS-2 program structure declaratives are used to define the source program organization by specifically delimiting the structure type as shown in Figure 2-6. exampl(~ An of the correct organization of program structure declaratives for a compile-time system is presented in Figure 2-7. 11-2-10 M-5035 Beginning Delimiter Ending Delimiter SYSTEM ENO-SYSTEM . Delimits a compile-time system SYS-UU ENU-SYS-OO Oelimits a system data design within a compile-time system SYS-PROC END-SYS-PROC Delimits a system procedure within a compile-time system LOC-DD END-LOC-DD Delimits a local data design· within a system procedure PROCEDURE END-PROC Delimits a procedure within a system procedure FUNCTION END-FUNCTION Delimits a function within a system procedure SYS-PROC-REN END-S YS-PROC Delimits a reentrant system procedure within a compiletime system AtrTO-DD END-AlITO-DD Delimits a reentrant data design within a reentrapt system procedure HEAD END-HEAD Delimits a header package within a compile-time system Figure 2-6. CMS-2 Program Structure Declaratives 11-2-11 ::;: I U1 o w U1 15 11 20 S'AJ~ PI LIEI I I I I I I I I I I , I I I I l>IA,T1A1),E,C-1 ,.... ...... I N I ..... N 25 ISlt,SIT, E,MI IN, £, ALl, £$, 30 35 ,.it I I , , , , I I ' ' 'iT-I/,DIN,S, I(,III bt -IH,E' I AI)' Is,t,SI-I),l, pt., 1 I ,V,t,A,R, $1 I I IE IWI:bI-ISI'fISI-~I)1 I I I I , I I I I I I , I I I I I I I I IVI~,8tL., U,B),R"IC, I 1 I Major Header 1.$1 , , I I 1 I I 15IDlul~CIEI ~ , , 1 I I 40 System Data Design 'I CompileTime System ISli1SI-,P,IC"o,G, 1$1 I , , , I , I 1 IP,~,D'c.,E' I)'''' ,R,EI kJ,PLJ>,A ,TIE, I~I Is IElll IY IEIAIRI I,.jOI "I ~1711t IRltITIUI~INII!' I ,$, I,, I I I I I I IFIIIIJ>'-IPIRIOICI IUlp,l),AITI" ~I I IE,IIIl>I-Rly,SI-IPIRl o lc, 1$1 IE ,N,J>,-,S 1'1 ISjT ,[ "" I ,$, , I Figure 2-7. I , I I I I I A Compile-Time System Structure System Procedure M-5035 2.3.1.1 Procedure Structure Declaratives and Linking The dynamic statements that describe the processing operations of a program are grouped into blocks of statements called procedures. The overall purpose of a program, its design, and to some extent, its size, influence the programmer's decision as to whether one or several procedures will be declared. The transfer of program control from one procedure to another requires the observance of procedure linking rules for such transfers. The concept of procedure linking may best be described by posing a situation from which those linking requirements desirable for use by a programmer may be derived. As a program design develops, it becomes apparent to the programmer/designer that there is a requirement to execute a given set of statements at several points (within several procedures) in the total program. As ~ach of these points is encountered, it would be advantageous to have a program control capability of branching to a common routine (procedure), processing, and returning to the next instruction following the program control branch point (or procedure call). Along with this procedure call should be a capability of simultaneously and automatically passing that data, from the calling procedure to the called procedure where the data is processed. This automatic data transfer is defined as input of parameters, that cedure. is~ data input to the called procedure from the calling pro- Upon completion of processing by the called procedure, it also should be possible to automatically pass the results of the processing from the called procedure to the calling procedure when program control is returned to the calling procedure. This is defined as output of parameters, that is, data output to the calling procedure from the called procedure. Additionally, there should be a capability of specifying an instruction address (statement label) to which the called procedure may transfer program control in the event it does not perform its normal processing due to invalid input data or processing checks indicating invalid or illogical results. This is defined as an abnormal exit (abnormal return). 11-2-13 M-5035 The foregoing is the capability available to provide linkage among all procedures. Furthermore, all or part of these linkage capabilities may be used, depending upon the requirements of the program •. The syntactical requirements for defining a procedure and making a procedure call are presented in Sections 4 andS, respectively. Figure 2-8 is a schematic representation of the procedure linkage concept. 2.3.1.2 Reentrant System Procedures Certain programming applications require that one or more of the procedures comprising the program package or system f6r that application be structured such that they may be shared by more than one task concurrently. Procedures of this type are said to be reentrant procedures. The principal characteristic of a reentrant routine is that it must be divided into two logically and physically distinct parts: a constant part and a variable part. The constant part (instruction part) is loaded into memory once and services all tasks requiring this routine. One copy of the part (data area) belongs to each task that is being serviced. ~ariable This copy is usually created (that is, it is allocated memory space) when the task is initiated. Within the CMS-2 language, a programmer has the capability of declaring a system procedure to be reentrant. In this case, the object code generated by the Compiler for all procedures within this system procedure will be invariant (constant) under execution. In addition, a special type of local data design called an automatic data design may be declared within a reentrant system procedure. An automatic data design is used for the definition of temporary storage and procedure parameters used by the reentrant procedures within the system procedure. Within a reentrant system procedure, the Compiler automatically performs the required separation of the constant part (procedures) and the variable part (automatic data designs). of the variable part may then be loaded into m~mory Multiple copies along with a single copy of the constant part and the reentrant system procedure may be executed simultaneously by more than one task or central processor. 1I-2~14 M-5035 -- ... - -, Procedure B Procedure M Entry Entry r--" , CMS-2 Dynamic I Statements ~ I I I I • I I I-J Procedure B Call Next inst. after call •I Procedure G Call I I J ~ --- .... Return ~---------------------~ - Procedure G • Next inst. after call ~ ; I I I I I 1 t I I Procedure R -, Entry I- Procedure R Call ------, I Return t ~ ----, I Next inst. after call L_r-J I I ·1 I I ~.I-J I I I I I Entry i- Procedure F Call Next inst. after call I I I ~I .. "' } Procedure F I .~ Branch to Abnormal Sequence or Continue with Normal Sequence I I I I I INorma 1 I L!!£.t.E!..~. I t I I Tes t Sequence I J - ..., I I I I I I I r- _.J I I I Abnormal Processing Sequence I I .J r· I I • I AbnorI mal I Return .-~---- ____ -.JI· ~ I t I I Return 4---.. t---------...J Figure 2-8. Statement Exe~ution Flow Involving Procedure Calls 11-2-15 M-5035 It must be clearly understood that the Compiler provides only this separation capability. The responsibility for loading these programs into memory and allocating space for automatic data designs is properly a function of loaders, monitors, and executive programs. Furthermore, the CMS-2 language and Compiler provides the capability, through this separation function, of implementing such sophisticated programming te~hniques as recursion and reentrance after suspension. However, much of the responsibility for this type of programming must be borne by the programmer/designer and the executive program for the application., 2.3.2 Data Declarations Data declarations by the programmer define the format, structure, and of data elements within a compile-time are as follows: 1. 2. Swi tches: a. Statement switches. b. Procedure switches. Variables: a. b. 3. . system. Computational: 1. Integer. 2. Fixed-point. 3. Floating-point. Non-computational: 1. Hollerith. 2. 3. Boolean. Status. Tables: a. One-dimensional. b. Multidimensional (array). c. Subtables. 11-2-16 ord~r The three major data types M-5035 2.3.2.1 d. Like-tables. e. Item areas. f. Fields. Switches Switches provide for the transfer of program control to a specific location within a compile-time system. Switches contain a set of identifiers, or switch' points, to facilitate program transfers and branches. points represent program addres~es The switch of statement labels or procedure names. Transfer of control to a particular switch point is usually determined by the value of a programmer-supplied index. 2.3.2.2 Variables A variable is a singular piece of data. or words. statement. It may be one bit or multiple bits A variable may be preset to a desired value within the definition The variable may contain a constant value or its value may continuously change during program execution. Multiple variables ~aving identical attributes may be defined in a single declarative statement. types th~t Data may be specified fora variable are arithmetic (fixed- or floating- point), Holleri th(character string), status (defined states of condi tion), or Boolean (true or false). An initial value, or preset, may be specified for the variable in the declarative statement. 2.3.2.3 Tables Tables hold ordered sets of identically structured information. unit of data structure in a table is the item. The common An item consists of k computer words where k Js selected by the'programmer or Compiler. A table may contain n items, where n is programmer selected. Thus the size of the table in number of required computer words for st~rage becomes the product of nand k. A table structure is illustrated in Figure 2-9. 11-2-17· M-5035 Word 0 Word 1 Word.2 Item 0 1 2 3 4 n Figure 2-9. Table Structure 11-2-18 Word k M-5035 Items may be subdivided into fields. Fields are the smallest subdivision of a table. A field may be a partial word, a full word, or a multi-word subdivision. Data types that may be specified for a field are arithmetic (fixed- or floating-point), Hollerith (character string), status (defined states of condition), or Boolean (true or false). Field~ may overlap each other. Data may be preset into a field. is illustrated in figure 2-10. Word 0 Word 1 y ( Item 2 An example of field assignments Word 2 y I I I, t \.. \ Field B '~--------~T--------~~ Field A Field C Figure 2-10. Field Assignments for a Table CMS-2 tables may be defined as horizontal or vertical. This specification by the programmer dictates the manner in which the table words will be stored in core. The words of a horizontally declared table are stored such that words o of all items are ~tored sequentially, followed by words I of all items, etc. The words of a vertically defined table are stored such that all words of item 0 are siored sequentially, followed by all words of item 1, etc. Figure 2-11 illustrates the storage pattern for horizontal and vertical storage. Word 0 Word 1 Word 2 Word o. Wor.d 1 Word 2 Item 0 Item 0 Item I Item 1 Horizontal Storage Figure 2-11. Vertical Storage Table Storage Sequence 11-2-19 M-5035 The CMS-2 table structure also allows the programmer to define a subset of adjacent items within a table as a subtable. The programmer may also allocate outside the table a working storage area, designated as an item-are~which will automatically take on the same field format as that defined for the table items. Additionally, the programmer may declare tables kno~n as like-tables having identical field format as the parent table but having a different number of items. Figure 2-12 illustrates these ~escribed relationships to the parent table. 2.3.2.4 Arrays An array is an extension of the table concept for storing ordered sets of identically structured information previously defined as items. Arrays may be conceptually visualized as rows, columns, and planes of items. An example of an array (three-dimensional) is presented in Figure 2-13. As with tables, the basic structural unit of an array is the item. The array item may consist of k computer words with fields defined as desired. The pattern for storage of an array within core is illustrated in Figure 2-14. 2.3.3 Compiler Directive Declaratives Certain CMS-2 declarative statements specify control information to the Compiler. These declaratives direct Compiler action as to allocation mode, listing options, system index registers, program debug features, base numbering system interpretation, data pooling requirements, and the computer mode of operation within which the designated program is expected to run. These declarative statements may be located in major headers if the control applies to the entire compile-time system, in minor headers if the control applies to a system element, or within a system element. The rules for placement and range of effective action for the individual declaratives are defined fully in Section 7. 11-2-20 M-5035 Item 0 I 2 Parent Table 3 Subtable 4 5 Subtahle 6 7 8 II II I I Item-Area Like-Table 2 3 Figure 2-12. Parent Table Relationships II~2-21 M-5035 Column 0 Column 2 Column 1 Row 0 1 / . 2 \ \ \\ , I I \\ ~o\ umn 0 Column \ I I / 3 Plafe p ,I / Row 0 1 . 2 / / 3 " , / / // / / / ,, \ \ \ ,Plane 1 , ,, , \ \ , \ \ \ I I I / / / I / / / \ \ \ ,,, , / \\ ,.,\ \\ '. / / / / / / / / 1 \ \ \ \ \ \ \ \ / Item 1, 2, 0 Word k Word l' Figure 2-13. A Three-Dimensional Array 11-2-22 Column 2 M-5035 Plane 0 r Column 0 , r Word o Word 1 Word 2 Column 1 r Word 3 Row 0 1 2 Repeat the pattern with next plane, commencing at Row 0, Column 0, Word O. Figure 2-14. Array Storage Sequence 11-2-23 M-5035 2.4 DYNAMIC STATEMENTS CMS-2 dynamic statements specify processing operations and result in executable code generation by the Compiler o A dynamic statement consists of an operator followed by a list of operands and additional operators. An operand may be a single name, a constant, a data-element reference, or an expression. 2.4.1 Expres s ions " Arithmetic expressions may include standard addition, subtraction, multiplication, and division operators, as well as exponentiation, mixed-mode values, and inline redefinition of the scaling of fixed-point numbers. hierarchy of operation evaluation is used. An algebraic A relational expression performs a comparison between two similar operands as specified by a relational operator. There are four types of comparisons available: 1. Arithmetic, involving the comparison of signed arithmetic values (fixed, floating, or mixed). 20 Hollerith, involving a left-to-right, character-by-character comparison. 3. 4. Boolean, involving single bit comparisons. Status, involving the comparison of status values. Arithmetic operators used in CMS-2 are + (addition), - (subtraction), / ( d i vis ion), ~~ ( mu1 tip Ii cat ion), )!c e xp 0 ne nt i a t ion), and •• ( i n1 i nesc ali ng) • )!¢ ( Relational operators are EQ (equal), NOT (not equal), LT (less than), GT (greater than), LTEQ (less than or equal) and GTEQ (greater than or equal). Boolean operators used in CMS-2 are AND, OR, XOR (exclusive or) and COMP (logical not). A CMS-2 expression may include algebraic, relational, and Boolean operators. 2.4.2 Statement Operators The CMS-2 statement operators allow the programmer to write his program in an easy-to-Iearn, problem-oriented language. Major CMS-2 operators and their functions are summarized on the following page. 11-2-24 M-5035 Change -! Function Op(~rat()r SET Per f () r msea 1c u1ali 0 nsur ass i Uns a val ut' t 0 () nf! 0 r m0 rt~ d a tau nit s • The ass i g nnH' n t may 11 ear i t hmel ie, II 0 lIe r i t h , .status, Boolean,' ur multi-word. SWAP Exchanges the contents uf two (;OTO Alters program flow directly or via a statement switch. IF Expresses a test situation for conditional execution of one or more statements. VARY Establishes a program loop to repeat execution of a specified group of statements. FINU Searches a table for data that satisfies specified conditions. PACK Transfers bit strings into a data area. SHIFT Shifts a string of bits. FOR data units. Selectively executes one of a set of statement blocks based on the value of a controlling expression. 2.4.3 Special Operators Special operators are available in CMS-2 to facilitate references to data \ structures and operations on them. These operators and their functions ate summarized below. Operator Function BIT To reference a string of bits in a data element. CHAR To reference a character string. COR AD To reference a core address. ABS To obtain the absolute value of an expression. POS, FIL To pOSition a magnetic tape file. LENGTH To obtain an input/output file length. eNT To obtain a count of bits set. CAT To concatenate character strings. 11-2-25 I M-5035 Change 4 HIGH-LEVEL INPlH/OlJfPlJr STATEMENTS CMS-2 high-level input/output (I/O) statements permit the program to communicatt with various hardware devices while running in a non-real-time environment under a Monitor system. When CMS-2 I/O statements are used by the programmer, the Compiler generates specific calls to run-time routines that must be loaded wit.h the user's program. The run-time routines are designed to link with the Monitor system and communicate with its I/O drivers. I/O declarative and dynamic statement operators and their associated functions are summarized below. Operator Function FILE Defines the environment and pettinent information concerning an input or output operation, and reserves a buffer area for record transmission. OPEN Prepares an CLOSE Deactivates a specified file and its external device, if appropriate. ~xternal device for I/O operations. Directs an input operation from an external device to a FILE buffer area. OIHPlJr Directs an output operation from a FILE buffer area to an external device. FORMAT Defines the desired conversion between external data blocks and internal data definitions. ENCOUE Uirects transformation of data elements into a common area, with conversion in accordance with a specified FORMAT. DECODE Directs unpacking of a common area and transmittal to data uni ts as speci f ied by a FOHMAT declarat ion. EI\UF 1I.E Plac('s an CIILCKIU lJi LJEF llJ lJ i Tf ~ e 1 s the Tf~e t (~nd-()f-file mark on appropriate recording mediums. scheck! nlj an III header or 1 abe I on a fi Ie. 0 u t put of a n IlJ }1( ~ cJ d (~ ron a f j I J -2-:!() 1e • M-5035 2.l) PROGRAM DEBUG FACILIT IES CMS-2 debug statements may be placed in the source language of a user's program to assist in program checkout. These statements may reference any data units defined within the system. Machine code is generated by the Compiler to call on run~time debug routines. The debug routines communicate with the Monitor system during program execution to print the desired checkout data onto the system output device (high-speed printer). Five program checkout statements are provided. Output code is generated only if the corresponding statements are enabled in the program header information. A programmer may then control and select the debug tools as needed. The debug operators and their functions are summarized below. Operator Function DISPLAY Causes the contents of machine registers and/or specified data units to be formatted and printed on the system output. SNAP The contents of a data unit are printed and stored. Subsequent executions cause a printout only when the data contents are modified. RANGE A high and low value are specified for a data unit. Each tihte the data is modified in the program, a message is printed if the value falls outside the range. TRACE A printout is generated for the execution of each CMS-2 statement between TRACE and END-TRACE boundaries. PTRACE Each CMS-2 procedure call encountered in the program being executed is identified by calling and called procedure names. 11-2-27/II-2-28 Blank M-5035 SECTION 3 BASIC DEFINITIONS A CMS-2 program consists of an ordered set of sentences composed of symbols and delimiters. The symbols and delimiters are formed using characters from the CMS-2 alphabet. 3.1 CMS-2 ALPHABET The CMS-2 alphabet consists of letters, digits, and marks as described below: a. Letter - One of the 26 letters of the English alphabet, A through Z, written in capital letter form. b. Digi t - One of the ten Arabic numerals, 0 through 9. c. Mark - Any additional special character that may be input to the Compiler via the Monitor I/O routines. The commonly used marks that have significance to the CMS-2 Compiler are listed below, along with their common name: + / ~:: (pI us) ) (right parenthesis) (minus) $ (dollar sign) (comma) (slash) (asterisk) (prime) (decimal point, period) ~ (left parenthesis) (space) (space) 3.2 SYMBOLS CMS-2 symbols are composed of strings of one or more letters, digits, or marks from the CMS-2 alphabet. There are three types of symbols: 1. Operators 2. Identifiers - Names by which programs reference their environment. - Words that represent unchanging values (constants Constants 3. - Indicating operations or specifications. in the mathematical sense). 11-3-1 M-5035 3.2.1 Operators Operators are symbols that denote an action or delineation to the Compiler. They :ell the Compiler "what to do" or "what it is" as opposed to other symbols that tell "where it is" or "how much it is". The following symbols are examples of CMS-2 operators; the symbols are divided into five categories: Arithmetic + I Relational Boolean Dynamic Declarative EQ AND PROCEDURE TABLE LT OR FIND FIELD GT COMP SET LOC-DD A special class of operators provides machine control interface. are entirely machine dependent. These symbols For the AN/UYK-7 Computer, these symbol s are: KEYl, KEY2, KEY3, STOP, STOPS, STOP6, and STOP7. 3.2.2 Identifiers Identifiers are ::Jrbitrary names used to label various units of a CMS-2 program so that these units may be referred to by unique names. A name is composed of from one to eight letters and digits; the first character of a name must be a letter o All CMS-2 identifiers (except statement labels, procedure names, and abnormal exits) must be defined by or within a data declaration, which associates the identifier with its specific attributes. In order to prevent ambiguities in the sotirce input for a CMS-2 program, the Compiler does not allow the programmer to declare or define identifiers that duplicate operator symbols in the CMS-2 language. of those symbols which are reserved words. Appendix D presents a list These reserved words are not available to the programmer for use as identifiers. In addition, any programmer expecting to make use of CMS-2 run-time routines (high-level debug, input/ output, or mathematical routines) should avoid the use of identifiers beginning with the characters "RT". This will prevent possible conflict at load time with global identifiers defined and referenced within the CMS-2 run-time library. 11-3-2 3.2.2.1 Statement Label A statement label is a special identifier in a CMS-2 program; the statement label is used to label a dynamic statement. A statement label derives its definition by context, since it is always followed immediately by a period. When reference is made to the statement label during an operation within the program, the period is omitted and the label is then known as a statement name. More than one statement label may be applied to a dynamic statement. NOTE Statement labels may appear only on dynamic statements. Hence, the period following a name signifying a statement label may be used only between the PROCEDURE and END-PROC declarations and may never be used with direct code statement labels. 3.2.3 Constants A constant denotes a value that is known at compilation time. m~nipulate CMS-2 programs the following four types of data: 1. Numeric values consisting of rational numbers. 2. Hollerith or literal values consisting of strings of characters from the CMS-2 alphabet. 3. Status values consisting of independent sets of arbitrarily named conditions. 4. 3.2;3.1 Boolean values consisting of the two values: true or false. Numeric Constants A numeric value, positive or n~gative, may be represented by a de£imal or octal constant as described below: 1. Decimal - Consists of one or more base-IO digits (0-9). is the normal mode of the Compiler. This The number enclosed in parentheses, preceded by the letter D, is also acceptable and may be used when a non-decimal mode is specified to the Compiler (see Section 7). 11-3-3 M-5035 Change 3 - Consists of one or more base-8 digits (0-7) enclosed· 2. Octal in parentheses and preceded by the letterO. These constants may be preceded by a plus sign if positive and must be preceded by a minus sign if negative. A radix point appearing within or at the beginrting of the constant identifies the constant as a mixed number or fraction. The number of fractional bits attributed to the constant equals: 1. 3. 2*n+l truncated to an integer, if constant is decimal, or 2. 3 *n, if constant is octal where n is the number of fractional digits. If the radix point is omitted or occurs at the end of the constant, it identifies the constant as an integer (whole number). Examples a. b. -94 0(77) (negative decimal integer) (positive octal integer) c. 88.1 (positive mixed decimal number) d. -O( .64) (negative octal fraction) e. -0(492.3) (negative mixed decimal number) To avoid writing many zeros, it is sometimes convenient to express a very large or· very small numeric constant as a coefficient multiplied by an exponent. Examples a. .00023 a = .23 ','-'. 10 -3 8 8 b. 180000°10 = 18 10 .,'-'. 10 c. 1500°10 = 1.5 10 r. J -'. 10 4 ',' = o(. 23E-3) = 18E5 -- 1.5E4 3 = 7.3 8 '.,-'. lOa = O( 7.3E3) 730°8 Both the coefficient and the exponent must have the same Dase. If the number is octal, it must be preceded by the 0 descriptor. d. 3. 2. 3. 2 Hollerith Constant A Hollerith constant is composod of a string of characters preceded by the descriptor H. 11-3-4 e~closed by parentheses and M-5035 Examples 1. 2. H(NOTNOW) H(REWINDilil) 3• H() ) LAST) In the second example, the two blanks are considered part of the constant. The third example illustrates the use of a right parenthesis as part of the constant within a string of characters. Each right parenthesis must be represented by two consecutive right parentheses since the terminated by a single right parenthesis. ~tring is Encoding this constant results in the characters: ) LAST Any character, including blank, is a valid character in the Hollerith set and may be used in source programs to construct character-string constants. NOTE If a Hollerith constant appears as the last term of a parenthesized expression, at least one blank must separate the right parenthesis signifying the end of the Hollerith constant from the right parenthesis signifying the end'of the expression. 3.2.3.3 Status Constants A status constant is a mnemonic used to describe one of the possible values of a data unit. The Compiler assigns a unique value (beginning with zero) to each status constant that is associated with a data unit. In subseque~t statements, as the programmer sets and tests the data unit using the mnemonic, the Compiler sl~bstitutes the assigned value to differentiate possible conditions. constants must be,uniqu~ fo~ Status a given data unit but may be reused for other data units. A status constant may be composed of any characters of the CMS-2 alphabet with the exception of a single prime The status constant may have the same (f). number of characters as an identifier. Status constants are always enclosed by single primes, as illustrated on the following page. 11-3-5 M-5035 Change 1 'REPAIR' 'STANDBY' 'ALERT' 'AIRBORNE' 3.2.~.4 Boolean Constants A Boolean constant denotes one of the logical values of Boolean algebra (true or false) and is represented as a binary integer: Logical 3.3 Binary True I False o DELIMITERS Blanks serve to separate symbols in a CMS-2 program. a single blank accomplishes the same result as a blanks. When used as a separator, ~equence of two or more All marks described in paragraph 3.1 may be used as delimiters. Some marks, such as $, have unique delimiting uses. When a mark appears between two CMS-2 symbols, blanks are not needed as separators although they may be used if desired. J.,I STATEMENTS CMS-2 statements are dynamic and declarative and symbols and delimiters. ~re composed of a string of In general, a declaration defines a structural con- figuration of data and a dynamic statement defines the processing operation that manipulates the data. sign ($). All CMS-2 statements are terminated by a dollar More than one statement may appear on one card and a statement may be continued on several cards. Null statements are recognized by the compiler when a statement terminator is immediately followed by a statement terminator and is otherwise syntactically correct. 3.5 COMMENTS ComnH'nts, jnlf!nd{~d as eJarifyinu text, havp no oper"ational f'ff(!(:t on a prourarn and may he included in either of the following two ways. 11-3-6 M-5035 Change 3 1. Within a statement by enclosing the comment within two consecutive single-prime symbols, as illustrated below: VRBL Z I"NTEGER" 14 "BITS" S"IGNED" $ NOTE A symbol may not be broken by this type of comment; i.e., V"A"R"IA"BL"E" would not result in the symbol VRBL. 2. As a separate statement the use of the operator, COMMENT: COMMENT THIS ROUTINE COMPUTES SQUARE ROOTS $ NOTE A dollar sign may be expressed within either type of comment by coding it as two consecutive dollar signs. 3.5.1 Special Comments Comments beginning in card column 11 (the first column of the statement field) are treated as special cases by the Compiler. If the statement is one of the following, the Compiler performs the indicated action on the listing: Action COMMENT6«EJECT $ COMMENT 6( (LINE~!; $ Eject to the top of the next listing page. COMMENT6( (SKIPn $ Skip n lines, where n is a number from 1 to 9. Print a line of asterisks (*). If a comment statement beginning in card column 11 is not one of the special indicators, the Compiler replaces the word COMMENT with a single asterisk (*) in column II and lists the comment after skipping a line. Input: COMMENT THIS IS AN EXAMPLE $ Output: ::; Till S IS AN EXAMPLE $ These special commenls allow programmers to produce listings that have a greater narrative format. than list.ings without t.he special comments feat.ure. 11-3-7 3.6 SOURCE CARD FORMAT All CMS-2 source cards contain a card identification field and a statement field. The card identification field occupies columns 1 through 10; the statement field occupies columns 11 through 80. Card columns 1 through 10 have no operational effect on the Compiler. the suggested use of the card identification field is as However, follow~: ao Columns 1 through 4 - Program identification. b. Columns 5 through 8 - Card sequence number. c. Columns 9 through 10 - Insert number. The statement field has a free format. Statement labels, operands, operators, etc", may occur anywhere in columns 11 through 80. Each statement is terminated with a $. There can be more than one statement per card or a statement may require several cards o No continuation card indicator is needed when a CMS-2 statement exceeds one card. throu~h The statement continues in columns 11 of each succeeding card until a dollar sign is encountered. 80 If a symbol or contiguous string of characters is to span two cards', the first part must end in column 80 of card 1 and the second part must start 1n column 11 of card 2. For example, if the eight-character symbol STMTLABI is started in .column 78 of one card, the remaining five characters must begin in column 11 of the next card. While packing of statements on cards reduces the size of the input deck, the CMS-2 Compiler does not format the listing of the input statements statements will ~ppear in the same form on the listing. 11-3-8 o Packed M-5035 SECT ION ;1 DECLARATIVES The CMS-2 declarative statements provide the Compiler with information about program structure and data element definitions. result in executable object code. groups: Declaratives generally do not Declaratives may be divided into three program structure declaratives, data declaratives, and control declaratives. LL I PROGRAM STRUCTURE DECLARAT IVES The following program structure declaratives are used to define the organization of a CMS-2 program: a. SYSTEM and END-SYSTEM statements delimit a compile-time systemo b. HEAD and ENU-HEAD statements delimit headers within a compiletime system. c. SYS-DD and END-SYS-DD statements delimit a system data design d. within a compile-time system. SYS-PROC (or SYS-PROC-REN) and END-SYS-PROC statements delimit a system procedure within a compile-time system. eo LOC-DD and END-LOC-DD statements delimit local data designs within a system procedure. f. AurO-DO and END-AUTO-DD statements delimit automatic data designs within a system procedure. g. PROCEDURE and END~PROC statements delimit procedures within a system procedure. h. FUNCTION and END-FUNCTION statements delimit functions within a system procedure. Each of these statements is discussed in detail in the following paragraphs in the order in which they generally occur in a CMS-2 source program (see Section 2 for further information on program organization). II-4-1 M-5035 Change 3 4.1.1 System Declarative (SYSTEM) The SYSTEM declarative specifies the beginning of ac6mpile~time system. This must always be the first statement of a CMS-2 source program. Format I name SYSTEM key-specification $ comments Explanation Name The identifier by which this system is known. SYSTEM Declares a compile-time system to be known by the identifier above. I Key specification Optional (see Section 7 for explanation). Comments '1.1.2 Programmer remarks. Optional. Head Ueclarati ve (HEAU) The HEAD declarative serves to identify a group of major or minor Compiler control statements •. The major header control statements of a compile-time systpm must immediately follow the SYSTEM declarative and must be terminated with an ENU-HEAU declarative. Minor header control statements immediately -precede the system data design or system procedure to which they apply. Since the HEAD declarative is primarily for library control purposes, its use in source input to the Compiler is generally optional (see Section 7 for further information on the HEAD statement). Format I narne HEAD key-specification comments $ Explanation I Name The identifier by which this header is known. HEAU Declares a major or minor header. Key specification Optional (see Section 7 for explanation). Comments Programmer remarks. 11-4-2 Optional. M-5035· -1.1.:3 End Head Declarative (END-HEAD) This declarative terminates a major or minor header within a compile-time system. Its use is required after major header control statements but is optional after minor header control statements. Format END-HEAD name $ ~xplanation END-HEAD Declares the end of a header. Name The header identifier. Optional. Example :S:A:~:Pt:£: : : ~~f:r:~b~:~s:o:u:~c:£: I IE~I~I-IHIEIAI~ I I I I I I I I I I I /41 I ,: :::::: :::: I I I / I I I I I I I I I I I I I I I I I I 11-4-3 I I I M-5035 Change 3 401.4 System Data Design Declarative (SYS-DD) This declarative specifies the beginning of a collection of data element definitions that are global to the system; that is, these data elements are known to all system procedures that follow in the compile-time system. A system data design is a basic element of a CMS-2 program. /' Format I name SYS-DD key-specification comments $ Explanation I Name The identifier by which this system data design is known. SYS-DD The system data design declarative. Key specification Optional (see Section 7 for explanation). Comments Programmer remarks. Optional. 4.1 5 End System Data Design Declarative (END-SYS-DD) 0 This declaration terminates a system data design'within a compile-time system. Format END-SYS-DD name $ Explanation END-SYS-DD Declares the end of a system data design. Name The identifier by which this system data design is known. I 1-4-4 M-5035 Change 3 ,t.l.() Sys\('JI1 ('fue('dlH .. J)e(~lara'ivc (SYS-I'HOC) Syslt'1ll proepduf{'s consist of one or more procedures or functions and mr:ly contain one or more local data designs. A system procedure is a basic ('lement of a CMS-2 program. F urmn 1 name SYS-PROC key-specification comments • $ Explanation Name Thp idpntifier by which the system procedure is knowno . 11. also identifies the prime procedure wi t.hin the sys tem procedure. SYS-PROC Initiates a system procedure consist.ing of local da1a designs and procedures. • Key specification Optional (see Section 7 for explanation). Comments Programmer remarks. Optional Examples !SlUiter, Is ItISI-IPI~IOCI ,t' I I I I I I I I I 11-4-5 I I I I I I J 1 I I M-5035 Change a 4. 1. 7 Reentrant System Procedure Declarative (SYS-PROC-REN) This declarative specifies the beginning of a special type of system procedure known as a reentrant system procedure. The generated code produced by the Compiler for all procedures within a reentrant system procedure is invariant under execution (see Section 2 for a further explanation of reentrant code). A reentrant system procedure consists of one or more procedures and may contain one or more local data designs or automatic datadesigns. Format Name SYS-PROC-REN key-specification comments $ Explanation Name The identifier by which the sy stem procedure is known. It also identifies the prime procedure within the system procedure. SYS-PROC-REN Initiates a reentrant system procedure. Key specification Optional (see Section 7 for explanation). Comments Programmer remarks o Optional. 4. 1. 8 Local Data Design Declarative (LOC-DD) This declarative specifies the beginning of a set of data element definitions that are valid only within the system procedure in which this local data design appears. Such data elements must be defined in a local da!a design before they may be referenced by a dynamic statement within a procedure. Format name LOC-DD comments $ Explanatlon Name The identifier by which the local data design is known. Optional. The name has relevance when LQCDDPOOL is requested. The user must provide a LOC-DD name at compile time if he wants to reference the pooled local data design by AC name atloadtime. LOC-DD Declares the start of a local data design. Comments Programmer remarks. Optional. 11-4-6 M-5035 4.1.9 Local Data Design Declarative (ENU-LOC-DU) This dpelarative specifies the end of a local data design within a system proc~dure. Format END-LOC-DD name $ Explanation END-LOC-DD Declares the end of a local data design. Name The identifier by which the local data design is known. Optional. 4.1.10 Automatic Data Design Declarative (AUTO-DU) This declarative specifies the beginning of a set of data element definitions that are valid only wi~hin, matic data design appears. thG reentrant system procedure in which this autoAn automatic data design may appear only within a reentrant system procedure (i.e., it must follOW a SYS-PROC-REN declaration). All formal input and output parameters and temporary data storage areas used by .reentrant procedures that follow must be declared between the END-AUTO-DD declarativcs. AUTO~DU and The allocation for these data areas must be provided dynamically prior to or during execution; hence, automatic d~ta designs may not contain switch definitions or preset data. Format name AUTO-DD comments $ Explanation Name. The idenlifipr by which the automatic data design is known~ AurO-DD Declares the start of an automatic data design within a reentrant system procedure. Comments Programmer remarks. Optional. 11-4-7 M-5035 NOTE Automatic data designs are functionally similar to local dat a designs except t hat they may be used only wi thin a reentrant system procpdure and may not contain preset data or switches. Automatic data designs should contain the definit ions of all data units that are modified during execution of reentrant procedures. Local'data designs may be used within reentrant system procedures for defining switches and preset data that are not modified during execution. 4.1.11 End Automatic Data Desiqn Declarative (END-AUTO-DD) This declarative specifies the end of an automatic data design within a r e (~n t ran t s ys tern p roc e d ur e • Format END-AurO-DD name $ Explanation END-AurO-DO Declares the end of an automatic data design. Name The identifier by which the automatic data design is known. 4.1.12 Procedure (PROCEDURE) and End Procedure (END-PROC) Oeclaratives A procedure is the bBsic organizational unit of dynamic statements in a CMS-2 program; it establishes the rules of data manipulation in processing a problem. Procedures specify a se< [X H 7 H HOLCHAR H 1 C>< IMPL Initial Value Rounding Preset Scaling $ V( .25,0) $ $ $ $ P 0(12345) P 1.25 P 12.75 P 15E9 P 0 P I P0 P 'NONE' P H(ABCO) A A $ $ $ $ $ $ $ $ e><: [X $ $ $ $ $ $ _L- NOTES 1. 2. Tags such as INTDBITS, FIXBITS, FIXFRAC, and HOLCHAR may be used as indicated but must be assigned integer values by an EQUALS declaration. If the type of variable is implied (type-structure omitted) the attributes of the variable are determined by the implied mode of the Compiler to be a signed l6-bit integer, unless superseded by a MODE declaratio~ M-5035 Change 5 A multidimensional table (array) is stored forward in memory, in order of increasing absolute locatiori, with the leftmost subscript (which represents the row or item) varying most rapidly. said to be stored in a columnar fashion. Thus, a two-dimensional array may be All the defined subcomponents of a g i,' e n tab Ie (f i e Ids , . sub tab I e s, I ike - tab I e.s, and item - are as) mus t bed e fin e d bet\\ecn the TABLE declaration and its associated END-TABLE declaration. Subtables and like-tables are not allowed as subcomponents of an array. Subtables, like-tables, and item-areas cannot be included in a table that is variable in length or that uses indirect addressing (INDIRECT). In the following discussion of table format. the term tag is indicated as an option to specify integer values for the various parameters associated with the declaration of a table. When this option is exercised, the value supplied by the tag must be provided by an EQUALS declarative (see Section 7). Format TABLE name INDIRECT storage-type words-per-item or packing~descriptor number-of-items or dimensions major-index-name $ Explanation TABLE Specifies a TABLE declaration. Name An identifier unique to the TABLE. Storage Type Specifies the storage alignment desired according to one of the following types: Words~per-Item H Horizontal arrangement V Vertical arrangement A Array arrangement in n-dimensions An integer constant or tag that specifies the numher of words contained in each item. This value cannot be o. 11-4-21 I M-5035 Change 5 Packing Descriptor Specifies that the Compiler will compute the number of words per item necessary to contain the specified fields, as follows: Descriptor Result NONE Each field is assigned at least a full word. MEDIUM Each field is assigned the smallest available, directly referable word fragment that will hold the data. DENSE Fields wil~ be packed by the Compiler in a dense manner, making optimum use of all bits in a word. (data type) The Compiler will assign the number of words required to accommodate the attributes of the specified data type (see explanation under FIELD declaration for data type). This parameter permits referencing a single piece of data by item. Field declarations must specify starting bit and word number when used with typed-item tables. INDIRECT Optional. referenced. Specifies that the table is indirectly Furthermore, no core allocation is made, the names and definitions are preserved, and \ the core allocation can be accomplished dynamically. II-4-22 M-5035 Number of I t(~ms An int.eger or tau that sl)(~eifif~s the maximum number of items in the table. Integers and/or tags, separated by commas, which Dimensions specify the array dimensions (a maximum of 7). Major Index Name Optional. Defines a unique identifier containing the current number of items in the table as maintained by the user. If the major index name is specified, the Compiler uses it to determine the current number of items in the table containing data when searching or moving the table. Use of a major index is restricted to V- and H-type tables. Specification of a major index name constitutes a definition of it as a data unit (signed 16-bit variable); consequently, it cannot appear in any other data declarative statement. Examples In this example, the table named DICT is a horizontal table with three words per item, 500 items, and a major index named ALPHA. At run time, ALPHA contains the current number of items as set dynamically by the program. , I I 2. I The table named IONS is a vertical table with 1,200 items and is to be densely packed~ The Compiler comp~tes the words per item based on the number and size of the defined fields and performs the dense 3. ,T,II,B, L,E; I I JIt;~Yj ,/I, "S; 6.1 I ,3", It, ;$, I 1 J1 I I I packing~ I , I In this example, an array, ARY, contains five words in each item. dimensions are 2 by 3 by 4, or 24 items. 11-4-23 , I Its This example defines an array, RAY, of which each item contains two words. Its dimensions are 2 by 3 by 4, or 24 items. indicates that no core allocation is to be made. The word INDIRECT All references to table RAY will be made by indirect addressing. Following is an example of the use of INDIRECT and a major index. Assume that a procedure processes data tables of fixed format and varying lengths up to a maximum of 100 ehtrfes. The data design associated with the procedure contains a table declaration: This declaration specifies a horizontal table of two words per item 100 items maximum, that h~s not been allocated core storage. The table has. a major index JI, which will contain the a.ctual·number of items at runtime as provided by the dynamic source statements. This declaration may be accompanied by FIELD declarations as desired. The procedure itself might require as input the location of the calling . program's data table and the number of items in the following table: The calling procedure puts data in its associated data table. The procedure OUTDO is then called: where MYBUF is the name of the caller's data buffer which has a structure compatible wi th TABA, and BUFITEMS contains the number of i terns in MYBUF. The procedure OUTDO thus has its TABA defined dynamically as the user's data table for this operation of OUTDO. Each, subsequent request for OUTDO would provide simi lar entry condi tions (see Section 5).· 11-4-24 M-5035 Change 5. 6. TABLE TRACK V 1 0 $ The table TRACK is vertical with one word per item. table because it is declared with zero items. TRACK is a "null" No core locations will be reserved. 7. TABLE FLOATDAT V (F) 1000 $ Table FLOATDAT has been declared vertical and 1,000 items long; the type of data associate~ with the table is floating-point. will assign two words per item. The Compil~r References to the table may be by item . -and the Compiler will utilize the declared data type (floating-point). 8. Following is an example of the use of tags within a table declaration: NUMWORDS EQUALS 1023 $ NUMITEMS EQUALS TABLE 25 $ LARGE V NUMWORDS INDIRECT NUMITEMS $ In the above example, the names NUMWORDS and NUMITEMS represent 1023 ahd 25 respectively. The statement is interpreted as: TABLE LARGE V 1023 INDIRECT 25 $ The table LARGE is arrpnged vertically, with 1,023 words per item and 25 items. Dynamic core allocation is specified by the INDIRECT specifier. 4.2.3 Field (FIELD) Declaration The items of a given table may be further subdivided into units called fields. Field configurations are identical for all items of a given table. may occupy a partial word, a whole word, or more than one word. A field A field defined as part of a word must be wholly contained within that word; i.e., it may not cross word boundaries. A field occupying more than one word will 11-4-25 M-5035 be allocated an integral number of words. in horizontal tables. Multiword fields are not permitted Field defihitions within an item are completely inde- pendent of one another and may, therefore, overlap. It is not necessary for all of the dat~ within an item to be completely defined by fields. A field name is always associated with a particular table, like-table, subtable or item-area. Format There are two basic formats for defining fields: 1. Type a FIELD name data-type initial-value 2. (R) V(x,y) word-location starting-bit-position initial-value V(x,y) $ Type b FIELD name data-type (R) $ Explanation FIELD Specifies the FIELD declaration. Name The identifier used to reference the field within the table. Field names are local to the table within which they are defined. The same names may, therefore, be used for fields within various tables. The same name may not be duplicated within the same table definition. Data Type Meaning Descriptor F Floating-point field. B Boolean field. H followed by the Hollerith field having the number of characters indicated number of characters. (not to exceed 132). S followed by a list Status field, which can have any of status constants of the states from the list.ed separated by commas. status constants. 11-4-26 M-5035 Change 5 Ucscriptor A followed by the Fixed-point field. number of bits (not to exceed 64), designator s/u (signed or unsigned), and the number of fractional bits. 1 followed by the Integer field. number of bits (not to exceed 64) and the designator S/U (signed or unsigned). NOTE If the data type specification is omitted, the field will be assigned the implied mode (i.eo, by a MODE declaration or Compiler-provided signed 16-bit integer). (R) Optional. This parameter is meaningful only when a floating-point data type is specified. If specified, it indicates that AN/UYK-7 floating-point inst.ructions with rounding are to be used for arithmetic operations of this field. Word Location An integer or tag indicating the word of the item in which the field occurs. This value must not be greater than 255. St.arting Bit Position An inte~er or tag specifying the most significant bit oi sign bit of the field. In an n-bit word, the positions are numbered from left (n-l) to right (0). Initial Value Optional. This field may be preset with this parameter. If specified, this parameter consists of a P followed by one or more constants. These constants must be a value compatible with the data type specified for the II~4-27 I M-5035 Change 2 field. A series of constants, up to a maximum of 255, separated by commas, may be specified for mUltiple occurrences of the field. Constants may be enclosed in parentheses and preceded by a repeat factor. V(x,y) Optional. This parameter specifies that the field is to be preset to the preceding specified initial value parameter according to the magnitude and bit position contained within the parentheses. The initial value will be computed using the magnitude assigned by the x-parameter to the bit position assigned by the yparameter (see Example 6). . 15 hi ts. The magnitude must not exceed Type-a fields are used when the programmer wishes to specify the field location within an item (programmer packing). Type-b fields are used to permit packing to be controlled by the packing designator used in the TABLE declaration (Compiler packing). The data type may be omitted for both type-a and type-b fields to specify use of the implied data type of the Compiler. The implied data type is the inherent mode of the Compiler (a signed l6-bit integer) or is specified in a MODE declaration. Examples of Type-a Fields 1. ,fj/IEtL~ I I I6p.Qt.. .A .4t I 1,0, ,$, I I I I , I I I I I I I , I I I The Boolean field, BOOL, occupies the rightmost bit of the second word (word 1) of the item. In this example,the Hollerith type field, HOLL, has 120 characters. is located in word 2 of the item and starts in bit position 31. It It is implied that this is a multiword field requiring the necessary number of words to contain the 120 characters. horiZontal table.) 11-4-28 (HOLL would not be allowed in a M-5035 :~ . ,iii , EjL..~ J!,TiA,T, 5, ,',&ElJjEjC.,T, '", " yt,ctc,e'iBn' " , J ,. I I I I , I J J I , , " 'tftO)LJ.b,'", ,',6.1'IXI'J I~' ,1, ~, The status type field, STAT, may contain only the status constants 'REJECT', 'ACCEPT', 'HOLD', or 'FIX'. It is located in word 4 of the item and starts in bit position 2. 4. In this example, the field ARITH is a signed fixed-point data type having 24 bits, four of which are fractional. It is located in word 0 of the item and starts in bit position 23. 5. Ii A §'1A I I ~~,HtIt'J>J '£ ,45) tf, , I I 1 I I I I, I , , , , I I I The field MDHWD starts in bi t 15 of word 2 of each i tern. Its type is implied by the Compiler or a MODE declaration and must not conflict with the starting bit 15. In this example, field MATH is a signed integer, 12 bits long, starting at bit 26 of word 1. The first occurrence of this field is to be preset to the value of 30 with bit 28 of the field representing the magnitude of 12. The result of the preset assignment will show an Qctal represent- ation of 1200' in the field, as illustrated below: Word 1 I f 26 31 Word Q' I ?~ Sign Bit \ o 15 I I 0I 1 I °I 1 I 0 I °I u I 0·1 0I 01 ° 1 t T " 11-4-29 .~~ 2O. = 21 = 22 = 2 3 == 2 4 == 25 == 26 == 27 = 28 2 9= 210 == Octal 0.046875 )0 0.1875 0.375 } 3 6 } .2 °.09~\75 0.75 1.5 0 = 12 24 48 } 1 M-5035 In this example, field FARITH is a floating-point data type, two words long, starting at bit 31 of word O. The (R) signifies that arithmetic operations using this fieid must employ floating-point instructions .with rounding. Note that a floating-point field must never be defined in a horizontal table since the AN/UYK-7 adjacent computer words. floating~point format requires two Examples of Type-b Fields 8. 1 1 II I I I I ,/f/,EjLtA ,8iOJgL, ,8. ~ This is a Compiler-packed Boolean type field. have a packing descriptor. I I I I I I , , I , , I I J The associated table must The integer field VALUE will be allocated or packed according to the packing descriptor specified in the table declaration. The first occurrence of this field in an item will be preset to -145, the next three occurrences will be preset to 19, and the following 4 occurrences will be preset to 73. See Table 4-2 for further examples. 4.2.4 Item-Area (ITEM-AREA) Declaration An item-area is a data set with a structure identical to that of an item of the associated (parent) table, with the same number of words and the field configuration. ~ame There may be any number of item-areas associated with a parent table, but they are physically separated from the table. The itemarea is a convenient working storage area, assigned by the Compiler, where· a single item of a table may be temporarily stored for examination, manipulation, or accumulation of data. 11-4-30 M-5035 Format ITEM-AREA area-name(s) $ Explanation ITEM-AREA Specifies the ITEM-AREA declaration. Area Name( s) The unique name or names, separated by commas, of areas of working storage. Each area has the same format as an item of the parent table; therefore, only the name of each item-area associated with the parent table need be specified. Examples I 1. rA I I A single item-area named BUFFI is defined. There are three item-areas named BUFF2, WORKl, and WORKST. 4.2.5 Subtable (SUB-TABLE) Declaration A subtable is a set of adjacent items, wholly contained within the parent table. ! Its item size and field configurations are identical with those defined for the parent table. Except that it lies within the confines of the parent table, a subtable is itself a table having its own optional major index and stipulated maximum number of items. table ~re Subtable definitions within a parent independent of one another and may overlap. Subtables may only he defined for single-dimensional tables (horizontal or vertical tables). Format SUB-TABLE name initial-item-number-of-parent-table maximum-number-of-items-in-subtablemajor-index-name 11-4-31 $ TABLE 4-2. EXAMPLES OF TYPE-a FlEWS , OF FIELD OECLARAT ION Start Rounding Location Bit I FOR~lAT TYPE OF FIELD FIELD Name Data Type Integer FIELD FIELD INTA INTB I I Floating Point FIELD FLTA F Fixed Point FIELD FlXA FIELD FIXB 5 U 64 S A 6 U 2 A 32 S 16 FIELD FIELD BOOLA BOOLB B B Status FIELD STA S 'ON', 'OFF' Hollerith FIELD FIELD HOLA fiOLB H 40 H 3 FIELD IMPLA Boolean ...... ....... I A I W I\: Implied - ------ L 2 INTBWL 15 INTBST 1 31 ~ F IXBLOC I \/ A / \\ ° 5 31 V 0 o W $ P3(lO) P 0 $ $ V(l,O) ~ P 9.548 0 BOOLBBIT P 1,0,1 1 14 P 'ON' 3 31 28 P H(ABC) 15 (J'1 In1 ti a 1 Values Scaling 1 0 1 1 \/ V /\ /V \\ $ $ $ $ $ $ $ $ $ NOTES 1. 2. 3. ~ ::3: I , I I I·' ,,1, J,lI ,S, 1/'" ,$." , I , , J It-pie,A, L, T,lt-,I( ,NI ..~i, lip p, IL,OI'-ir,~ ITt &!'tfli 0, tt, ,3 ,A-I ,5, ,D, ,'.3,1,,$, I, , , I I "" I I I , I I , , , , " I 1 ·1 I :':N~:~~A:6IL:E: :L:O:C:A:~T:R:K: I , ,, I I I , I , , I (II ,3,L ,.$, I 1 i: ::::::I:::::::::I:: ::: therefore, the MODE-declared attributes of A 32 S 16 would be assigned Note that it is still necessary to specify the word location and starting bit for those three fields since Compiler packing was not specified. 4.4 I &tJ ,3,.L1 c$. .;31 ,-I,L ,~ In this example, fields Xl, Yl and TI have undeclared data-type attributes; to each. I SYSTEM LINKAGE System linking is the process by which program information known to one basic CMS-2 element. may be communicated to another basic element. It may be required when the information is local to a system procedure within a SYSTEM or unknown because the elements were compiled under different SYSTEM headers. The following items may be linked between two basic elements: a. Tables (and associated items). b. Variables. c. P-switches. d. Procedures. e. Functions. f. Files. 11-4-64 M-5035 Change 5 The capability to link the above items between and within basic CMS-2 elements is provided by the EXTREF, EXTDE¥, TRANSREF, or LOCREF operators. This capability eliminates the need to expand the local concept of certain items and/or include entire elements within SYSTEM compiles 'when only a few unknown items are referenced. Because segments containing items 'a through f can be linked at load time, it is unnecessary to externally reference a procedure (unless it has input/output parameters or exits) or to define a procedUre in a segment in order to call it in that segment. . Although the compiler will not flag such an "undefined" procedure, the loader will do so if that procedure remains undefined at load time. 4.4.1 External Definition (EXTDEF) Operator The name and associated declaration following the operator EXTDEF is to be considered as global so that it may be referenced within any basic element of any SYSTEM compilation. Format (EXTDEF) $ identifier-identification Explanation EXTDEF. Specif ies an external defirii tion. Identifier-Identification A symbol and its associated definition defined totally within this SYS-PROC. Examples 1. , (,f,XiT.), £, F,) I IV,& e. LI ,x, I Fj r@ I I I I I I I I I I I I I I I I , I I This example specifies that VRBL X, defined in a LOC-DD of the SYS-PROC, is referenced by other SYS-PROC's and is to be considered global. This example declares that variables XX, YY. and ZZ within this SYS-PROC are global floating-point data units. ll-4-65 I I M-5035 4.4.2 External Reference (EXTREF) Operator The declaration following the operator EXTREF defines an item that is physically located in another SYS-PROC or SYS-OO and is referenced within the current SYS-PROC. Allocation of the item will not occur in the SYS-PROC being compiled, but the definition to provide the necessary element compatibility will be applied. Format ( EXTR EF ) ide n t i fie r - ide n t i fie a t ion $ Explanation EXTREF Specifies an external reference. Identifier-Identification A symbol and its associated identification that is referenced from, but not located within, th is SYS-PROC. Example I I I I I I , 1 I I This example specifies that VRBL FI is used within this SYS-PROC, but is physically located in another SYS-PROC or 4.4.3 SYS~DO. Transient Reference (TRANSREF) Operator The declaration following the operator TRANSREF defines an item that is physically located in another SYS-PROC or SYS-OD that cannot be assigned a permanent base register. References made to this item will result in the load of a transient base register to cover the referenced SYS-PROC or SYS-DD. definition furnished ~ill be applied to provide the necessary element compati- bility. Format (TR ANSR EF ) The ide n t i fie r - ide n t i f i cat ion $ 11-4-66 M-5035 Change 5 Explanation TRANSREF Specifies a transient reference. Identifier -Identific ation A symbol and its associated identification that is referenced from, but not located within, this SYS-PROC. Examples 4.4.4 Local Definition (LOCREF) Operator The procedure or function declaration following the operator LOCREF is considered local to the system procedure in which it is contained, so that forward references to the procedure or function receive proper parameter linkage. The declaration containing the (LOCREF) modifier must appear in a local data design prior to the procedure or function.containing the local forward reference. Formal parameters m'll:-st be defined prior to the declaration. Format (LOCREF) procedure or function declaration $ Explanation LOCREF Spe~ifies Example 1. ,vIK,8ILI IVI ({d , ,I, I~I lUI l1, a local procedure or function declaration. t t , , I I I , I I I I I I I I t ,, This example specifies that procedure PRA is a procedure local to the system procedure and is called locally within this system procedure. Its formal input is VB!. 11-4-67 'M-5035 Change 5 4.4.5 1. ,fb Applications ofEXTDEF, EXTREF, and TRANSREF I I I I I II IS if ,s'-JP,i~ 99 .#1 I I l I I I I I J i :G~kk:E:f~: :~~~~: ~~~: \16 4 :~IJ: ~: : : : : : : : : : : : : :{:~~~:~:~F~: :~:~~:~:A:~~~lb~~~S: ~ 1°: :3t: :$; ::: : lrITIE,"tI-I,+IRlfIAJ !S,u,MIBJ I I J J ., I J I I I I I I -I I I I I I I I ,$, I I I J I I , I I I J -T able SUM is linked between syste m procedure A and system procedure B. Since the field defintion for SUM! is included in the table deSCription, SUM! is also linked between A and B. A reference to SUM (0, SUM!) in either system procedure will access the same data unit. Subunits of tables, such as like-tables, subtables, and item-areas are not automatically linked between system procedures. In this example, a reference to SUMB will access different data units. However, linkage can be achieved for subunits of tables. Item-area SUMA is externally defined in system procedure A and externally referenced in system procedure B, thus providing the ability to reference the same data unit from either system procedure. An externally referenced table must have the same field definitions as that of the ex .... ternally defined table. Only like-tables, subtables and item-areas may be added or n-4-68 M-5035 Change 5 deleted from the definition. As an example of this, SUML can be included in system procedure B without being in system procedure A as long as it has the same attributes as table SUM. n -4-68A/ll-4-68B (Blank) M-5035 Change 5 IEirJdJ I I , )B,., .s,r,BRi/etblE"tR, ,IS,)',SJ-I/3R,o,c, 1.t1!~"4f(I,,,/1 IIi I I I (:E~~~ :~:E:F~: :~ %:~~~:!~:r5 ~ ::::::::::: :::::::::::: :: (1§)l,T 1t'2-.,f,F-3), IV,&6t4 IP,2t111 I I I I , I , I IV I R18, '-i Iff ,it "1 If, , I I 1'" Lt J I I I I I I I I I I"" ·1, (:~:t~:g:E:f:): :;:~~~:~~:i~:~ ~:L:P~:~ :/:~p:uM J I IEIN,.b, -, L,gc'-lb}J> I , ,."., , I 1 I I I It, I I I I I I I I I I I ') ., I I I' I I , I I , I I I IL ,0, Cl-ll?tl?1 I I I , I , I , , I , I I t I , , I I I I I I I I I I I , I I I , I , , I I I I I I 1 , I J I ,r ,:b JE, F,), I\II Il, S,l, Pg., ,F, 1$. I I I , ,. , I I I I I , , I I· I I I , I IE:N;A-.L,O,C,-,'b.)1 I I I I·,. I I. , , I I I I • , , ,', I tt, I, I I I I , , I I I I , 1 , I' , I , I, I, I 1 I I I I•I t ,., I I I I I I I I II-4-69 I I I I ' , I ,J I 'I', , I , 1 I , I I J I , I , I I I I I I , I I , 1 I I , I I I I Procedure ALPHA is in SYS-PROC HAND. SYS-PROC BETA initiates a procedure call to ALPHA by means of ALPHA INPUT Al OtrrP11f A2$. To indicate this cross-referencing to the Compiler, procedure ALPHA and its associated formal parameters, variables PI and P2, are flagged as external references in SYS-PRDC flPTA and as external definitions in SYS-PROC HAND . • , I , I I , ,, I I I I , I'll :i,i: ~U:T:P:U~: ~ P:i :~: I I , I , I I', 1$, 'I I 1 I t , I " I I I I 1 I I I I I , , I , I I " I I I I., I I J I ( , Ej ~ II " Iii I I I ",! •• J I I I I I I I M-5035 :3. ,$, Is ,y,S,Tj EjM, ,AI I I I,·, , , , , I I , I ,., , I I , , 1 , 1 " J ", ,Ey('~IP, , , , , IS,'I15,-,P,RIOIY , ITt., .plo,E, 171~I~JY 1'7,0, tI" "I :(:~&A:N:~~:~f:) ;:~:;:tL: 1:l:A~S: :A: :3:i is: II;': :$: : : ; : : : F,), Fi; IFi I (1' Ej K, T I &§ I , I VI R, 8, 1.., , I I ,., I , I 1 I I I ,., 1 I , I , ,$ I I II I , I I I, I , , I I , I I , I , I , I , I I ,. , I I', I , I , I I I I '-I I I 'I , , , I I I I , I , I , I , , I I , 1 J I , , I " I .I", II 1 , I I I ,., I I , , I , I I I , , I. I , .I I " I I I I I I I , I I I I I J I , I ,., , I , ,I I I I I I, I I I I -'I , I I I I I , I I •" I I I I I , I I I .I I 1 I I I" , ,I ,., I I I ,, ,, I , I I , , I , , I I ,'1 I I " I·' I I I I " II I I ., J , I I I I J I I I J I I I I ,, I I ., J , , , , I 1 , I J I , I I I I I I I I I I J , I , I J I I I I I I I When SYSTEM A was compiled, the programmer ant.icipated using two variables from different SYS-IJU's in SYSTEM B that would not be covered under the 11-4-70 M-5035 Change 5 same base register. This capability allows assigning a base register to one SYS-DD when SYSTEM A is loaded for execution and a transient register to the ot~er SYS·DD. It was not necessary to attach the operator EXTDEF to the variables in SYSTEM B since they are within SYS-DD's and, hence, global. Use of the TRANSREF and EXTREF operators allows the Compiler to generate the appropriate object code for SYSTEM A. is ,determined by the system Loader. 4. SPCX SYS . . PROC $ LOC-DD $ VRBL VX1 A 16 S 10 $ (LOCREF) PROCEDURE PRXl OUTPUT VXI $ VRBL VX2 H 2 $ (LOCREF) FUNCTION FNX2 (VX2) H 4 $ VRBL (VA3, VA4) A 32 S 24 $ VRBL (HAS ,HA6) H 4 $ • • END-LOC-DD $ PROCEDURE PRCAl $ • • PRXI OUTPUT VA3 $ • • 11-4-71 The allocation M-S03S Change S SET HAS TO FNX2(HA6) $ • • END-PROC PRCAI $ PROCEDURE PRXI OUTPUT VXI $ • • END-PROC PRXI $ FUNCTION FNX2 (VX2) H 4 $ • • END-FUNCTION FNX2 $ • • END-SYS-PROC SPCX $ Procedure PRXI and function FNX2 are local to system procedure SPCX; both are called prior to their definition by procedure PRCAI. Including the declarations in the local data design prior to PRCAI permits m6re accurate error checking and generation for their parameter passage with respect to scaling and type. II-4-72 M-5035 Change 4 SECTION 5 DYNAMIC STATEMENTS Dynamic statements specify processing operations within procedures and functions. They perform calculations, manipulate data, and direct control of the program. This type of statement consists of an operator followed by a list of operands and additional operators. An oper~d may be a single name, a constant, a data unit reference or an expression. Expressions may be arithmetic, Boolean, relational, or literal. Dynamic statements have two possible forms: simple and compound. A simple statement comprises a single dynamic statement followed by its statement terminator ($). A compound statement consists of two or more dynamic statements, each separated by the connector THEN, followed by a single $ statement terminator. With the exception of decision statements (Paragraph 5. 6), there are no restrictions on the number or types of dynamic statements which may be compounded. With this exception, the connector THEN is exactly equivalent to the terminator $. Example The compound statement SET A TO B THEN PROCA INPUT X THEN L2. SET E TO F THEN GOTO Ll $ is equivalent to the simple statements: SET A TO B $ PROCA INPUT X $L2. SET E TO F $ GOTO Ll $ 11-5-1 M"':5035 Change 4 I Simple. and compound statements may also be· grouped into a statement block by the formation ofa BEGIN, VARY, or FOR block (Paragraph 5.7). Statement blocks are required in order to nest decision statements (Paragraph 5. 6. 6). 5.1 EXPRESSIONS The arithmetic, Boolean, relational, and literal expressions used in dynamic statements are described in the following paragraphs. NOTE Variables, constants, local and system indexes, field references, typed item references, item word references, function references, and functionally modified data units may be used as operands in CMS-2 expressions. Tables, sub-tables, like-tables, and untyped item references may not be used as expression operands. 5.1.1 Arithmetic Expressions An arithmetic expression consists of two or more arithmetic data units or constants (operands) connected by arithmetic operators. The operators and their hierarchy of execution are defined in Table 5-1. Operations involving the level-l operators are evaluated first, followed by evaluation of operators of levels 2 and 3. M-5035 Change 4 TABLE 5-1. HIERARCHY OF EXEClITION 1 ARITHMETIC OPERATORS OPERATOR - 1 ~~~~ 2 ~c 2 / 3 + 3 - FUNCTION Unary minus Exponentiation Multiplication Division Addition Subtraction If expressions involve more than one operator of the same hierarchy, execution is performed from left to right in the order in which the operators are encountered. For example, A*B/C is evaluated as (A*B)/C. The one exception to this rule occurs with ~xpressions involving the exponentiation and unary minus operators (level-I). In this case, e~ecution proceeds from right to lefl. For example, -X**-Y is equivalent to -(X**(-Y), unless X is a constant in which case the sign is part of the constant. Note that the unary minus is the only operator that may directly follow another operator. Example A+B::~/D~~*3 is evaluated in four steps: 1. B~: IGS, (Je, IC,),), IA,N#l 14 The expression is evaluated as follows: 1. B or C 2. A AND the result of Step 1 3. COMP the result of Step 2 4. The result of Step 3 AND C 5. A OR the result of Step 4 Operands associated with logical operations in a Boolean expression may be of any type (i.e., Hollerith, numeric, status, or Boolean) or they may be relational expressions. If no Boolean operators are used, the operand of a Boolean expression must be a Boolean variable, Boolean constant, Boolean function, Boolean functional modifier, or a relational expression. If two operands result in bit strings of lengths a and b, where a and b are not equal, the length of each bit string is assumed to be the maximum of a and b with the shortest bit-string filled with zeros on the left. All bit strings are right-justified before the binary Boolean operations are performed. In arithmetic operations, bit-strings are assumed unsigned, fixed-point data with no scaling. I The primaryluse of Boolean expressions is in IF and FIND statements, which select stat ment execution options based on relational comparisons. The Booleanexp ession is also useful for manipulating bit strings and assigning values to B data units. i When the value of a relational expression is used as an operand in a Boolean" expression, each bit .of the required bit string for the operand is. assigned the value true (1) or false (0). When a Boolean data unit is used as an operand in a Boolean expression, it is always assumed to be a single bit in length. If the functional modifier BIT specifies a single bit of a data unit, that d~ta unit is considered a Boolean operand. 11-5-1 M-5035 When relational and Boolean operators are mixed in a Boolean expression, the relational operations are performed first and the resultant Boolean values are evaluated according to the Boolean operators. Example 1. 2. A LT B (true or false) C EQD (true or false) 3. (result of 1) AND (result of 2) The results of Boolean operations can be shown in a truth table. "Referring to Table 5-4, the A and B" columns represent the assignment of truth values for these variables. The remaining columns show the truth values "resulting from the Boolean operations. For example, if A and B are both false (represented internally as 0) then COMP B would be true", A AND B would be false, A OR B would be false, and A XOR B would be false. TABLE 5-4. 5.1.4 TRillH TABLE A B COMPB A AND B Ai OR B XOR 0 0 1 0 0 0 0 I "0 0 I I I 0 1 0 I I I I 0 I I 0 Literal Expressions A literal expression is similar to other expressions in that it specifies a single literal value expressed in terms of literal operators and associated operands. The operands that are allowed with literal expressions are: fields" and variables typed as Hollerith, Hollerith functions, the functional modifiers BIT and CHAR, and Hollerith constants. 11-5-8 M-5035 The operator allowed in a literal expression is CAT (concatenation). Whpn Used, it places the rightmost character of the left operand adjacent to the leftmost character of the operand on its right. Example Assume the following variables have been declared with associated initial values: then M CAT E CAT SCAT S CAT A CAT G CAT E is equivalent to the Hollerith value, MESSAGE. 5.2 FUNCTIONAL MODIFIERS Functional modifiers facilitate easy reference to various parts of data structures or indicate an operation to be performed on data. designated as open and/or closed functions. They are An open function reference generates instru~tions that are compiled in-line. A closed function requires references .at run-time to Compiler-supplied routines loaded with the user's program. The following formats define the allowable functional modifiers: f. ASS (data uni t) BIT (index, index) (data uni t) BIT (i ndex) (data unit) CHAR (index, index) (data uni t) CHAR ( index) (data uni t) CNT (data unit) g. h. COR AD (data unit) FIL (file-name) i. LENGTH (file-name) j • POS (file-name) a. b. c. d. e. 11-5-9 r-5035 5.~.1 ADS Absolute Value (ABS) Modifier is used for referencing absolute value of a data elempnt or ari thmt't ie th(~ expression; it is an open function. Forma t ABS E xp 1 a n.a t (d a tau n i U ion Specifies an absolute value operation on the specified ABS element. Data Unit A data unit or arithmetic expression. Examples I 1. I I 1 I I I I I J I I I I , , J I , I I The example refers to the absolute value of the variable ALPHA. f!,§S. GCIL.tAI5ISI(.s,:rI'~E J~J I 2. I I I I , I I I I J , I I , I This example refers to the absolute value of the field, SIZE,· in the item-area CLASS. 5.2.2 Bit (BIT) Modifier BIT is used to reference a string of one or more bits in a data unit. unit bits are numbered with bit 0 specifying the leftmost bit. Data This function may be open if the starting bit and length specifications are positive integer constants and do not require movement across a word boundary. Format BIT (starting-bit,number-of-bits) (data-unit) Explanation BIT Indicates t.hat. bit speeificatio~s f (I J ] ow. IJ-~-lO for a data clem(~nl M-5035 Change 3 A numeric constant, data unit, or arithmetic expression. Starting Bit This bit specifies the initial hit position of the string. Number of Bits Optional. A numeric constant, data unit, or arithmetic expression. It specifies the number of bits in the string. If this option is omitted, the number of bits is assumed to be 1. The name of a data unit. The data unit cannot be a system Data Unit or local index. Examples The string begins in bit 0 (the leftmost bit) and is five bits long. ALPHA is the name given to the variable by a previous declaration. This bit string begins in bit 6 and is six bits long. The table (subtable or like-table) is BETA, the item index is N, and the field referenced is SUM. In this example, assume that field SUM has been defined such that it~occupies bits 27-16 of a table word. Thus, the bit reference applies to word bits 21-16, as illustrated below: ,... Field SUM I, 31 30 : 27 25· 20 t Starting bit specified in the BIT n~ference II-5-11 .. I I 16'15 I M-5035 Change 3 3. This example specifies the single bit in bit-position 6 of variable ALPHA. This bit string begins in the position specified by the variable START. Its length is determined by the value of the variable LENGTH. (subtable or like-table) is BETA. The table The item index is N, and the field referenced is SUM. J.~.~3 Character (CHAR) Modifier CHAR is used to reference a string of characters in a data unit. characters are numbered with 0 specifying the leftmost character. Data unit This fonctionmay be open if the character string specifications are positive integer constants and do not require movement across a word boundary. Format CHAR (starting-character ,number-characters) (data-uni t) Explanation Indicates that character specifications for the CHAR data element follow. Starting Character A numeric constant, data unit, or arithmetic expression. po sit ion 0f It specifies the initial character the s t ring. . I Number Characters Optional.' A numeric constant, data unit, or arithmetic expression. It specifies the number of" characters in the string. specified, the number ~f If this option is not characters is assumed to be 1. I Data Unit. The nnmf! of a dn t. C1 un it. system or local index. 11;...5-12 The data unit cannot be a M-5035 Change 1 Examples Ie., hiA,& 1. d,t) ,3,) I (I~I Ej Tj /IdA" !Si14 !IIIj ) I) I I I I I I I I I I I I The character string begins in character position 1 and is three , characters long. . The table (subtable or like-table) is BETA, the item is 4, and the field referenced is SUM. This example can be vi~ualized like Example 2 for BIT, t'he difference being that this uses character counts where there are eight bits per character. This character string begins in character position I and is one character Tbe table (subtable or like-table) is BETA, the item index is N. long. and the field referenced is SUM. 5.2.4 Count (CNT) Number of Bits CNT furnishes the count of the number of bits set (equal to 1) in the specified data element. CNT results in an integer value and may be used in a numeric or status expression. This is an open functiono Format CNT (one-word data-unit) Explanation CNT Specifies the counting of bits set to 1 in the designated I data unit. One-word ' data-unit The name of a data unit contained in one word. Example I I I The number of bits that are set in field FLDPOS of item XX of table TBLE will be counted. II -5-13 M-5035 5.2.5 Core Address (CORAD) Modifier CORAD is used to reference the core address of a data element. function. It is an open Format CORAD(data-unit or statement-name) Explanation COR AD Specifies the core address of the following data element or statement name. A data unit or statement identifier. Data Unit or Statement Name NOTE .The CORAD modifier always results in an unsigned, 16-bit value which represents the SY address of the data uni t or statement· name referenced. Under no circumstances will CORAD result in an la-bit absolute address. 5.2.6 File Position (FIL) Modifier FIL is used for file positioning. See Section 6 for usage examples. This is a closed function. Format FIL (name) Explanation FIL Specifies the positioning of a device to a {}articular file. Name The identifier of a file. 11-5-14 M-5035 :i.:!o7 Reeord Position (paS) Modifier POS is used for record positioning. This is a closf~d function. See paragraphs 6.S.1 and 6.5.2 for usage examples. Format POS(name) Explanation Specifies the position of a file named within the POS parentheses. The identifier of a file o Name ° 5 •2•8 Record Length (LENGTH) Modifier LENGTH is used to determine the length of the last record of an input or output operation; it is a closed function. See paragraph b.7 for usage examples. Format LENGTH (n arne) Explanation LENGTH Specifies the length of a record for the file named. Name The identifier of a file. 5.3- PROCEDURE LINKING Procedure linking is accomplished through the procedure call, function call, the procedure swi tch call, and the return statement. This capabili ty provides for program segmentation and increased efficiency through the elimination of statement duplicationo Paragraph 4.1.12 gives instructions for declaring a procedure. 11-5-15 M-5035 5.3.1 Procedure Call A procedure call establishes transfer of control to a named procedure and may assign actual parameter values to the formal parameters defined in the procedure declaration. All procedure input parametl)r linking is accomplished by transferring the values contained in the actual input parameters of the calling statement to tllP formal input parameters of the called procedure declarative statement. That is, an actual parameter and its corresponding formal parameter are usually (iistinct programmer-declared data units allocated to different locations in core. Therefore, modification of a formal input parameter in the procedure does not affect the value of the actual input parameter in the calling procedure. Procedure output parameter linking is accomplished by transferring the values contained in the formal output parameters of the called procedure's declarative statement to the actual output parameters specifi(~d in the calling statement upon procedure return. param(~ter is omitted" or if the same data unit is specified as both the actual paramct(~r and the corresponding formal parameter, no transfer of values is performed. If an actual Addresses of data units may be transferred (simulating a call by name) by using the CORAD operator (see paragraph 5.2). Format name INPUT actual-input-parameter(s) actual-output-parameter(s) EXIT OUTPlH statement-name(s) $ Explanation Name Identifies the procedure to be executed. INPUT Optional. Specifies that the following list of actual parameters is to be input to the named procedure. ' Act ua] Input I'aramnler(s) Constants, data units, or expressions that f(~pJaGP ttw Gorrt!sponding formal input para- meter valuns during execution of the nam£!d , T ~ .. , M-5035 procedure. Actual parameters must type with formal parameters. agrf~e in Mult.iple para- meters are separated by commas. There must be a one-to-one correspondence with the formal parameters defined in the called procedure's declarative statement (see note below). OUTPUT Optional. Specifies that the list of actual parameters following are the outputs from the named procedure. Actual Output Parameter(s) Data units whose values are replaced by the corresponding formal output parameter values after execution of the named procedure. Actual parameters must agree in type with formal parameters. Multiple parameters are ~eparated by commas. There must be a one-toone correspondence with the formal parameters defined in the called procedure's declarative statement (see note below). Optional. EXIT Specifies the statement name(s) that follow are abnormal exit reentry points. Statement Name An identifier that replaces the corresponding formal exit name during execution of the named procedure. Program control is trans- ferred to the named statement if a RETllRN (see paragraph 5.3.3) referencing the formal exit name is executed. NOTE If tbe same data unit is specified as both the actual parameter and the corresponding formal parameter, no transfer of values is performed. Alternatively, if an actual parameter is omitted from the calling statement. no transfer of values is perfo~med. In this case, the position of the actual parameter in the parameter list must be maintained with a comma. 11-5-17 M-5035 Change 5 Since the passing of parameters involves a passing of actual values, if the designated parameter is a table, subtable, etc., the entire table, subtable, etc., is actually transferred into the procedure receptacle. The procedure must, therefore, provide a receptacle of sufficient size. Any excess beyond the receptacle size is truncated. The CORAD modifier and the IN DmE CT table opt~on may be used when a table is specified as a procedure parameter and it is desirable not to have the entire table passed (see paragraph 4.2.2). NOTE It is not legal to use status constants as actual input or output parameters for forward reference procedures (procedures which are called before they are formally defined or declared with an EXTREF or LOCREF modifier). Furthermore, a local procedure may not be forward referenced before its local formal para":' meters are defined or declared, regardless of the parameter types. Examples 1. tl,X,., I I , , IT,EjS,T,R, tI;tJ,p,Utra ,0, Q,tJjr,p,U,TJ The statement AX will call the procedure TESTR. will be passed to TESTR as the actual ~nput ly~Il,S, ,$, I I I, INPlIT specifies that 0 parameter value. The actual parameter CLAS will receive the output value from procedure TESTR. :! • 18, Call, C, 6 H, P, \:\TJ ,11IP,~, ' ') tA, P", ,o,y T Ie. LA, Tj I , , , I . ,E,x,r, Tj I ,A,T I~' ~ I I I I , , , ". I ~ MIA g1 E; ,I, I , The procedure RCAC is to be called. API and AP3 are the first and third actual input parameters. The actual parameter IMAGE will contain the output from procedure RCAC. If an abnormal exit is taken from RCAC t reentry to the calling procedure will be at the statement labeled AT3. IT-5-18 M-5035 procedure. Actual parameters must aurp(! in type with formal parameters. Multipl(~ meters are separated by commas. parn- There must be a one-to-one correspondence with the formal parameters defined in the called procedure's declarative statement (see note below). OUTPUT Optional. Specifies that the list of actual parameters following are the outputs from the named procedure. Actual Output Parameter(s) Data units whose values are replaced by the corresponding formal output parameter values after execution of the named procedure. Actual parameters must agree in type with formal parameters. Multiple parameters are separated by commas. There must be a one-toone correspondence with the formal parameters defined in the called procedu~e'~ declarative statement (see note below). Optional. EXIT Specifies the statement name(s) that follow are abnormal exit reentry points. Statement Name An identifier that replaces the corresponding formal exit name during execution of the named procedure. Program control is trans- ferred to the named statement if a RETllHN (see paragraph 5.3.3) referencing the formal exit name is executed. NOTE If the same data unit is specified as both ~he actual parameter and the corresponding formal parameter, no transfer of'values is performed. Alternatively, if an actual parameter is omitted from the calling statement, no transfer of values is performed. In this case, the position of the actual parameter in the parameter list must be maintained with a comma. 11-5-17 M-5035 Change 5 Since the passing of parameters involves a passing of actual values, if the designated parameter is a table, subtable, etc., the entire table, subtable, etc., is actually transferred into the procedure receptacle. The procedure must, therefore, provide a receptacle of sufficient size. Any excess beyond the receptacle size is truncated. The CORAp modifier andthe INDmECT table option may be used when a table is specified as a procedure parameter and it is ~esi!able not to have the entire table passed (see paragraph 4.2.2). NOTE It is not legal to use status constants as actual input or output parameters for forward reference procedures (procedures which are called before they are formally defined or declared with an EXTREF or LOCREF modifier). Furthermore, a local procedure may not' be forward referenced before its local formal parameters are defined or declared, regardless of the parameter types. Examples 1. A,x,.,·, I , , IT,EjS,T,R, ,JijNIP,Utr, ,0, Q,U,T,P,U,TI ,yLtR,S, ,$, , The statement AX will call the procedure TESTR. I I I INPlIT specifies that 0 will be passed to TESTR as the actual input parameter value. The actual parameter CLAS will receive the output value from procedure TESTR. :!. IR,C,tl,y I , , ,., otJ,P,'1T J ,E,x,r, Tj ,A,P,;" ..,tA,P'31 I I R,T '~J ~ I , I ,O,YT,5lA,Ti I" , I " ;tj~Ag,€j I I I , I The procedure RCAC is to be called. API and AP3 are the first and third actual input parameters. The actual parameter IMAGE will contain the output from proc.edure RCAC. If an abnormal exi t is taken from RCAC t reentry to the calling procedure will be at the statement labeled AT3. II-5-18 M-5035 Change 5 5. 3. 2 Function Call A function call establishes transfer of control to a named function and assigns one or more values to the formal input parameters of the function. A function call may appear in dynamic statements or expressions; it resembles conventional mathematical function notation. Format name (actual-input-parameter, ••.. , actual-input-parameter) II-5-18A/IT-5-18B (Blank) M-5035 Change 5 Explanation Name The name of the function to be executed. Actual input Paramcters(s) Specifies each actual input to the function. There must be at least one specified; multiple parameters are separated by commas. Example The function call for the function TAN is TAN(AX, AY). AX and AY are the actual i~ut parameters to be used as the values of the form al input parameters of the function. The function is evaluated and provides the value specified to complete the operation of the SET statement. NOTE It is not legal to.use status constants as acutal input parameters for forward reference functions (functions which are called before they are form ally defined or declared with an EXTREF or LOCREF modifier). Furthermore, a local function may not be forward referenced before its local formal parameters are defined or declared, regardless of the parameter types. 5.3.3 Return (RETURN) Statement The RETURN statement is a transfer of control operation used within a given procedure or function to exit from that procedure or function. There are three types of RETURN statements for procedures: a normal RETURN, an abnormal RETURN, and a conditional RETURN, dependent on a hardware key setting. All procedures should have at least one normal RETURN statement. However, a RETURN statement may be omitted if it immediately precedes the END-PROC declaration. There is only one type of return for a function. Format RETURN statement-name special-condition $ RETURN (expression) ,$ 11-5-19 M-5035 Change 5 Explanation RETURN Causes a norm3J. transfer back to the statement following the procedure -linking operation of the calling procedure or function. Statement Name Optional. Must be the same name as one of those follOwing the EXIT definition in the procedure declaration and effects an abnormal transfer of control to a labeled state ment of the calling procedure or function. A one-to~ne corresporidence is established between EXIT names specified in the c all and those specified in the declaration to effect this transfer. Special Conditions Optional. Specifies any of the special hardware conditions defined for the target machine~ For the ANfUYK-7, these are KEYl, KEY2, KEY3, STOP, STOP 5 , STOP 6 , and STOP7 (see paragraph 7.3.4 for simulating these speci al condi..; tions). Expression Any legal data name or CMS-2 expression. This format is reserved for returning from a function. The Compiler will process the expression and return the result to the calling procedure. Examples l. I 1 ,. 1 I 1 1 I I I I This is thp normal type of ret.urn. Control is transferred back to the JI r IIt'l'eI" r t' I hill (' II I I t'dIII'DA'n: • 11-5-20 M-S035 2. Jf,l3tg"E.1~U,~,Ei JR,E,4J) , I j ,., J J I·' , I , , " ii' I I J , , I , I·, I , , I J JRIEjr,U, ~w. III I I I , I I , I. I,I I J I O,u,T,PfllT, It!BD, ,EjX,rJT, ,E;9F,$/ I 'J I I , , I J I I ·1 I I The RETURN EOF statement results in a return to the alternate reentry statement corresponding to the parameter EOF in the procedure call. In this case, the output parameter value is not transferred. 3. ,s;r )0, R ,$, , I&E,1iu.K.ttI I I l~l I I I I I I I , IS,,- lo,p,S, , I ,$, These are examples of special condition returns. The first example results in an unconditional halt with the return executed after operator intervention. The second example results in a stop if key 5 is set, with the return executed after operator intervention; otherwise the return is executed. 4. IR,EiT,U.iaN, I .s;rle-,p,9, I ISaT,9P~ ,1, I I , I , I , In this example, if key 5 is set, a halt will occur. I,, I " I After operator intervention, the return will be made through STEP9 to the controlling procedure or function. without halting. 5. JgIEJljij~,,vI' ~XI Otherwise, a return through STEP9 is executed Itl Itt ,+, ,Z),, ,$1 , I I I , , I I , I. I I , , I In this example of a return from a function, the expression X+Y+Z will be evaluated and returned to the calling procedure as the output value of the funct.ion. 11-5-21 M-5035 Change 5 5.3.4 Executive (EXEC) Statement This statement provides an interface with an executive program. A call to an executive program is generated and a parameter is placed in the appropriate register for the executive program to access. e~ecutive The parameters required by the program are spe~ified by the particular ,system. This statement merely provides the interface capability. Format EXEC parameter-I, parameter-2 $ Explanation Causes a call to an executive program (generation of an EXEC XS instruction). A parameter required by the executive program to inform Parameter I it ~s wh~t to action is to be taken (this parameter is specified by the particular system). This parameter will appear in the SY portion of the XS instruction. Parameter 2 Optional. A parameter that will be loaded into machine register AO prior to execution of the XS instruction. Examples I. ?l~ tiC, , tLS(·, t$, I I , I I I I I I I I I I I I I I I I ' , I ' This example provides code 15 to the executive program and requests the task I associated with code 15 to be performed (i. e., generates an XS 017 instruction). 2. .Q"& Ef'1 I ,.451 ',I Vl~ ,BtbX, ti I I I I I , I I I I I I I , I I I I This example provides the contents of VRBLX to the executive program through task register AO. This data unit may either instruct the executive program to perform a specific task. or may contain a core address for the executive program to access for its instructions. generated instruction is dependent on the particular system that is imp 1c~mt~n tHd) • 11-5-22 (This M-5035 :i.:\.:i l'roct'dure Switch Cnll A procpdun\ switch call t~stahlis}ws of control to one of the (see paragraph 4.2). proc(~dures a procedure link by specifyi'n~J a transf(~r named in the procedure swi tch declarat ion Actual paramt!ters nrc assigned to formal parameters named by the declaration. The index value of the procedure switch call determines which procedure within the declaration is to be called. If the value of the switch index is outsidp the range of allowablc values, control may be transferred to the named via the INVALIU operator. statemt~nt Allowable index values are 0 through n-l, where n is the number of switch points. If the user does not use the INVALID o~tion, it is his responsibility to see that the index is within the range of the switch. If the procedure switch is defined with formal input and output parameters, actual input and output parameters must be included in the procedure switch call, as in a normal procedure call. Format name USING index INVALID actual-paramcters statement-name OUTPUT INPUT actual-parameters $ Explanation Name The identifier of a previously defined P-SWITCH. USING Specifies that the following index indicates the procedure to be called. This parameter is not used in a procedure item switch call. Index A data unit, constant, or arithmetic expression whose integer value determines the procedure to be called. This parameter is not used in a procedure item switch call. INV ALIU Optional. Specifies that the procedure linkage should be accomplished only if the switch index is valid. 11-5-23 M-5035 Statement Name Identifies the statement to which control is transferred if the invalid condition is met. INPUT Optional. Specifies that the list of actual para- meters following are the inputs to the named procedure switch. Actual Parameter A data unit, constant, or expression that replaces the corresponding formal input parameter during execution of a procedure referenced by the procedure switch call. Multiple parameters are separated by commas. OffiPm Optional. Specifies that the list of parameters following are to contain the outputs from the named procedure. Actual Parameter A data unit that is replaced by the corresponding formal output parameter after execution of a procedure referenced by the procedure switch call. Multiple parameters are separated by commas. 11-5-24 M-5035 Example The following declaratives are referenced in t.he procedure switch call. IVd '. ',$ '1 AJ8tL, Ej ,.1i§slr,EiR, ,H I tD,E't',SIE", tl,o, ,$, I l I I I 'I "" I I , :, " tiL,]), ,C.,/ . I ~,i, I ;r, ," kI, ,0, ,ft', .$, 1 I IFj (,c,LJ>. tE"IHlbC- I , jT,,,,~,L.le, ,If, ,W,It,O,'-,t, J , , , I I I, I .. I I I I I I J I , I , I ,$, I I I I I II , , I I , ,I :~:~~~: : : : I : :~A~ ~~ :U8:1':t~:($:Jl>:I(:~LL:Y~: J: I "viR, C!JLI , J I I J IA,X,FI6A,&-1 AB .$. , I , I I , I I , ,, ,, I I I , I " 1. J Every word of table WHOLE is set to 15. 2. S,t;jTj 'lC,IO,TIT, ,Tig I,D, ,$, I,, ,, I The table CATTiscleared to zeros. 3 .. ,s. £iT" ,'riA,rJT, ,Tj g , ,L,:;'!t I ,$, , , , , , , , f , " , I I 1 1. , Every word of CATT is filled with the value contained in the variable LIB. 4. ,5,EiT" ,"11,m, ,1IQ J ~H;O, YEi Gi, ,,2 "3,, ,Wt.JD Each word of the subtable CATA is assigned of item 1,2,3 in table MIOLE. 1 th{~ I If. I I I 1 1 , • value of the field W3 M-5035 Each of the three words in the item specified by 0,1,0 of table WHOLE is assigned the value of the arithmetic expression LIB •• 2*4 o 6. 1Si£JT1 IQAIDrl',A) I I IIIQ I IClQII1I81PI t$ I I I I I II I I I I I I Each word of item 1 of table CATT is filled with all or part of the characters of the Hollerith variable COMAP. For example, since the AN/UYK-7 machine word size accommodates four characters, the characters REDK would be stored in each word of the item. ,(>, 7. I I I I I I I I I , I I I I ., Each word of subt3ble CATA is replaced with the true or false (lor 0) value of the Boolean variable AXFLAG. 3.4.2 Exchange Statement (SWAP) Th(' exchange statement swaps the values contained in two data units. The exchange statement may be viewed as two assignment statements that are executed simultaneously. The rules regarding ~ata unit iengths and types in the exchange statement are the same as the rules for the assignment statement (see paragraph 5.4.1.1). However, both the left and right terms assume the role of the receptacle. Format SWAP data-unit data-unit $ Explanation SWAP Specifies the Data Unit The identifier of a data unit. ~peration 11-5-30 SWAP. M-5035 Change 3 Examplt'S I . '-. tS,tv, At P, 3. ~W,I!tP, ~) ,j tS/NI&P, I , J I 1 J I , ,, 5.4.3 Shift (SHIFT) Operation The SHIFT operation moves the contents of a data location into either the same or a different data location. During the operation, the data is shifted as prescribed. Format SHIFT data-unit shift-type shift-count INTO data-unit $ Explanation SHIFT Specifies the operation. Data Unit The identifier for a data unit (two words or less in length). Shift Type Shift Count One of the following: eIRe Specifies circular shift. ALG Specifies algebraic shift (sign flll). LOG Specifles logical shift (zero fill). Specifies the number of positions to shift and the . shift dire~tion. This may be a constant, a data unit or an arithmetic expression. A negativ~ shlft count denotes a shift to the left, a positive shift count denotes a shift to the right (the sign must be explicitly specified for a left shift). INTO Optional. Specifies that the receiving data ualt'. name follows. 1I-5~39 I M-5035 Change 3 NOTE The SHIFT statement is intended primarily to provide highlevel access to the shift instructions in the AN/UYK-7 repertoire. Consequently several restrictions and limitations are imposed: the data-unit being shifted must not exceed 64 bits in length; partial-word circular shifts are not permitted (i. e. ,if crnc is specified, the source data-unit must be defined as exactly 32 or 64 bits, or 4 or 8 characters); when a receptacle data-unit is specified, the normal data-type rules for assignment statements must be followed and the shift operation itself is independent of normal operand alignment or conversion which takes place prior to the assignment; because all left shifts must be performed using AN/UYK-7 circular shift instructions, left algebraic shift operations can result in filling to the right with magnitude bits. Examples 1• 6l#tZiB7j ,. tIJNj7j I IL.O" I ,-12. I $, , I , I , 'I I 1 I 1 , , I -. OJ :~ . 5.4. 4 Pack (PACK) OperatioI). The PA CK operation requests packing of specified data units into a specified data area. Format PACK data-unit WITH data-unit data-unit ... data-unit $ Explanation PACK Specifies the operation. Data Unit The identifier of a data unit. WITH Specifies that the· data units which follow are to be packed into the receptacle. The effect of the PACK statement is bit string transfers from the source location to the target area, where the strings are stored consecutively and without spacing. If the receptacle is a table or an item, the right side data units must be tables or items. If the receptacle is a variable or field, the right side data units must be variables or fields. 11-5-40 M-5035 Examplp As s un\(~ : a. COON is a half-word variable. b• ANG i s a 40 - bit fie I d • c. LAT(L) is a three-word field in item area LAT. The variable QUAU will receive the following Word 0 Word 1 Word 2 cont~ibutions: Word 3 Word 4 ~! I presuming that QUAD is a storage area capable of containing the specified bit strings. 5.5 CONTROL STATEMENTS A control statement alters or affects program flow within a procedure. There are three types of control statements: 2. GOTO statement name GOTO switch name 3. STOP 1. 5.5.1 GOTO Statement Name This statement performs a transfer to a named statement and may specify a governing special condition imposed by a console hardware switch. Format GOTO statement-name special-condition 11-5-41 $ M-5035 Explanation GOTO Specifies a transfer of control. Statement Name The name of the gatem{~nt to which control is to be transferred. Special Condition Opt.ional. Specifies a machine-dependent condition of lh(' console key selt;ingso For the AN/UYK-7, these are KEYl, KEY2, KEY3, STOP, STOPS, STOP6 and· STOP7. ~amples I . 6.1QJjQ I , lL,BllAITiEi I ~ I I I " I I J I J I I I , I I ., , J I Execution of this statement transfers program control to the statement labeled UPDATE. A transfer is made to statement label ERRDIAG if console key I is on. If console STOPS is on, program execution halts. When restart is accomplished, a transfer is made to statement label ALTRNATE. 5.5.2 GOIO Switch Name This statement performs a transfer of control toa statement label listed within an index- or item-switch declaration. Transfer may be made conditional as governed by a specified console key setting. 1. Referencing an Index-Swi tch. Transfer is based upon the valu~ of the switch index. value is specified in the GOTO statement. th(! Compiler as to th(~ This No check is made by valictity of the index. Therefore, if the index is outside the range of switch index values, program M-5035 ('xpcution eonlrol ean b(' Josi. To of thl' INVALJl) operator direct.s the pf(~v(!nt. this, spp(;ification Compil(~r to perform a validity check; if the index is oUlside the range of index values, contr61 will be transferred to a programmer-supplied statement label. ..... Referenc i ng an I fem-Swi tch. ') The value of the variable specified in the item-switch is compared against the list of constants defined in the switch declaration. If a match is found. transfer is made to the corresponding statement name. If a match is not found, control is transferred to the next statement or to a statement svecified after the INVALID operator. Format Goro switch-name value INVALID statement-name special-condition $ Explanation GOTO Specifies a transfer of control. Switch Name The name of the referenced index- or item-switch. Value A constant, arithmetic expression, or data unit that provides an index value pointing to a switch point. This parameter is not to be used when referencing an item-switch. Special Condition Optional. Specifies the machine dependency conciitions to be imposed by console key settings. KEYl, KEY2, KEY3, STOP, STOP5, STOP6, and STOP7 are the CMS-2 identifiers used for the corresponding key settings on the AN/UYK-7. INVALID Optional. Spe~ifies a transfer of control to the following named statement if the index is outside the range of the index-switch values or if no match is found in an item-switch. M-5035 Statement Name Control is transferred to this statement if the switch test is invalid. Examples Thp following declarations are referenced ip the GOTO switch examples: IV1RI~ll I I~ I ~I I I I 1 I I I I I I 1 I I , I I I~~IAI I IS~I~~I lSIAI&i~ I ~11i131 I!I t2,~XI 1$1 I I I I I I II I' I 12IWI§ I(~I~)(~I Iii 151 81.1.1 ,$1 I I I I ~lwt!lrl~~ IVI~BI~ I 1 15Iwl~rl~HI IbiD", tJ,o, ~I 1 ISI§&J !$, I I 1 1 I ,.2 1 1)1 I I IS181311~1 I J IEjNlbl-I~WI~!1C.I"1 lSI Wl61 Iii I I I. , ° rna TiOI 1 ISIWAI I 1 J I I I I I I I I tld I til I I I 1 I I I I I I I I '.1 I I I 1I I· I I 1 I 1 I Program control is transferred to the switch point of SWA specified by I. ~or example, if I equals 2, control is transferred to statement SA3. This is the same as Example I, except that if 1 is outside the valid index range, control is transferred to statement SA4. For example, if I equals 4, control is transferred to SA4. ~. t;iOlriA I Plwle, I tS, I I I , I I 1 I I I I I I I I , I III I I I I I Prouram control is transferred to the statement corresponding to the value in SWX. For example, if SWX equals 30, control is transferred to statement SB2; however, if SWX equals 35, program control continues to the next sequential statement. 11-5-44 M-5035 Change 3 Cia ro, I .5,wl8. , ;+'tI, v,R,Lil;) I , ,S ,B,i, , .$, 4. I • • , I. I I , , , This is the same as ExamI)le 3, except that if the value of SWX is not found in the switch definition, control is transferred to statement 5B4. For example, if SWX equals 40, control is transferred to SB4. > a J SIMA, 5. I ,4. IK,k,y,il , S. 1 I J , , J , J Program control is transferred to the statement labeled SA2 if console key I is on. 5.5.3 STOP Statement The STOP statement temporarily suspends program execution. This statement is legal only in programs being compi.led to execute in the executive state. Format STOP special-condition $ Explanation STOP Specifies a suspension of program execution. Special Condition Optional. Specifies machine dependent conditions \ of the console key settings. ;).o, DECISION STAT~M~NTS The IF operator allows for conditional execution of one or more slatenlPnts. The condition is based on one of the following four types of de'cisions: 1• Log lea 1 . '-. S('arch :l. Validi ty 1., Parity ) A decision statement may be followed by the ELSE operator which allows for execution of one or more statements if the result of the condition is false. 11-5-45 I M-5035 Change 3 5.6.1 Logical Decision Statement \ The logical decision statement evaluates a specified Boolean condition and reduces the evaluation to a true or false result. Format IF Boolean-condition THEN statement(s) $ Explanation IF Specifies that an evaluation, resulting in a Boolean true or false condition, is to be made. Boolean Condition Specifies a Boolean condition, defined in CMS-2 notation by operands (constants, data units, and arithmetic expressions) and relational or Boolean operators. THEN Specifies that the statement or statements that follow are to be executed only if the result of the Boolean condition is true. Statement(s) I A simple or compound statement, or a block of dynamic statements. See paragraph 5. 8 for an explanation of blocks and the requirements for compounding (nesting) .decision statements. Exam(!les 1. ~fi I ~Er'i ~ iiiit' IE"~I G:.QIUO, I~.£I ~ 8.1 ITiDI ail ctl . Iii I til I I I I I I I I dJ eQ Control is transferred to statement Sl when A equals B. I .I I I Otherwise, the set statement is executed. 2. t;FI J I , ,R,+I§ ILO-'EiQ is•.,,, ITiflffl' ISle l~' ,TiD, .), ,1j"'Cj'l 15 lilT, I~ InQ IF! I ,.-. I I I I I I I I I C is set to.D, and E is set to F when A+B is less than or equal to B.C. 11-5-46 I I M-5035 .trjF1 ,W,~,Ajrlltlt'",R, ,E,Q, :\. I I 1 .-',R,4ts'MY/ J ,Tr#lEtI'J ,Crtg 1iA IE,V,A-,LW, T,tt,R, , ri, , , , , ('(I!llro) is Iranst't'rrt'd 10 s.talt·Jllt~nt I I , E\ALWnm if lilt' statlls of \\LXIIWH is 'HAI:\Y'. eIiF, It, tA,Hj)J I. ,5 IgR, , , , YxQTj{), I el~ I ,(g.1 ,$, Yjrl 1M lAtJ.iJl I I I I ;;)1 I I , , I I I I , J ,T,H,tflj t I I I , If Iht' Bouh'an variahlt's E and F art· both trUt' lII, or if (; is Ihan II and thp Boolt'an \'ariablt' I is trUt', ~Irt'nlt'r lIH'!l conlrol is Iransft'rrt'd t () S t a I I'ml' n lSI • If thl~ Buol('an variable BOOL is set to tht' trUt' slate (U, pro~lral11 control is transfl'rred tu thl' slatement labelt'd TRUE. b. If the Boolean variable BOOL is set to the false state (0), takin~J tht' complement will make it true; hence, the true path is takt'n with protJram control transfer beinu made to statement FALSE. 7. ~~, I I titn ~I~ AIN~ ~~~I~lrI61TI I£'~ 1/~~I!t!I~ I, J·~C~i 8tirJt~ 61£(17 IClo,lliEI ITe, I'dl'l Irfl.E~t I I I I i i I aIQJ1jO, leBOICIEIS~dl· I Ifl I I I I I The rei a t ion a I e x pre s s ion s ( GT and E(J) are fir s t to a true or false condit ion. I ·1 t'V a 1 u ate dan d r (' d u (' e d These two results are then logically tested (ANU) for the final determination of a true or false condition. If evaluat(~d true, the status variable COUE is St't and is lransferrpd to statement PROCESSA. II-~-:17 pro~lram eontrol I L.J...J.. M-5035 Change 4 . 5.6.2 Table Search Statement The table search statement provides the capability of searching a table for data that satisfies specified end conditions. The statement is a combination of a FIND statement and a search decision statement. The FIND loop is terminated when the value of the table element, specified by the index, first satisfies the condition. If the condition is satisfied, the loop index points to the element that satisfied the condition. The loop is also terminated when the index has reached its final value. The FIND statement must always be followed immediately by a search decision statement, which may in turn be followed by an ELSE statement (Paragraph 5.6.5). 5. 6. 2~ 1 FIND statement Format statement-label. FlND expression VARYING loop-index initial-value final-value increment $ Explanation Statement Label. Optional. The name by which this statement is referenced. This label is required if the table search is resumed. FIND Specifies a table search. Expression A relational expression, the first term of which must be a subscripted table reference using the loop index. II-5-48, M-5035 Change 4 VARYING Optional. Specifies that the operands that follow, control the loop. If not included, the loop index is varied from 0 in increments of 1 within the limits of the table. The loop index, initial value, and final value are allowed only if VARYING is given. Loop Index Optional. The name of an index or integer variable to be varied. It must be included whenever VARYING is used and it must be one of the subscripts included in the table reference. If the VARYING clause is omitted, the first subscript in the table reference will be used as the loop index. Initial Value Optional. FROM followed by a constant, arithmetic expression, or data unit that specifies the beginning index value of the loop. If omitted, the initial value is O. Final Value One of the following: 1. May be THRU followed by a constant, arithmetic expression or data unit. This value Signifies the last pass through the loop. 2. May be WITHIN followed by the name of a horizontal or vertical table, subtable, or like-table. The value assigned is the number of items defined for the table or the current value of the major index. 11-5-49 M-5035 Change 4 Increment Optional. BY followed by a constant, arithmetic expression, or data unit. If this value is to be a decrement, BY must be followed by a minus sign. If omitted, the increment is 1. When varying within a table by a negative value, the initial value is the number of items defined for the table or the major index, and the final value is O. 5.6.2.2 Search Decision Statement The search decision statement must immediately follow a FIN D statement. The FOUND/NOTFOUND condition is determined by the results of the FIND search. Format IF DATA FOUND THEN statement(s) $ IF DATA NOTFOUND THEN statement(s) $ Explanation IF Specifies that a condition is to be evaluated as true or false. DATA A compiler control word used to clarify the statement. FOUND Specifies the condition to evaluate upon satisfaction of the FIND condition. NOT FOUND Specifies the condition to evaluate when the search loop is completed. THEN Specifies that the statement or statements that follow are to be executed if the FOUN D or NOTFOUND condition Is true. 11-5-50 M-5035 Change 3 Explanation ELSE Specifies that the statement or statements that follow are to be executed only if the result of the Boolean condition in the corresponding previous decision statement 'is false. A simple or compound statement, or a block of dynamic Statement(s) statements. See paragraph 5.8 for an explanation of blocks and the requirement for compounding (nesting) decision statements. Examples 1. IF A EQ B THEN'SET C TO D $ ELSE SET C TO 1 $ C is set to D if A equals B. Otherwise C is set to 1. 2. IF BOOL THEN PROCA $ ELSE BEGIN $ SET E TO F $ SET G TO H $ END $ PROCB $ If the Boolean variable BOOL is true, then procedure. PROCA is called. If BOOL is false, then the block of set statements is executed. In either case, PROCB is then called. 5.7 LOOP STATEMENTS Loop statements direct repeated execution of a specified group of statements (vary block) or perform. a table search. II-5-50A M-5035 5.7.1 Vary Block Statements A vary operation· is used to execute .one or more statements a specified number of times (at least one time). The statements to be executed are bracketed by a VARY statement and an END vary statement. This group of statements is defined as a vary block. The number of passes through the loop is controlled by a loop index. Multiple vary loops on the same level are allowed within the same VARY statement. . II-5-50B M-5035 Change 4 Statement(s) A simple or compound statement, or a block of dynamic statements. 5.6.2.3 Table Search Format A generalization of the FIN D statement in combination with the required search decision statement follows: 1. FIND statement $ IF DATA FOUND THEN (found sequence, with or without RESUME) .•• $ (search completed sequence, should not RESUME) 2. FIND statement $ IF DATA NOTFOUND THEN ••• (search completed sequence, should not RESUME) ..• $ (found sequence, with or without RESUME) The search completed sequence in the first case and the found sequence in the second case may be ELSE statements. 11-5-51 M-5035 Ghange 4 5.6.2.4 Table Search Examples 'TARGET' is compared fJljainst. field PLUTA in table PAR, starting at ii, 'm 0 and c () n Lin u i nU un til an e (I ui val en c e i s f 0 und 0r the com pie t e table has been searched (not. found) and an exit made to AVERAGE. t h" FIND is control is s('archt'd. satisfi(~d lransf(~rred If before the complete table has been searched, out of the loop and the remaining items are not The variable K is the loop index. This sequence of statements increments TALLY each time the third word in the first seven items of CATD equals CATC. If no equivalence is found or the varying portion of the FIND is satisfied, control is I ransferred to STEP2. The RESUME statement. continues the search only if an (>({uivalence has occurred. It is no~ logical to resume a FIND loop on a not-found condition since the search continues without reinitialization. tJr In the example, STEP2 will always be executed whether not dat.a is found, since completion of the table search will be interpreted as a true NOTFOUND condition and exit will be via THEN (;OTO STEP2. 11-5-52 1\1-5035 Change 4 The following three f>xamples illustrClte a table search for a ~pecified condition using Cl FIND st.atement with a search d(lcision statement of ForNU and NOTFOUNU, respect ively, in the first two pxamples, and a VARY block in the thitd examp·le. All three examples produce the same result: a transf('r to ALARM is made if the specified condition is met less than five times during the search; otherwise, processing continues with the next instruction in sequence. 1 I 'I I 4. 1 I I I I I I 1'1 I I.! , ,A- r; Rt Rj' f: JAtl) IY', J 1.' ,S,c." ,KO,Uft,TI ,r; 9 ,0, If, I J 11 ,FtZiM), ,"':,BIUM,'-,( ,TI~'J'5L,"'J~lr I C~~f1~) , II-5-53 I , I I I J J J I , I'"16,), lillI&., I ,I 1 I M-5035 Change 4 ,-,. I I I , I , J , , ls,EiT, ,f4,O,tJ,MT, lA~IR,R,£"II4I~,Y,.1 IVaD,R,Y, ,TiX, Irp"f), ,$, I J J J , , 4 " ,Wlr,T,HltJl OrJ:,Arj,!,B,L, If, , 1 I I I I 5.6.3 Validity Decision Statement . The validity decision determines whether a subscripted data reference is valid. For example, if a horizontal table is defined wlth four items, any reference with the item index larger than 3 would be invalid o Format IF table-element VALID/INVALID THEN statement(s) $ 11-5-54 M-5035 Change -.1 Explanation IF Tablt~ Spt'cifips that n decision is to bf' EIl'mt'nt performf~d. A subscripteu table ell'mt'nt wtll'rl' tht, suhscript cnlculation is checkpd for \,nlidity. \' AL I I) / I NVALI I) 5 Pe c i fie sac 0 nil i t ion () f a \' II 1 i Ii subscript. TlIEN Specifies that the statellll'nt or statpments thnt follow ()rf~ 0 r i nval i d to bp (,Xl'cutt'd if tht' tllhll' l'lenwnt ref ere nc e i s VAL I U () r I :\ \' AL III • 5tatement(s) A simple or compound statenlent or a block of dynamic statements. Examples The following tieclnration is referenced in the validity decision examplt>s: ''2WiB' e I ,ClA'M .s)UlB -171ABIL 1«1 , I 1111 I l-5j IClefIZl81 lat I ,2 I $ III ,$I Program control is transferred to statement 51 if I has a value of U or 1. Program control is transferred to statement 51 if I is not zero. 5.6.4 Parity Decision Statement The parity decision statement determines parity by testing the data specified for an odd or even number of I-bit settings. If the sum of the I-bits contained within the data unit is an even number, theparitj is considered even. If the sum is an odd number, the parity is considered odd. II-5-55 1\1-5035 Change 4 Format IF one-word data-unit onDP IF one-word data-unit EVENP THEN THEN statement(s) $ statement(s) $ Explanation IF Specifies that a condition is to be evaluated as true or false. One-word data-unit The identifier of a data unit contained in one word. ODDP/EVENP The decider as to whether the parity condition of the value contained in the data unit is odd or even. THEN Specifies that the statement or statements that follow are to be executed if the ODDP or EVEN P condition is true. State~ent(s ) One or more (connected by THEN) dynamic statements. Example The bits set to 1 in the variable STAT are tested to see if their sum is an even number. If so, the variable FLAG is set to O. 5.6.5 ELSE Statement Any of the four types of decision statements may be immediately followed by an ELSE statement which allows for execution of one or more statements if the result of the condition is false. Format ELSE statement(s) $ I1-5~56 M-5035 Change 4 Explanation ELSE Specifies that the statement or statements that follow are to be executed only if the result of the Boolean condition in the corresponding previous decision statement is false. Statement(s) A simple or compound statement, or a block of dynamic statements. Refer to paragraph 5.7 for an explanation of blocks and the requirement for compounding (nesting) decision statements. Examples 1. IF A EQ B THEN SET C TO D $ ELSE SET C TO 1 $ C is set to D if A equals B. 2. Otherwise C is set to 1. IF BOOL THEN PROCA $ ELSE BEGIN $ SET E TO F $ SET G TO H $ END $ PROCB $ If the Boolean variable BOOL is true, then procedure PROCA is called. If is executed. B~OL is false, then the block of set statements In either case, PROCB is ,then called. 11-5-57 1',1-5035 Change 4 5. 6. 6 Nested Decision Statements Because the connector TH EN serves a specialj purpose within decision statements, IF and FIND statements cannot directly appear ~fter THEN or ELSE associated with an IF statement. However, the compiler interprets all statements within a statement block (Paragraph 5.7) as the equivalent of a simple statement. This provides the means of nesting decision statements and gives rise to the following rule: If an IF or FIND statement is to appear following the connector THEN or the operator ELSE associated with another decision statement, the nested IF or FIN D statement must appear within a statement block. Furthermore, when a stat~ment block appears within an IF statement, execution of all statements within the block is subject to the condition of the IF statement. Examples 1. IF 'A Bl. THEN BEGIN $ FIND TAB(I) EQ B $ IF DATA FOUND THEN SET F TO 1 $ ELSE SET F TO 0 $ END B1 $ ELSE 132 •. BEGIN $ IF B LT 10 THEN SET B TO B+1 $ ELSE VARY I WITHIN TAB $ SET TAB(I) TO 0 $ END $ END B2 $ 1I~5-58 M-5035 Change 4 In this example, the outer decision statement is logically equivalent to the form: IF A THEN block Bl ELSE block B2 $ The BEGIN and END statements are necessary due to the nested FIND statement in Bl and the nested IF statement (with its nested VARY loop) in block B2. 2. IF STATUS EQ 'START' THEN SET STATE TO 0 THEN VARY I WITHIN ANS $ SET ANS(I, SUM) TO 0 $ END THEN COMPUTE $ ELSE FINISH $ In this example, the VARY block is the equivalent of a simple statement within the compound conditional portion of the decision statement. 5.7 STATEMENT BLOCKS A statement block is a group of simple or compound statements initiated by a BEGIN, VARY, or FOR statement and terminated by an END statement. A statement block is interpreted by the compiler as the equivalent of a simple statement. A value block (Paragraph 5.7.3.2) is a special block used only in the construction of FOR blocks; a value block· is not the equivalent of a simple statement. 11-5-59 M-5035 Change 4 5. 7. 1 BEGIN Block Format statement-label. BEGIN $ dynamic statements EN D statement-name $ Explanation Statement-label Optional. The name by which the block is identified. BEGIN Specifies the start of a block. END Specifies the end of a block. Statement-name The name, if any, given to the block as • specified in the BEGIN statement. The BEGIN and END statement brackets serve only to delimit statement blocks; the BEGIN statement does not specify a dynamic processing function as does the VARY or FOR statement (Paragraphs 5.7.2 and 5.7.3). Because the BEGIN statement does not define a loop structure, it cannot be resumed. Statement blocks delimited by BEGIN and END may be nested within, and in the same manner as, VARY blocks and FOR blocks. ll-5-60 1\1-5035 Change 4 Example Ll. BEGIN $ SET A TO B $ VARY I WITHIN TAB $ BEGIN $ SET C TO D**A $ IF C LT 100 THEN SET TAB(I) TO C $ END $ SET A TO A+1 $ END $ END Ll $ Three statement blocks are defined in the above example: an outer block, Ll, delimited by BEGIN and END; a VARY block nested within block Ll; and a BEGIN/END block embedded In the VARY block. Note that the two BEGIN statements and their associated EN D statements serve only to group dynamic statements in a logical manner; removal of these bracketing statements would not alter the processing function of this program segment. 5.7.2 VARY Block A vary operation is used to execute one or more statements zero or more times. The statements to be executed are bracketed by a VARY statement and an EN D vary statement.. This group of statements is defined as a vary block.. The number of passes through the loop is controlled by zero or more loop indices, a WHILE condition, and/or an UNTIL condition. 11-5-61 M-5035 Change 4 5.7.2. 1 VARY Statement The VARY statement initializes the loop and specifies controls for the number of passes through the loop (see Figure 5-1). Format statement-label. VARY index-clause(s) WHILE clause UNTIL clause $ Explanation Statement Label. Optional. The name by which the vary block is referenced. This label is required if the VARY loop is resumed. VARY Specifies the start of a vary block. Index-clause(s) Optional. Specifies the data units to be incremented or decremented and possibly tested (Paragraph 50 7.2 .. 1. 1: Multiple index-clauses are separated by commas. WHILE clause Optional. Specifies a condition which is to be tested before each pass through the loop (Paragraph 5.7.2.1.2). UNTIL clause Optional. Specifies a condition which is to be tested after each pass through the loop (Paragraph 5.7.2" 1.3). A program's execution nlust not depend on incrementing and testing of the indices and the evaluation of the UNTIL clause being performed in a.ny predefined order. The conlpiler will order the end loop evaluation a.ccording to optimal code generation. II-5-62 M-5035 Change 3 Simple and compound statements may also be grouped together into blocks by means of the brackets BEGIN or VARY and END. Statement blocks are particularly useful, and in fact are required, when compounding (nesting) of decision statements is desired. 5. 8. 1 Statement Blocks A statement block is a group of simple or compound statements initiated by a VARY or BEGIN statement and terminated by an END statement. A statement block is lnterpreted by the compiler as the equivalent of a simple statement. Format statement-label. VARY. . . $ or statement-label. BEGIN $ . dynamic statements EN D statement-name $ Explanation Statement-label Optional. The name by which the block is identified. This label is required on the VARY statement if the VARY loop is resumed. VARY. A VARY statement is specified in paragraph 5. 7. 1. 1. BEGIN Specifies the start of a block. END Specifies the· end ofa block. Statement-name The name, if any,given to the block as specified in the VARY or BEGIN statement. n-5-62A . M-5035 Change 3 The BEGIN and END statement brackets serve only to delimit statement blocks; the BEGIN statement does not specify a dynamic processing function as does the VARY \ statement, described in paragraph 5. 7. L Because the BEGIN statement does not define a loop structure, it cannot be resumed. Statement blocks delimited by BEGIN and END may be nested within, and in the same manner as, VARYblocks. Example Ll. BEGIN $ SET A TO B $ VARY I WITHIN TAB $ BEGIN $ SET C TO D**A $ IF C LT 100 THEN SETTAB(I) TO C $ END $ SET A TO A+l $ END $ END Ll $ Three statement blocks are defined in the above example: an outer block, Ll, delimited by BEGIN and END; a VARY block nested within block Ll; and a BEGIN/END block embedded in the VARY block. Note that the two BEGIN statements and their associated END statements serve only to group dynamic statements in a logical manner; removal of these bracketing statements would not alter the processing function. of this program segment. 5.8.2 Compound Decision Statements Because the connector THEN serves a special purpose within decision statements, IF statements (and therefore FIND statements) cannot directly appear after THEN or ELSE associated with an IF statement. However the compiler Interprets all statements within a statement block (1. e., all statements from BEGIN or VARY to the corresponding END statement) as the equivalent of a simple statement. This provides a convenient means II-5-62B M~5035 Change 3 of compounding, or nesting, IF statements and gives rise to the following rule. If an IF or FIND statement is to appear following the connector THEN or the operator ELSE associated with another IF statement, the nested IF or FIND statement must appear within a statement block. (Note that VARY may directly follow THEN or ELSE because the VARY statement defines the start of a block.) Furthermore,. when a stateIJlent block appears within an IF statement, execution of all statements within the block is subject to the condition of the IF stat~ment. Examples 1. IF A THEN Bl. BEGIN $ FIND TAB(I) EQ B $ IF DATA FOUND THEN SET F TO 1 $ ELSE SET F TO 0 $ END B1 $ ELSE B2. BEGIN $ IF B LT 10 THEN SET B TO B+1 $ ELSE VARY, I WITHIN TAB $ SET TAB(I) TO 0 $ END $ END B2 $ In this example, the outer decision statement is logically equivalent to the form: IF A THEN block B1 ELSE block B2 $ II-5-62C. M-5035 Change 3 The BEGIN and END statements are necessary due to the nested FIND statement in Bl and the nested IF statement (with its nested VARY loop) in block B2. 2. IF· STATUS EQ 'START' THEN SET STATE TO 0 THEN VARY I WITHIN ANS $ SET ANS(I, SUM) TO 0 $ END THEN COMPUTE $ ELSE FINISH $ In this example. the VARY block is the equivalent of a simple statement within the compound conditional portion of the decision statement. Il-5-62D M-5035 Change 4 Index Ini tiallzation Condition False VARY Block Increment Indices and Evaluate UNTIL Condition Yes Next Statement Figure 5-1. VARY Flow l'Y1-5035 Change 4 5.7.2. 1. 1 Index Clause. An index clause specifies a data unit which is to be initialized before the first pass through the vary loop, incremented or decremented after each pass through the loop, and possibly compared against a limit after each pass through the loop in order to terminate the loop. Format loop-index initial-value increment final-value Explanation Loop-Index The name of the data unit to be varied, Initial-Value Optional. FROM followed by a constant, arithmetic expression, or data unit that specifies the beginning index value of the loop. If Increment omitte~, Optional. the initial value is O. BY followed by a constant, arithmetic expression, or data unito If this value is to be a decrement, BY must be followed by a minus sign. If omitted, the increment is 1. When varying within a .table by a negative value, the initial value is the number of items defined for the table or the major illdex, and the final value is O. II-5-64 M-5035 Change 4 One of the following: Final Value 1. May be THRD followed by a constant, arithmetic expression or data unit. This value signifies the last pass through the loop. 2. May be WITHIN followed by the name of a horizontal or vertical table, subtable t or like-table. The value assigned is the number of items defined for the table or the current value of the major index. The initial-value, incr~ment, and final-value may appear in any order within an index-clause. Refer to Paragraph 5.7.2.4 for examples of index-clauses. 5.7.2. 1. 2 WHILE Clause. The WHILE clause specifies a condition which is to be tested before each pass. If the WHILE condition is true, the pass will be executed. Format WHILE condition Explanation WHILE Specifies a WHILE clause. condition A Boolean-condition as defined in Paragraph 5.6.1, a validity condition as defined in Paragraph 5.6.3, or a parity condition as defined in Paragraph 5.6.4. Refer to Paragraph 5.7.2.4 for examples of WHILE clauses. II-5-65 1\'1-5035 Change 4 5.7.2.1.3 UNTIL Clause. The UNTIL clause specifies a condition which is to be tested after each pass through the VARY block. If the UNTIL clause is true, another pass through the VARY block will not be performed. Format UNTIL condition Explanation UNTIL Specifies an UNTIL clause. Condition A Boolean condition as defined in Paragraph 5.6, a validity condition as defined in Paragraph 5.6.3, or a parity condition as defined in Paragraph 5. 6.4. Refer to Paragraph 5.7.2.4 for examples of UNTIL clauses. 5.7.2.2 Resume (RESUME) Statement A RESUME statement specifies a transfer to the increment and test steps within a VARY block. This allows partial vary passes through a VARY block and a means to continue the VARY block. A RESUME statement may also be used in conjunction with a FIND statement, since FIND operations permit VARY operands. Format RESUME statement-name $ Explanation RESUME Specifies the RESUME operator. Statement Narne The name given to the VAR Y or FIN D statement to which this RESUME statement applies. II"'5-(j() M-5035 Change 4 5.7.2.3 End Vary Statement (END) The EN D vary statement specifies the conclusion of the vary block. If the loop is not yet completed, any loop indices are incremented and control is transferred to the initial statement within the vary block. If the loop has been completed, control is transferred to the statement following the END vary statement. Format ENU statement-name $ Exp lana t i on ENU Specifies the end of a vary block. S t a Lemen t Name The name, if any, given to the corresponding VARY statement. 5.7.2.4 Examples of VARY Blocks 1. The data unit APR is varied from starting point 1 (FROM) point 10 (TURU) by an implied faetor of I. val u e 0 f 'I NSERT' i nit em s 1 t h r 0 ugh 10 0 to thpf'nding The field FCX2 iss!'t to thp f tab 1e PAR. Whe nth e 100 pis completed, processing cont.inues with the statement following the ENU stat em(~nl • NOTE Upon loop terminat.ion (aftpr thp END statement), the loop index will not neeessarily eontain 1.h(1 value of thp ending point or tht' pndin~) point plus one. 11-5-67 1\1-5035 Change 4 2. ,S,T,EiP,,,., ,-e,y, IV)41RIY' ,L>,W, ,WtrlrtHtEaM o'&2t8cr1 J,s,EjT, ,FjCtg,RIT,(JZ)~,. J,), ,01 IEiNlb, IS, " , I , I I , II ,T,O, ,S,T,.,,,,, Cd, J~' It, I I I I I The data unit UW is varied according to the number of items in table FC2RT or the major index (if any). ·Each word 1 in all i terns of table F C 2R T wi 11 be set toO. , I I I I IVIAl 1 IK, ,W,r,TIHi5N, ,Ct;15,R, iBl)'J ,-,.L I EIFI ·1c..,II8,RI(I~.13UI ',#to,Tj ,0, ,DMEf(1 I C,A,T\,R,., f()]lowin~1 Whl'l1 CJBH(K,:3) is nonzpro, tl1l' statpnwnt PXI'(~ulpd. Th(~ ro transf('r ll1ah(~ ,i tile IF is nol pass Ihr()lI~lh Ihl' vary b]och Ilw twxl is accomp 1 j shed by I lip HESt:~lE s tat cnH'ut • . _~ ij£d<,J" Iv ~ JAj 16R,oM, I j _LLj_l.~.LLJsJ§Il ,X. i~~~1.21QL ...L.L.LJ-L.L-L ,'I1_.1±l..Jk. LJ.~_.} ..... L...L-LL.l._L_J-1_l Ii! JTjol 1 -1-. _. ; J __L-Ll kJFl fi 161Tl ~J! IlT1H-f"1.ti.L_jQ:.~!'QL_~~A[1~ J~L-LJ _ _j_~ .. ~._.2 .L..l.-l_~J)j ... J g,T,§~ I J~_.~ .. J._l.... L__ LJ __.4.-1-l.J-~~ ..Ll. -L.L I !. 1 .l.. I l.~J--.LL-L...L1 1 ,1 1 L-L.l_J.....LJ ...l L.~~ 1 1.J _L..L-.L..J. 1 1 , I ) '-1 1 J .1-1-L' I I I I l..J____ L...LL~ , 1 1 J-Li j I j '! :,~~g.: :: ~:;:~ ::~ :T.ol : YM~~: I ~. I I I T his III f •X J 1 IRIE'IS1U,MtEll6JT~,& a III pIe ill II ~ t rat (~ s t h (' t r an s fer 1 0 Ut I~ I J 1 I I I' sid (' () f a va r y b 1 0 e k. J Wh f' n X is Un',ltt'r than :2;1, control is transferred to stp» LATH outside of this vary block. Thp HESIJME stat(~ment will transfer control hack into 1h(' vary hloch. 11-5-70 1\1-5035 Change -1 tie VARY I FROM I WHILE TAB(I) VALID ~ SET TAB(I) TO TAB(I)+5 $ VARY I FROl\1 I \VITHIN TAB $ SET TAB(I) TO TAB(I)+5 $ END $ This example illustrates two methods of increnlenting a set of table itenls not necessarily starting with the first iteln. The diffetcnc"e between the two Inethods is the location of the test to deternline if another pass is to be perfornled. The VAR Y using the \VHILE clause will test before each pass, while the VARY using the \VITH1N will test after each pass. The WHILE VARY would be used for situations in which !!£ passes through the loop were desired because I does not contain a valid TAB index. 9. VARY I UNTIL SYl\tIBOL NOT H(,) $ SCAN $ "SET NAIHE(l) TO SYlVlBOL $ SCAN $ END $ The above example illustrates the use of an UNTIL clause to process a comnla separated list, storing each list itcnl in a name"table whose index is also initialized and incremented by the VARY block. Assuming SCAN updates the value of the HoU'erith variable SYl\IBOL, a test is made at the end of each pass to determine if another list item is specified. 11-5-71 M-5035 Change 4 10 0 VARY I, J THRU5 WHILE B1 UNTIL B2 $ TABPROC INPUT TIN(I) OUTPUT TOUT(l), BI, B2 $ END $ The above examples illustrate a loop which may be terminated by any of the three loop termination criteria: index, WHILE, or UNTIL. No passes will be made through the block if the Boolean variable B1 is false when first entering the block. TABPROC will set the first six items of table TOUT assuming neither Boolean variable B1 or B2 is set to false due to some condition diagnosed by TABPROC. 11. VARY I $ END $ VARY $ END $ The above examples illustrate two methods of programming "infinite" loopso The only difference between the loops is that in the first example, I will maintain a count of how many times the loop has been executed. 5. 7 . 3 FOR Block A FOR block consists of a FOR statement followed by a set of value blocks . and an END statement which terminates the FOR block. Execution of a FOR block will result in the execution of the value block one of whose values is the . same as the result of the FOR expression contained in the FOR statement. 11-5-72 M-5035 Change 4 Format statement-label. FOR-statement $ value-block value-block EN D statement-name $ Explanation Statement-label Optional. The name by which the FOR block is identified. FOR-statement Refer to Paragraph 5.7.3.• 1. Value-block Refer to Paragraph 5.7.3.2. END Specifies the end of the FOR block. Statement-name The name, if any, given to the FOR block . as specified in the FOR statement. Examples Refer to Paragraph 5.7. 3. 3. 5.7.3.1 FOR Statement The FOR statement specifies the controlling expression, type, and optional ELSE statement of a FOR block. Format FOR FOR-expression FOR-type ELSE-statement $ 1\1-5935 Change ·1 .Explanation FOR-expression Any arithmetic, Boolean, relational, literal, or status expression legal as an assignlnent expression as defined in Paragraphs 5. -1. 1. 1 through 5.4. 1. 4. FOR-type Optional. The presence of an explicit FOIt-type is denoted by a comma following the FOHexpression. The comma is followed by a data type containe.d in parenthesis. The data type nlay be any type allowed in a variahle declaration with the restriction of a rnaximum of eight characters for a Hollerith type. ,If the F(>I~-expression is a variable, field reference, typed item reference, or function reference and the FOR-type is not explicitly specified, the FOR block will have the type of the FOR-expression data unit. If the FOR- expression is a local or system index and the FOR-type is not explicitly specified, the FOR block will have a type of I 16 U.. If the FORexpression is an item word reference and the FOR-type is not explicitly specified, the FORblock will have a type of I 32 S. If the FOR- expression is not one of the above data units the FOR-type must be explicitly specified. If the FOR-type is explicitly specified, the FOR- expression must agree in type with the FOR-type U-5-74 1\1-5035 Chang(.) 4 acco'rding to rules of assignment specified in Paragraphs 5 . .J. 1. 1 through 5..1. 1. 4. Additionally, if the explicit FOH-type is Hollerith, the FOR-type 1l1UY not specify a greater nUlnber of characters than contained in the FOR-expression. ELSE-statement Optional. Refer to Paragraph 5. 6. 5. Execution of a FOR statenlent will cause the evaluation of the FORexpression, the required conversion, if any, to the FOR block type, and execution of the value block having the same value as the FORexpression. If the value of the FOR-expression docs not match any of the l. . OR block values and an ELSE-statement is not specified, the control will be transferred to the staten1ent following the FOR block. If the value of the FOR-expression docs 110t match any of the FOR block values and an ELSE-statclllCnt is s})ecified, the ELSE-statelncnt will be executed. After execution of the selected value block or the ELSE-statement, control will be transferred to the st.atement following the FOR block. Execution of a FOR statement is subject to the following rules: 1. If the FOR-expression is an arithmetic expression, it will be evaluated with "simulated receptacle" rules defined on Page II-5-4. 2. The result of a FOR~expression will be converted to the FOR block type as if the FOR-expression were being assigned to a variable having the FOR block type. II-5-75 M-5035 Change 4 3. To produce correct code, the'FOR block type ~ express all possible values which may be produced by the FORexpression o For example, if an arithmetic FOR-expression produces a negative value, the FOR block type must be signed. This rule does not imply that a value block must be specified for each possible value which may be produced by the FOR-expression. 4. To produce optimal code, the FOR block type should express only those values which may be produced by the FOR-expression. For example, if an arithmetic FOR-expression will always produce only the integers between 0 and 7, the FOR block should be typed I 3 U. 5.7. 3.2 Value Block A value block is a group of statements which is executed when the evaluation of the associated FOR-expression results in one of the constant values associated with the value block. Format Statement-label. BEGIN value(s) $ . dynamic statements EN D statement name $ Explanation Statement-label Optional. The name by which the value block is identified., n-5-76 1\[-5035 Change -l Specifies the start of a value block (when BEGIN followed by constants). Constants that are associated with the value Value(s) block. Multiple values are separated by commas. The constant must agree, in type with the FOR block type. If the constant is Hollerith, it will be blank filled to the right to the size of the FOR block type. Statement-name The name, if any, given to the value block as specified on the BEGIN statement. 5. 7. 3. 3 FOR Block Examples 1. FOR X $ VA. BEGIN 0, 7 $ CASEA INPUT H($) $ END VA $ 'VB. BEGIN 4 $ CASEB INPUT H(,) $ END VB $ VC. ',BEGIN 1,2,3 $ SET ERCOD TO 16 $ END VC $ END $ Assuming X is a local-index, the appropriate value block will be executed if X has the value 0, 1,2,3,4, or 7. If X is 5,6 or greater than 7, the statement following the FOR block will be executed. If it is known that at the time of execution of the FOR statement, X will never be greater than 7, the FOR statement should be coded: FOR X, (I 3 U) $ 11-5-77 1\:1~5035 Change 4 2. FBLOCA. FOR F(X)+2, (1646S) BEGIN -7, -5, 7 $ VBLOC. VARY UNTIL X GTEQ 0 $ SET X TO X+F(X) $ END VBLOC $ SET MES TOH( ) $ END $ BEGIN -1, 0, 1 $ FBLOCB. FOR H(Y) ELSE SET MES TO H(*****) THEN SET X TO 1 $ BEGIN H(Tl) $ SET MSG TO H(AA) $ SET X TO 5 $ END $ BEGIN H(Dl), H(T2) $ SET MES TO H(??) $ SET X TO 7 $ END $ BEGIN H(DIA) $' SET MES TO H(ERROR) $ SET X TO 0 $ END $ ENDFBLOCB $ END $ END FBLOCA $ The value block containing VBLOC will be executed if the arithmetic expression F(X)+2 results in -7, -5, or 7. II-5-78 The value block containing 1\1-5035 Change -1 F BLOC B will be executed if the expressions results in -1,0, or 1. If none of these values result, the control will be transferred to the statement following block FBLOCA. FBLOCB is a FOR block whose FOR-expression is an H 4 type function. returns the value H(Tl.6.6), H(Dl.6.6), ,H(T2.6~), II the function or H(DIA.6), X and 1\IES will be set by the appropriate value blocks. Otherwise, X and 1\-[ ES will be set by the execution of the FOR ELSE clause. 3. FOR T(J) ELSE BEGIN $ VARY UNTIL T(J) EQ 'FREE' $ 'END $ SET T(J) TO 'BUSY' $ END $ BEGIN '101' $ VARY UNTIL T(J+l) EQ 'FREE' $ END $ END $ BEGIN' '102' $ VARY UNTIL T(J+2) EQ 'FREE' $ END $ END $ BEGIN 'FREE' $ END $ END $ Example 3 demonstrates a possible ~sage of a FOR block used to control wait loops in a multiprocessing environment. where the processors communicate the system status through a table with status typed items. Note that the value block whose value is 'FREE' contains no dynamic statements. II-5-79/U-5-80 Blank M-5035 SECTION 6 INPUT/OUTPUT STATEMENTS The CMS-2 language i~cludes a number of statements that enable the user's program to communicate with peripheral equipment. The operators for these statements are summarized below: General Operators INPUT OUTPUT FORMAT ENCODE DECODE Special File Handling Operators FILE OPEN ENDFILE CLOSE POS FIL LENGllI DEFID CHECKID To use these statements successfully, the following restriction must be observed: The CMS-2 Monitor must be in core during user-program execution. This requirement arises because of Compiler-generated procedure calls to input/output run-.time routines, which are designed to link with the Monitor and communicate with its input/output drivers. 6.1 INPUT/OUTPUT OPERATIONS For many input/output purposes~ a user's program requirements can be most simply met wi th: only the INPUT, OUTPUT and FORMAT s ta tements. In these general situations, the CMS-2· operating system provides system-defined names by which the user may reference the hardware device involved with the input or output function. These names and their associated devices, hereafter referred to as startdard files, are described in Table 6-1. 11-6-1 M-5035 TABLE 6-1. CMS-2 OPERATING SYSTEM STANDARD FILES FILE NAME FILE DEVICE READ PRINT Card reader Printer PUNCH Card punch OCM Operator communication medium For those cases in which the user wishes to perform input/output operations using devices other than standard devices, special are provided. fil~-handling operators These operat-ors are discussed in paragraph 6.3 (Nonstandard File Control). The INPUT and OUTPUT commands are used to transmit data between a hardware device and a user's program. Figure 6-1. These commands are functionally illustrated in Each input or output statement causes the Compiler to generate calls to particular run-time routines. These routines interface with the Moni tor to cause immediate transfer of data between a buffer area and the hardware device. For standard files, the run-time routines provide the buffer area. If formatting (conversion of data from one representation form to another) is required, transformation routines that utilize the specifications of the FORMAT statement as their inputs are provided. These transformations occur in the input/output flow as illustrated in Figure 6-1. Prior to each input or output operation, the buffer area associated with that file name is preset to blanks if the data is to be formatted, and to zeros if the data does not have formatting specified. For standard input/output operations where no format statement is prescribed, the input card image is interpreted as Hollerith characters and stored with the internal octal representation of the individual character. During 6utput, the word contents are interpreted in 8-bit Hollerith characters and are printed. 11-6-2 M-5035 Us er Req ui res Formatting User Does Not Require Formatting External Hardware Device External Hardware Device Output Buffer Area Buffer Area Data Conversion Based on Format Statement Input User's Data Area User's Data Area Figure 6-1. Input/Output Data Flow 11-6-3 M-5035 6.101 INPUT Statement This statement ~irects an operation to input da1a from the device associated with the specified file name. When tlds command is used to transfer data into an entire table by means of whole-tahle referencing~ the data is moved sequentially word-by-word without regard to the defined table structure; however, when all or part of a tahle is specified by means of .Item referencing, the data transfer is performed hy items o If a FOHMAT declaration is referenced, automatic conversion o~curs. Forma t INPUT file-name receptacle-data-list format-name $ Explanation INPUT Specifies an INPUT operationo Fi l'e Name The name of a-standard file or the name of a nonstandard file that has been defined with a FILE declaration statement. Legal standard file names for input are: 1. OCM - specifies the,operator communication medium. 2. READ - specifies the operating system's input device for punched card images. 'Receptacle Data List One or more of the following CMS-2 data structures o If more than one receptacle is to be specified, the names, separated by commas, are gathered into a list which is enclosed in parentheses. 1. The name of a table, subtable, like-table or item~area. This name indicates that the entire structure is to be used. 2. The name of a major index of a table, subtable or like-table. :L The name of a variahlf!. M-5035 Change 2 110 A speeifj(~ item reference of a table, subtable, or like-table, which may be indexed by a variable or a numeric parameter. This indicates that every word of this item is to be used. 5. A field or fields of some specific item within a table, subtable, like-table or item-area. Multiple field references can be made to any item specified; these references must be separated by commas. 6. A series of items of a table, like-table or subtable that may be modified by field reference(s). This modification is accomplished by bracketing the starting item number in parentheses followed by three periods followed by the ending item number and bracketed in parentheses, such as: HIGHT «A) ••• (B), MI, M2) where Ml and M2 are fields within the table. 7. A series of items in an array: ARRAY «K,L,M) ••• (N,P,Q» Every word in the referenced items is filled. Format Name Optional. Refers to the name of a previously defined FORMAT declaration. If a format name is specified, the data units in the receptacle data list must have internal data attributes conversion format type. II-6~5 ~ompatible with the external M-5035 Change 2 Examples 1 0 ITt If aJ.., fj lelA IBI 1M i'/I Ii I DI I I I , I I I I" I I I , I I , I ,II I I I I I I , I I I I I I I I I I. I I: In this example, one record is read from the device described by the FILE declaration LBR and is transferred to fill each word of the table CAB. 2. Iljhl81L,Ei J)lzlC. l1i 1/1131 I I I I I I I I -I I· I I ,., I 1101 ~I 1 I , I , I 1, , I I 'I I I I I I I I , ~:~~Q:~ :~JA:tr:E: ~I:t:~(~): ~: ::::: ::::::: I : : : I I: One record is read from the device described by the FILE declaration IMAGE and is transferred, filling each word of item 2 in table DICT. 3. !l5D~,M'''I7i IEIDtRlMtfl j3,z,!>-", 101(1.3, ), ~I Ifill LIEI ,:r111 pi ,HI Iii' I ,RI I2,DI 1""T,2 ,.;,. I ,, ,I 1 ,lOI lSI I I I -I I·' I I I- I I I I I I I I -II I I I I , I I I " I I I I I I I I I I I One record is read from the device MT2; assume that it is the Hollerith string: (20 characters) When the format FORMA is applied to tbis are: MIOOR (0,0) 35°10 MIM>R (1,0 ) 201 MlOOR (2,0) MIOOR (3,0) 10 110 7778 11-6-6 string~· the results in memory M-5035 Change 2 6.1.2 OUTPUT Statement The OUTPUT statement dire(~ts an operat.ion to output da1JJ to associated with the file name. the devir,e Data transferred from an entire table by an OUTPUT command using whole-table referencing is moved sequentially word-byword without regard to the defined table structure o However, when all or part of a table is specified using item referencing, the data transfer is performed by items. takes place. If a FORMAT declaration is referenced, automatic conversion Format OUTPUT file-name source-data-list format-name $ Expla na ti on OUTPUT Specifies an File Name The name of a FILE declaration or a standard file. OUTPU~ operation. Legal standard files for OUTPUT are: Source D~taList OCM Operator communication medium. PRINT Systems output for printer listing. PUNCH Systems output for card punching. A constant or one or more of the operands as described for the INPUT statement. If the FORMAT declaration describes a Hollerith string only, the source data parameter is not required. If more than one data unit is to be acted upon, the names are gathered into a list, separated by commas and enclosed in parentheses. Format Name Optional. An operand referring to a previously defined FORMAT declaration. If a format name is is specified, the data units in the source data list must have internal data attributes compatible with the external conversion format type. 11-6-7 M-5035 Examples 111 The data to be written on the device identified' in the file named PRINT is contained in the variable DICT. The optional operand TERRY, refers to a previously defined FORMAT declaration. The data contained in the tables POS, SPEED, and 10 is to be written on the device identified in the file named DATUM. The optional operator TRUNC refers to a previously defined FORMAT declaration. 3. In reference to the data structure of Example 3, paragraph 6.1.1, assume that table MAJOR is the result of the INPUT command. The values in MINOR (0,0) through MINOR (3,0) are transformed to the Hollerith character string: tJ,. .t:.. 350 Illl 20 1 t:. i. Illl 1777 Il t:.. (20 cha racters) which is then transferred as one record to the hardware device MT2. 6.1.3 FORMAT Declaration The FORMAT. declaration describes the conversion of data between internal and external forms. The external form is usually a Hollerith string containing, in addition to the data, certa1n spa~ing and control information. Data existing in this external form is referred to as ,formatted data and is transmitted to and from an external device in this form. When the user requires data conversion, he references the FORMAT declarative's name in the INPUT or OUTPUT command. The FORMAT declaration is always referenced by the ENCODE and DECODE statements when they are utilized ina program. declarations may appear only in data designs. 11-6-8 FORMAT M-5035 Forma t Expla na t ion FORM.'\T Specifies the FORMAT DECLARATION. Name The identifier to he used to reference this FORMAT declar~ tion. t\ format descriptor. Q. , 1 form ~nd The format descriptors indicate the arrangement of data and the types of conversions to be performed. Numeric eonversion types are summarized helow. Format DescriPtor Internal Form External Form Fixed-point hinary IW.d Fixed-point decimal Floating-point binary Fw.d Fixed-point decimal binary EW.d Floating-point decimal Ow.d Fixed-point octal Floating~point Fixed-point binary I nth eli s t 0 f forma t des c rip to r s; t hat follow s, w i san uns i g ned i nt eg e r representing the maximum width (number of characters) of the field in the external medium. printer line. Integer w must not exceed the number of characters in one Descriptor d'is an unsigned integer representing thenumher of characters in the field that appears to the right of the hinary or decimal point. The maximum width of the field w must include space for signs, radix point~, and exponent descriptions. Hence, field d must he less than w. The d-field is optional if the internal fixed-point hinary value is an integer. 11-6-9 1\1-5035 Change 4 Format Descriptor Iw~ d Function Specifies conversion of data between internal fixed-point binary and an external fixed-point decimal Hollerith character string. w Fw.d ~ d+2. For a positive value, For a negative value, w ~ d+3. Specifies conversion of data between internal floating-point binary and external f~ed-point positive value, W decimal. L d+2. For a For a negative value w L d+3. Ewou Specifies conversion of data between internal floating-point binary and external floating-point decimal. The acceptable forms of input fields for the E conversion (floating-point) are: +0. mantissa E ,::00 mantissa E ~ exponent I I"'!"6-1 0 M-5035 The mantissa may be of any ~agnitude; the allowable exponent range depends upon the object machine. The output form for E conversion is: !9.xxx ••. xxxE~ee where: d is the number of digits in the mantissa. w includes all characters. Thus, w ~ 7, where the 7 accounts for the specific characters ±p.E~ee of the above output form. Ow.d Specifies the conversion of data between internal fixed-point binary and external fixed-point octal. For a positive value, w must be ~ 2. For a negative value, w must be ~ 3. other formats descriptors that ma,y appear are described below. Format Descriptor Function H (string of characters) Specifies an alphanumeric field in the form H(ABC), for example, where ABC represents a string. For input, an H (string) specification causes n characters to be skipped in the input record. For output, the string of characters specified within the parentheses is the output image., Aw Specifies the first w characters of an alphanumeric data unit in a transfer to or fr-:>m an input/output buffer. Aw appears in the FORMAT declaration. The related 11-6-11 M-5035 Format Descriptor Function data unit in the input/output reference can have more than w characters. The remaining characters are ignored. If the data unit has less than w characters, the rightmos~ characters are truncated on input and trailing spaces are inserted on output. Lw Specifies the sam~ as Aw, only here the last w characters of the data unit are used. Everything else said under Aw applies here. wX Specifies skip w characters of an input record or insert w spaces in an output record. Tw Specifies a position designator for the buffer of a record input/output file. w indicates the character position within the buffer. The count starts with 0 at the start of the buffer. The FORMAT statement can have many !'St one for every data word or constant. T is illegal for files having a length descriptor of S. n format descriptor Specifies repetition of a format descripter n times, such as n Ew.d. Slash specifies end of a record or, when used sequentially, indicates the number of records to be skipped or inserted: n+l consecutive slashes on input cause n records to be skipped. 0+1 consecutjve slashes on output cause n blank records to be prod uced • 11-6-12 M-5035 Format Format Descriptor m(group of descriptors) Specifies the repetition of a group of format descriptors within the parentheses m times. No other parentheses except for H descriptors are allowed within the group of descriptors. Printer carriage Appear in an H string. control characters spacing, page eject, etc. They specify These control characters appear as the first Hollerith character in the first word of each record. If the character is not one of the following, it is replaced with a blank. Carriage-Control Character Operation blank Single space and print line. o Double space and print line. Triple space and print line. Page eject and print I line. H Cancel headers, page eject and print line. A Cancel headers, page eject, print line and save location and length of line as 8 major header. B Cancel lower-level headers, double space, print line and save 11-6-13 M-5035 Carriage-Control Character Operation location and length of line as a minor header. Cancel lower-level headers, single space, C print line and save location and length of line as a minor header. If classification, major header, and/or minor header lines are wanted, they will be printed in the following order each time a page eject is necessary: classification, major header with page number, minor header B, minor header C. The page number will occur even if a major header is not used. It is not necessary to specify consecutive levels of minor header information. It is the programmer's responsibility to ensure that· the specified type of format conversion is compatible with the declared data unit mode (for example, F-type conversion should not be applied to integer data units). If the FORMAT descriptors are exhausted and the target list not yet filled, the FORMAT,is restarted. Examples 1. Given the external string of characters 350274-0162E+o50703 with format the quantities s'tored on a read or decode statements are: 35, 27.4, -l.62XIO5 , 703 11-6-14 M-5035 2. Given the internal quantities 3 417, -320, 0.536xlO and octal 627 with format the string of characters resulting from an OUTPUT or ENCODE statement is: l417*******+O.536E+03~27 where the asterisks indicate that the value -320 cannot be encoded within an F6.2 format descriptor. 3~ Given the internal qu~ntities 27, H(XY Z), 74. 51, H(JKLM) with the format ,F,D,#t,M,A,T, ,ttIA,'" ,F 1'1·,2,"1 ,HI(,«,Re-~ 1'1 ,L,~,I 1 1 the string of characters resulting from an OUTPUT or ENCODE statement is: 27.00RAGYZ 74.5IMODPJK 6.2 ENCODE AND DECODE OPERATIONS The ENCODE and DECODE statements direct run-time routines to transfer data internally from one area of the computer to another, while converting the data from nonformatted to formatted (encoding) or vice versa (decoding). The transformation is specified by a FORMAT declaration. The ENCODE and DECODE statements are analogous to INPUT arid OUfPUT statements that reference a FORMAT declarative, except that no transmission to an I/Odevice takes place, and the buffer area involved is a data unit specified by the programmer. ,The rules previously discussed regarding formatted I/O also apply to the decode/encode operations. 11-6-15 M-5035 Change 1 When inputting records of different types, a DECODE statement can be used to reformat the data after the record type has been examined. The ENCODE statement can be used to format data that is to be modified before being output. These statements are also valuable for debugging by simulating input/output operations in memory. The ENCODE statement specifies that the data contained in the data units named in the source list is to be converted as specified in the named format declaration and packed into a character string identified by the formatted data-unit name. The DECODE statement spec~fies that the character string identified by the formatted data-unit name is to be converted as specified in the named format declaration and placed in the data units named in the target list. Format ENCODE formatted-data-target unformatted-source-list format-name $ DECODE formatted-data-source unformatted-target-list format-name $ Explanation ENCODE Specifies the encoding operation of converting data from unformatted to formatted form. DECODE Specifies the decoding operation of converting data from formatted to unformatted form. Formatted Data Target The data-unit na:rp.e that will receive the formatted character string (starting in character position 0). This identifier may refer to a single word or multiword data unit with Hollerith attributes. 11-6-16 M-5035 Change 2 Formatted Data Source The data-unit name containing the character string (starting in character position 0) to be converted to unformatted data. This identifier may refer to a single word or a multiword data unit with Hollerith attributes. Unformatted Source List One or more data units containing the data to be converted to character string form. If more than one data unit are specified, they are collected together, separated by commas, and enclosed in parentheses. These data units must have internal data type attributes compatible with the external conversion format type. Unformatted Target List One or more data units that will receive the unformatted data after conversion. If more than one data unit is specified, they are collected together, separated by commas, and enclosed in parentheses. These data 'units must have internal data type attributes compatible with the external version format type. Format Narne The identifier of the format. 11-6-17 con~ M-5035 Example "- PIC 1- ,btl>, If 1 I , I I .1 I , . I I I I I I I I I I L ,el I I I I I I I I I I , , I I I I I -, , I I I I , I I I I I , I I I I I I I I -, I , I . I . I I I I I I I I , 1 'I . I I I I I I I I I I I , I I I I I I I I . I I I I I I I· I I I In this example, the character string JOE· is to be packed with the value of VRBLs AI, A2 and A3 as indicated by the format BILL. The result will be JOE: 223GOBAC12.14 6.3, NONSTANDARD FILE CONTROL The special file operators presented in the remainder of this section are not to be used with the standard file names listed in Table 6-1. In addition to the CMS-2 operating system standard file names and their associated devices, each operating system provides other devices for the user. These devices consist principally of magnetic tape and paper tape punch units. The principal difference in using nonstandard devices versus standard devices is the requirement for the user to describe the physical characteristics of the data to be transferred and ·to state the name of the device on which input/ output operations are to occur. These attributes are collected in a fermal declarative called a FILE declaration and identified by a user-supplied file name. This file name has significance only within the user's program. It provides the linkage between the attributes described in the file declarative 5tatement and the run-time routines that interface with the Monitor to achieve satisfactory input/output results. 11-6-10 Th«! followinu d«~finilions are necp.ssary hefore proceeding with th'e discussion of nonstandard file control. A group of adjacent., related dat.a items such as the individual f'f1t tj~~ in a telephone book for name, address and telephone number. This organization has significance only to the user and is not necessarily a physically definable entity. Physical record A group of adjacent, related logical records defined as a unit such as the alphabetic groupings of telephone book entries. On magnetic tape, a physical record is delimited at the beginning and end by inter-record gaps. These gaps are recognizable by the h~rdware device. A physical record may (~ontain one (unblocked) or mo r .than one (blocked) logical records. ' Blocking is the technique used to reduce the wasted space of inter-record gaps between unblocked logical records. Physical file A group of adjacent, related, physical records defined as a unit such as the complete telephone book for one city. On magnetic tape, a physical file is delimited at the beginning and end by an end-of-file mark (for the first ph~sical file of a tape, it's beginning is signified by a beginning-of-tape mark). These marks are recognizable by t'he hardware handling device. Thus, the physical file comprises one or more physical records. 11-6-19 M-5035 Peripheral file device That mechanical device which is the repository for a group of adjacent, not necessarily related, physical files. A file device may contain one or more physical files as spact' permits. File-name A unique, user-assigned name to provide referencing from the dynamic input/output command and control statements to the run-time routines. 6.3.1 FILE Declaration This declaration is mandatory for all input/output functions involving nonstandard file devices. The ~ILE declar~tion are to be processed. defines the environment in which one or more physical files The declaration assigns a file name for dynamic statement referencing, identifies the symbolic name assigned to the actual hardware device, and declares that all data to be processe~ on the named hardward device is physically organized as described in the declarative statement. The FILE declaration indicates the hardware device and reserves two areas. The first area contains the record description r the file status variable, device address, space for keeping track of file and record positions, .nd in case of a file having the length descriptor Sf the position pointers. The second area reserved is a buffer, equal in size to the maximum record that may be transmitted. For record input/output the buffer area does not accumulate data for blocking purposes, so that each INPur or OUfPUT statement causes immediate communication with the device. If the file declaration contains the len'gth descriptor S, data is accumulated in a fixed size stream buffer and output is under control of run-time routines. The number of words transferred between the buffer and the data area depends upon the number of words specified in the data list of the input or output statement rather than the record length. are request(~ by specifying a ~O-word For example, if 50 words of input table in an input statement and if the input record is only 10 words long, the first 10 words of the input record are II-6-20 M-5035 assigned to the first 10 words of the table. and the remainder of the table is Sht to blanks or 0 depending on the record type. If 50 words of input are requested and the input record is 100 words long, the first 50 words of the input record would be transferred and the remaining 50 words would be lost. The INPLn' and OmpUT statements, when referencing a FORMAT declarative, imply either an automatic decode from the FILE declaration buffer area or an automatic encode into the FILE declaration buffer area. The FILE declaration must occur in one of the user's data design areas. ware device may be referenced in more than one FILE declaration. A hard- Standard hardware units have implied FILE declarations; the user is not required to declare them. Format FILE file-name type maximum-no.-of-records length-descriptor maximum-record-size hardware-name states WITHLBL $ Explanation FILE Specifies a FILE declarative. File Name An identifier to be used to reference this information. Type One of the following: H - records are all Hollerith. B - records are all binary. Maximum Number of Records I An integer or tag that specifies the maximum number of records that may be accessed in a physical file. If 0 is specified, any number of records may be accessed. Length" Descriptor One of the following: R - the size of each record is equal to the maximum length as defined by the record size (rigid length). I I -() "21 M-5035 v - The size of each record is determined by the amount of data transferred to from the ~nd file buffer and is not to exceed the maximum length as defined by the record size (variable length). S - The size of each record is rigid. Data is accumulated in the buffer gradually. Maximum Record Size An integer or tag that specifies the maximum length of the record (meaning number of words if the type is B and number of characters if the type i~ H). If 0 is specified, the size of the operand used in the particul~r input/output statement determines the record length. In this case,' no buffer area is set aside, and data is transferred directly betw~en area and the input/output device. the data Zero is illegal with a length descriptor of S. Hardware Name The name of any external storage device in a computer's environment. Run-time routines will provide direct interface with peripheral equipment (printer, punch, magnetic tapes, etc.). 11-6-22 M-5035 Change 2 Examples of hardware names, which may vary for each installation: MT2 TTY Magnetic tape input and output units. Teletype. An optional parameter that defines one or more states, which may be tested between input/output operations on this device. Each state is a mnemonic enclosed in single primes and corresponds to one of the ~umeric values States returned by the Monitor after each I/O . operation. (See paragraph 2.3.1.4 Volume I). Testing one or more of these states may be necessary to avoid an input/output abort (see paragraph 6.4 for format to tes t s ta tes ).• Optional. Indicates that this file has or will have a label lor identification as its first entry preceding the first record. WITHLBL Examples 1. ·lfi/Illti Ill6T.Et I' I i I I I I I 1M 1,s,2fQ(l is 1/12101 Y'lT12 I' rBuLs,Yt '", "If,O,R,MA,L'", I',E,O,FI"'I ,\,E,B1R,/, $1 The file LBR has a maximum of 3200 Hollerith-type records, whose sizes are rigid (120 characters) .. The external storage device named is MT2, whose possible states are 'BUSY't 'NORMAL', 'EOF', and 'ERR'. 2. t8/1t.141 I I , II I(28s1JcJ t8 17f()/QI I \t1 191801 ""rtf, ,'",s1YI' 1,1 II I I I' 1601EI' I, IMlIIM''''L! 1$1 I I , 'I I I I' WI6rM1' I, I I I I I I The file OBJC is a binary file containing up to 700 records with the name OBJC as the first record. The record size is variable and may have a maximum of 480 words. If the user tests an , EOF' hardware state, Monitor hardware state-2 will be tested. 11-6-23 I I M-5035 6.3.2 OPEN Statement Before data can be transmitted between a user's program and an external nonstandard device by means of the INPUT or OUTPUf statements, the run-time routines must be informeo that any reference using the FILE declaration name is legitimate and expected. The OPEN command instructs the hardware device specified by the FILE declaration to be accessible for input, output or both. E5tecution of an OPEN statement does not establish or guarantee the physical readiness of the hardware device. In addition, a file that is open may not be reopened until it has first been closed. That is, if a file is to be changed from an input unit to a scratch unit, it must be closed and reopened as a scratch unit. Format OPEN file~name action $ Explanation OPEN Specifies an OPEN operation. File Name The identifier of the file . .Action One of the following: INPUT OlJIPUT SCRATCH (both input and output allowed) Example 108M 1l,t&eIIIA4AUIZ1 4, I I I J I I I I I I I I, I I I I I I I I I This statement causes the file identified as LBR to be activated and specifies use as INPUT only. 6.3.3 KNDFILE Statement if a user wishes to group records together, he may form a physical file. A physical file of data is any set of sequential physical records delimited by 11-6-24 M-5035 Change 1 an end-of-file mark. These groupings may.be used for device positioning; a device may cont.ain any number of these marks. The ENUflLE statement is used to place an end-of-file mark on those hardware devices to which it is applicable.· Writing an end-of-file automatically sets to 0 the record count associated with the file name of the file declarative. There is no change in the physical position of the hardware device as a result of this command. Format ENDF1LE file-name $ Explanation ENDF1LE Produces an end-of-file mark on a hardware device~ File Name The name of a previously opened nonstandard file. The parameter OUTPUT or SCRATCH must be included in the OPEN operation for this file name. Example I, ,-, I I I I , , , , , I Ie J J ,EJUj,£, I,Lt4j The file declaration LBR, specifying hardware device MT2, is opened for both input and output. The ENDF1LE operation causes an end-of- 11-6-25 M-5035 file mark to be placed on the hardware device MT2, the record count for LBR is set to 0, and the file count is incremented by one. 6.3.4 CLOSE Statement The CLOSE oper~tion deactiv~tes the specified file by setting an indicator that this file is not activated. Standard devices cannot be closed. Closi~g an dutput file having a length descriptor of S will also send the last unfinished buffer to output. Closing a tape file does not imply rewinding the tape. A SET FIL (file) to 0 or -0 will rewind the tape. Setting to -0 will rewind tpe tape, release the device, and close the file (see paragraph 6.5.1). Format CLOSE file-name $ Explanation CLOSE Specifies a CLOSE operation. File Name The identifier of the file. Example I I This statement causes the file identifier as LBR to be deactivated. 6.4 DEVICE STATE CHECKING In performing any input/output, various states may b.e flagged by the Moni tor. These states might indicate such errors as end of input conditions either as a hardware problem or system problem. Each device may have various associated states that may be checked by the user. Those states which are of interest to the user may be specified in the FILE declaration by unique mnemonics enclosed in single primes. 1 1-6-26 M-5035 Change 2 The states may be tested by use and this unique mnemonic. cit th~'IF statement containing the file name The test checks equality between the current status of the file and the value assigned to the unique mnemonic. All runtime I/O operations are completed before returning to user's program. It should be noted that this test is dependent upon the hardware and Monitor system. The list of states appearing in the FILE declaration must correspond to the numeric status values returned by the Monitor (see Volume I). Format IF file-name EQ or NOT state THEN expression Explanation IF Specifies an IF statement. File Name The name of a FILE declaration. EQ or NOT Specified relational operators. State Any mnemonic designated in the FILE declaration. It must be enclosed in single primes. THEN A CMS-2 connector word. Expression Any CMS-2 dynamic statement. Examples The status variable of the FILE LBR is tested. If the condition indicated by the mnemonic 'NRM' is true,"a transfer to ENJOB is executed. 11-6-27 $ M-5035 Change 1 2. ,Fj I,L,E, ,I,/t',Plr,c, ,H.,S;O,D, I , I I I I I ." I I I ·1-- I I ,R, 'JEiOJE! '", 1/ 1%")' IM,T e; I ',E1RIRLSI 1', , I , , , , I , I I I , I I , I I I I I i I I I lIB·btl' r V'.. oU:lRIMI' .. I I.JP , " . !t!.1._ _ ~ I r$, I' I I I I I The state for 'EOF' (Monitor hardware status code 2) in the file defined by INPTC is tested. to ALPHA is executed. If the condition is true, a transfer 6.5 DEVICE POSITIONING In order to retrieve data from a device more efficiently, the programmer may separate .his data into one or more files or subfiles. The run-time routines will recognize these files by end-of-file marks and maintain position counters for the number of files passed and a counter for the number of records passed within a given file. The SET statement in conjunction with the functional modifiers POS (record position), FIL (file position) and LENGTH may be used to physically position a device, determine its present position or determine the length of a record • . Positioning requests are not applicable to all devices and incorrect use of the above modifie.rs will result in an input/output error indication. 6.5.1 POSitioning By Files A unit may be positioned forward or backward by a 'number of files or subfiles. The unit is always automatically positioned following the ead-of-file mark. Format SET F1L(name) TO signed-integer-constant or data-unit-name 11-6-28 $ M-5035 Explanation \ Specifies a Sb1' operation. SET Specifies the positioning (FIL) of the unit FIL(name) specified by the name of a FILE declaration. TO CMS-2 separator. Signed Integer Constant Specifies the number of files the unit is to be or Data-Unit Name pOSitioned. The sign indicates the direction of the movement: + forwarrl and - backward. If a data name is used, it must contain an integer. A data-unit name containing a 0 will cause the device to be positioned to the beginning, If -0 is specified, the unit is locked out from further reference. Examples 1. If the variable LOCI contains a 4, the device referenced in file declaration NARFLAG will be positioned forward four file marks. The same statement may be used to backspace four LOCI to -4. fiI~s by setting If a request" is given to backspace more files than are written on the device; the device is positioned at the beginning. A request to backspace one file mark causes the tape to be positioned at the start of the current file. 11-6-29 M-5035 2. ,",T ,FI3, ,3,01°, lFI/ILIE', IVIRI81l1 I , I I I I ,F,',L.IP e151 Ir , , , " I ,I 1, , , I ·1 , , , I ,R, ,i,LID, ,11 IT 11 j3, ,-$, , ,il~ IU I ," ,I ·1 I I I I 1I Q,PIFIN, IM,T,FI3, IRIE',AI)I ~ J I I I I ,, 1 , 'I , , I , ,I ,, ,,, ) ,, , , , , , ,, ,, I i IAI L, PI HIA,. I , ISltlTI I F I L IMIT IF I 3,) , ITIO, 1,;/1'll1 o ,s1 ~I , , I I I , I , , II I I I I' , I , I ,, , , -I , , I I I I , , , I I I I I IS,E,T, , FI /,L,(I"'I T IF,"3 I) I IT,O, 1°1 ~I I I ~EIT IA, I , 'I , I , , I I ·1 I , I I I I , , ,. 1 1 I I I I I 1 I ,I I I I I , 1 I 1 I _, I I J I 6AII\IMI AI.' I , , I I( 1' 1 I 1 , I 1-S,EITi I fi'l I , , I , , L,{,H,TIF,'3, ), ,710, I-,D I ·1\1 I 1 1 1 Statement ALPHA causes the hardware device Ml'13 to be positioned forward as many files as indicated in the variable FILPOS~ Statement BETA causes the hardware device MTl3 to be set to the beginning position 0: By statement GAMMA, the hardware device is set to the beginning, locked out from further reference, and the FILE MTF3 is closed. 6.5.2 Each time, the file counter is adjusted. Positioning by Records A unit may be positioned forward or backward a number of records within the current file. Attempted record positioning beyond the bounds of the current file will cause the device to be positioned at the beginning or end of the current file •. Record positioning should not be used with stream files. Format SET POS(name) TO signed-integer-constant or data-unit-name 11-6-30 $ M-5035 Change 1 Explanation SET Specifies a SET operation. POS Specifies the positioning (POS) of the unit named by a FILE declaration. TO CMS-2 separator. Signed Integer Constant Specifies the number of records to be or backward spaced. or Data-Unit Name forwa~d Examples 1. In this example, the file named ~OOK is sp~ced fo~ward the number of record positions contained in the variable named SCREEN. 2. Iii' 1Lit, l}fjA/tiIF II, L/ Sit, 18, ,D 1 I I 1 I " I I I I I I , I I I I -, 1 I 1 1 I I , I I I I I It, 13,3'''1 I , 1 I 1 1 , I I 1 I I I I I I "'IT/il 1 I I , I', :-:3: :~ : : I : : : : : :: : : : : eIPI~,IJI,MIAI4IFIIILIEI~1 ,IN,P,U!T"$,,., I ~:£:T: :P:O:$:{~:~:~:F:':L:~~): Irk: l'IBIZi' I) I 'IN' .Rlte'l, , I'G,ol"I'1 II I II" I', The hardware device described as Mf4 is positioned three records backwards, relative to its current position. 6.6 FILE AND RECORD POSITION DETERMINATION The record file or subfile position within the current file can be determined with the use of the POS or FIL modifiers. Format SET data-unit-name TO FIL(name) 11-6-31 or POS(name) $ M-5035 Explanation SET .Specifies a SET operation. Data Unit Name The location where record position is to be stored. TO CMS-2 separator. FIL(name) or POS(rtame) Specifies the file position (FIL) or record position (POS) of the unit specified by the name of a FILE declaration. Example ,5/II.IEI li/SIRI 1M rf l'l 13 ,L,B,RIF",L , .xl iVI~8ILI 1L.1~ItIP,OISI e:1 ,VIRI 8 I l 1 1·1 I'" ,,-tID ID I 1,tt,f ,2. 1 Iii&' ,1I1 r\1 I!,'I lUI 1$" ~I I I, I. I I I I I, .I I I I I I I I I I I I I I I I PIPIEi'" IL,'Ill ,RtF1AI])1 1$1' I I t I, I I , , I I I I I I ~:f:T: :L:8~:;:'o:L: :~o: :~,~ :dL:~&~ ~: : :: : : ::: : :: :: : : SIEjrl R,Pl 1L.,8t tSl ,TiOI I PetSI(IL,~RI)1 I~ I I I I I I I t I I , I I J The current file or subfile position of the hardware device Mr2 is stored in the data unit LBRFIL; the current record position within this file is stored in LBRPOS. 6.7 RECORD LENGTH DETERMINATION The length of the last record transmitted by either an INPUT or an OUTPUT statement may be determined by using the functional modifier, LENGTH. Format SET data-unit-name TO LENGTH(name) 11-6-32 $ M-5035 Explanation SET Specifies a SET operation. Data-Unit Name Specifies the location where the record length is to be stored .. TO CMS-2 separator. LENGTH(name) Specifies the length of the previous record on the unit specified by the name of a FILE declaration. Example R,8,L, E:T: 8 I ~E",NITjH, ,.; ,1,6, ,11, I~" I " I I , , I, :L:r:w:;ltt: :r:o: :L:£~~:d~:(:~:~:~:F: I:L~)~: I, J : : :: :::: : : DEVICE IDENTIFICATION OPERATIONS , is sometimes desirable to make a check on a device (e.g., a tape unit or .sk to make sure that the right unit is mounted). The following two special :atements are used for this purpose: 1. DEFID Statement. 2. CHECKID Statement. lese commands are illegal on standard hardware devices . . 8.1 DEFID Statement EFID writes an identifier on an external device. If the tape is not at load ()int when the DEFID command is ·given, the statement will be ignored. Format DEFID file-name STANDARD or (header description) 11-6-33 $ M-5035 Explanation DEFID Specifies a CMS-2 control word. File Name The identifier of a file that references the external device for which an ID block is desired. STANDARD or Header Description The description Df the identifier record to be written. If it is standard, the header is written in the local convention known to the run-time input/output routine. If a header description is given in parentheses, the contents of the parentheses are used as header. All header record~ are a standard 30 words long. Examples A standard header will be written on the device referenced in the file declaration LPR. The header "INVENTORY SDIEGO ··1 JUL 71" wi 11 be wri t ten on the device referenced in the file declaration LPR. ] I-()-3t1 M-5035 Change 3 6.0.2 CHECKID Statement CHECKID checks an identifier on an external device. If the tape is not at load point when the CHECKID command is given, the statement will be ignored. Failing the check will result in an input/output error condition. Format CHECKID file-name STANDARD or (header des.cription) $ Explanation CHECKID Specifies a CMS-2 control word. File Name The identifier of a file which references the external device on which the identifier is to be checked. STANDARD or Header Description Describes the wording against which the identifier is to be checked. Example The,header record on the device referenced in the file declaration LPR will be checked if it is in standard format. II-6-35/n-6-36 mank) M-5035 SECT [ON 7 COM .. I i.E-,/, [ME SYSTEM FAC I t, IT 1ES The primnry function of the CMS-2 Compiler is the translation of sourCe stntpmf~nts into machine (object) code. To effect this trnnslation, cprtain convpn- tions regarding the organization' of the source statements have been established in previous sections. These conventions pertain to system data designs and systpm procedures as the organi,zational elements of a system. sections, the header controls of a system are presented. In the following They contain informa- tion specifying listing options, loading controls w system index registers, inclusion of program debug features in the object code or other facilities that effect the compile operation~ A compile-time system comprises system elements and associated header rontrols (see figure 7-1). This concept establishes a method for obtaining a complete or partial translation of a user's program. The compile-time also signals the initiation and the termination of the translation process. For translation purpuses, such a system is regarded as something complete in itself; all information necessary for a successful compile is specified within the system and in accordance with the rules and facilities of the CMS-2 language. 7 • 1 ACCESSING THE COMPILER To obtain the services of the Compiler requires use of a uniquely formatted Monitor control card. Furthermore. additional Monitor control cards are re- quired to properly define the user's job processing requirements for the Monitor. These requirements might be one or more of the following: compile; load and execute; build a library; update a library; etc. The $CMS-2 Monitor control card activates the CMS-2 Compiler. Following this Monitor control card are one or more compile-time systems (source input to the compiler). MINATE $. Use of the Compiler is terminated by the CMS-2 statement: TER- The card formats of the Monitor control cards, their functions and their placement in a job deck are discussed in Volume I. _ ... .-r.... ' ~ 11-7-1 M-5035 Statement Figure 7-1. Elements of a Compile-Time System I 1-7-2 M-5035 7.2 MAJOR AND MINOR HEADERS Headers are classified CIS major or minor deppnding upon position and TClnue of influence within a r.ompilt,-time system. A major heClder consists of those statements immediately following the SYSTEM statement (see paragraph 4.1.}) and bracketed by the statement: Format END-HEAD name $ Explanation END-HEAD Specifies the end of the header. Name Optional. The header identifier. The major header statements contain control information that applies throughout the compile of the entire system. A minor header, on the other hand, is a group of header statements immediately preceding a system element. The parCl- meters within a minor header are in effect only throughout the compilation of the particular system element that the header precedes. Minor headers are optional if suffici:nt information is included in the major header. Figure 7-1 illustrates the positions of major and minor headers. Major and minor header may be retrieved from a CMS-2 library. In this case, the header statements are bracketed by HEAU and END-HEAD statements. The format of the HEAU statement follows: Format name HEAD comments $ Explanation HEAD Specifies a set of header statements to supplement major header controls or establish minor header groups. Name Optional. The header identifier. If the header group is to be included on a library, the name is required in order to identify the element on the library and for subsequent retrievals. II -7-3 M-5035 Change 5 Below is a list of available header statements, divided into four categories. These statements will be defined and their usage described in following sections. 1. Options header statements:' OPTIONS 2. Allocation header statements:' BASE .' TABLEPooL DATAPOOL LOCDDPOOL EQUALS NIT EMS 3. Library retrieval header statements: LIBS SEL-ELEM SEL-8YS SEL-HEAD SEL-PooL CORRECT DEP 4. Miscellaneous header statements: SYS-INDEX MEANS EXCHANGE DEBUG I CSWITCH..;.DEL EXECUTIVE CMODE SPILL CSWITCH-ON CSWITCH-OFF CSWITCH END-CSWITCH END-CSWITCHS II-7-4 1't1-50~15 Change 5 The OPTIONS, SYS-INDEX, and DEBUG statements are allowable only within a major header. DEP statements are restricted to minor headers. All the remaining statement types may be used in either category of header. The major headers must include the OPTIONS statement. The statements of a major header may occur in any order except for the OPTIONS statement, which should precede all others. The comment features described in Section 3 are allowable within headers. 7.3 OPTIONS HEADER STATEMENT Every compile-time system requires a major header containing at least the OPTIONS statement. This statement should immediately follow the SYSTEM statement. The OPTION S statement designates the types of output, the output units and the various program listings to be generated by the compiler for a compile-time system. Format OPTIONS PI' P2"" Pn $ Explanation OPTIONS Specifies the OPTIONS header. Pl···Pn Denotes optional parameters of the following types: SOURCE Source output and dispOSition. OBJECT Object options, output, and disposition. LISTING Listing dispOSition. MONITOR Execution under l\1onitor. NONRT Execution in a non-real-time environment allowing calls to implicit run-time functions. LEVEL(O) All error and warning messages are listed. This is the default condition .. LEVEL(l) \Varning messages are not generated. l\lODEVR BL Allows impl icit definition of variables. STRUCTURED Specifics that the system is written according to CMS-2 structured programming conventions. 1I-7-5 I 1\1-5035 Change 4 Any or all of these parameters may be specified in any order. If no parameters are given or no OPTION S statement is included in the source input, the Compiler outpufconsists only of syntax error messages. The first three controls' listed above may be accompanied by subsidiary information in parentheses following the. parameter. This additional information ~sdescribed in the following paragraphs. The presence or absence of some of this informaUon can affect the duration and comprehensiveness of the compilation. The number of outputs requested may be restricted by the installation r s peripheral configuration. 7.3.1 SOURCE Option This parameter calls for the listing, punching and/or tape output of the (edited) source statements input to the Compiler. The presence of this parameter on the OPTIONS statement indicates a request for source output; the associated parameters indicate the disposition of this source. Format SOURCE (LIST, CCOMN, CSRCE, CARDS) Explanation SOURCE Requests output of edited sotlrce statements. LIST Optional. Indicates that disposi tion of source output is hardcopy listing. This is the default parameter and is only necessary if a hardcopy listing is desired in addition to one or more of the following parameters. CCOMN Optional. Indicates that the disposition of source is the output unit CCOMN. CSRCE Optional. Indicates that ~isposition of source is the output unit CSRCE which is unloaded at the end of the compile time system. CARDS Optional. Indicates source output in the form of punched cards. II-7-6 M-5.035 Change 4 Any or all of these parameters may be specified in any order. Whenever either CCOMN or CSRCE is requested, any hardcopy listing that results from either the LIST parameter or the OBI ECT options will show the source statements numbered as in a Librarian listing. This Compiler output may then be used in lieu of a library listing of the source code. l·~xampl 1. (' s 15,9"',R,c., €a ,~ , I I 1'7-1 I I 1 I I It. 1 I 1 I PI PI Ti I,01f6, I I I I I I H.' q til'S I s a h a r d (' () PY 1 i s lin ~I () f t h (' 1 I , I I I SOLI r (' t' i rfp 1I I H('qUl'sls a hardcopy listinu nnd a plinchl'l\ t!t'C" • or Ih(' sOllrc(' input. 3. Bequests output of thl' source input to unit s{'quent library updatf' run). CU)~lN (genendly for a suh- Any hardcopy listing of the sourrt' will harp statements numbered according to Librarian conventions. 7 .:L 2 OBJECT Opt ion This parameter req'uests the Compiler to proceed all the way through its objprt generation phases. The sub~idiary information with this parameter specifies special generation options, object-code listing forms, and disposition of relocatable binary object-card decks. NOTE If OBJECT is not specified on the OPTIONS sta.tement, the Compiler will perform the syntax analysis phase only (producing syntax diagnostics) but will not proceed into the code generation phases. When SOURCE is present without OBJECT, the hardcopy' source listing will have syntax error diagnostics interspersed with th,e source statements • . 11-7-7 M-S035 Change 5 Fonnat OBJECT (Special-mode, list-options, CNV, CCQ\1N, COBJT, CARDS) $ Explanation OBJECT Requests object generation phases of the compilation. Special Mode Optional. List Options One of the following: CMP Request a compool generation run. OPT Requests optimization of transient references. Optional. One or more of the following hardcopy output options: I CR Requests both local and global cross-reference listings, which are alphabetized listings of the identifiers defined within the compile-time systern, their assigned locations, and the locations that reference them. I CRG Requests a global cross-reference only. CRL Requests a local cross-reference only. If CR, CRG, and CRL are omitted, only cross-reference , listings of unallocated identifiers are given. SA Requests symbol -analysis listings which provide a list of identifiers categorized according to declarative type. Within each grouping, the identifiers are alphabetized and accompanied by a stnnmary description of· their respective 8M attribut~s. Requests a full symbolic output listing which pro .. vides for the complete listing of the source statements intermixed with the octal and nmemonic representations of the generated machine code and their corresponding addresses. 11-7-8 M-5035 CNV Optional. Specifies that fixed-to-float and float-to-fixed numeric conversions are to be provided by run-time routines rather than inline generation. CCOMN Optional. Indicates that disposition of relocatable binary object-code is the output unit CCOMN. COBJT Optional. Indicates that disposition of relo- eatable binary object-code is the output unit COBJT, which is unloaded at the end of the compile time system and may be saved. CARDS Optional. Indicates relocatable binary obj ect code output in the form of binary punched-card decks. Any or all of the above primary parameters may be specified in any order. r«lTE The special mode parameter CMP requests the creation of a compool output. This parameter may be used only with compile-time systems whose elements are system data designs and headers. The compool output is identified by the name of the last system data design and consists of the definitions of all the data design elements decoded into a format internal to the Compiler. A compool may be placed on a library tape and may be retrieved instead of the corresponding source system data designs for subsequent compile-time systems. Using such a compoolsaves the compilation time normally needed to process the source system data designs. The special mode parameter OPT requests optimization of transient references. The use of the parameter may result in the elements of a system being no longer independently compilable. 11-7-9 M-5035 Change 5 Examples ,gPa 17/,0."'3 to,e, :JjEjc, 7i 1. ,$, , I I , , , I I , I , I, , I " , , I I' , Requests diagnostic output from all Compiler ,phases; no other output will be produced. Requests a hardcopy listing of source and diagnostics from all phases of the Compiler. Adjacent to each source statement is the relocatable location of the first instruction generated for 'that statement. These locations are useful if CR is also requested. p,p,r;I,gNJSt 3. I IO,A~EjCITjGC,~,,1 rS,t1",Sltf l), ~11 ,I II ,, I J I Requests a local and global cross-reference, symbol analysis, and full symbolic hardcopy listing, along with diagnostics, from all phases of the Compiler" 4. Qe.lj l,aMs, IS,O,U,R,C,Ei" ,O,Bllj fjC,7i(,C,MP",Cto,B,Ji7j"S.M.;, il Requests a source listing and a full symbolic listing for a compool generation compilation. The compool and its corresponding relocatable binary object code will be output on unit OOBJT, which will then be unloaded. 7.3.3 LISTING Option This parameter specifies the disposition of the hardcopy listings produced by the Compiler as a result of the parameters described in paragraph 7.3.2. It need only be specified if the hardcopy or printer, output is to be written onto other output units instead of, or in addition to, being printed. Format lISTING (PRINT, CCOMN, ClIST) 11-7-10 M-5035 Change 2 Explanat ion lISTING Requests nonstandard hardcopy listing disposition. PRINT Optional. Indicates that disposition of printer listings is the printer. This is the default parameter and is only necessary if printer output is desired in addition to one or more of the following parameters. CCOMN Optional. Indicates that disposition of hardcopy listing output is the output unit CCOMN. CCOMN may not be used if specified in OBJECT option. ClIST Optional. Indicates that disposition of hardcopy listing output is the output unit eLIST, which is unloaded and may be saved at the end of the compile time system. Any or all of the above parameters may be specified in any order. Examples 1. ~PI7j l,gNis. fO,s,JjEje,Tj(StJ)I" ,LIIIS." 1,It't'dr I(,e IC,O,~N~), ,$, Requests the full symbolic hardcopy output listing to be placed on unit CCOMN rather than to be printed. 2. Requests a hardcopy listing and a punched card deck of the source input. The listing will be printed, as well as placed on the output unit CLIST. 7.3.4 MONITOR Option The MONITOR parameter allows the compilation of statements that directly or indirectly require access to the CMS-2 operating system (i.e., high-level I/O and DEBUG statements). It also results in all testing of the special console condi tions (e.g., KEY 1 , STOPS) to be simulated by the Moni tor. This parameter 11-7-11 M-5035 Change 3 should be specified only when the object code produced by the Compiler is to be executed under Monitor control. See Volume I, Section 2 (Monitor) for simulated settings of special console conditions. 7.3.5 NONRT Option The N ONR T parameter indicates that the program· is to be executed in a non-real-time environment and allows the generation of calls to implicit run-time functions (exponentiation, BIT/CHAR, and fixed/floating point conversion). The MONITOR option automatically implies the NONRT option. In the absence of NONRT (or MONITOR), all impliCit references to these run-time functions will cause source warning messages and/or object error diagnostics. 7.;3. 6 Two-Level Diagnostics Error listings produced by the Compiler contain two categories of diagnostic messages: serious errors which affect program execution and warning errors which may not affect program execution. The LEVEL(l) option causes suppression of the listing of errors in the warning category. A LEVEL(O) specification, or no specification of the LEVEL option, causes errors in both categories to be listed. Regardless of level specified or implied, errors in the warning category are not included in the COMPILE ERROR Summary at the end of the compile. 7. 3. 7 MODEVRBL Option The MODEVRBL parameter instructs the compiler to create local variable definitions for any undefined data units appearing in dynamic statements where the syntax of the statement allows references to variables. These implicitly defined variables are given the attributes of the MODE VRBL declaration or the compiler's inherent mode (I 16 S) in the absence of a MODE VRBL declaration. II-7-12 M-5035 Change 4 7. 3 0 ~ STHUCTURED Option The STRUCTURED option informs the compiler that the system is written . according to the Cl\IS-2 structured programming conventions. The Compiler will issue the warning message "NON-STRUCTURED STATEl\IENT" for the each statement which violates these conventions. These statements include: 1. Statement switch declarations 2. GOTO statements 3. Procedure declarations containing abnorlual exits 4. Procedure call statements containing ahnormal exits 5. It ETUHN statelnents containing an abnorlnal exit 6. SET statements containing an OVERFLOW specification 7. Procedure Switch call statements containing an INVALID specification 1I-7-12A M-5035 Change 4 7.4 ALLOCATION HEADER STATEMENTS The Hllocat ion srheme inrorporated in the Compilf'r generally consist s of ttl£' assignment of addresses to instructions and datH definitions in a sequentiHI mHnner thHt reflects the order of the source stHtements. All identifif'rs thHt function as symbolic addresses Hre assigned locat ions arrordingly. rasp of n data namp, tIl() ]n th£> sizp of the ar£>a reser\'pd is determined from its definition in a declarative stHtement. If the j)rogrHm subspquf>ntly sppcifies a preset value for the data unit, the Compiler ueneratf's the preset valup originHting Ht the location previously HllocHted. The requirem~nts of a particular program or application package often require departure from this standard allocation scheme used by the Compiler. F6r this purpose, various allocation header statements are provided in the CMS-2 language. Since the effect of these allocation statements on a user program often involves both the Compiler and the Loader, the reader should also refer to the description of the CMS-2 Loader in Volume I, Section 3, in particular, the AC and CS d i rec t i ve s. The words "allocation" or "relative allocation", when used to describe CMS-2 for the AN/UYK-7, will refer to the positioning of an individual data unit or dynamic statement (TABLE, label, etc.) within a basic CMS-2 element SYS-PROC). (SYS~DD or The words "relocatable allocation" will refer to the posi 1ioning (offset) of a CMS-2 element from its associated basic register content. 7.4.1 Pooling Statements Two basic types of pooling statements exist. The first type directs the Com- . piler to divide a basic element into two separate elements for the purposes of subsequent relocatable allocation by the Loader. LOCUDPOOL and TABLEPOOL. Statements in this group are If it is ever required to treat local data designs and/or tables as relocatable elements at load time, these statements must be II-7-12B M-5035 present, with their associated basic elements, SYS-PROC and SYS-DO respectively., during compilation of the source. The second type of pooling statement includes those pool statements that are associated with the basic CMS-2 elements. They are BASE and DATAPOOL. It is necessary to include these pool statements with the source only if machine and system-dependent information is included. In general, pooling statements may occur in both major or minor headers. Pool- ing statements used in a minor header affect only the SYS-DO or SYS-PROC that immediately follows. (If a pool statement is used that is inappropriate, it is ignored by the Compiler; e.g., LOCDDPOOL within the minor header of a SYS-DD would be ignored.) If a pooling statement occurs in a major header, it applies to all basic elements not having this pooling statement as a minor header. All four of the above pooling statements may appear in a header, but only one of each type may be specified (i.e., two BASE statements may not appear in,the same header). Each of the pooling statements allows an optional name to be given for the purpose of identifing the pooled element or group of elements. This name defines a compound section and appears in the CS Loader directive generated by the Compiler as part of the binary output. A compound section informs the Loader that relocatable elements are to be grouped together (see Volume I, Section :3). If no name is given on default names. t~e pooling statements, the Compiler will provide They are as follows: Pooling Statement' Default Name BASE DATAPOOL SYSP LOCUDPOOL LOCDD TABLEPOOL TA3LI~ Furthermore, if neither the BASE SYSDD ~or the DATAPOOL statements are provided by the user, the Compiler will use the respective default names for the compound section sperifications. 11-7-13 M-5035 One of the parameters appearing in all of the following pooling statements specifies that the data or instructions in the pool be referenced using a transient base register. This parameter should be used only for extremely large programs. 7.4~1.1 LOCDDPOOL Statement The LOCDDPOOL statement instructs the Compiler to compile the local data designs with reference to a separate base (i.e., as a relocatable element). If 'found in a major header, it instructs the Compiler to compile all local data designs in this manner. (A LOCDDPOOL also found in a minor header would be redundant unless it had a different name, requested transient reference g or suggested grouping under a different base register.) If found in a minor header, only the local data designs of the associated PROC will be compiled as a relocatable element. S~S All other local data designs will be based relative to the base of the SYS-PROC as encountered within the source. Format name LOCDDPOOL (Tv identifier) optional-value $ Explanation name An optional name assigned to this element or group of elements. This name defines a compound section and appears in theCS Loader directive generated by the Compiler as part of the binary output. LOCUDPOOL Identifies a local data-design pool. T, Identifier An optional implementation aid. normal conventions will be used. If not presentv If T is present, it specifies that the local data designs covered by this pool statement should be referenced transiently. The identifier, if present, spe- cifies the AN/UYK-7 base register under which 11-7-14 M-5035 t.his p}pmf'nl may hf' This illlo(~Htpd. inf()r·~ mation is passed on to thp Loader but may be overridden at load time. The identifipr may be an EQUALS tag or a positive integer constant. The absolute allocation at which it is Optional Value desired that this element (or group of elements) be located at load-time. The Compiler passes this information to the Loader. The Loader allows this value to be overridden at load time. Example I I I 1 I , I I , , I , , .II · , , I I I -, , I I I I I , I I I I I J I ,., I I I , J , J I I " ,., I , , I I I I I I , , J , I , I ,.• , , , I I 1 I -, I 1 I I , , I I, , , , I I I J , " I I, I , I , , , I I , 1 , I' '" I I l I , I I I 1 I I This example represents a program which, because of system design, found itself with a shortage of base registers. Since the programmer realized that he made few references to his own local data designs, he commands' the Compiler to use a transient base data is requested in his program. regi~ter whenever any local He further commands the Compiler to indicate to the Loader to use 56 as the transient register and to base his local data at address 40000. This can be changed at IGnd time. 11-7-15 M-5035 7.4.1.2 TABLEPOOL Statement The TABLEPOOL statement instructs the Compiler to with reference to a separate base location. ~ompile all applicable tables The TABLEPOOL applies only to tables declared in a SYS-DD. If this pool statement is present in the major header, it is applicable to all tables declared in all SYS-DD's not having a TABLEPOOL statement in their minor header. If this statement is present in the minor header of a SYS-DD, it applies only to tables declared in that SYS-UD. Format name TABLEPOOL (T, identifier) optional-value $ Explanation Name An optional name asSigned to this element or group O:f element s. Thi s name defines a compound section and appears in the CS Loader directive generated by the Compiler as part of the binary output. TAI3LEPOOL Specifies pooling of all tables with reference to a separate base location. T, Identifier An optional implementation aid. If not present, normal conventions will be used. If T is present, it specifies that the tables declared in the SYS-DD covered by this pool statement should be referenced transiently. The identifier, if present, specifies the AN/UYK-7 base register under which this element may be allocated.· This information is passed on to the Loader but may be overridden at load time. The identifier may be an EQUALS tag or a positive integer constant. 11-7-16 M-5035 Change 2 Optional Value The absolute allocation at which it is desired that this element (or group of elements) be located at load time. The Compiler passes this information to the Loader. The Loader allows this value to be overridden at load time. 7.4.1.3 BASE Statement The BASE statement instructs the Compiler to compile system procedures with reference to a sep~rate base location. This pool statement is considered to be present in the major header by default. If this pool statement is present in the major header, it is applicable to all SYS-PROC's not covered with a BASE statement in a minor header. Format name BASE (T, identifier) optional-value $ Explanation Name An optional name assigned to this element or group of elements. This name defines a compound section and appears in the CS Loader directive generated by the Compiler as part of the binary output. BASE Specifies pooling of all instructions with refer-· ence to a separate base location. T t Identifier An optional implementation aid. normal conventions will be used. If not present, If T is present, it specifies that the generated instructions covered by this pool statement should be referenced transiently. The identifier, if present, specifies the AN/UYK-7 base register under which this element may be allocated. This information is passed on to the Loader but may be overridden at load time. The identifier may be an EQUALS tag or a positive. integer constant. '.., .~ .:~ ;.tl'~~~:;;;:.' ."IIIlIllIllI'l. 11-7-17 M-5035 Optional Value 7.4.1.4 The absolute allocation at which it is desired that this element (or group of elements) be located at load time. The Compiler passes this information to the Loader. The Loader allows this value to be overridden at load time. DATAPOOL Statement The DATAPOOL statement instructs the Compiler to compile system data designs with reference to a separate base location. This pool to be present in the major header by default. is considered stat~ment If this pool statement is present in the major header, it is applicable to all SYS-DD's not covered with a DATA POOL in a minor header. Format name DATAPOOL (T, identifier) optional-value $ Explanation Name An optional name assigned to this element or group of elements. This name defines a compound section and appears in the CS Loader directive generated by the Compiler as part of the binary output. DATAPOOL Specifies pooling of all data with reference to a separate base location. T, Identifier An optional implementation aid. If not present, normal conventions will be used. it specifies that the data pool statement shbuld be If T i's present, design~ referenc~d covered by this transiently. The identifier, if present, specifies the AN/UYK-7 base register under which this element may be allocated. This information is passed on to the Loader but may be overridden at load time. The identifier may be an EQUALS tag or a positive integer constant. 11-7-18 M-5035 Change 2 Op1.ionul Valu(~ The ahs()lu1.(~ thClt this Hllor.ation nt whir.h it is el(~m(~nt (or uroup of (!lements) bp. located at load time. ~nformation d(~sif(~d The Compiler passes this to the Loader. The Loader allows this value to be overridden at load time. 7.4.2 EQUALS Statement The EQUALS statement is used for two purposes: the assignment of numeric values to symbols and the specification of relative allocation. If the EQUALS statement is contained in a major header or system data design, the EQUALS statement applies throughout the system and the value will be substituted wherever the name appears. If the EQUALS statement appears in a minor header or local data design, the value will be substituted only throughout the system procedure or data design which follows the minor header. When the EQUALS statement is used to assign a numeric value to a symbol used in the following procedures or data designs, the values used in the arithmetic expression must be either constants or values previously defined by an EQUALS st3tement, or previously specified in a system data design within the system being compiled. Arithmetic expressions appeio-:.·ing in EQUALS statements must be simple, parenthesis-free expressiolls and are evaluated left to right without precedence consideration. Relative allocation is accomplished with the. EQUALS statement where the right-hand side references data units. Format name EQUALS expression $ Explanation Name The name of a data unit, or a tag for a numeric constant. EQUALS Specifies that an allocation or value assignment follows. Expression A simple, parenthesis-free expression representing a relative allocation or numeric valup. The basic arithmetic operations of +, -, 11-7-}9 * and I M-5035 are allowed. The operands in this expression may be data unit names, tags defined by previous EQUALS, and constants. Table 10-1 summarizes the rules for legal final results (left side of EQUALS) and legal intermediate results (binary operations within the expression on the right side of the EQUALS). TABLE 7 ~l. ONE OPERAND Constant (tag) Relative (data unit) Constant (tag) OPERATOR + _ I OTHER OPERAND RESULT (FINAL OR INTERMEDIATE) Constant (tag) Constant (tag) Constant (tag) Relative (data unit) Relati ve (data unit) Relati ve: (data unit) Relative (data unit) + + Relative (data unit) 7.4.2.1 f~ EQUALS EXPRESSION SUMMARY - Constant (tag) Defining a Tag When neither the name on the left nor any of the names on the right of an EQUALS statement are the identifiers of data units, the name on the left becomes a tag for the numeric value represented by the expression on the right. This tag may then be used in data declarations and dynamic statements and the appropriate value will be substituted. If the expression on the right involves data units (relative locations) and the result is an integer value, the tag may be used in dynamic statements or other EQUALS statements but not in data declarations. 11-7-20 M-5035 Exam~le oft{ , IFt:!!ltlIIIIL #fNt 1 JEAu~,LIS, IFjWvi ,MAg, ,S, IE,flIUIAI LIS ,3.2, . JI, ,,I ,f, 1 1 1 1 , ,F,W,-IHtI!',- ,il ,$, I J I ., , , I I 1 I I , , , I " I , I', , , , , , I , , I I , I I ,V,R,8,L, IX, Al ,FaW, ,5, ,Hlw, IA /fAg, I, , , ,, J , ,, I, J I , , , I , ," , , , I I , ,S,E",li lx, ,Tjo, ,g., ifr "'IA~ .$, , I J I I I ,. I J 1 I I I I I J I J I , 1 I The variable X is a 32-bit, signed, fixed-point data unit with 16 fractiona'l bi ts and an ini tial value of 15. Execution of the SET state- ment assigns the value 30 to the variable X. ·7.4.2.2 Establishing Relative Locations The EQUALS ,stat ement m(lY he used to assign the location of a name relative or equal to the locat.ion of another name. The definit.ions of these names must appear within the same system element. The identifier used on the left side of an EQUALS statement must be a data name for a table, like-table, item-area, va.riable or switch. The express,ion on the right involves data unit names, tags, and const.ants. If a data name appears on the left side of t.he EQUALS statement, no area for the data definition is reserved by the Compiler. During the allocation pro~ cess, the allocat.ion count('rs are not altered; the affected delta definition is removf'd from l.hf' normfll data name appearing to :lssiunm(~nt t sequence and is allocated relative to the hf' right of the EQUALS. (I f the data n~mp ont he right does not appear on the left or an EQUALS statement, its data definition receives normal allocation nnd reservation of area by the Compiler.) label may not appear 011 the left of the EQUALS statement. 11-7-21 A statement M-5035 Change 3 Example Storage is allocated for B but is not reserved for A or C. f A occupies the same location as B,and C occupies the next consecutive memory location. 7.4.3 NITEMS Statement The NITEMS statement is a special case of the EQUALS statement as used to tag an identifier to a constant. Its purpose is to assign a value to a tag appear- ing as the number-of-items specification in a vertical table. Format NITEMS (identifier) EQUALS value $ Explanation NITEMS Indicates a special case of the EQUALS statement. Identifier A tag used on a subsequent table declarative to represent the number of items. EQUALS Specifies an EQUALS declaration. Value An integer constant or another identifier tagged to a constant by a previous EQUALS statement. The NITEMS statement provides an initial constant for the number of items of a vertical table declaration using the tag and also provides a name to which another value may be attached at load time; thus, the length of a table may be changed without recompiling the I program. As a result no fields of a table whose length is determined by a NITEMS tag may be preset. 7.5 LIBRARY RETRI-EVAL HEADER STATEMENTS Elements of a compil~-time ~ystem may be retrieved from CMS-2 libraries and Compiler output tapes as part of the input to the Compiler. h(~;HJf' r nnd sys t(~m el('mf~n t These include s r,onta i ni ng sourr,e statement sand compool element s 11-7-22 ¥ M-5035 Change 5 wldch (tre compiled system data designs, in a format internal to the Compilpr. The following parugraphs describe the control stn\('lIIcnIS nef'ded to source elements and compools. r('lril'Vf' Additional control stntements are provided for the purpose of correcting source elements during element retrieval. These library retrieval and correction statements may he used either in major or minor headers or in place of system elements of a cumpile-~time system. Library features are described in Volume I, Section 4. LIBS Statement 7.~.1 Prior to control statements that select elements from a lihrary, the library must be identified by a LIBS statement. Format LIBS internal-id {external-id} $ Explanation LIBS The statement identifier. Internal ID The name of the library or Compiler output. External ID Optional. Some external identification (such as tape reel number) which will be output to the compiling system operator. If not given, the internalID will be used. When Compiler-produced outputs are used in library retrieval, the names CCOMN, CSRCE orCOBJT must be used as the internal-ide The name used corresponds to the one specified on the OPTIO~S statement when the tape was produced by the Com- piler. Sources statements'may be retrieved from CCOMN or CSRCE; compools fromCCOMN or COBJT. If CCOMN is being used as library input and CCOMN has been specified on an OPTIONS statement as an output file, the LIBS statement must include an external-id other than CCOMN to distinguish between the two files. 7.5.2 Retrieval Selection Statements Elements on a library are identified by name and an optional key. The key is required if the elements selected have been given a key during library preparation. Element keying provides a means of distinguishing between elements of the same name on a library. 11-7 -23 l\1-5035 Change 4 The name of a source element for retrieval is the nanle specified on the H EA 0, SYS-DD or SYS-PH()C statelnent. The narne of a cornpool elernent is the name of the last SYS-DD llsed to create the COlllpool. The name and the HEA 0, END-HEAU, SYS-DD, E~D-SYS-I)(), SYS-PHOCand E~{)-SYS-PHUC statetnents define and delirllit an eicnlentduring the retrieval procpss. Hetrieval of eleOlcnts from a library is achieved through selection statenH.mts which specify thl' desired elerllcnts by name and/or key. statements: SEL-ELE:~I, There are four types of Sf-: L control SEL-SYS, SEL-IIEAD alld SEL-POOL. Formats SEL-ELEI\I SEL-SYS I name (key) (key) , dep-option $ dep-option $ :$ Sf: L-IIEAI) name (key) , SEL-POOL name (key) $ Explanation SE L- E LE 1\1, SE L-SYS, SEL-HEAD, SEL-PooL Staternent identifiers. Natne Identifies the element desired for retrieval. Key Hequired only if the named element has a key on the library. If not required, the parentheses and key are omitted; the key is considered blank. Dep-option Optional. Specifies the level of dependent element retrieval. A dep-option may be one of the following: ALL retrieve all dependent elements ONLY retrieve no dependent elements II-7~24 M-5035 Change 4 no-of-Ievels retrieve the specified levels of dependent elements No-of-Ievels is an integer or an EQUALS defined name of an integer. These integers have the following interpretations: o all dependent elements, equivalent to ALL 1 no dependent elements, equivalent to ONLY 2 this element and one level of dependencies 3 this element and two levels of dependencies, etc. If no dep-option is given, ALL is assumed. This parameter is used only in conjunction with libraries and is ignored when retrieving from Compiler output tapes. The SEL-ELEM statement causes the retrieval of a specific system element and possibly all its declared dependent elements; it may not appear in a major header. The SEL-SYS statement requests the retrieval of all elements having the specified key. All source elements are retrieved when the key is blank. The SEL-HEAD statement causes the retrieval of the named major or minor header and possibly . all corresponding dependent elements. The BEL-POOL statement causes the retrieval of the named compoo!. NOTE SEL-SYS statements may be used in conjunction with SEL-ELEM and SEL-HEAD statements. The order of retrieval is dependant upon the order of the elements on· the -library. A single correct' deck (with elements referenced in their library order) may be used to update elements called by a combination of BEL statements. n-7-24A M-5035 Change 5 I The BEL-POOL statement must appear in an unnamed major header of the compiletime system such that it precedes all user-defined identifiers except the system name. Retrieval of a com,pool occurs immediately when requested. Retrieval of elements specified in one or more consecutive select state~ents commences when one of the following conditions occur: a. The Compiler detects the CORRECT statement. b. The Compiler encounters a CMS-2 statement other than the LIBS or select statements. c. The number of consecutive select statements exceeds 60. When retrieval is completed for a given set of requests and corrections, the Compiler returns to the standard system input device for the rest of the user's input to the Compiler. 7.5.3 Correcting Elements During Library Retrieval Source elements may be corrected during the retrieval process;" compools may not. The corrections do not modify the library or Compiler output tape itself, but only the elements as they are passed to the Compiler. The name of the element and the card image sequence numbers, as given in the library listing, provide the reference points for making corrections in the form of deletion, insertion or replacement of card images. The Compiler listings produeed during a SOURCE output onto CCOMN or CSRCE also provide the same card image sequence numbers. Corrections decks must be introduced by the statement: CORRECT $ which indicates that one or more of the elements (that are to be retrieved as directed by preceding SEL control statements) are to be corrected. Since CORRECT is a CMS-2 statement, it may not start in card columns 1 through 10.' The CORRECT card is followed by correction contr.ols (as described in Volume I. Section 4) and CMS-2 statements. The correction deck is terminated by the II-7-24B M-5035 Change 3 Librarian directive /ENDCOR .. Within a block of corrections, th~ order of the corrected elements must be that of the library or Compiler output tape. 7. 5.4 DEP Statement For any given element of a compile-time system, the programmer may declare other elements to be dependent or subordinate to the given element. Such a specification of dependents may appear only in a minor header. An element may have a maximum of 58 dependent elements. Any minor header source element is automatically declared a dependent element of the associated system element. The DEP statement has no direct effect on the compile process; the information is simply passed through to the source or relocatable output. The dependent element concept has' bearing primarily upon the Librarian process and the relocatable loader. In library retrieval, whether of' source or relocatable elements, dependent elements are retrieved automatically with the selected element unless otherwise specified by the user. Furthermore, during relocatable loading, all declared dependent elements must be satisfied. Format DEP name (key),. name (key),... $ Explanation DEP Declares a dependent element. Name ,The name of another element such as a system data design or sy stem procedure. Key An optional key value placed on the element. 7 . 5. 5 Key Specification Various programmer selected outputs from the Compiler may be incorporated into libraries. Elements on such libraries are identified by name and an optional key. The name of an element output by the Compiler is automatically defined as the name given 11-7-25 I M-5035 Change 3 on the associated HEAD, SYS-DD or SYS-PROC statement. Key specification provides the programmer with the option of defining library element keys at compile time. Key specification may be included in the SYSTEM, HEAD, SYS-DD, SYS-PROC and SYS-PROC-REN statements (see Section 4). This section describes the key specification. Formats (key) (key)*S (key) *0 (key)*C (key)*L Explanation Key Alphanumeric identifier of not more than four characters. Specifies that the key is to be attached to a S source element. o The key is to be attached to an object element. C The key is to be attached to a compool. element. L The key is to be attached to a listing element. More than one key may be specified on any of the applicable declarative statements; each "(key)*element-type" is separated by a .comma. Key specification included in the SYSTEM statement applie~ to all elements of the designated type output for the compile-time system. Key specification included in the HEAD, SYS-DD, SYS-PROC and SYS-PROC-REN statements apply only to outputs associated with that element. If system declared key specifications and an element declared key specification designate the same type of output, the element key is used .. Finally, if no output type is attached to the key specification, all output types are keyed; if no key specification is given, all output elements are keyed with blanks. 11-7-26· M-5035 7.6 MISCELLANEOUS HEADER STATEMENTS 7. 6. 1 SYS-INDEX Statement The SYS-INDEXstatement may be used only in a major header. This statementassigns a unique identifier to a particular index register. This register is reserved throughout the entire system for use wherever the identifier is referenced. Format SYS-INDEX n identifier $ Explanation SYS-INDEX Specifies that a system index is to be declared. N An integer specifying a machine index register number from 1 to 5. Identifier A unique identifier to which the index register is to be assigned. Example ,S I '/,5, j I ,1Ij-A Ej X, I~ I IX, Plo,S, , ,$, , I I I , , , , , I , , I The index (B-register) 1 is assigned the name XPOS througbout the system compile. 7. 6.2 MEANS Statement The MEANS statement provides a· method of character substitution during the compilation process; no permanent changes are made to the affected source statements. Format identifier MEANS character-string $ Explanation Identifier Indicates· where the substitution is to be made during the compilation. The identifier appears in subsequent statements (but never in another MEANS or EXCHANGE statement). MEANS Specifies that a character substitution is to be defined. 11-7-27 M... 5035 Change 2 Character Strong . 'A string of characters that is to be used in place of the identifier. It consists of all characters between the term MEANS and the dollar sign excluding the blank delimiter. It may include other identifiers, constants or CMS-2 symbolic operators. Since the dollar sign terminates the string, it may never appear within the string as a character to be substituted. The maximum number of characters is 132. If the MEANS is contained in a major header, it applies throughout the system and the character string will be substituted wherever the name appear's. If the MEANS appears in a minor header, the string will be substituted only throughout the system procedure or data design that follows the minor header. character-string Examples character-string The following statements illustrate the before and after effects of the above character substitutions for the purposes of Compiler interpretation: "' e , , ,V,RlB'LJ IN,ts_IEl/I , IAIDTIS, I$J I I I I , I , , lA, 131.2, 151 ,Jla , I' I$IEITI IBllXlplTI Ina OOflf:QI lit ICIO,EIEIFI 'IVt8J8ILI IMIA I ,$, I I I , iii I I I I I"~ 7.6.3 Before: After: Before: After: EXCHANGE Statement The EXCHANGE statement provides exactly the same capability as the MEANS statement, except that the specified character substitution appears in the source output and Compiler listings. Format identifier EXCHANGE character-string 11-7-28 $ 'M-5035 Change 1 Explanation Identifier Indicates where the substitution is to be made during the compilation. The identifier appears in subsequent statements (but never in MEANS or EXCHANGE statement). EXCHANGE anoth(~r Specifies that a character substitution is to be defined. A string of characters that is to be used in Character String place of the identifier. It consists of all characters between the term EXCHANGE and the dollar sign 'excluding the blank delimiter. It may include other identifiers, constants, or CMS-2 symbolic operators. Since the dollar sign terminates the string, it may never appear within the string as a character to be substituted. The maximum number of characters is 132. 7.6.4 DEBUG Statement Various program checkout statements, as described in Section 8, may be inclUded in'the system elements of a compile-tjme system. essed by the Compiler. These statements are pror- Appropriate calls and parameters for the object-time f debug package are generated and included in the object-code output only if the user so requests via the use of the DEBUG control statement in the major header element. Format DEBUG parameters $ Explanation DEBUG Requests the Compiler to process those types of program debug statements specified by the parameters. Parameters Consist of one or more of the following names separated by commas~ DISPLAY v SNAP, RANGE, TRACE, PTRACE, DELETE. 1I-7-2q M~5035 Change 5 The DISPLAY, SNAP, RANGE, and TRACE parameters permit the compilation of the corresponding types of source debug statements. If 'One of these parameters is not included in the DEBUG header, the corresponding statements in the system elements are ignored by the Compiler. The PTRACE parameter specifies that code is to be generated during the compilation process to cause a print message to appear during execution before every procedure call. The DELETE parameter specifies that all debug statements not activated by the other parameters are to be deleted from the source output and listings. 7.6.5 CSWITCH Declarations The CSWITCH feature provides selective compilation of specified sequences of statements within a compile -time system. The CSWITCH selection declaration defines the "on/off" setting. The CSWITCH bracket defines the sequences of statements. The CSWITCH delete declaration instructs the Compiler to remove those sequences which are "off. " 7.6.5.1 CSWITCH Selection Declaration CSWITCH -ON defines the named CSWITCH sequences to be compiled. CswITCH-OFF defines the named CSWITCH sequences to be ignored. This declaration is optional; a CSWITCH bracket sequence whose name has not been defined by a CSWITCH selection declaration is considered to be "off. " Format CSWITCH-ON name-1, name-2, ••• , name-n$ CSWITCH-OFF name-1, name-2, •.• , name-n $ Explanation CSWITCH-ON Specifies that the listed groups of statements are to be compiled. CSWITCH-OFF Specifies that the Ii sted groups of statements are not to be compiled. name-1, ..• , name-n Nam es that identify the selected CSWITCH groupsofCMS-2 statements. II-7-30 M-5035 Change 5 A CSWITCH selection declaration may appear anywhere within a compile-time system except within direct code and between a FIND statement and its corresponding IF data statement. The CSWITCH name follows the standard CMS-2 local/global conventions. The "on/off" setting of a CSWITCH name may be reversed at any time during the compile by including the opposite CSWITCH selection declaration. If the setting of a global CSWITCH name is reversed within a system procedure (locally) it is reset to the global setting after the END-SYS-PROC has been processed. If a CSWITCHselection declaration appears within a CSWITCHbracket sequence and reverses the setting of the CSWITCH bracket name, the reversed setting does not affect processing of that CSWITCH bracket sequence. 7. 6. 5.2 CSWITCH Brackets The sequence of statements between the CSWITCH bracket declaration and the END- . CSWITCH bracket declaration is to be compiled, depending on the "on/off" setting of the CSWITCH name. The CSWITCH bracket may appear anywhere within a compiletime system except within direct code and between a find statement and its corresponding IF data statement. Format CSWITCH name $ END-CSWlTCH name $ END-CSWITCHS $ Explanation CSWITCH Brackets beginning of CSWITCH block. END-CSWITCH Brackets end of a CSWITCH block. END-CSWITCHS ~erminates name A name of a CSWITCH block. Must correspond to ~ all CSWlTCH sequences. name in a CSWITCH selection declaration. CSWITCH brackets may be nested up to a maximum of 10 ("on" or "off'? with a last-on first-off sequence. The name following END-CSWITCH terminates th·at CSWITCH name ll-7-30A M...;,5035 Change 5 sequence. If the CSWITQI sequence is ·'0££," only CSWITCH warnings are diagnosed; all other syntax checking is suspended tmtil the END~CSWrTCH bracket declaration is encountered or the language boundary structure has been violated. A CSWITCH bracket declaration in a data design (local, global or auto), procedure, fWlction or systern·procedureDRlst have the END . . CSWITCH bracket declaration prior to the respective data design bracket (local, global or auto), END-PROC, END-FUNCTION orEND-SYS-PROC declaration. NOTE A CSWITCH bracket declaration appearing in a header (major or minor) will not be terminated until its corresponding END -CSWITCH bracket declaration, an ENDSYSTEM, a TERMINATE, or a monitor control card is encountered. If the END -CSWITCH bracket declaration is not encountered, the remainder of the source will not be compiled when the CSWITCH bracket declaration is "off. " 7 • 6. 5.3 CSWIT CH Deletion The CSWITCH delete declaration may appear only in a major or minor header. If in a major header, all sequences of "off" CSWITCH brackets following within the compile-time system are deleted from the listing and source outputs. If in a minor header, all sequences of "off" CSWITCH brackets through the end of the following element are deleted fro m the listing and the source outputs. Format CSWITCH-DEL $ 7.6.5.4 CSWITCH Example EXMPI SYSTEM $ • • CSWITCH-ON CSWAl, CSWA2 $ Major header. CSWITCH-OFF CSWA3, CSWA4 $ END-HEAD $ SDDl SYS-DD $ 1I-7-30B M-5035 Change 5 CSWITCH CSWA2 $ CSWITCH-ON CSWB2 $ CSWlTCH CSWA2 is set "on" in the • • major header; this sequence will compile and CSWB2 will be set "on. " END-CSWITCH CSWA2 $ • • CSWITCH CSWB2 $ • • Statements from CSWB2 to CSWA3 CSWITCH CSWA3 $ will compile. Statements from CSWA3 • • to END-CSWITCHS will be ignored. END-CSWITCHS $ • • END-SYS-DD SDDl $ SPCl SYS-PROC $ LOC-DD $ CSWITCH CSWAl $ • • } Will compile. END-CSWITCH CSWAl $ • • CSWITCH CSWA3 $ Will not compile. END-LOC-DD • • will produce END -CSWITCH MISSING diagnostic. END-LOC-nD $ n-7-30C M-5035 Change 5 Will set "off" CSWA2. CSWITCH-OFF CSWA2 $ PROCEDuRE PROCI $ • • CSWITCH CSWA2 $ • • Will not compile. END-CSWITCH CSWA2 $ • • END-PROC PROCI $ • • END-SYS-PROC SPCl $ HEDI HEAD $ • • CSWITCH CSWA3 $ END-HEAD HEDI $ SPC2 SYS-PROC $ • Will not compile. • END-SYS-PROC SPC2 $ HEDI HEAD $ END-CSWITCH CSWA3 $ n-7-30D M-5035 Change 5 CSWITCH CSWA2 $ END-HEAD HED! $ SPC2 SYS-PROC $ • • CSWITCH CSWAl $ • • Will CSWITCH CSWAa $ • • Will not CSWITCH CSWB2 $ CSWB2 is • • ignored even compile since compile. if it is "on. " Will compile. END-SYS-PROC has reset CSWA2 to "on." END-CSWITCH CSWB2 $ • • END-CSWITCH CSWA3 $ • • END-CSWITCH CSWAI $ • • END-SYS-PROC SPC2 $ HED2 HEAD $ END-CSWITCH CSWA2 $ END-HEAD HED2 $ SPC3 SYS-PROC $ II-7-30E M-5035 Change 5 CS\VITCH CSWAI $ • • CSWITCH CSWA2 $ • • All will compile. END- CSWITCH CSW:a2 $ CSWITCHS terminates • • the sequence. END-CSWITCHS $ • • END-8YS-PROC SPC3 $ END-SYSTEM EXMPI $ U-7-30F M-5035 Change 5 7.6. 6 EXECUTIVE Statement The EXECUTIVE statement may appear in a major or minor header and is used to inform the Compiler that the program generation is for use in the interrupt (executive) state of the AN(UYK-7. (The Compiler requires this information when generating control memory references to index registers and accumulators). The Compiler assumes generation for the task state in the absence of this statement. Format EXECUTIVE $ Explanation EXECUTIVE Indicates eode generation to be executed in the exeeuo. ve statement ll-7-31 M-5035 Change 5 7.6.7 CMODE Statement The CMODE statement may appear in a major or minor header and is used to inform the Compiler that octal is to be the implied mode for numeric constants in the element or elements which follow. This statement provides for compatibility with other versions of CMS-2 in the method of expressing constants. Format CMODE $ Explanation CMODE Specifies that the implied mode of numeric constants is to be octal. When this statement is included in a header, decimal constants must be followed by a Dor must appear in parentheses 'and be prefaced by a D. Unmodified constants or constants enclosed in parentheses and prefaced by an 0 will be treated as octal constants. Examples ~ I::%~:t~~~: ~: :f:~:~ ::I:::::::::::: 7.6.8 I SPILL Statement The SPILL statement may appear in a major or minor header element. Format SPILL $ Explanation SPILL I Causes the Compiler to declare, at output time, every identifier within each affected system procedure as an external definition. 11-7 -32 M-5035 Change 5 Tllis der.lnrat.ion primarily far.ilitates the patr.hing of result;)nt relor.atablf· object code by permitting the use of symbolic addresses (such as statement labels, procedure names or data names) to specify the locations to be patched. This declaration does not alter the normal scope of identifiers during the compilation process. If sPILL appears in a m ajor header, all local identifiers will be declared as external definitions at output. If in a minor header, only those identifiers in the following element will be declared as external definitions at output. 11-7-33/11-7-34 (Blank) M-5035 SECTION U DEBUG STATEMENTS A set of program checkopt statements provides the capability for flow analysis and data display while an object program is being executed under control of the operating system. One or more types of program checkout statements may be included in the source input. When the corresponding statement types are enabled, tnese statements generate calls to debug package routines (see paragraph 7.6.4). Debug package routines may'then be selectively activated at program load time (see Volume I, Section 3 for usage of the CMS-2 Loader). Therefore, the following three conditions must be fulfilled when one or more debug capabilities are desired: 1. The DEBUG header card must be present with the desired debug aid as a parameter. This card instructs the Compiler to generate the code for that aid when encountered. If the debug aid is not included in the header statement, the Compiler will ignore the debug aid and will not generate code for it. 2. The debug aid, as discussed in this section, must be located in the source program deck. 3.' The- desired debug' aid must be included as a parameter on the $LOAD card (see Volume I, Section 3). This parameter instructs the Loader to set Monitor flags directing execution of the instructions associated with that debug aid. Absence of the debug aid parameter will cause the instructions associated with that missing parameter to be bypassed during program execution. 11-8-1 The various types of program checkout statements and the results of enabling these statements at compile and load time are described in the following paragraphs. 8.1 DISPLAY STATEMENT The DISPLAY statement allows the contents (image) of specified data units to be output on the system output device in the appropriate format for that data type. Optional value conversion will be made if stated. Format name DISPLAY image V(w,y), image V(x,y), .•• , image V(x,y) $ Explanation Name Optional. ment. An identifier for this state- If included, this identifier must be followed by a period and is printed. with the data units and their co~tents. This name is not a statement label and therefore may not be referenced. Image REGS for machine registers or the identifier of a variable, table, subtable, liketable, item-area, or field. This dataunit reference identifies the image on the printout. The output format for REGS, table, subtable, like-table, and item-area words is an II-digit octal number. The data type for fields and va~iables is the same as the data type specified for that data unit in its data declaration. 1I-8-2 M-5035 Changel The format of t he out put is specified below. Format Data Type V(x,y) A 120.8 I 120.8 B The integer 0 or 1 S The status constant name F E20.8 H Aw (w = number of characters) Optional. Specifies the magnitude for conversion for a field or variable. magnitude must not exceed 15 bits. Examples Assuming M is a 4-word table, X is a Hollerith variable, and Y is a . floating-point variable, the printout might appear as follows: .M 046732115043 362341023456 265123245675 145676343210 X OOG GONE Y 0.34244632+07 11-8-3 The M-5035 Assuming FIELD is an arithmetic field, the printout might appear as follows: BETA TABL(ALPHA FELD) 432.06 t 3. J7T~8J /"'6 !IIlfIV', ,Vi l&ili, I,, IFi'ltlL.U>, 1511>1£1,"'.1>, tIl ,1 10, lUI ,IJ I ttl 1 I I , I ,J,l, ", I , I 1 , , I', I I I I , , I , , , I 1 I I I I I I I , I I , I Iii I I I I I " I , I I', I , I I ., ~ CJ 14 31 I I I I I I I I I I I I I I , 1 '-L1....J1L...-J-1-"I-JI~I.....L'--,-'..4... I loJ,)1 1o 111 0 111 0 10 0 I I I I , " I I I I I I I I ", -'---'I--'-.........""""'""-~~_.-__ I I 10 I .~ ~ 1 3 0 I Field Magni tude Bi t l'osition He resented 20 I ·0.15625 21 I 0.3125 I 22 0.62[) I 1.25 :!J I 24 I 2.5 25 I 5 I 10 26 I 20 27 I 28 I 40 29 I 80 I I I 11-8-4 M-5035 Assume that the field SPEED had bit settings as indicated in the illustration above. To execute the display statement with the con- version specification that bit 2° of field SPEED represents ,10, t.he output would be: KNOTS NAV(O,SPEED) 6.25 where 6.25 is the summation of the binary bit values of 2 5 3 and 2 (5 + 1.25) respectively. 8.2 SNAP STATEMENT The SNAP statement reserves an area image equivalent in size and attributes to the data unit. The first execution of the SNAP statement causes the contents (or convert~d value) of the data unit to be printed on the system output device and stored in its reserved image area. Subsequent execu~ions of the statement cause a printout only if the contents of the data unit have changed. Format name SNAP image V(x,y) $ Explanation Name Optional. An identifier for this statement. If included, this identifier must be followed by a period and is printed with the data unit and its contents. This name is not a statement label and therefore may not be referenced. Image An identifier for a table, subtable, liketable, item-area, field, or variable. The image output format is the same as that described for DISPLAY (see paragraph 8.1) . 11-8--5 M-5035 Change 3 Optional. Specifies the magnitude for conversion for a field or variable. The V\X,y) magni tude mus t no t exceed 15 bi ts • Examples 1• II I , I I , In this example, snap ALPHA is always executed, while snap BETA is executed only when Z is less than or equal to O. The IF statement serves only . to place a condition on the snap; deletion of the SNAP parameter on the DEBUG header would render the IF statement unnecessary. These same considerations also apply to the use of the DISPLAY statement. (Note that the debug statements should not be compounded.) This example illustrates several aspects of SNAP statement usage. 2. I ,rIA,SIL,E, ,f/IAI" I IVI 12, 1.1, IS, I I~I t I EjLI)' ,(.1 0 lu 1R151 E, II,18, IYI 1E"'INI ~I-ITI AI 8, '-I t I IN,If,V, 1=it I , , ,I I I Ii, 1{I" ,I ,I I ,I I I 1 I~I I I I ,I I 1 I ,eIIiS"SINtAPi NtAIVI(,OI"C,OJUIRS,E')1 ,V,lJI',OI,,7r), I I Ij, At the time the SNAP is first executed, assume the bit configuration for COURSE is as follows: The output would then be: CRS NAV(O, COURSE) 33.75 11-8-6 M-5035 which represents the summation of the binary bit values, as specified 3 by V{360,14), of 2 and 22 (22.5 + 11.25 respectively). See paragraph 0.1, Example 3 for a detailed explanation. 8.3 RANGE DECLARATION The RANGE declaration specifies that a data-unit value is to be examined to determine whether it exceeds the values specified each time the data unit is set. This declaration can appear only within a data design. Format data-unit-name RANGE value l ..• value 2 . $ Explanation Data Unit Name A variable or field (floating-point, fixed-point, or integer). Value 1 The upper limit for this data unit. Value 2 The range separator, used only if value 2 is specified. NOTE Only one RANGE declaration is allowed per field or variable definition, If the RANGE declaration references a field, the declaration must be placed within the table brackets. Examples Each time data is s~t into the data element DISTANCE, the range is tested. If at any time the value is outside the range of 64 to 8, a printout to that, effect is made s imj lar to the following: DISTANCE EXrEEDS RANGE AT CALC + 2 where CALC is a statemant lahel and the statement causing the range to be exceeded occurs two statements after CALC. (For the purpose of statement counting, both the THEN separator and the $ terminate a statement.) 11-8-7 M...;5035 .) Ii ,0 ,c ,- J) tb, ~, ,. I I·, ,., , , I I I j,-,AIBI'-I£' ,r,AIBILI IH, ,.t, 1'1 ~J' 'P IRIO, Cl fl,)IM,RIEI th I" IM,fIR,O,C.1 I , I I ~I I, ,, J 1 1 I , I I I ~:Ut\:l:!:.: : 1~:::~:Y:T~:8:~ (:~::;:~:~:;,,):a:~:o:~i)(: :~ :~ :~: II I II I I I 1E'1"'1:b 1 tll~IMll,il If I I I I I , I , I I ::: : I I I I I I , I I If any occurrence of field FELU in table TABL is within the range, no message is printed out. If FELD is outside the range of values, the .printout might appear as follows: TABL ,, ,X ,, ,, EXCEEDS RANGE IL,O,'-,- ,j),'D, ,$, ,I , IV,R,B,L, ,x, ,li ,/IJ~ IV,RIBII., ,t, ,A, 1/161 3. I (4, FELD) I I I IL,A,B,i, ., ,,,,, IU, I'" ,~ I IS,E',TI ,)(, ITlo, I ,3, ,$, 181 tJlN,tr, t, , 3,8, ~, , I , , 1£!N,b,· , I-,O,c,-,) ,lll I I , IPIK,OI,-,£,),U,R,E I Ip,R,O,C,& ,,,, I AT DUMLI+I ,, ,I til 111+,7 ,$, , I , 1 ,, If X is greater than 38, the printout might appear as follows: X EXCEEDS RANGE AT LABI+O I I -8-8. I , I I M-5035. H. tl TRACE STATEMENT The THACE statement generates a line to be printed on the system output device for each executed statement that occurs between the TRACE and END-TRACE statements. This line identifies the flow of execution by the most recent statement label plus an increment of statements relative to this label. counts statements whenever a $ or THEN is encountered. following the TRACE statement should be labeled. Format TRACE $ dynamic statements END-TRACE $ 11-8-9 The Compiler The statement immediately M-5035 Example , I I I , IT,R,Aic,£. 6 1 • I , , • I I I I· I I I , I .,. J « « Assuming that Y is 0 and there are two occurrences of X in field FELD of table TABL, the printout might appear as follows: AAI + 0 AAI + I AAI + 2 AAI + 3 BBI + 0 BBI + 1 BBI +3 BBI + 4 BBI + 0 BBI + 1. BBI + 3 BBI + 4 BBI +0 BBI + I 11-8-1U M-5035 BBI -+ 2 CCI + 0 If in the above example Y is not 0 and there are no occurf(~lIces of X in field FELD of table TABL, the printout might appear as follows: AAI + 0 AAI + I AAI + 2 AAI + 4 BBI + 0 BBI + I BBI + 2 CCI + 0 8.5 PROCEDURE TRACE (PTRACE) The PTRACE parameter on the debug header provides a mapping of procedure linkages by printing a message for every CMS-2 procedure call encountered. Format PTRACE Example Print('d output shows Ihe eurrpnl proeedllf(' nalll(' and Ihf' (:nl1('d pro(,.,durt' nam(! at each pToc.edure call as follows: PROCEDURE xxxxxxxxxx CALLING PROCEDURE yyyyyyyyyy where xxxxxxxxxx is the current proced~re being executed and yyyyjyyyyy is t.he proced1lt p t.o be, executed. 11-8-11/11-8-12 Blank M-5035 Change 2 SECTION 9 DIRECT CODE Direct code statements, or symbolic machine code instructions, are operations which generally result in the generation of a single machine instruction. The CMS-2 Compiler processes as direct code, a subset of the language defined for the CMS-2 Assembler (see Sections 11 and 12). This direct code may appear in both data designs and procedures, but it must be properly bracketed and must follow a specific source card format. The remainder of this section describes the direct code statement format, the various directives available, and specific processing conventions. In addition, this section describes the differences between the direct code subset that may be embedded in a CMS-2 program for processing by the CMS-2 Compiler and the full assembly language capability available through the C~IS-2 9.1 As sembler. DIRECT CODE STATEMENT FORMAT When one or more direct code statements appear in a CMS-2 source program, they must be bracketed between two CMS-2 statements provided for that purpose. These state~ents DIRECT are described below. $ Must immediately precede a sequence of direct code. CMS-2 .. $ Must immediately follow a sequence of direct code. The format for direct code statements apprearing in a CMS-2 program is slightly different from that accepted by the CMS-2 !\.ssembler. The format is consistent, however, with that of CMS-2 source cards in that card columns 1 through 10 are strictly for programmer use and are ignored by the Compiler. The normal direct code format consists of three fields delimited by spaces and connas. Periods indicate the end of a coding line. Direct code statement is limited to one card. The general card format is illustrated below. 11-9-1 M-5035 Format CARD-ID label op-code operand Explanation 9.2 Label Instruction label. Always starts in column 11 of a coding line. A space in column 11 indicates no label. A label may consist of at least one but not more than eight alphanumeric characters; the first character must be alphabetic. It must not be followed by a period. Op Code Separated from label field by at least one space. May contain a mnemonic function code. A space signifies the end of the op-code field. Operand Contains the elements of the function specified by the op-code. Operand fields are separated by commas. Line termination and comment fields are acceptable and are indicated by a period followed by a space. DIRECT CODE STATEMENT REPERTOIRE The CMS-2 Compiler will accept the full AN/UYK-7 machine instruction repertoire as defined in Append,fx G. A more detailed description of these instructions may b~ found in Section 12. In addition to processing the symbolic machine language repertoire, the CMS-2 Compiler will accept several Assember directives and a variety of expressions and constants as operands in the direct code statements. 9.2.1 Direct Code Directives The following items define the CMS-2 direct code directives that are processed by the CMS-2 Compiler. 11-9-2 M-5035 1. ABS Format label ABS label Explanation Translates compile-time location counter value into an ABS object-time absolute address. 2. BYTE Format BYTE Explanation BYTE Redefines the embedded character size and number of characters placed in an object word for direct code character strings occurring subsequently within the same CMS-2 element. The number of characters to be packed into an object word. The size of the character field in bits, not to exceed 16 bits. 3. CHAR Format Explanation C. The octal code (000 through 377) that is to be redefined. e. The redefined value where current character e. becomes 1 1 1 new value e .• 1 11-9-3 M-5035 Change 2 4. DO Format label DO e, direct-constant-entry Explanation e An integer defining the number of times the direct constant is to be generated. If a label is specified, it shall apply to the first word of generated data. The direct constant entry must not contain a symbol. 5. FORM Format Explanation FORM Describes a special word format specified by the programmer. The word format may include fields of variable length, where the length in bits of each field is user-defined. e. 1 The number of bits in a user-defined field. The total number of bits must be equal to or less than 64 and the number of such subfields limited to 16. e i must be less than 32. The FORM directive may be implied. FORM is illustrated below. The format for utilizing the implicit Format 11-9-4 M-5035 Change I Only constants are accepted in Form reference sub-fields with the exception of a name appei-lring in the last sub-field where that sub-field size is dcfil1('d as 16 bits or greater. When a value appearing in a Form reference sub-field requires more bi ts than \Vas defined in the Form declaration the leftmost bi ts of the value will be truncated when packing the resul ting constant. Explanation N. Values to be packed into fields of word. I The Compiler determines the number of bits required to contain each value by dividing the word into n fields and forming the word accordingly. Format RES e ,Exp lana t i on RES Adds the value of the single expression in the operand field to the current location counter value. e An expression that must result in a determinable positive value. 11-9-5 M-5035 Change I 9.2.2 Constants Constants accepted in direct code statements are: 1. 2. Decimal numbers. Octal numbers. 3. Floating-point numbers. 4. Double-word-Iength octal numbers. 5. Double-word-length decimal numbers. 6. 7. Character strings from one to eight characters in length. Scaled decimal numbers. Constants may be used in direct constant entry statements and in direct code expressions. 9.2.2.1 The following paragraphs define CMS-2 direct code constants. Decimal Numbers A decimal number is converted to its binary equivalent and used in its binary form for all computations. The integer may consist of 9 digits if single word ,U,C.IEj~ ,A, jr,Wp,-,h'lo,R,l), ,V,8,yU,Ei 1 'I ,-, ,E"f&U, 4, 1.., mOt , ,g9.3,7,1 ,/1.5jJjI,?j I, I I , , I 1+ISl/1~ 1 ,-, 11-9-6 M-5035 Change 3 9.2.2.2 Octal Numbers An octal integer is specified by preceding the first digit with a O~ Each character of the octal integer (0 through 7). Rules for evaluation are the same as octal number may also be followed by the letter D to result • . (most signficant) octal must be an octal digit for decimal numbers. An obtain a double-precision Example lte'I"31 I '-I ,ptBt9 D,U,C"E,5, l-A3,5i" ,., ,pIR,OJl)tt,C.,E,S, ,0, olo,O,AO,o P,g I~, ,.3,?17,7,717,717t11~/, I, ,, ,, ,, , I I , I I I I J , ,+p,7, ',Jj1,3,ZJI ID,!,2,JJ), I-I 'PlpJ9~U,C.,EjS, ,3",J11IJ~ 119/1.1,3, J J I I I , 1 , I I l ' , J 11-' ,AlI/fA I , I I 1 PPIOIO,DlgOpepl/1 9.2.2.3 Floating-Point Numbers A floating-point number must be coded as a single word decimal mixed number conSisting of an integral part and a fractional Vart, and must include the decimal point. Spaces are not allowed within the number. The number is converted to a 64~bit floating-point number, formatted in memory as follows: Sign of characteristic S Mantissa where S is the sign of the mantissa. 1~-Y-7 Characteristic I M-5035 Example ,+~ .,.siif; i)~ 1-, ,P,PiOJ?,Y.C, §51 pe,O,o,o,oe,o.oI.ZJ4, , , I' , I -, ANA , , , , , ,I, ".q,z,z,',1,90 10 ,o, I , 1- ,2,. tf,~,t", 1-, ,P,R,Otl> ,U,C,E'i 51 ,0,0,0 tOe'0,oI0r9J2" , I I , I-, ,thNIA I , , , I .z.~,3,Sjs,' I, ~ 1, "7,'1, -, ,pl~,oP,u,C,EiSI ,0,0,0,0,°,0,0,90 10,1, , 1+,1,0,-1°" , , ,, , , " ,1f,Nt=A , , I I/,y 0, 0, '3 0,0,0, 010. 0, ,-,1 -,0, ,fl(,O,D, U,C,fi 51 IO,O,oeeee,golg I, , , , I ,It 7, '1, ~ " " 7,7,717, 7, , lAMA ,-,.,.3, , -, RR,O~U,CI§.51 13," ,'1,7, '7, 7,7,1,717,', , ,I , , I ,z, ~.3,/,DI".3,/,11'131· , , Ji,N..A , "II I i I I I 1 I I I I 1 I I I I I I I I , I I , I I The I * + and I I -I •I " * - I I operators are accepted when declaring" a floating- point constant. 9.2.2.4 Character Strings When a + precedes a character string, the Compiler regards the string as a constant; therefore, the number of characters between apostrophes may be from one to eight. One to four characters yield one computer word; five to eight characters yie Id two computer words. Characters are packed, right-j ustified, within the generated words with leading binary zeros as required to pad the word. The implied code for character strings in ASCII. Example ,., ,., 'l'I OI5i I I P,&OI ~1L(1~1 Ei ~ IlI9/~OI'I~ ft-, 1/.A~ ,&£,'1 I I I It, ,'IA,'-I &Ei~~E 1'1 I·' I P,RI~,"t1 ~ Ei§ lo~Ot2£,~",/,5i.2I~ I I I I I I I , 1 I 11~1.l~9~413~OI5i I I I I I I I I I I I I , 11-9-8 I I I M-5035 Change 2 9.2.2.5 Scaled Decimal Numbers A decimal or floating-point number followed by a Compiler as a scaled, fixed-point value. ~::/N The form of shall be handled by the scal~d numbers is shown below: Format Nl ~::/N2 Explanation NI May be a decimal or floatinu-point number. N2 Shall be a decimal number. The converted decimal number shall be aligned to a scale value indicated by N2. Example 9.2.2.6 Scaled Octal Numbers An octal number followed by a IO/N shall be converted and shifted as specified by the scale value following the "~c/" indicator. The compiler will not test the scale value for overflow but will simply perform a left shift circular or right shift sign fill by a number equal to the scale value. 11-9-9 M-5035 Change 2 Format Nl*/N2 Explanation Nl Scaled octal number N2 Decimal number If N2 is signed negative, Nl shall be converted and shifted right N2 bits. If N2 is unsigned or positive then NI shall be converted and shifted left N2 bits. Example 9.2.3 Data Expressions The data expression forms that are accepted by the CMS-2 Compiler are defined below: 1. Constant (as defined in paragraph 9.2.2). 2. Numeric tag (identifier assigned a value by equals statement). 3. Operand -operator-operand (operand must be a constant in this form). 2 2 l The operators allowed within data expressions are: 1. + (addition) 2. - (subtraction) 3. * (multiplication) 11-9-10 M-5035 Change 2 4. / (division) Mixed mode constants are not permitted in data expressions. 9.2.4 Literals A literal in CMS-2 direct code is defined as a data expression contained within parentheses. Examples (56) ('Cr\T' ) One or two object words result from evaluation of a literal. allowed in literals are defined in paragraph 9.2.3. 9.2.5 Data expressions Direct Constant Entries The CMS-2 Compiler accepts data words declared in direct code that result in one or two generated computer words. Character strings may require more than two words. These direct constant entries shall consist of declared constants as defined in paragraph 9.2.2, character strings, or data expressions. A + or -sign in the operation field followed by one or more subfields in the operand field signifies that a constant is to be generated. Whenever ,a + or - sign appears as the first character of the operation field, any number of spaces or no, spaces may separate the sign from the first operand. Subfields are separated by commas. In generating constants, the Compiler uses the size of the object computer word. If the operand field contains one subfield, the signed value of the subfield is right-justified in the generated word. If the operand field ,contains two subfields, two equal-length signed subfields are generated with the values right~ustified within each field, and so forth. The first subfield must be signed. Successive subfields may optionally be signed. The absence of a sign implies a positive value. If variants of this implicit equal subdivision of data words are required, the capabilities of the FORM directive may be used to derive the desired format. This is accomplished by referencing the FORM label in the operation field. 11-9-11 M-5035 Change 2 ExampH~s 1. 1-1/",3Iel~ ,P,~OrbJU,C,€j5, ,3,7,',7,717,3,'1,','7,7, ,tB",-,~",2,,!t ,1-tl,S, ,-, ,PtRp,b)",C"c, s, ,9 I e,7"",.t,~7,.f,3t I , I , I , ,., If the operand field contains just one subfield immediately followed by a D, or if the constant is a floating-point number, the Comriler . generates a double-length constant in two successive computer words. The first generated word of the double-length constant will contain the least-significant bits of the result,. context is only meaningful when appended 2. ,+, ,',0,.,0, ,.1 I I , I , , I I ., I I , I I , , ,., I , , I I a numeric constant. pI7,?,'1,'1,'1I'1,7,'1,'1t71 , , I , I , I I., , ,., Ip,It,O,b,u, G§S, ,.3"~ 7",Sj4,3t241J II I , , I , , I,I , I I I ~o IPIKJOtP,U,c.,c,Sa ,OIo,999lggq?,o.11 J ' I I I I , , I ,I iJ.J9 0 ,999OPeel rr,O,I,.l,3,4,5p1"1J,,S,i,3JZ,i~, I The letter D in this , , I I I ,., I" ,Sj', " , " ,/)19°,0,0 BD,90 ,l,2i I Character strings longer than eight characters may be entered as a direct constant entry_ No character s~ring in CMS-2 may exceed 132 characters. 9.2.6 Instruction Expressions The CMS-2 Compiler recognizes and processes simple expressions appearing in the operand field of direct code instructions and in direct code directives. Expression forms allowed are: a. Symbol (label, tag, $). b. Symbol ~ constant - If symbol-constant is used and the symOOl externally re~erenced, see note at end o.f section 11.3.3.12. ~ 11-9-12 .. IS M-5035 ChClnge 2 c. Constant + symbol. d. Constant. e. Literal. A constant used in an instruction expression must be limited to a decimal or octal integer. The $ symbol is used only to reference the Compiler location counter. The contents of the location counter are accessed by coding the symbol $. $ signifies that the contents' of the location counter are to be substi tuted in the expression. Example ,., An alphanumeric label may be used within an expression. The label must conform to the rules for labels as described earlier; for example, it must not exceed eight characters; it must consist of alphabetic (A through Z) or numeric (0 through 9) characters and the label must begin with an alphabetic character. When the expression is evaluated, the value allocated to the label is substituted in the expression. Numeric constant values may be equated to labels by the CMS-2 high-level declarative EQUALS for use in direct code expressions. The high-level EQUALS statement allows simulation of the parenthetical static expression capability in direct code. An identifier that has a value assigned by an EQUALS statement is defined as a tag. Example The tag VALl can be used in a simple expression carrylng an associated value of 7.5 when the expression is evaluated. 11-9-13 M-5035 Change 2 A sym,bol defined by a high-level MEANS or EXCHANGE statement may be referenced in direct code. However, the character string to be substituted for the symbol in the direct code issubj ect t,o the following restrictions: a. The character string may not contain a comma or a period (i.e., it must represent a single term of a single direct code statement). b. The character string must be equal in length to the symbol. it replaces in direct code. NOTE Character substitution for a symbol defined in an EXCHANGE statement will be performed for the purpo'se of statement interpretation. However, no source card or listing editing is performed. Example ~~A:::i.~~::~:~E~T~fu1:i f: : : : : : : : : : : : : : : : : l ,-I I I I , , I , I 1 .I I I I I I I I I I ,., 1 '" I·' I I I I I 1 AA&~ ~+. ~.: :: :: : : I:::::::::I : : : : : : : : : l IL,~ , tLXa,IPr4,RM"Ka3, ,.1 C1,\5,-,2, e ·1 . I . ~""'--I~ A : : I I I I I I I I , , I·' I ,!::-'-L-L....L-JL.-L........ The direct code statement would be assembled by the Compiler as: LB 84, TAGll, K3 11-9-14 ............. M-5035 Change 2 9.3 PROCESSING CONVENfIONS The following conventions apply when processing direct code statements appearing in CMS-2 programs: a. Direct code statements, bracketed by DIRECT and CMS-2 may appear within the following source program elements: b. 1. Procedures (PROCEDURE). 2. System data designs (SYS-DD). 3. Local data designs (LOC-DD). The rules established for referencing labels within or from . . outside procedures and data designs apply to direct code segments. The direct code statements assume the same refer· encing and allocation characteristics as the program element within which the direct code residcso A direct code statement may be declared to preset a data unit defined in a high-level declaration. The direct code statement must be labeled with the duplicate of the identifier of the high-level "declarative and must not precede the high-level declaration. It must be given within the same data design. Any direct code following the preset of a high-level data unit is assumed to be part of that preset unless labeled by an identifier duplicating another high-level definition. 11-9-];1 M-5035 Change 2 Example I I I I I I I I I I ,', I J , , " • I I I I , , I I' I I I 1 , I I I I J I J I I I I I I I I , I' I I I I " I I \ I , :::::::::I~~~=~Y:::-~)I ::E:K:A:~;'L:E: !~ :: ::: The computer word to which the variable NAMI is allocated will be preset to the decimal number 625 declared 'in the low-level direct constant entry. c. Direct code segments may reference other direct code segments resident in the same SYS-PROC or SYS-DD. d. CMS-2 high-level statements may reference direct code statement labels (GOTO or SWITCH only). e. CMS-2high-level statement may not reference data units defined only by direct code statements. f. Direct code statements may reference data unit names (symbolic addresses) defined by high-level declaratives. K-designators must be coded explicitly. II-9-16 M-5035 g. Direct code statements may reference high-level statement labels. h. The rules of symbols, operator priority, and elements established for direct code statements are independent of those applicable to high-level statements. i. The following mnemonics, used to reference computer registers, are recognized by the direct code processor: j. 1. Accumulators: AO, AI, A2, A3, 2. Index registers: 3. Base registers: 4. Quarter-word memory: 5. Half-word memory: L, U. 6. Whole word memory: W. 7. K-designators: A~~A5, A6, A7. BO, Bl, B2, B3, B4, B5, 86, B7. SO, 51, 52, 53, 54, 55, 56, 57. Ql, Q2, Q3, Q4. KO, KIt K2, K3, K4, K5. K6, K7. Direct code half-word instructions are packed together into one word where possible. Labeled half-word instructions will always be assigned to the upper half of the word. The following tables illustrate the method for packing half-word instructions (HW = half-word instruction, FW = whole-word instruction): 1. Instruction Nonlabeled: Memory Assignment HW IiW FW FW HW HW } HW HW 11-9-17 M... 5035 Change 2 j . 2. Labeled: FW FW HW HW LABLI k. } HW HW FW FW HW HW LABLI HW HW FW FW HW HW LABL2 HW LABL2 HW LABL3 HW LABL3 HW Spaces appearing between elements in operand fields of direct code statements are ignored except where specifically defined as a delimiter, as illustrated below: MOD M + on RAD + R Spaces ignored. AD Illegal because of spaces within element itself. 1. Labels of direct code in system data designs are treated as global labels by the Compil~r. m. When referencing procedures declared by high-level statements, the direct code instructions must be the same as the instructions generated by the Compiler for a high-level procedure call. n. A direct code statement that contains an explicity coded sdesignator (base register) may contain only a constant in the Y-field. Table 9-1 summarizes the values and symbols that may appear in direct code struction subfields and in direct constant entries. 11-9-18 in . . Table 9-1. a ~ ~ I y Instruction Sub-field Valid Forms k b s ak af4 sy m/h I w p I) Oc ta I dig i t x x x x x 2) Q (1-4) x x x x x 3) ttL" (=1) x .x x x x 4) "U" (=2) x x x x x S) "W" (=3) x x x x x 6) A, B, C, n,H, K, S (0 - 7) x x x x x 7) NTAG (=0 - 7) x x x x x 8) MEAN/EXC (2)-6) above) x x x x X 9) Integer Sl77 x x x x 10) NTAG x x x x II) "ALL) (= 177777) x 12) C(O - 17) x 13) In tege r 14) NfAG s 177777 x 15) Y operand $ Y x e DeE Lit ..0 I ..... -.0 (~I77) S 177777 16) Integer So77 17) ~ Integer or Integer x n3 ::r'1 1»U'1 x x ::so cCw (t)U'1 N x Table 9-1. (continued) n3: ::r. 01 Q,) a x ~ Relocatable Identifier Integer x 20) Relocatable Identifier x 21) $::!:, Integer x 22) Li teral: (Constant, NTAG, data express.) x 19) k b s ak af4 sy m/lJ 1 24) MEAN/EXC tag 25) Constant p e OCE Li t x x X x x x x x x x -.0 I N 0 26) Const [;] Const (no mix) 27) Char String S132 chars 28) Integer ~37777 ~4000 :s 0 r.Q C'D x 23>- NfAG w N Integer + Relocatable Identifier 18) 1-4 1-4 I y x (BCW) x (BCWE) x RTAG - Identifier equated to identifier. NfAG - Identifier equated to a value. e - data expression Identifier - includes RTAG w 01 M-5035 Change 2 The following items. identify additional capabilities ayailable under the CMS-2 Assembler which are not included in the direct code capability of the CMS-2 Compiler. 1. section declarations in the label field are not allowed (direct code is compiled under the existing high-level Addres~ing allocation environment). 2. Macros and related directives are not allowed (including macro name and statements, paraform usage, and macro reference lines). 3. Library retrieval from direct code is not allowed. 4. Labels of direct code externalized by postfixing an asterisk to the label are not allowed. 5. The CMS-2 Compiler does not process direct code statements containing expressions using parentheses. 6. 7. The following directives are not acceptable as direct code: a. END b. SEGEND c. LINK (can use the high-level EXTREF statement instead) d. Loader directives e. LLT f. LCR g. LIST, ELIST, and NOLIST h. OnD and EVEN i. PXL j. WRD k. RF$ 1. EQU (can use the high-level EQUALS (~:'AC, ::;CS, etc.) state~ent instead) SETADR and LIT literal directives are not allowed (the Compiler controls when and where to dump the literals). 11-9-21/11-9-22 Blank M-5035 Change 3 SECTION 10 COMP II.ER OUTPl JTS A variety of hardcopy or listed outputs is available from the CMS-2 Compiler. The method of selecting these various outputs using the OPTIONS statement is described in Section 7. The purpose of Section 10 is to explain the various li~ting formats, page headers, and column descriptors. 10.1 SOURCE LISTING FORMAT The source listing provides a record of input to the Compiler. This listing consists of a page header for each listing p'age containing the element name and number, the date of the compilation and a page number. ....." If the source· listing is requested by a SOURCE option and no OBJECT option, the format is as follows: Meaning Column Heading CARD ID Columns 1 through 10 of the card image. SOURCE STATEMENT Columns 11 through 80 of the card image (the CMS-2 source statement field) • ERROR COND IT ION An error message for any syntax errors detected in the source statement. If the source listing is requested by a SOURCE option and an OBJECT option (no 8M), the body of the listing consists of several columns, the contents of which are explained below. Column Heading ERR Meaning Used to indicate errors that occurred in the adjacent source statement. A list of these errors, their meanings and identifying numbers that appear in the error column is given in AppendixE. 11-10-1 M~5035 Change 3 S Base register numter. AC Address counter number. LOC The relat~ve memory location (in octal) of the first instruction or , data word generated for this statement. LABEL The label associated with the source statement or the first 10 characters of the input statement. STATEMENT A character field containing the remainder of the CMS-2 source statement. CID Four characters of the card ID (columns I through 4). SID Four characters of the card 10 ,representing the statement number (comumns 5 through 8). CR The remaining two characters of the card 10. 10.2 SOURCE AND MNEMONIC LISTING FORMAT ·1 The source and mnemonic listing (8M) provides a record of the source iaput to the Compiler as well as a side-by-side mnemonic and octal representation of the machine instructions generated for the source statements. This listing consists of a page header for each listing page containing the system procedure or system data-design name, the date of the run, the number of the element being compiled, the page number, and the type of element. The body 11-10-2 M-5035 of the listing consists of several columns, the contents of which are described below. Meaning Column Heading ERR Used to indicate errors that occurred in the adjacent source statement. A list of these errors, their meaning, and identifying numbers that appear in the error column is presented in Appendix E. S Base register number. AC Address counter number. LOC The relative m~mory location (in octal) of the data or instruction (13 bits), or the operand of the instruction. FUNCTION The first half of the data or instruction containing the operation (upper 16 bits left-adjusted). x Flag for external reference (R) or transient reference (T). LABEL The label associated with the source statement or the first 10 characters of the input statement. STATEMENT A character field containing the remainder of the CMS-2 source statement. CIO Four char~cters of the card 10 that appeared on the card aS50ciat~d with the statement (columns I through 4). 11-10-3 M-5035 Change 5 I SID Four characters of the card 10 representing the statement number (col umns 5 through 8). CR The remaining two characters of the card 10. May contain·a flag (R) in column q if the source statement references a reserved word (see Append ix D). LOCAL CROSS-REFERENCE LISTINGS The local cross-reference (CRL or CR) listing provides a record of each symbol de10.3 fined in the system element; the listing shows the location of each symbol and all re- I ferences to that symbol. Also included in the list are global symbols defined in other elements but referenced within the current element. If no CR or CRL is requested, only unallocated identifiers and references are listed. The listing contains a page header at the top ci. each page. The header shows the name of the system procedure, the date of the run, and page number. The body of the listing consists of several columns, as follows: Column Heading Meaning AC Address counter number. S Base register number. LOC Gives the relative location, in octal, of the following label. A location of all sevens denotes an allocation error. LABEL The label to which the references apply. The labelS are printed alpha bet i Ca 11 y • The s ymbo 1 ")~';c******" denotes a genetation error in referencing an identifier. I I -10-4 M-5035 Change 5 EXT This column identifies t.he label as being defined as local or external to the system procedure (blank means local to the system procedure, D means external definition, M means local, implicitly MODE defined in the system procedure, R means external reference, T means transient reference).' If not blank, the label will also appear in the global cross-reference listing. REFERENCES A set of octal addresses within the system procedure that shows the location of each instruction using the preceding label. The word NONE appears if there were no references to the label. The references are given in the same format (AC S LaC) as the location of the referenced identifier. 10.4 GLOBAL CROSS-REFERENCE LISTING The global cross-reference (eRG or CR) listing provides a record of each global element defined in the system, showing the name of each system element that referenced it. The global cross-reference appears at the end of the compile. The listing consists of a header at the top of each page; the header contains the name of the system, the date of the run and the page number. The body of the listing consists of several columns, as follows: Column Heading EXT Meaning The label is an external reference. The definition is presumed to be given in another compile-time system. 11-10-5 I M-5035 . 10.5 LABEL The label of the element referenced. Labels are printed alphabetically. DEFINED IN The name of the system data design or system procedure that contained the element. REFE RENCED BY The nam~ of each system procedure that referenced the label. SYMBOL ANALYSIS FORMAT The symbol analysis (SA) option provides information as to the USAge of the symbols in the system compilation. The analysis utilizes the following categories (the items in the individual categories are printed in alphabetical order) : a. Files. b. Formats. c. Tables (including subtables, like-tables, d. Switches. e. Variables. f. Procedures-functions. g. Index registers declared locally. item-areas~fields). A header, printed at the top of each page, gives the heading SYMBOL ANALYSIS and the identifier as either a SYS-OU or SYS-PROC name. Each of the above categories is headed by the category type and bracketed with lines of asterisks. The following are descriptions of the headings for the various categories: a. Files: The general heading is FILES DECLARED. Column Heading NAME The columns are: Meaning The name of the files. 11-10-6 M-5035 MU The file mode: II - Holler i t.h • B - Binary. The record type: TP V - Variable length. F - Fixed length. 5 - Stream. C0<1f~. HRDWR The hardware MXSZ The maximum record size. MXRCU The maximum number of records. NSTC The numb~r of associated status constants. b. Forma t.s: The general heading is FORMAT STATEMENTS. heading sets of two headin~Js There are eight idpnt iCHl each as described below: Column Ileading NAME The n::lI:w of t.he format. XT If declared, the external icl('ntifil~r, R, for external reference or IJ for external defini.tion. c. Tables: Th(~ firsl tab Ie. seUrTJerll or the print Jilll~ id(~ntirips the table or The sec 0 nd s e g me n tid e n ti fie s t h (~ a t.t r j IJ u t. p s assoeiated tabln. as soc ita I ed at t r; [HI Th(~ I (,~s 0 a~suei;""ll f the t tJ h I ('or third segment. identlfi('s the fields and Iheir • 11-10-7 M-5035 Column Heading Meaning TABLE-NAME The name of the prime table being described. ASSOC NAME The name 'of a subtable, like-table of item-area associated with the prime table. ASSOC TYPE One of the following: SUB - Subtable. LIKE - Like-table. ITEM - Item-area. TP Denotes the type of the prime table: H - Horizontal. V - Vertical. A - Array. NI TM If the length of the table is variable (specified by a NITEMS statement) ,this eolumn will contain NT. PACK NDIM Denotes the packing usage on fields for horizontal or vertical tables or denotes the number of dimensions if an array; this may be NULL, MEDIUM or DENSE or an integer from I to 7. ADD MOD Indicates whether the table is addressed directly (DIR) or addressed indirectly, (IND). 11-10-8 M-5035 Specifies the number of words per WDS/ ITEM item. INDEX-NAME Gives the name of the major index for the table or the associated table. NO. ITEMS DIMS. SIZE The number of items if H (horizontal> or V (vertical) t or the size of the dimensions if A (array). EXT Designates whether the table or associated table is externally defined (D) (R) t t externally referenced or transiently referenced (T). START ITEM The item number at which the FIELDS Applies to the remainder of the associated table starts. headings. NAME The name of the field. TP Defines the field type: F - Floating-point. B - Boolean. H - Holleri th characters. A - Arithmetic fixed-point. I - Integer. SN Indicates whether the field type is S for signed, U for unsigned~ or blank if neither S nor U apply. Starting bit position in the word. START BIT 11-10-9 M-5035 WORD LOC. The word number by which the field NO. BITS OR CHARS Designates ihe number of words for is addressed. multi-word fields, the number of bits for types F, A, or I, the number of characters for type .H, . or the number of status constants for type S. FB d. Fractional bits. Switches: The general heading is SWITCHES. The columns are: Co 1umn Head ing Meaning NAME The name of the switch. TYPE One of the following: S - Statement switch. P Procedure switch. IT - Item switch. NO. PTS Gives the number of switch points. EX Defines the external specifications: R - Externally referenced. T - Transiently referenced. D - Externally defined. SHSW-CVRBL Indicates the name of a shared switch; if the switch is an item switch (IT), the compared variable is given. 11-10-10 M-5035 Change 3 Thf(~(~ INPUT e. (!olumns of input parnmelHrs PARAMETERS if switch type P. OUTPUT PARAMETERS Three columns of output parameters if switch type P. Variables: The general heading is VARIABLES. The columns are: Column Heading Meaning NAME The name of the variable. TYPE Gives the variable type: F - Floating-point. B - Boolean. S - Status. I - Integer. A - Arithmetic fixed-poi n t. H - Hollerith. EX Defines the external specifications, if any: D - Externally defined. R - Externally referenced. T - Transiently referenced. M - Implicitly and locally defined. SN Specifies whether signed (8) or unsigned (U). FB Fractional blts. NO. CHAR. BIT The number of characters, bits, or status constants depending on type. 11-10-11 I f. Proced ures -F unc ti ons : The general heading is PROCEDURES-FUNCTIONS. Column Heading g. The columns are: Meaning NAME The procedure or function name. TP Either P (for procedure) or F(for function) • INPUT PARAMETERS Four columns listing the input parameters. OUTPUT PARAMETERS Four columns listing the output EXIT The names of parameters. an~ abnormal exits. Index Registers Declared Locally: The general heading is LOC-INDEXES DECLARED. Column Heading The columns are: Meaning NAME The name of the local index declared for the current system procedure. REG The B-register assigned to the above ,symbolic name, or the letter T if a temporary cell is assigned. PROCEDURE The name of the procedure i~ which the local index is defined. 10.6 COMPILER ERROR SUMMARY At the end of each compile-time system for which the OBJECT option is used, a summary of errors is listed. The name of each element, its element number within the compile and the number of syntax/generation errors and the number of allocation errors are listed. The syntax/generation errors are individually listed at the front of t.he eompile listing. 11-10-12 Th(~ allocation errors are flagged M-5035 in th(~ source (and mnemonic) list.inu where t.hey occurr(~d and art.! al!'lo lbdc'd in the local cross-reference. 11-10-13/11-10-14 Blank M-5035 SECTION 11 ASSEMBLER 11.1 ASSEMBLER FUNCTIONS The Assembler accepts symbolic source code in eO-column card image format and translates this coding into an object machine language suitable for loading into the AN/UYK-7 Computer memory via an object-code loader program (see Section 3 of Volume I). The Assembler operates in conjunction with the Monitor to provide programmers with a level of programming assistance not ordinarily associated with an Assembler class of language processors. The Assembler capabilities include: a. Macro directives as well as other directives which enable the programmer to control the assembly process in a positive way via conditional assembly. I b. A powerful set of directives which enables variable bit-field definitions, character substitution, segmentation, and so forth. c. The ability to handle multiple addressing sections (counters) for use in segmenting and assembly-time allocation control. d. Printer side-by-side listings of the symbolic source code and also an edited representation of the generated object code. e. Optionally selected printer listing of all alphanumeric labels referenced within the source code. The labels are separated into internally referenced labels and those which can be referenced from another program. f. Optionally selected printer listing of all alphanumeric labels crossreferenced with their respective addresses. g. Evaluation of arithmetic and logical expressions. h. Relocatable object machine code output which employs full binary card image format (960 punches per aO-column card). 11-11-1 M-5035 i. All Assembler-detected errors in source statements are flagged when encountered. The $ASM card commands the Monitor to place the Assembler in memory and initiate its execution. In operation, the Assembler scans the. subsequent symbolic input code twice. The first assembly pass performs a pseudo-generation primarily to record any programmer-defined r.'tacro sample code and to define forward referencing. The second assembly pass simultaneously produces the object code and the program listing. When referenced in the program, generation for macro sampl~ code is carried on as a subassembly of the main program. Figures 11-1 and 11-2 show the basic functions performed during the first and second passes, respectively. Jl.l.1 Input Language Structur~ Inputs to the Assembler consist of programmers prepared symbolic coding statements. The programmer has one basic unit available when constructing symbolic code on the coding sheet. This unit is the operation which may consist of three parts: 1. Label. 2. Statement. 3. Notes. The label and notes are generally optional attachments to the statement and are always separated from the statement by.at least one space. In order to apply notes t the statement must be terminated by a period (.). Format I I I A program written in the CMS-2 Macro Assembler Mnemonic Language consists of action statements. Their structure is discussed in the following paragraphs. 11.1.1.1 Label Within the progranuning language, the labels consist of 1 to 8 alphanumeric characters. o should The first character of any label must be a letter. The letter also be used with caution as any character of a label because of the iI-I1-2 M-5035 Library Source Source Tape Intermediate Source Tape In ut or Source Cards Input/Output Syst em (Part of Monitor) _ _ _--.._... or Intermediate Assembler Source In Input/Out put 1 - - -.... Core Storage Controller ~ Macro Sample in Core Storage Figure 11-1. Translator Item Table in Core Storage Assembler Pass 1 Data Flow 11-11-3 M-5035 Object Tape Intermediate Source Tape Monitor Object Cards or - -.. Side-by-Side Listing In termed i a te Assembler Source in 'Core Storage ....._ _ _ _..... Input/Output Controller Macro Sample In Core Storage Translator Figure 11-2. Item Table in Core ....._ _ _ _• Storage Assembler Pass 2 Data Flow 11-11-4 M-5035 visual difficulty in distinguishing it from zero. A label is used to identify a statement which may be referenced by another. 11.1.1.2 Statements Except for purely comment statements, programmers are normally concerned with three basic fields of a coding line: 1) label field; 2) operation field; and 3) operand field(s). A line of coding is defined as a logical symbolic statement not necessarily confined to a single physical line; for example, a logical line may extend over several cards. 11.1.1.2.1 Fields. Fields are delimited 'by at "least one space following the last character of the field. There can be no spaces between characters of an element or expression within a field or the Assembler will interpret the space as the end of the field. The label field is always assumed to start in column 1; if there is no label field, its absence is indicated by at least one space starting in column 1. Subfields. Any field may consist of one or more subfields separated by a comma and terminated by a space. There can be no spaces between the characters of a subfield or between the subfield and its terminating. comma. The Asserrrbler interprets the first space as terminating the current field. 11.1.1.2.2. To the Assembler, a comma indicates that another subfield follows; therefore the last subfield coded does not terminate with a comma, since a space terminates both the field and the last subfield. Any number of spaces may intervene between a terminating comma and the first character of the next subfield, since the Assembler was alerted that another subfield will follow. 11.1.1.2.3' Omission of Subfields. The first subfield must always .be expressed If the programmer desires to omit this field, he codes a zero followed by a comma. (A coded zero' is not legitimate as the fi rst .subfie ld of the labe 1 field). 11-11-5 M-5035 Intermediate subflelds may be.omitted by coding two successive commas, ot commaspace..;.comma, or cornrna-zero-comma. The Assembler interprets any of these representations as assigning a zero value to the subfield •. Trailing subfields ma~ be omitted by following the last ~xpressed subfield with at least one space. The Assembler assigns a zero value to any missing subfields~. ll.1.1.2.4 Statement Continuation. A logical coding line may be interrupted at any point (~xcept between apostrophes) by coding a semicolon (;) as the next character and continuing the line on the next physical line: i.e., next card. The Asse!i.bler ignores any characters following the semicolon on the interrupted line and continues its scan starting with column 1 of the next card. The sequence of coding on continuation statements must fOllow the syntax rules governing fields and sub-fields. 11.1.1.2.5 Statement Termination and Notes. Programmers may include notes as part of their coding lines by following the state~nts with a period followed by at least one space. The period space combination, except when it appears between apostrophes, causes the Assembler to stop scanning for additional fields or subfields. If a coding line involves a fixed number of fields and subfields and all are encoded on the line, programmers may add notes without the preceding period space combination, since the Assembler ceases scanning when the last required field or subfield is evaluated. A coding line may be nothing but a notes line. In this case, the period space must precede the first character of the notes. Any number of spaces or no spaces may precede the period. 11.1.1.2.6 Blank Card Images. Blank cards (source statements containing no non-space characters) are given a source line number but are otherwise ignored by the ASRembler. It is important n6t to include blank cards within macros since this results in slowing up the expansion of them, whenever called. 11.1.1.2.7 Language Structure Summary. Spaces delimitiields. A comma delimits a subfield except for the la$t encoded subfield which terminates with a space. A semicolon (except when it appears between apostrophes) denotes line continuation, causing the Assembler to continue its scanning with 11-11-6 M-5035 the first character of the continuation line. A period space combination (except when it appears between apostrophes) signals the Assembler to terminate line evaluation. 11.1.1.3 Notations Used In This Section Whenever a statement or operation is described in this section, a uniform system of notation is used to define the structure. This ~otation is not part of the language, but is a standardized notation that may be used to describe the syntax (construction) of any programming language, thus providing a brief but precise means of explaining the general patterns that the language permits. It does not describe the meaning of the statements or operations but merely describes the structure; that is, it indicates the order in which operands must appear, the punctuation required and the options allowed. 11.1.1.4 Coding Control Statements Control statements direct system performance rather than user program generation. Conunents, printer page control and product directives are in this category. 11.1.1.4.1 Comments.. A comment is a special type of operation which may appear .anywhere within a source program. The usage of a comment is optional. A comment in the source program does not produce any generation and is detected by the system under the same form as notes in a language statement; that is, following a period and at least one space. Format 11.1.1.4.2 Printer Page Control. If the first character of a language statement is a slash (/), the printer listing will be ejected to the top of the next page. The character may precede a label, a statement (in absence of a label) or singly on a separate card im~ge. 11-11-7 M-5035 Format II, III It I I ,",0 mE,S, , 1·1 I I ,., , I , 11.1.1.5 I Directives· There are two forms of directives: I) those that direct the system and prod- ucts to perform specific functions, and 2) those thatdirec~ the Assembler generation. Within the Assembler generation, the dIrective is a predetermined mnemonic coded in the operation field of a language statement. These directives take the same form as the language structure of paragraph 11.1.1. Format CODE: f.cDIRECTlVE 1 .1 11.1.2 Addressin~ Sections The Assembler provides the programmer with the ability to assemble program sections which are intended to operate a~ a sin'gle program unit, but which, for segmenting purposes, the programmer may consider discrete. A simple example is the case of any program unit consisting of instructions and data. One good purpose for keeping them separate is to take advantage of hardware overlap in accessing data from within instructions (see Section 3, Volume 1 of this document) . Il~I.3 Segmentation Segmentation is accomplished through use of· the SEGEND and PXL directi ves. SEGEND is used when assembling back-to-back segments. PXL is used to output 11-11-8 M-5035 externally defined labels to be, us~d as source input in programs assembled at some other time. 11.1.4 Assembly Base Addresses rhe Assembler initially sets all initial address counters to zero. The base address of any address counter can be set to some other value by beginning coding for that counter with a SETADR directive. When generating code for the AN/UYK-7 this may have the effect of biasing the base register number on all references to words associated with that address counter. In generating code for non-base register machines, address counter values may have a direct correlation to physical memory addresses. 11.1. 5 Conditional Assembly Sometimes it is desirable to code a program on a modular basis. Certain sections of the progra~ may not Qe needed at any given time. Whether to omit or include this code may be based on a condition known at assembly time. This leads to what is sometimes called conditional assembly which can be made by two methods: a. Any given source statement can be generated dependent on the setting of a condition known at assemhly time. This can be done by coding the statement as part of a DO line, where the DO count is the result of the condition (either 0 or 1). b. An instruction or series of instructions can be effectively overridden or included in object output by following these instructions with a negative reserve (RES) directive, dependent on the result of the condition. If the result of the condition is one, the specified number of previously generated lines of code are overlain by those following the negative reserve line. II-11-9 M-503S Format II. 1.6 Library USa(le Source library' programs can be included within the calling program at the pqint at which they are called. 1 1. 1 • 7 Ma c ro s Often programs require repetition of sequences of coding not necessarily identical hut similar enough so th~t repetition of the coding becomes mechanical. A device wi thin the Assembler which generates such sequences is called a macro.' The Assembler stores the .,.HC fO sample code when 'encountered and generates this coding whenever the pro"edure is called upon. The Assembler modifies the lines generated in accordance with pnrameters supplied in the calling line/-reference J j ne . 1]-11"..10 M-5035 Change 1 lI.l.R Expressions An expression is an elementary item or series of elpmf~nts connprted hy opf'rntors; which, when evalu~ted, results in a binary value, a floRting point number or a memory reference addresse If more than one element is included within an expression, they must be separated from one another by operators. An elementary item is an expression containing only one element. 11.1.9 Assembler Generation The Assembler generates object code in accordance with the capabilities of the AN/DYK-7 Computer instructions. 11.1.9.1 Ful1~Word Full words are generated from computer instructions, data words, FORM reference lines (see paragraph 11.3.3.8), and character strings. ORe d'ata word can produce up to two computer words of object code. A character string can generate a variable number of computer words. 11.1.9.2 Half-Word If a number of successive half-word (16-bit) instructions are encountered by the Assembler, they are packed two per word. When a half-word is encountered between two full words or is the last of an odd number of successive haifwords, it is generated in the upper half-word and the lower half-word contains zeros. 11.1.10 Temporary Storage Two modes of temporary storage are available: 1) magnetic tape, or 2) computer memory. The standard mode is storage on magnetic tape. Small programs can be assembled using core memory as temporary storage (see paragraph 11.2.1). 11-11-11 M-5035 Change 1 11.1.11 Assembler Output Output from the Assembler consists of relocatable object code. This output is in a format recognized by the Object Code lnader and may also be composed of Loader directives passed on through the Assembler source input language. 11.1.12 Assembly Time Allocation Allocation of address sections can be achieved at assembly time by including ~bject Code Loader directives in the source input to the Assembler (see Section 3, Volume I of this document). 11.1.13 Linking Values corresponding to labels can be made available to some independently processed code by suffixing the labels with an asterisk. Conversely. symbolic program names not defined within the current program can be referred to, and the necessary information is saved to provide a link to the program which defines them. The current program simply declares these names in the operand field of a LINK directive • .11.2 CONTROL CARD Generally a card containing an asterisk (lie) in COlUDDl I is considered by the Assembler to be a control card. One exception to this rule is when column 2 conta~ns a space (blank). This combination is used to achieve assignment ofa particular line of coding within a macro to a label found on the macro reference line (refer to paragraph 11.4). Those non-Assembler control cards found between the first card and assembly terminating END card are transmitted to the output code when they are encountered. 11.2.1 Start Assembly (ULTRA) Each program submitted for assembly must begin with the ULTRA statement. 11-11-12 M-5035 Change 3 Format *ULTRA , source-option, object-option, listing-option name; version Explanation Source Option One of the following (option: R maybe used with MIS): I M - Memory will be used as the intermediate device. ·S - An ISCM tape will be·built which contains the source. It will be used as the intermediate device. Blank - A scratch tape will be llsed for the intermediate device. This is the default option for source. R - Source will be resequenced. Obj ect Option Any logical combination of the following: D - Disable obj ect output. S -. An ISCM tape will be built which contains the object output of the assembly(s). This output will be saved for the user. P - Object output will be in the form of binary punched-card decks. E - An ISCM tape will be built which contains the object output of the assembly(s). This option should be used when the user wants to assemble, load, and execute his program but does not want the object output saved after hls.job has been run. This is 'the default option for object and is necessary only if this. option is desired in addition to one of the other obj ect options. II~11..;13 I M-5035 Change 3 Listing Option Any combination of the following: S - An ISCM tape will be built which contains the sideby-side listing output.. H - The side-by-side listing will be output to the printer. This is the default for listing and is necessary only if this option is desired in addition to the above listing option. Name A one to eight-character name which will be used to build the obj ect output program: ID and the library element IDs for ISCM tape output(s). Version A one to four-character version which will be used to build the object output program ID and the library element IDs for ISCM tape output(s). For options which request output on an ISCM tape, the ISCM tape will be given the following internal and external names: , Field Option Source Option S ASOURCE Object Option S AOBJECT E ACOMMON S ALIST Listing Option Internal and External Name No spaces are allowed on the label field between *ULTRA and the three following subfields nor can any be present between the program name and version. The resequencing option causes the last twelve columns (69-80) to be overlaid with a period-space, four character name, four character ,number (starting at 0001), and two spaces. The four character name is taken from the first four characters of the element name specified on the *ULTRA card. The final two spaces allow for insert numbers when the assembler Is not resequencing. 11-11-14 M-5035 Change 3 Examples 1*IUIIJTIRJAI,ISIRla Is I ITIEI SITIPIRIOIGI I, I I I I I I I I I I I I I I I I I I The ISCM ASOURCE and AOBJECT tapes will be built, the element will be named TESTPROG, and the source will be resequenced on the ASOURCE tape with .. TESTxxxx6 6(-6= space, x = number) in columns 69-80 The programmer has the' added option of specifying what is to be overlaid in columns 69-74. By immediately following the R with a left parenthesis, any combination of six or les's characters, and a right parenthesis, the characters (as many as specified) in columns 69-74 would be overlayed with the Information between the parenthesis, Example The ISCM ASOURCE and AOBJECT tapes will be built, the element will be named TESTPROG, and the source will be resequenced on the ASOURCE tape with REEFxXXX66 in columns 71-80 Assemblies may be stacked back-to-back for Assembler input. The Assembler detects the end of a given assembly through the occurrence of an END or SEGEND directive. The parameters following the *ULTRA are evaluated for the first *ULTRA card only and are then effective until the stop assembly card (*OFF) is encountered. The name and version on the first *ULTRA card of each source program is used as the name and version for that source program. Assemblies requesting source, object, or listing output should always include a name on the *ULTRA card to allow element identification. If no name or version is supplied, spaces will be used. II-11-14A I M-5035 Change 3 11.2.2 Stop Assembly (OFF) The last program to be assembled (or only program if there is bu~ one) ter- minates with the following card: ltO'FIE'.1 I INIQITIEISI II I I I I' I., i i ' 11·,·11.11 11·1 :::OFF appears in the label field and all other fields are empty. 11.2.3 Disable Object Output Code (OFO) If no object output is wanted for one or more of a number of stacked assemblies, U-11-14l3 M-5035 a programmer codes within the source deckts) the following statement: I I .OFO appears in the label field and all other fields are empty. If no object output is wanted for all the stacked assemblies, a '0' is coded . in the object options subfield of the first ~:;ULTRA card, thus eliminating the need for ~::OFO cards in each source deck. \ 11.2.4 Sample Deck Using Control Cards figure 11-3 and 11-4 show sample source decks to illustrate the use of Assembler and Moni tor cant ro 1 cards. END *ULTRAA ~ TXP t I $ASM Figure 11-3. Sample D~ck Using Control Cards SOURCE STATEMENTS 11.3 A source statement is a coding line not nec·essarily confined to a single physical line; for example 9 a logical line may ext~nd over several cards. Except for purely comment lines, programmers are normally concerned with three basic fields of a coding line: 1) label field, 2) operation field, and 3) operand field(s). 11.3.1 Label.Field The label field must start in column 1 of the source line. of a line of symbolic coding may· contain: a. An address counter declaration. b. A symbolic label. 11-11-15 The label field M-5035 c. An address counter declaration followed by a symbolic label. d~ An asterisk (*) in place of a symbolic label. If an address counter declaration and a label appear in the label field, the address counter declaration is coded first fOllowed by a comma (,); then the label is coded as in line 2 of the example shown on the next page. The label field may be preceded by the control character slash (I), 'which causes the ASsembler printer listing to be ejected to the top of the next page. If the slash control character is' uSrd, it must be coded in columnl, and the, label field must then start in column 2. A space in column 1 (or in column 2 if column I contains a slash) implies that the label field is empty. Examples 11.3.1.1 Labels A label is a means of identifying a symbolic coding line. Normally a label is giv~n the'current value of the active address counter. L~bels associated with EQU, FORM, GO, DO, MACRO, NAME and LIT ha've unique interpretations which are explained for these directives under paragraphs 11.3.3 and 11.4. A label may consist of up to eight alphanumeric characters. The first character must be alphabetic (A through Z). Subsequent characters may be any combination of alphabetic or numeric characters (0 through 9) or $. An asterisk (toe) may follow a label without intervening spaces. Asterisks so used do not count as a character of the label. If a label outside of a macro' is suffixed with an asterisk, the label is externalized (defined as level 0). This label then becomes available outside the program. 11.!J.,1.:'! Refer to paragraph for an explanation of the siunificance of starred labels within macros. II-11-H> . \ M-5035 NEXT JOB $JOB, •••• $SEQ,123M0~2 $TRA, LABEL ~SE-L---E-L-M-P-R-O-G-l--~ Transfer control to LABEL. Select object code by name (PROGl). Library select the ta pe to load (ACOMMON ) • Ca 11 the Loader. ...a...---- ...... $LOAD, PI, P2, .........~:....--- ::;OFF I JOB ASSEMBLY PROGRAM Externalized label (LABEL). ~;AC,P1, ~:ULTRA $ASM,U Figure 11-4. P2, P3, P4 PROGI 4I-~---- Call the Assembler. Sample Deck to Assemble, Load, and Execute a Single Program 11-11-17 M-5035 , ' 11.3.1.2 Address Counter Declaration The first time an address counter is declared, it has the relative value of zero. Subsequent declarations of the same address counter cause the associated generation to continue at the next sequential address, regardless of how many other address counters 'were declared in between. A declared address counter controls the generated coding until another counter is declared. If no address counter is declared, the entire assembly is under control of address counter zero. Format S (e) Explanation e The desired address counter 0=31. If an address counter is used in conjunction with the LIT'directive, the active address counter is not changed (see paragraph 11.3.3.14). "11.3.1.3 Leading Asterisk (*) An asterisk (*) may be coded in the label field in place of a symbolic label, within macro definition coding. During macro ex~ansiont this causes the label coded on the macro reference line to take on the value of the active address counter corresponding to the line containing the leading asterisk. ' The leading asterisk must be followed by a space, and can only be used within a macro definition. The asterisk must only appear once within a particular macro. 11.3.1.4 Half-Word Instruction LabelS The computer instruction repertoire includes a group of half-word (16-bit) instructions as well as full-word (32-bit) instructions. An Assembler- generated object word may, therefore, contain either a single 32-bit instruction or two 16-bit instructions. The, programmer codes each half-word instruction as 11-11-10 M-5035 a single source input s~atement. Two half-word instructions may not be coded as one source statement. The Assembler will collect two sequential half-word instrurtions into a si~gle object word with the first occupying the most significant (upper) half and the second occupying the least significant (lower) half. A single unpaired half-word instruction will be placed in the upper half of the object word and the Assembler will pad the lower half with a no-operation instruction. instruct~ons Only those half-word which will occupy the upper half of an object word (as described above for the Assembler's pairing convention) may be labeled. CODING Examples SIDE - BY - SIDE 000010 000011 000012 000013 000013 000014 1 0 4 3 0 0 LA FLIP 7 140 5 0 2 443 0 0 000014 FLOP GOOF 7 1 453 0 6 240 I 0 HOR SA HAND HLC Line l·is assemuled at relative address 000010. 4,GOOF,W 4,5 4,GOOF,W 4,3 4,8 LINE LINE LINE LINE LINE I 2 3 4 5 Line 2 is assembled into the upper half of relative address 000011; the lower half will be a no-operation. Line 3 is assembled at relative address 000012. Lines 4 and 5 are assembled at relative address 000013 and 000014 respectively, with the logical instructiori in the half of each word. upp~r half and a no-operation instruction in the lower The label FLIP has a value of 000011; label FLOP has a value of 000013. Line 5 violates the half-word labeling convention; fore, references to GOOf have a value of 000014. 11.3.2 there~ Operation Field \ The first non-space (rrn-blank) character following the label field is assumed to be the start of the operation field except when that character is a period or a semicolon. (A period space si~nifies signified line continuation.) 11-11-19 line termination; a semicolon M-5035 the operation field may contain: a. A computer-instruction mnemonic function code. b. An Assembler directive. c. The label of a previously defined FORM directive. d. A label already defined as an entry point to macro codingo e. + or - followed by a data word. (When the operator is + or spaces may separate the sign from its related operand.) f. An apostrophe. (When an apostrophe is the first non-blank character following the label field, the remainder of the line through the terminating apostrophe is assumed to be a character string. ) In any event, except as noted in items e) and f) above, a space following any character except a comma signifies the end of the operation field. Whenever a symbolic line results in generation of a computer word, the value of the controlling address counter is increased by one. An exception to this is the RES directive which causes the counter to be modified by the value . derived from the expression in the operand field. 11.3.2.1 Processor Instruction Mnemonics Processor instruction mnemonic codes consist of up to four alphabetic characters. All half-word instruction mnemonics begin with an H. 11.3.2.2 Input/Output Controller Command Mnemonics Input/Output Controller GRAM CODING LINES A B +Al, Dl +A2, D2, D3, D4 REFERABLE BY B AND MAIN PROGRAM AVAILABLE OUTSIDE' A AVAILABLE INSIDE A ONLY REFERABLE BY A AND MAIN PROGRAM REFERABLE ONLY BY B REFERABLE ONLY BY C DEFINED FOR MACRO D C REFERENCES NESTED MACRO D UNDEFINEQ'FOR MACRO C DEFINED FOR MACRO C BREFERENCES'NESTED MACRO C UNDEFINED FOR MACRO B DEFINED FOR ~ACRO B DEFINED FOR p!!ACRO B MAIN PROGRAM REFERENCES MACRO A MAIN PROGRAM' REFE RENCES MACRO B DEFINED FOR MAIN PRlGRAM UNDEFINED FOR MAIN PROGRAM II-II-52 M-5035 'Change 2 11. ti. 4. ~ Macro Reference Lines· Macro reference lines (calls upon'macros) are coded following the normal Assembler syntax governing fields arid subfields. A macro r~feience line may be labeled. The label is normally equated to the address of the first word generated from the macro, but may be equated to any line within the macro by coding an asterisk only in the label field of the line. The macro is called by writing the entry label {from the MACRO or a NAME line} in the operation field, followed by as many parameters as may be required in the operand field. Parameters are organi zed into fie Ids and subfie Ids according to the requi rement s of the macro. Subfields of the operand field are assumed to be parameters of field 1, field 29 and so forth, in left-to-right order. Any subfield maybe preceded by a single referenced macro. ast~risk to be used as a conditional value within th2 An address counter declaration may be coded on a macro reference line. This declared address counter will supercede any address counter declaration made on the macro directive line. (See also Paragraphs 11.3.1 and 11.5.) 11.4.4.6 Complex Macros Macro capabilities provide an extremely powerful technique for controlling Assembler generation. Macros c~n b~ simple or complex limited only by the programmer's ingenuity. The example which follows of a more complex macro may be used to generate for data word lines assuming a 32-bit object I word size. Example II-II-53 j ;' M-5035 Change 2 The following macro example generates an overlapped bit-field object word for an l8-bitobject word. Example 11.5 ADDRESS COUNTER DECLARATIONS The Assembler provides for 32 address counters, and anyone may be refere~ced or used. Grouping of constants an~/or instructions under a given address counter may be more convenient or meaningful for segmenting purposes or for collecting coding groups at load time. A specific address counter is declared by coding in the label field: Format $ (e) Explanation e The address counter number (0 through 31). At the start of an as sembly, the Assembler assumes address counter 0 is active. All address counters have an initial value of zero. A declared address counter (counter 0 if no other has been declared) remains active until a new address counter is declared and all coding following the· declaration is controlled by that counter (assembled relative to zero). Coding resumed under a previously declared counter continues at the next sequentia~ address following the last one used under the counter. II-II-54 M-5035 Change 2 • Examples 11.6 EXPRESSION STATEMENTS An expression is an element or a series of elements connected by operators which, when evaluated, produce as a final result a binary value, a floating point number, or a memory reference address. The final value may be used as a word(s) of data in memory, as a subfield of an instruction word or data word, or as a parameter for an Assembler directive. An element is a grouping of characters which is recognizable to the Assembler as an entity and can be replaced by a binary val~e, a floating pOint number, or a memory address. An element may be: 1) a symbolic name, (a label); 2) a decimal, oetal, or floating point number; 3) the contents of an address counter; or 4) a literal item enclosed by parentheses. A detailed discussion of element follOWS. An operator is a special mathematical symbol defining the operation to be perfo·rmed on the operands immediate ly preceding and immediate ly following the operator. An expression need not include any operators if it consists of only one element; however, if more than one element is included within an expression, they must be separated by operators. Expression evaluation is normally performed in a single-precision mode (singleprecision normally being 32 bits, unless altered by the WRD directive). However, if any numerical element of an expression is terminated by the letter D, the remainder of the evaluation shall be performed in a double-precision mode, with a double-precision result generated. An expression is terminated by either a comma or a space; therefore these two characters cannot be included within an expression. The one exception to this rule is the use of character strings as elements. in the following paragraphs. II-II-55 These are further explained M-5035 Change 2 11.6.1 Labels An alphanumeric label may be used as an element' within an expression. The label must conform to the rules for labels as described in paragraph 11.3.1~1; for exampl&, it must .not exceed eight characters; it must consist of alphabetic (A through Z) or numeric <0 through 9) characters, or $; and the label must begin with an alphabetic character~ When the expression is evaluated, the value allocated to the label is substituted in the expression. If the label is undefined at the time the expressi'-III is evaluated, it is assigned a value of 0, and a U error flag appears on the assembly Ii sting adj acent to the line referencing the undefined label. Example 11.6.2 Address Counter The contents of any address counter used by the program may be referenced in an expression by coding the symbol, $ or $(e). $ signifies that the contents of the current (active) address counter are to be substituted in the expression: $(e) signifies that the contents of the address counterspecified.by eare to be substituted. e must be an octal or decimal number, or an expression resulting in a binary value. II-II-56 M-5035 Change 2 Example 11.6.3 Decimal Number A decimal integer may be used as an element within an expression. The decimal number is converted to its binary equivalent and used in its binary form for all further computations. The integer may consist of any number of decimal digits; however the final binary value represents only the least significant bits of the number as determined by the object word size. The sign of the number is the leftmost bit of the final o~ect word. The first (most significant) digit of the coded decimal number must not be zero (0). If the decimal number is immediately followed by the letter Of a two-word binary equivalent shall be generated. Example 11.6.4 Octal Number An octal integer is specified by preceding the first (most significant) octal digit with a zero (0). Each character of the octal integer must be an octal digit (0 through 7). Rules for evaluation are the same as for decimal numbers. An octal number may also be followed by the letter 0 to obtain a double-precision resul t .• I II-II-57 M-5035 Change 2 Example 11.6.5 Floating Point Number A floating point number may be used as an element in an expression. The number must be coded as a decimal mixed number consisting of an integral part and a fractional part, and must include the decimal point. Spaces are not allowed within the number. The number is converted to a 64-bit (regardless of the declared word length) floa-ting point number, formatted in memory as follows: Least significant 32 bits Mantissa S Most significant 32 bits Sign of characteristic Characteris tic S is the sign o!the mantissa. Example 11-11-58 M-5035 Change 2 11.6.6 Fixed Point Number A fixed point number is an expression element containing only an integral part, and hence does not include a decimal point. referred to as a signed pure binary number. This type of number is often 11.7 DATA MODES Since expressIon evaluation 'is essentially an arithmetic process, the elements within an expression (with the exception of character strings) must be able to be identified with a unique numerical quantity. This numerical quantity may exist in one of two formats: 1) a signed pure binary number; or 2) a floating point number. The resultant or final value of the expression is either a binary value or a floating point number. (The final value may be truncated to fit a specified subfield or word size at the time the generated object code is produced in its loadable form.) All internal expression evaluation is performed in one of these two modes (either binary or floating point). If the expression involves both binary . values and floating point va~ues, internal data conversions are performed (for example, binary to floating point, floating pointtto binary) so the evaluation can be carried out. 11.7.1 . Literals A line of coding without a label field, without leading or trailing spaces~ and entirely enclosed in parentheses is called a line item" A line item may only be a symbolic computer instruction, a data word, a macro reference line, or a FORM reference line. The object word(s) (either one or two) generated for the line item is called a literal and is stored in a literal pool. The Ii teralpool address is then substituted for the parenthetical expression in the parent line. The line item must be the only element within the expression being evaluated, and must not be preceded by a + or - sign. If the first subfield of a data word line item is a symbolic name~ the name should be preceded by a + or - to avoid possible confusion with a symbolic computer instruction, see paragraph 11.7.2. Six levels 01 parentheses (for example, five line items nested within line items) are allowed. A double-precision literal constant may be generated by terminating the numeric constant within the parentheses by II-II-59 M-5035 Change 2 the letter D. If the line item is a character string, up to two words can be generated. Example 11.7.2 Data Words The Assembler recognizes two distinct types of data words: 1) constants, resulting in either one or two generated computer words; and 2) character strings, resulting in one or mOre generated computer words containing character codes. 11.7.2.1 Constants A + or - in the operation field followed by one or more subfields in the operand field signifies that a constant is to be generated. Whenever a+ or appears as the first character· of the operation fi'eld, any number of spaces or no spaces may separate the sign from the first operand. Subfields are separated by commas. In generating constants, the Assembler assumes the size of the object computer word. If the operand field contains one subfleld, the signed value of the subfield is right-justified in the generated word. If the operand field contains two subfields, two equal-length signed subfields are generated with the values right-justified within each field,and so forth. The first subfield must be signed. Successive subfields may optionally be signed. The absence of a sign implies a positive value. If variant~ of this implicit 11-11-60 M-5035 Change 2 . equal subdivision of datn words are required, the capabilities of the FORM directive may be used to derive the desired format. Example If the operand field contains just one subfield immediately followed lJY a 0, or if the constant is a floating p.oint number, the Assembl::;rgenerate~ a doublelength constant in two successive computer words. The first generated word of the double-length constant will contain the least significant bits of the result. The letter 0 in this context is only meaningful when appended to a numeric constant. Examples 11~7.2.2 Character .Strings Strings of characters which can be represented by the Assembler's imbedded character set (with the exception of the apostrophe) may be encoded by enclosing the entire character string between apostrophes. The apostrophe is not included in the allowable characters because it is the control character delimiting the string. A semicolon between apostrophes is treated as a character, not as a line continuation symbol. Similarly, a period space combination between apostrophes is treated as two characters and not as a line termination. The Assembler's internal character set is the USA Standard Code for Information Interchange, commonly referred to as ASCII code. Unless directed to the contrary by the CHAR and BYTE directives, the Assembler will right-justify each ASCII- II -11-61 M-5035 Change 2 coded character within an eight-bit field, up t~ a maximum of four characters per generated word. If the first non-blank character of the operation field is an apostrophe, all subsequent characters up to, but not including the terminating apostrophe are packed l,eft-justified into as many successive computer words ~s are required to accommodate the string. Any remaining partial word is padded on the right with space characters. If the object word size is not evenly divisible by the declared character length (see paragraphs 11:3.3.2 and 11.3.3.3), the unusable bits'will app~ar as binary zeros in the rightmost bit positions of the generated object word. If a + precedes a character string, the Assembler regards the string as a constant; therefore, the number of characters between apostrophes may be from one to eight. One to four characters yield one computer word; five to eight characters yie ld two computer word s • Characters are' packed right-justified within the generated words with leading binary zeros as required to pad the word. However, if two computer words are generated, the character string is regarded as a double-length constant and the leading character codes will be in the second word. Examples Refer to paragraph 11.3.3 for descriptions of the BYTE, CHAR, FORM and WHD di recti ves. These directi ves may be used to deviate from the imbedded obj ect word length and eight-bit 'character framework. 11.8 OPERATORS The Assembler provides 14 mathematical operators which define the exact sequence and manner in which elements are to be combined within an expression during evaluation. These operators serve essentially the same purpose as those M-5035 Change 2 encountered within a normal algebraic expression. Similar to the rules of algebra, which assign a priority to each of its operators (for example, multiplication is performed before addition), the rules for expression evaluation a~sign a priority to each of the 14 operators recognized by the Assembler. These priorities may be overridden by using parenthetical grouping,.in the same way that parenthetical grouping is used in an algebraic expression. The rules for evaluation are discussed in greater detail under Operator Priorities (see paragraph 11.8.2). Each of the 14 operators falls into one of three classes: 1) arithmetic, 2) logical. or 3) conditional. Arithmetic operators have the highest priority; conditional the lowest. 11.8.1 Symbols The operator symbols as well as their relative priorities are listed in Table 11-1. Table 11-2 summarizes the data formats allowed with each operator, and the format of the resultant value. Note that the table is divided into four columns,labeled First Item, Operator, Second Item, and Result. If the entries under First Item and Second Item for a particular.~operator specify both binary and floating, the corresponding value for that item may be either data format; however, the result is in the format specified under the Result column. The actual evaluation is performed in the mode specified for the result. 11-11-63 M-5035 Change 2 TABLE 11-1. OPERATORS AND PRIORITIES OF OPERATORS Relative Priority Operator 6 *+ A *+ B is equivalent to A* lOB 6 *- 6 ·1 A * -8 is equivalent to A * 108 A * I 8 is equivalent to A * 2 5 • Arithmetic product 5 I Arithmetic quotient 5 II Covered quotient 4 + Meaning 8 Arithmetic sum Arithmetic difference 4 3 •• Logical product (AND) 2 ++ Logical sum (OR) 2 Logical difference (EXCLUSIVE OR) 1 EQUALS ,conditional A=B has value 1 if true; 0 if not true 1 > GREATER THAN conditional A > B has value 1 if true; 0 if not true 1 < LESS THAN conditional A < B has value 1 if true; 0 if not true 11-11-64 M-5035 t";ln~lC' TABLE 11-:'!. Fi rs t 1 , pm < Hinnry or flont i ++ , ::...- , Bi nfl ry Binary or float.ing Hi nary Bi nary Bi nary Bi nary Floating Flonting Floating Floating Flo~ting -+ , - Flnntinu +, - •, Binary +, ICc +, - •, n~l Rinary or f loa t i n~l ~:+, Binn}'y *' I ' , . , * .' Floating «() Binary or floating Binfll"y n~l Hp su 1 t > •• • Fl 0<1 t i Second I tern Operfltor Bi nfll'y or float inH " U,\TA MOUES FOR OPEHATOH ITEMS Bi nary (Greater Than). The greater than operator results in a value of I if the quantity on the left is strictly greater than the quantity on the right; otherwise, the resultant value is O• .' Example 11.8.1.3.3 «Less Than). The less than operator compares the value on the left with the value on the right and sets the result equal to a I' if the left-hand quantity is less than the quantity on the right; if it is not less, the resultan t va I ue is O. 11-11-69 M-5035 Change 5 Example 11.8.2 Operator Priorities In the absence of parentheses, individual operator priorities determine the order in which elements are combined within an expression. Evaluation is performed left to right if two or more operators 'with the same priority occur within the same expression. Table 11-2 shows that ::;+, :::_, and ::) have the highest priority' (6), and =,>, and < the lowest (1). Thus, within a given expression, elements separated by one of the three exponential operators are combined before anyone operation is performed. Comparison' of values within an expression is done last (such as is done when anyone of the th'ree condi tional operators is encountered). Example I I I 11-11-70 M-5035 Change 2 11.8.3 . Parenthetical, Grouping The normal sequence of evaluation within an expression may be altered by using parenthetical grouping; that is, enclosing certain portions of the expression within parentheses to override the normal rules of evaluation. The effect is to evaluate that portion of the expression within the parentheses as though it were the only expression on the line, independent of any elements or operators occurring outside of the parentheses. The value resulting from this evaluation is then substituted as an element in the entire expression, and the evaluation is continued. Up to five levels of parenthetical grouping are allowed. When encountered, the expression within the innermost set of parentheses is evaluated first. 11.8.4 Relocatability The final value resulting from the evaluation of an expression may be a memory address reference and. as such. may be potentially relocatable; fo~ example, the memory address may be modified at load time. General rules which govern whether the result of an expression shall be relocatable or not are: a. A floating point value is never relocatable. b. The value resulting from a logical or conditional operation is not relocatable. c. Only the + and - arithmetic operators yield a result that is relocatable; The one exception to this rule is multiplication or division of a relocatable quantity by +1. Tables 11-3' and 11-4 summarize t\hese rules for reloctability.• 11-11-71 M-5035 Change 2 TABLE 11-3. First Item RELOCATION OF BINARY ITEMS Operator Second Item Binary or floating <, -, > Binary or floating Not relocatable Binary or floating ++, --, Binary or floating Not relocatable Not relocatable +, - Not relocatable Not relocatable Relocatable (binary) +, - Not relocatable (binary) Relocatable Not relocatable (bi nary) +, - Relocatable (bi nary) Relocatable Relocatable +, - Relocatable Not relocatable Binary or floating ace Bi nary or floating Not relocatable Binary or floating *+, *- t Binary Not relocatable , I /, ~(* II 11-11-72 M-5035 Change 2 11.9 The ASSEMBLER OUTPUTS Ass(~mblcr produces on1y relocatahle object output. The 1o:ation of the ob- ject program then becomes a load-time determination. Assembler object code format is described in Volume I, Section 3 as part of the inputs to the Object Code Loader. Along with the relocatable object code, the Assembler passes to the Loader the number of errors that occurred during the assembly (see Volume 1, paragraph 2.2.3 for loading). The number passed to the Loader does not include the number of T errors or R errors (see paragraphs 11.9.2.5 and 11.9.2.6). Conc~rrent with the source language translation and output of the loadable machine code, the Assembler produces a side-by-side assembled program hardcopy listing. 11.9.1 Side-By-Side Listing This side-by-side listing contains: 1) a sequential decimal source language statement number; 2) each source language statement together with any generated addresses; 3) object code resulting from translation of the statement; 4) Assembler-detected translation errors and warnings included along with the statement in error. By means of Assembler directives, the progranuner can suppress all or any part of the side-by-side listing. Another Assembler directive permits the programmer to control the editing of the generated machine code into logically discrete fields. 11.9.2 11.9.2.1 Error Codes Expression (E) Expression errors result from illogical expressions such as a decimal digit . within an octal number; element type inconsistent with arithmetic operators; expression improper in context, such as a GO line used outside a macro or a DO coun~ in excess of 216 _1, or unequal number of left and right parentheses. 11~9.2.2 Duplicate (D) Duplicate errors values. A label defined prior to first and second result "from labels defined more than once with different used in an expression affecting an address counter is not its use resulting in a different addressing sequence in the assembly passes. 11-11-73 M-5035 Change 2 11.9.2.3 Undefined (U) . An undefined error results from any of the following three conditions: 1. A reference made to a label which was not defined in the program. 2. A reference made to a label that was not externalized properly by a calion a macro. 3. 11.9.2.4 A failure to suffix labels of macro entry points with an number of asterisks. a~equate Instruction(l) An Instruction error results when the Assembler encounters: a. A MACRO or EQU directive which has no label. b. A SEGEND within a MACRO. c. More than one coded subfield in field zero of a MACRO reference line ,called via a MACRO name. d. A nested LIB directive ora LIB directive within a MACRO. e. A LIBS directive retrieved from a library. 11.9.2.5 Relocation (R) A Relocation error results from an arithmetic or logical operation being performed on a reloctable value which destroyed its reloctability. 11.9.2.6 Truncation (T) A Truncation error occurs when the final va·lue of an expres~ion does not fit in the destined bit field of an object word, resulting in the Assembler truncating the left~most bits of the value in order to make it fit the field. 11.9.2.7 Overflow (0) The Overflow error occurs when memory available for the Assembler tables is exhausted. 11.9.2.8 Name (N) A Name error occurs when the Assembler encounters a name which contains more than eight characters. 11-11-74 M-5035 Change 5 11.9.2.9 Level (L) A Level error results from an expression containing a parentheses nested more than five levels or from more than 64 SETADR lines appearing in this assemhly or from an incomplet.e MACRO definition retrieved from a library. 11.9.2.10 Floating Point (F) A Floating Point error occurs under any of three circumstances: 1. The divisor in a requested floating point divide operation is zero. 2. A floating point operation during evaluation of an expression yielded characteristic underflow. Characteristic underflow occurs whenever the characteristic is less than -32767. 3.. A floating point operation during evaluation of an expression resulted in characteristic overflow. Characteristic overflow occurs whenever the characteristic exceeds +32767. 11.9.2.11 Warning (W) A warning results when alabel is used with a half-word instruction which is assigned to the lower halI ofa computer word. 11.9.3 I Generation Formats Assuming the editing listing option has been selected, a number of generated words, values, or half-words appear. They are: S FIELD CODED EXPLICITLY. 000120 14 0 0 0 0 0 00265 AO, CLASIV, , , SO AA S FIELD NOT CODED (SY COMIDNED). 0002"05 52 0 0 0 0000211 LBJ B7,FETCH FULL-WORD (ON-LINE CONSTANTS OF EQU VALUES). 001140 37700000377 00000000001 Al EQU 1 ll-11-75 " I I M-5035 Change 5 HALF-WORD INSTRUCTIONS. - . 000123 71 0 2 0 0 000123 61 11 0 1 HAN HLCI Ao,AO 010+Bl,AO 11.9.1 Listing Of Labels The Assembler provides programmers via the LLT directive, with an alphanumericall) sorted listing of source statement labels and corresponding Assembler-generated addresses or values. Listed labels are those defined at levels 0 and 1. LLT labels do not include 'MACRO, NAME, FORM, and LIT line labels. 11.9.4.1 Level 0 Level 0 labels are those names which are made available to load time to some other independent'ly processed code. 11.0~4.~ Level anoth~r program at 1 Level 1 .labels are those names encountered on the main program level. 11.9.4.3 LLT Sample Listing A sample of the listing produced by the Assembler after processing a LLT directive appears below: * LIST LABEL TABLE • LEVEL 0 AO A3 BI B4 B7 BEGIN1 00000000000 00000000003 00000000001 00000000004 00000000007 0000062 00 Al A4 B2 B5 BCOUNT BUFF 00000000001 00000000004 00000000002 00000000005 00000000002 00 0000150 A2 A7 B3 B6 BEG BUFFLAG 00000000002 00000000007 00000000003 00000000006 00000000007 00 0000125 AGAIN2 BWAIT2 CHARCK 0000402 0000355 0000444 LEVEL 1 ADD BWAIT CBUFF 0000353 0000347 0000544 11.9.4.4 00 00 00 AGAIN1 BWAITO COIV 0000275 0000262 0000521 00 00 00 Undefined Labels Names or symbols encountered during the assembly which are not defined are listed: UNDEFINED SYMBOLS PRDIR II-11-76 00 00 00 M-5035 Change 2 11.9.4.5 Cross Reference Listing A crossreterence listing can be produced at the end of an assembly if an LCR directive has been previously encountered by the Assembler. This listing consists of labels, address counter values, and address counters where these labels a·re referenced. A sample listing is shown in figure 11-5. 11.10 ASSEMBLER DIAGNOSTICS AND STATUS Several categories of error.a encountered during the assembly process cause an error message to be output to the standard hardcopy device, These errors fall into one of four classes: 1) Assembly; 2) Assembler Internal; 3) Library calli and 4) Peripheral. 11.10.1 Assembly Errors If an assembly error occurs during the assembly process, the following status messages will appear on the standard hardcopy devices: ASSEMBLY ERRORS xx xx EXl!lanation XX IT YY YY Any one of the followi og: 0 Overflow U Undefined D Duplicate E Expression T TruncatIon R Relocation I Instruction L Level N Name F Floati ng- Poi n t The number of errors of type XX that occurred in the assembly. 11-11-77 ~3: :;rQlc.n ::sO eeW ('Dc.n N I-o! !-oj .....I ..... LIST tRuSS R~FERlNCE TA8LE Ll 1J0lJO£J~ 00 Ll (IUU014 OU Ll L2 L? OUUOOl 07 L2 L3 UOOUU2 ns L3 L4 IIUU012 00 L4 L4 UU0017 00 t:5 L'; UOOO£J4 15 L5 nOOO04 (100006 1100001 IIUOOU2 000002 (100013 oU0020 fJl no 15 r:7 fll no L1 L2 L~ L3 Let L~ vOOOOO lJOOOO7 000015 lJUOO02 fJUOO03 UUOO03 lJ~ liO LO l~ l'5 III Ll L2 L3 L3 L4 L5 (10 J -'l co Figure 11-5. Sample Cross-Reference Listing OUOOOO 000000 OU0010 uU001& 0000U3 OUOOUet £J7 01 00 00 U7 05 L.1 L2 L.3 L.4 L" L5 000000 000001 000001 000011 000003 000004 15 O~ 01 00 15 07 M-5035 Change 2 ILLOGICAL SOURCE INPUT SEQUENCE This message occurs when the Assembler has read a sentinel statement. This only occurs when an illogical sequence of source cards is input to the Assembler. NOT ENOUGH UNASSIGNED TAPES The Assembler is unable to obtain enough tapes to assemble with the requested output options. 11.10.2 Assembler Internal Errors 11.10.2.1 Core Overflow The core overflow error occurs when the Assembler item table macro sample storage area, memory intermediate storage area, or literal origin stack overflows. No recovery is possible. 11.10.2.2 Level Overflow The level overflow error occurs when the number of nested macros exceeds 29. No recovery is possible. 11.10.3 Library Call Errors The following message is typed if the Assembler is unable to locate a called source library element on the assigned library medium: ****. LIB REF ERROR S name (vers) Explanation S Name (vers) Denotes source library. The called library element name (version). After the typeout, the Asserribler continues without soliciting a response from the operator. 11.10.4 Peripheral Errors The following peripheral error indications are received by the Assembler from the Centralized I/O Program or the Standard Input Program, and no recovery 11-11-79 M-5035 Change 2 is possible (the MN field in the messages is the name of the device involved in the error): I/O ERR MN END OF FILE A tape mark has been read while reading from the input. I/O ERR MN UNREC ERR A tape error has occurred and recovery procedure was unsuccessful. function was retried five times without success. The tape I/O ERR MN ILLEG PROC An illogical function has been requested (such as a magnetic tape read forward when the tape is positioned at the end of tape, or a pass backward function while the tape is positioned at the beginning of tape). I/O ERR MN STRG END End of tape was detected during a magnetic tape function or while using core memory as intermediate storage, or there was not enough core memory available to store the source program. In the second case, MN in the· message will be MM. I/O ERR MN NOT ASS1GNED An I/O function was requested on a logical unit which had been removed from the current equipment configuration .. 11.11 SOURCE DECK ORGANIZATION Figures 11-6 through 11-10 illustrate example structures of source decks. ·OFF END ASSEMBLER SOURCE DECK Figure ll-(). Source Deck Organization for a Single Program 11-11-80 M-5035 Change 5 *OFF END /ENDCOR lEND OPTIONAL, CORRECTION DECK Figure 11-7. Source Deck Organization for Assembling Using Library Input. 11-11-81 M-5035 Change 2 ASSEMBLER SOURCE DECK FI RST SEGME Figure 11-8. Th.iS card indicates dependent programs { or segments. Source Deck Organization for Two or More Dependent Programs ~r Segments ASSEMBLER SOURCE DECK FIRST PROGRAM Figure 11-9. ThiS card indicates ....._ _ _ _ _ _ . independent programs { or segments. Source Deck Organizat'ion' for Two or More Independent Programs or Segments 11-11-82 M-S035 Change 2 END ·ULTRA Figure 11-10. 11.12 Source Deck Assembly Time Allocation SPECIAL CONSIDERATIONS a. Only the first *ULTRA Assembler control statement has any effect on the mode of intermediate storage or on the name recorded on the object code program ID images. Subsequent *ULTRA statements are passed over by the Assembler. b. When coding for the CMS-2 Assembler, it is desirable to keep label lines (lines containing only a label) separate from coded machine instructions. This allows shifting the label line without altering any other line(s}. c. If a number of successive half-word (16-bit) instructions are encountered (under the same address counter) by the Assembler, they are packed two per word. The fi rs t half-word encountered after the address counter has been activated/reactivated is packed into the upper half of the generated word. 11-11-83 M-5035 Change 5 d. Generation of half-word in-line constants or literals is always in the lower half of the word with no packing. e .. If LLT and LCR directives have been encountered and no reference is made to a relocatable label within the assembly, the label will be flagged with NR. f. The assembler call $ASM, U indicates the, ULTRA/32 keypunch code is to be used when interpreting source statements for the assembly. lfthe U is not present, the keypunch code specified in the $JOB command is in effect. Note: ULTRA/32 keypunch code is not interchangeable with the 026/029 keypunch codes; See special character codes for options in Appendix A. n-ll-S4 M-5035 SECTION 12 INSTRUCTION 12.1 REPERTOln~ AN/UYK-7 COMPlJI'ER FUNCTIONS The UYK-7 is a general purpose, multi-state, multi-processor, multi-I/O processor, stored-program co~puter. Some of the features of this computer relevant to a programmer arc: a) High-speed memory with a cycle time of 1.5 microseconds and a capacity of 16,384 words expandable with more memory banks to 262,144 words. b) Memory banks containing 16,384 words each that can be addressed by the arithmetic processor(s), the I/O processor(s), and external devices with proper hardware adaptation o c) A portion of memory is non~destructive critical instructions and constants. readout (NORO) for storage of This storage provides the facility for automatic recovery in case of a system failure or program fault and for automatic initial loading of programs. d) A 32-bit word length allowing for storage of one full-word instruction or two packed half-word instructions. e) Ability to address a 32-bit whole-word, 16-bit half-word, or 8-bit quarterword with no difference in execution time. f) Use of parallel, one's complement, subtractive arithmetic. g) Use of single ~ddress instructions with the provision for address mOdifi- cation via seven index registers and eight base registers. h) Floating point and double prevision fixed point arithmetic functions. i) Memory protection, in segments of up to 65,536 words, under both program and manual control. j) An indirect addressing capability. k) Any field of a word addressing capability. 1) Provision for connecting a remote operating console. 11-12-1 M-5035 m) A manual/program addressable breakpoint register which may be set to stop or interrupt program operation at any point. n) Interrupt and task states each with their own associated registers. 0) A status register which contains information concerning the current status of a processor. p) Interrupt status or definition code capability. q) Provision for half-word instructions. r) Privileged instructions which can only be executed in the interrupt state. s) Eight arithmetic accumulators provided to allow parallel and cumulative computation. t) A processor capable of retrieving the current operand and the next instruction in parallel if located in different memory banks. u) Five different types of instruction formats., v) A processor decremental monitor clock, an IOC incremental realtime clock, and an IOC decremental monitor clock. 12.1.1 12.1.1.1 The Register Format and Usage Program Address Register progra~ address register (P) holds the.address of instructions to be executed by the computer. This register holds 19 useable bits. Bits 19 through. 17 (P ) hold a base register designator, 0 through 7, while bits 15 s through 0 (P D) contain a displacement value, relative to the address contained in the designated base register. Bit 16 is not used. P Register Format 11-12-2 M-5035 12.1.1.2 Addressable Registers, Control Memory Table 12-1 gives the control memory address assignments for the central processor. Accumulator register format A Base register fnrmat s Index register format B D Where: B5'= base register designator. BD ='displacement value. When actually used for indexing, only the 16 bits of BD are used. 16 is not used. 11-12-3 Bit M-5035 TABLE 12-1. CMR Address 0-710* 11-17* 20-27· CENTRAL PROCESSOR CONTROL MEMORY ADDRESS ASSIGNMENTS Register Selected Task Accumulators (Registers Register Size 0~7) Unassigned (Addressabl~) Task Index (Registers 1-7) Task Base (Register 0-7, Addressable in Interrupt Mode Only} 32 bits each 19 bits 19 bits each 18 bits each Unassigned (Not Useable) Brea kpoi nt 100-107*· } · (Addressable in Interrupt Mode Only) 20 bits Active Status 23 bits Interrupt Accumulators (Registers 0-7) 32 bits 110** Central Processor Monitor Clock 111-117~,c~~ Interrupt Index (Registers 1-7) Interrupt Base (Registers 0-7) 19 bits (clock . only 16 bits) 19 bits each 18 bits each Unassigned (Not Useable), * ** DSWand leW 20 bits each 160-167** Storage Protection Registers (Registers 0-7) 21 bits each 170-177** Segment Identification Registers (Registers 0-7) 21 bits each Task mode CMR address. Interrupt mode CMR address. 11-12-.4 M-5035" Change 5 Breakpoint register format BPI = when set, compares BPA with instruction memory address. BP0 = when set,compares BPA with operand memory address. If both BP and BPI are set, both operations are performed. O BPA = an absolute address, up to 18 bits. Central processor monitor clock register (CPMCR) Not Used CPMCR The CPMCR, when activated, is decremented at the rate of 1024 counts per se£ond. A class II interrupt is generated when its value changes from zero to a negative value by hardware decrementation. If bit 15 is set, the clock is deactivated. Initial condition word register (ICW) The four ICW registers contain entrance addresses for the four interrupt classes. ICWS contains a base register designator and bits 15 through 0 " (ICWU) contain a displacement value. II -12-5 I M-5035 . Designator storage word registers (DSW) DSW (P Register) DSW (Active Status Register) DSW (Interrupt Status Code) The twelve DSW registers are in sets of three; each set is used for one of the four interrupt classes. During an interrupt sequence, Ps of the P register is stored in DPS ' and PD of the P register is stored in DP D" Bits 19 through 0 of the Active Status Register are stored in DSWASR ' while the Interrupt Status Code is stored in DSW ISC • Storage protection registers (SPR) 10 .. II 17 .. 15JI~llsI121IlJlolll'T7T'T5T .. TsI211Io R IR I IA OW I OR 1 I 11-12_'; T I M-5035 The eight SPR registers correspond to the eight task base registers. a R is value, defining a segment of memory with a starting address displacC'm(~nt contained in the corrcspon~ing task base register. A final address is this address plus the value in R. This segment is then the only memory area accessible by the corresponding base register. The allowable types of operations within such a segment are defined by bits 20 through 16. The following operation is allowed when these bits are set: Bit 16 (IR) - Use of interrupt index and base registers in indirect addressing. Bit 17 (IA) - Use of indirect addressing. Bit 18 (OW) - Operand writing. Bit 19 (OR)· - Operand reading. Bit 20 (I) - Instruction execution. The SPRs are loaded by executing the LOAD BASE and MEMORY PROTECTION instruction (05 4). The lower 21 bits of the contents of the operand address +1 are loaded into an SPR. Segment identification registers (SIR) The eight SIR registers correspond to the eight task base registers. SIRS SIR D base register designator. a displacement value. These registers are loaded with the effective operand address of the LOAD BASE and MEMORY PRUfECTION instruction (05 4) which loads the correspondIng base register. 11-12-7 M-5035 Change 3 12.1.2 Modes of Operation The AN/UYK-7 Computer can be operated. in one of two modes of operation: 1) the executive (or interrupt) state or 2) the task state. Both states can be manually or program initiated. Four bits of the ~ctive status ~egister specify the state the computer is in according to Table 12-2. TABLE 12-2. AN/UYK-7 COMPUTER MODES OF OPERATION Active Status Reg i ster Bi ts 2 19 0 0 0 0 1 12.1.2.1 2 18 0 0 0 1 0 217 0 0 1 0 0 2 0 1 0 0 0 PrOcessor State 16 Task state Executive state Interrupt class III state Interrupt class II state Interrupt class I state Interrupt State In the interrupt sta~e, the computer has the following characteristics: a) The computer can reference any memory word which has been locked out. b) The computer uses the interrupt set of accumulators, index registers, and base registers. c) The computer can come to a stop condition. 12.1.2.2 Task State In the task state, the computer has the ,following characteristics: a) The computer can reference any memory word which has not been locked out. b) The computer uses the task set of accumulators, index registers, and base registers. 11-12-8 M-5035 c) The int.errupt state set. of registers cannot be referenced. d)' Privileged instructions will not be executed. e) The task set of base registers can be modified only under certain conditions. 12.1.2.3 Active Status Register The active status register (see Table 12-3) is a 23-bit register (one for each processor) showing the current environment relative to that processor at any moment. TABLE,12-3. Bi t Number' 22-20 19 18 17 16 15 14 13 12 11 10 9' 8 7 6-4 3 n ACTIVE STATUS REGISTER Designator CP identifier State I } Under State II Hardware - see Table 3-2 State III Control State IV Upper/lower Class I lockout Class II lockout Class III lockout Base(s) register selector Accumulator and index register selector Memory lockout inhibit Load base enable Boot st rap mode Not allocated Fixed point overflow indicator Compare designators ,11-12-9 M-5035 Upper/lower control - bit 15 The upper/lower control bit is s~t when al,l upper half-word instruction has completed execution and is cleared when a whole word or a lower half-word instruction has completed execution. Class I lockout - bit 14 Locks out class I interrupts when set. Class II lrickout - bit 13 Locks out class II interrupts when set. Class III lockout - bit 12 Locks out class III interrupts when set. Accumulator/index register selector - bit 10 Thissele~tor is set in the interrupt mode and cleared in the task mode to select which set of A and B registers the active program may acce~s. Special base register selector - bit 11 This selector is set when entering the interrupt mode and cleared in the task mode to select which set of base registers the active program may access. Memory lockout inhibit - bit 9 The l-:-bit memory lockout inhibit (bit 9) is set (inhibit mode) j.n the interrupt mode and cleared (memory lockouts used) in the task state. Load base enable - bit 8 Allows use of Load Base and Memory Protection instructions in task state when set. Bootstrap mode - bit 7 Set manually to enable access to NORO memory during bootstrap load. bit is cleared under program control by execution of the following instructions: Interrupt Return, or Enter Executive State. 11-12-10 Thjs M-5035 Spare bits - bits 4-6 Bits 4 through 6 are programmable spare bits. Fixed point overflow indicator - bit 3 Displays the sta~us of fixed point overflow (is set if overflow oc~urred). This bit is tested and cleared under program control by execution of following instructions: t~e Jump on Overflow, and Jump on No Overflow. Compare designator - bits 0-2 The compare designator (bits 2,1, 0) display the status of the compare instructions as specifIed in the descriptions of individual instructions. The status word designation is as follows: a) Bit 2 == 0 unequal case = 1 equal case b) Bit 1 = 0 = 1 c) less than greater than within limits = 1 outside, limits Bit 0 = 0 11-12-11 . M-5035 12.2 AN/UYK-7 INSTRUCTION FORMATS There are five different types of instruction formats: three are full-word formats and two are half-word formats. Half-word instructions do not have' any memory reference parts because these instructions deal mainly with data manipulations between various registers. The AN/UYK-7 Computer is a' self -modifying, one-address computer • Although one reference or address is provided for the execution of an instruction, this reference or address can be modified automatically during a programmed sequence. The references are modified by using the index registers and the base registers which contain previously stored constants. The final operand address is the result of adding together the 18-bit content of the selected base register plus the 16-bit content of the selected index register, and the 13 bits of the immediate operand field of the instruction. An instruction or data address is coded using octal notation with each octal digit denoting three binary digits. The instructions are read sequentially from memory except after jump instructions or interrupt situations. In- these cases, the sequential execution of instructions resumes at another location in memory. Each of the instructions in thr repertoire is assigned to a format class according to the operational characteristics of the instructions. three full-word (32-bit) formats (Formats I, II, and III) and two There are half~word (16-bit) formats (Formats IV-A and IV-B). The paragraphs which follow specify the formats and the type of instructions assigned to each. 12.2.1 Format I Instructions The instructions of format I have the following word format: 1'11012112112112' f ut24111 ulzllzo "1 11 117 a k " 151 14 111 121111101111171115(411121'10 b i s 11-12-12 y M-5035 These inst.ructions basically require two operands: 1) an arithmetic or index register specified by the 3-bit a-field and 2) an operand address y-designator. The effective operand address y is formed by adding the content of an index register specified by the 3-bit b-field, the 13-bit displacement y-value and the content of a base register specified by the 3-bit s-field. The 3-bit k-field .is used to control operand interpretation (see paragraph 12.3.3). The one-bit i-field of the instructions is used to specify indirect addressing. ·The f-field (6-bits) is the ,major function code. There are no subfunction codes in this format class. There is a group of Format I instructions in which the a- and k-designators are interpreted as a combined unit. In these cases, whole-word operands are assigned and ak specifies either a control memory address or a bit position within a computer word. 12.2.2 Format II Instructions Format II instructions have the following format: .II'01 29121127 lze 2112-1 21 2212'1 20 I'lllll7 " Isi l-l1• 121" 11011 II 17 I_ 151_1 .121 I 1o a f i b f2 s Y Whole word operands (k = 3) are hardware assumed in Format II. instructions. Thus, the k-fields are used as a subfunction code labeled f • The other fields 2 of the Format II instructions are used in the same manner as in Format I. 12.2.3 Format III Instructions Format III instructions have the following word format: 'Ilso129Iall2712' ula-ln 22121 ao 1'1'11 17 " 1511-11. 121" 1101'11171-1 514 r.1 z I 11o f a f3 ~ b i s Y Again only whole-word operands are specified or assumed in Format III instructions. Thus, the k-field is divided into two parts: l)a 2-bit subfunction code l~beled f3 and 2) a single bit labeled k for which zero is the only legal entry. The other fields of Format III instructions are used in the same manner as for Format I. 11-12-13 M-5035 12.2.4 Format IV-A Instructions Format IV-A instructions have the following word format: 15(14(15(12111110 _11(1 f a f a 11514 f4 slall b 0 i b i The instructions of For~at IV-A require two registers (index or arithmetj~) and are used for register-to-register transfers and arithmetic operations.' The 3bit a-field and the 3~bit b-field specify one of eight accumulators or eight index registers respectively. The 3-bitk-field is used as a subfunction code labeled f . Except as specified in the individual instructions, the 4 i-field of the instruction is unused in Format IV-A instructions. 12.2.5 Format IV-B Instructions Format IV-B instructions have the following word format: f a m Shift Desi na tor The Format IV-B instructions use the 7-bit m-fie~d to specify a shift count. the 3-bit a-field is used to specify ene of the eight accumulators whose data is to be shifted for shift instructions. The m-field value is interpreted as follows: if the upper bit of the m-field is set and bit 5 of the m-field is cleared, the shift count is contained in the B-register specified by bits I through 3; if the upper two bits of the m-fieldare set, the shift count is given in the A-register specified 'by bits 1 through 3. If neither of these cases apply (upper-most bit of m equals zero), then the shift count is contained in the lower 6 bits of the m-field (maximum shift permitted is 63 places). 11-12-14 M-5035 12.2. () If i ~ Jndi rect Word 1, the 20 least significant bit positions of an instruction (b, i, s, and y fields) are replaced with the 20 least significant bit positions of (Y). The 12 higher order bit positions of (Y) are used to specify indirect addressing options. The interpretation of the indirect control word is: 11110 2111111711'115 14121112111110 11111117 I' 11114111 121" 1101 t 1117 1-1114111 z II 10 c w P b i s y Explanation c Control designator specifying the type of addressing that will occur. c=lO For indirect addressing only. c=01 2 For single character addressing. c=112 For sequential character addressing. c=00, bi t 29=0: Indirect addressing where bits 17-19 indicate the base register and bits 0-15 the 16-bit displacement. c=OO; bit 29=1: Indirect addressing where bits 17-19 indicate the index register and bits 0-15 the 16-bit displacement. Indirect addressing shall continue as long as i = 1 with indexing capability at each cascaded level. When i = 0, the indirect addressin~ will terminat~ a~d the current instruction will be interpreted in the normal manner. When i = 0 and c = (01 2 , 11 2 ), the remaining ten positions of the indirect control word are interpreted and character addressing will occur. In this case, the p- and w-designators are interpreted as follows: p - bit position designator which specifies the least significant bit position of the variable-length character field. w - character length designator which specifies the number of bits of the character field based at p. 11-12-15 M-5035 When a character has been read from memory by character addressing, it is placed in the appropriate arithmetic register, right-justified, and zero-filled. If c = 112,sequential character add~essing is specified. The indirect control word is updated for subsequent addressing of the next character field and then stored back in main memory. 12.2.7 I/O Commands Formats I . The IOC will read the command from memory and begin its execution upon receipt of the command address from the central processor.' The I/O format is: 1'llOllIlal ll7lu 1511 4 15111121110 It f k j II '111111111' 4 1'11 ' 21"1'01'111111111411121'10 mc y Explanation f Function code of the .command. k Partial word designator. j Channel number (0-15). c Chain flag. m Monitor flag. y Absolute 18-bit address of the operand (buffer control words, external function words, etc.). The buffer control words specify the limits of the buffer of data for input/output and the desired mode of transfer (a word at a time, half-word at a time, and so forth). Buffer control words are in two formats: normal mode and ESI mode. 12.2.7.1 Normal Mode The normal mode format is: Final Address Compare Bi ts Y 11-12-16 M-5035 12.2.7.2 E5I Mode The ESI mode format is: k Final Address Compa re Bi ts y Explanation y Initial lO-bit buffer address. Final address compare bits Initial buffer address plus the buffer's length minus 1 truncated to the required number of bits to fit the field. k 12.3 Partial word designator. SYMBOLIC CONVENTIONS For symbols, registers, and terms used in the computer instruction descrip- tions, see Table 12-14. 12.3.1 f- Function Code Designator The f-designator always occupi.es the most significant 6 bits of the instruction. It specifies or determines the type of instruction to be performed. All unused major function codes are illegal instructions and, if executed in the upper half-word, will cause an illegal instruction interrupt. 12.3.2 a - Arithmetic Code Designator The 3-bit a-designator specifies which one of eight A-registers an instruction will use or reference. The accumulator designation i3 as ff)ll'l/r,: -t a) 000 AO 2 -t b) 001 A 2 1 t c.) 010 A2 2 -t d) 011 A3 2 e) 100 -+ A4 2 -t f) 101 A5 2 11-12-17 M-5035 g) 110 h) 1112 2 .... A6 .... A7 NOTE There are two groups of accumulators. One group is associated with the task state and the other with the interrupt state of computer operation. I I -12-10 M-5035 TABLE 12-4. INSTRUCTION REPERTOIRE SYMBOL DEFINITIONS Definition Symbol ( ) ( ) II x ;. + = i: > ~ < s 0 , Content or the quantity Complement of the quantity Absolute value Compare Multiply Divide Minus Plus Equal Not equal Greater than Greater than or equal Less.than Less than or equal Logical AND or logical product defined as: Tltr l 000 101 Inclusive OR or logical sum defined as: o4t~ I~~ Exclusive OR or logical difference defined as: rttt l 001 I I 0 a Instruction field designating an accumulator or index r e g i s t e r . · A Accumulator designated by the a-field. a Accumulator designated by the b-field. 11-12-19 M-5035 TABLE 12-4. INSTRUCTION REPERTOIRE SYMBOL DEFINITIONS (continued) Symbol af 4 Definition Instruction field designating the combined a- and f 4 -fields use to specify a control memory register. ak Instruction fiel~ designating the combined a- and k-fields used to specify a bit position or a control memory register. b Instruction field lator register. B a desi~nating an index or accumu- 16-bit index register designated by the a-fi~ld. 10-bit index register designated by the b-field. c Instruction field designating indirect addressing word type or the chain flag in "input/output controller commands. C Input/output channel. CA Capable of indirect word character addressing. Cj Input/output channel designated by the j-field. CD Hardware compare designator. CMR Control memory register. DSW Designator storage words. e Operand field of the HK pseudo instruction. EF External function. EI External interrupt. f In~truction field designating the major function code. Instruction fields designating sub-function code. i Instruction field designating indirect addressing or interrupt control memory addressing. I J -12-20 M~5035 TABLE 12-4. Symbol INSTRUCTION REPERTOIRE .SYMBOL DEFINITIONS (continu~~d) . Dcfi ni t i on I/O Input/output. IOC Input/output controller. j Instruction field designating an I/O channel. k Instruction field partial word designator. kj Instruction field designating the combined k- and jfields used to specify a bit position or control memory register in IOC instructions. 1 Operand subfield of buffer control word pseudo instructions. Instruction field designating a shift count or monitor flag in an IOC command. n Used as a subscript indicating a bit position; for example, (A ) . a n NI Next instruction. OD Overflow designator. p Indirect word bit position designator. P Program address register, 20 bits. PI Privileged instruction executable only when the processor is in the interrupt {executive} state. RPT Capable of being executed in the repeat mode. RTC. Real-time clock. s Instruction field designating a base register. SIR Segment identification register. SPR Stored protection register. 11-12-21 M-5035 TABLE 12-4. INSTRUCTION REPERTOIRE SYMBOL DEFINITIONS (continued) Symbol sy . Definition Instruction field representing s~ ·and y~fields in combination. U U regist~r (program control register). w Indirect word character length designator. y Instruction operand field deSignating an address or value. y Effective address formed by Y + (B b ) + (Ss). y. Effective operand as qualified by k (and/or p and w when 12.3.3 applicable)~ k - Operand Interpretation Code Designator I The k-designator determines what part of the wordi referenced by an instruction is to be used. Wh~n k #0, bits 15 through 13 sp~cify abase register. If the k-designator specifies an upper I)r lower halfl-word, the l6-bit operand will be sign-extended to 32 bits. If the k~designatorl specifies a quarter-word, the 8-bit quarter-word will be zero extended to 32 bifs. If the k-deslgnator .\'-i . I specifies the whole word, the full 32-b.. it. word willI be used •. The genera. I interpretation of the k-designator is specified ip Tables 12-5, 12-6, and 12-7. , 11-12-22 M~5035 TABLES ]:2-5. OPERAND INTERPRETATION GENEHAI~ TO ARITHMETIC) M~mory to Arithmetic k De s i g n B t () r i =0 k =1 k =2 k =3 I k i s y+( Bb ) .... A15 -0 Sign extended (y 15-0) .... A15 - 0 Sign extended i i (Y31-16) - A15 - 0 (Y 31 - 0 ) A31 - 0 - Zeros extended .... A7_0 !(Y 23 - 16 ) .... A7_0 .... A7_0 \(Y 31-24) Zeros extended (Y7 -0) =5 - Sign extended A7_0 k = 4 k (Mf~MORY (Y 15-8) 1 1 k Zeros extended I k = 6 =7 Zeros extended I 'I 1 TABLE 12-6. k k k k k k k k GENERAL OPERAND INTERPRETATION (ARITHMETIC TO MEMORY) 'I Designator Arithmetic to Memory 1 I =0 =1 =2 Not use(i =3 =4 =5 (A 31 - 0 > =6 I 1 (AlS-O>j (A - - i - )! 1S 0 (-A 7 -0) .... - (A _ ) 7 0 - (A 7 -0) YI5 - 0 ; Y31-16 Y31 - 16 ; Y1S-0 Y31 - 0 Y7 - 0 ; Y31 - 8 YI5 - 8 ; Y31 - 16 Y7 - 0 Y23 - 16 ; Y31 - 24 Y15 - 0 k =7 (A _ ) 7 0 i - Y31 - 24 ; Y23 - 0 11-12-23 ,- - - Unchanged Unchanged Unchanged Unchanged Unchanged Unchanged Unchanged Unchanged M-5035 TABLE 12-7. GENERAL OPERAND INTERPRETATION (NORMAL REPLACE INSTRUCTION INTERPRETATION) Normal Replace Instruction' Inte'rpretation k k =U =1 Not used Rea d : Stor~: ( Y15 -0 ) ..... A15 -0 (s i 9 n ex· ten de 1) · i Store the lower 16 bits of the operand in bits 15-0 of I address Y leaving the upper 16 bits df the contents of address Y I unchanged. I I k =2 Read: Store: 3l - 16 ) ..... A15 - 0 (sign extentl4d). Store the lower 16 bits of the operand in bits 31-16 of (Y j address Y leaving the lower 16 bits ~f the contents of address Y unchangedo . i I k = 3 Read: Store: k =4 Read: I (Y 3l - 0 ) -t A31 - 0 I I Store the 32 bit operand at ~ddress Y. (Y 7 - 0 ) .... A7 _0 (zero extended) ~ I Store: Store the lower 8 bits of th~ operand in bits 7-0 of address Y, leaving the upper 24 bitslof the contents of address Y unchanged. I ! i k = 5 Read: (Y 15 - 8 ) .... A7_0 (zero extended~. I Store: Store the lower 8 bits of th~ operand in bits 15-8 of address Y, leaving the remaining unchanged. k =6 bit~ of the contents of address Y I i ! Read: Store: - ) ..... A _0 (zero extende~). 23 16 7 I Store the lower 8 bits of th~ operand in bits 23-16 of (Y ! address Y, leaving the remaining bit. of the contents of address I Y unchanged. k =7 Read: Store: (Y i I I ) ..... A _0 (zero extender). 7 31 24 Store the lower 8 bits of th~ operand in bits 31-24 of - I, , the operand in bits 31-24 of addressi Y, leaving the lower 24 bits I of the contents of address Y unchang~d. 11-12-24 M-5035 b - Index Heqister Code Uesiqnator l:!.:\.·) The :~-hil h-desiunator specifics which of tht! modify the operand address y-designator. indexing loops in a program. ind(~x registers wi 11 he used t.o B-registers arc generally used for In addition, the B7-register serves as a repeat counter and the BO-register indicates a register which always contains zero. There is a group of index registers for each state of the computer. 12.3.5 i-Indirect Address Code Designator The i-designator is set by coding an asterisk (*) before the y field. The i- designator of the instruction word controls the use of indirect addressing and variable-length character addressing during execution. If i = 0, the instruc- tion will function normally. 12.3.6 s - Base Register Code Designator The 3-bit s-designator is used to modify the 13-bit operand address y-designator to form Y = Y+ Bb + 5 s ' The base registers addressing techn~que is as follows: » .... 5 (Add (50) to y + (B .... 51 (Add (51'> toy + (B c) 010 2 "" 52 (Add (52) to y + (B » b d) 011 .... 53 (Add (53) to y + (B » e) 10° 2 "" 54 (Add (54) to y + (B » b f) 101 2 "" 55 (Add (55) to y + (B b » g) 110 .... 56 (Add (56) to y + (B b » h) 111 .... 57 ~Add (57) to y + (B » a) 000 b) 001 2 2 2 2 2 0 b b» . b b There are two sets of eight base registers, one for each of the task and interrupt states of the processor(s). 12.3.7 The y - Operand Code Designator o~era~d y-designator is either a l3-bit value (zero extended) if k # 0, or , ' a l6-bit value (sign extended) when k = O. In the first case, the y-designator is part of the final operand addressi in the other case it is a constant. 11-12-25 M-5035 12.3.8 f2,f3' f4' ~ Subfunction Code Designat~rs In an effort to minimize the number of different function codes, various instructions have subfunctions in all or part of the normal k-designator field. In place of the k-field, a whole-word interpretation of the operand is hardware ass umed. 12.3.9 m - Shift Counter Field This is a 7-bit field used in half-word shift instructions to specify the number of data bits in an A-register that will be moved either to the right or to the left. 12.3.10 m - Monitor Interrupt Code Designator This is a special designator for input/output controller instructions consisting of a I-bit monitor flag that, if set, will cause the IOC to transmit an interrupt to the processor when a buffer is terminated. 12.3.11 c - Chain Flag Code Designator This is a special deSignator for input/output controller instructions consisting of a I-bit chain flag that, if set, indicates to the IOe that another command follows. When the operation specified by this command terminates, the chain shall remain active. 12.3.12 i-Channel Number This is a special designator for input/output cqntroller instructions consisting of a 4-bit field specifying which channel (0 through 15) the associated IOC command is to be performed on. 12.4 COMPUTER-INSTRUCTION REPERTOIRE The assembler recognizes and generates for an idbedded computer-instruction repertoire associated with the AN/UYK-7 Compute~ System. All mnemonic computerinstruction lines have the general format: Label Mnemonic Function : Operand Use of a label is always optional. An asterisk :(f,c) preceding the y field specifies indirect addressing and causes the Assembler to set the i-field of the generated instruction word to a one. II -12-26 M-5035 For convience of programming, the coding sequence of the operand subfield(s) does not necessarily correspond to the field order of the generated instruction. The material contained in this section presents the instruction repertoire in condensed form for reference purposes only. Programmers requiring more detailed information concerning the hardware operation should consult the appropriate hardware· specification document. Note that the mnemonic function code for all half-word instructions begins with the letter H. For ease of reference, the in~tructions are grouped according to their function into eleven major categories as follows: Load and Store, Arithmetic, Jump, Comparison, Logical, Shifts, Control Memory References, Interrupt Handling, Miscellaneous, Extension Mnemonics and Input/Output. Within each group, instructio~s are arranged alphabetically by name. Format I and Format II instructions are character addressable and repeatable except as indicated. There is some unavoidable overlap in the above classification. For example, some of the logical type instructions involve arithmetic operations. The list which follows may be consulted for corresponding names, mnemonics, and groups. 11-12-21 M-5035 MNEMONIC AA AB AEI AFC AIC ALP ANA ANB AOC NAME GROUP - ADO A ADO B Arithmetic ALLOW ENABLE INTERRUPT ACTIVATE EXTERNAL FUNCTION CHAIN ON Cj ACTIVATE INPtIT CHAIN ON Cj Arithmetic Interrupt Input/Output Input/Out put ADO LOGICAL PRODUCT SUBTRACT A (Add Negative A) Logical SUBTRACT B (Add Negative B) Arithmetic ACTIVATE OUTPUT CHAIN Input lOut put Arithmetic ON Cj AXC ACTIVATE EXTERNAL INTERRUPT CHAIN ON Cj Input/Output BC COMPAHE BIT TO ZERO Comparison BCW BUFFER CONTROL WORD Extension BCWE BUFFER CONTROL WORD ESI Ext ensi on BS SET BIT Miscellaneous BZ CLEAR BIT Miscellaneous C COMPARE Comparison CG COMPARE GATED Comparison CL COMPARE LI MITS Comparison CM COMPARE MASKED Comparison CNT COUNT ONES Miscellaneous CXI COMPARE INDEX, INCREMENTED Comparison o DIVIDE A DOL1~LE ADD A DOUBLE SllliTRACT A (Uoubl(! Add Negntive A) DOt13LE COMPAHE DOUBLE JUMP A NOT ZERO Arithmetic DA DAN DC UJNZ 11-12-20 Arithmetic Arithmetic Comparison Jump M-5035 NAME GROUP DJZ DL DOUBLE JUMP A ZERO DOUBLE LOAD A Jump Load & Store DS DOUBLE STORE A Load & Store FA FAN FLOATING POINT ADD FLOATING POINT SUBTRACT (Floating Point Add Negative) FLOATING POINT SUBTRACT WITH ROUND (Floating Point Add Negative with Round) FLOATING POINT ADD WITH ROUND INITIATE EXTERNAL FUNCTION BUFFER ON Cj FLOATING POINT DIVIDE FLOATING POINT DIVIDE WITH ROUND FLOATING POINT MULTIPLY SET EXTERNAL FUNCTION MONITOR INTERRUPT REQ UEST ON Cj FLOATING POINT MULTIPLY WITH ROUND ADD (SUM) All.OW CLASS II INTERRUPTS STOP PROCESSOR SUBTRACT (DIFFERENCE) Add Negative (Difference) AND COMPARE, REGISTER COMPAllli Bb WITH Ba COMPARE LIMITS, REGISTER COMPARE MASKED, REGISTER COMPLEMENT A Arithmetic Arithmetic MNEMONIC FANR FAR FB FD FDR FM FMIR FMR HA HAl HALT HAN HAND HC HCB HCL HCM HCP 11-12-29 Arithmetic Arithmetic Input/Output Arithmetic Arithmetic Arithmetic Input/Output Arithmetic Arithmetic Input/Output Miscellaneous Arithmetic Logical Comparison Compari son Compari son Comparison Ar it hmet i c M-5035 MNEMONIC HO HOCP HOLC HDRS HDKZ HOSF HK HLB HLC HLCI HLCT lIM UNO HOR HPI HRS HRT HRZ HSCI HSCT HSF HSIM HSTC HWFI HXOR NAME GROUP Arithmetic DIVIDE REGISTER Arithmetic DOUBLE COMrLEMENT A Shift DOUBLE SHIFT LEFT CIRCULARLY Shift DOUBLE SHIFT RIGHT FILL SIGN Shift DOUBLE SHIFT RIGHT FILL ZEROS Miscellaneous DOUBLE SCALE FACTOR Extension HALF-WORD CONSTANT ' Load & St ore LOAD 8a WITH 8b Shift SHIFT LEFT CIRCULARY Cont rol Memory LOAD INTERRUPT CMR WITH A Control Memory LOAD TASK CMR WITH A Arithmetic MULTIPLY REGISTER Extension HALF WORD NO-OPERATION Logical INCLUSIVE OR A (Logical Sum) Interrupt PREVENT CLASS III INTERRUPTS Shift SHIFT RIGHT FILL SIGN Arithmetic SQUARE ROOT Shift SHIFT RIGHT FILL ZEROS Control Memory STORE INTERRUPT CMR INA Control Memory STORE TASK CMR IN A Miscellaneous SCALE FACTOR STORE 1/0 MONITOR CLOCK Miscellaneous Miscellaneous STORE REAL TIME CLOCK I nt errupt WAIT FOR INTERRUPT Logical EXCLUSI VE OR A ( Logical Oi fterence) 11-12-30 M-5035 IB IBS IBZ ILTC IMIR JBNZ 10 IPI ITSF IW GROUP NAME MNEMONIC INITI ATE I NPIIT BUFFER ON Cj SET BIT CLEAR BIT LOAn REAL-TIME CLOCK SET INPUT MONITOR INTERRUPT REQUEST ON Cj INDEX JUMP (Jump B not zero) INITIATE INPUT/OUTPUT INTERPROCESSOR INTERRUPT TEST AND SET FLAG INDIRECT WORD INDIRECT WORD, SPECIAL INDEX INDIRECT WORD, CHARACTER INDIRECT WORD, CHARACTER INCREMENT INDI RECT WORD, SPECIAL BASE JUMP JUMP CONDITION SETTING JUMP EQUAL JUMP EVEN PARITY JUMP GREATER THAN JUMP GREATER THAN OR EQUAL JUMP (I NPUT / OUTPUT ) JUMP LOWER JUMP LESS THAN OR EQUAL JUMP LESS THAN JUMP A NEGATIVE JUMP NOT EQUAL JUMP NO OVERFLOW / 1M3 I\«: IWCI IWS J JC JE JEP JG JGE JIO JL JLE JLT IN JNE JNF 11-12-31 Input/Output Input/Output Input lOut put Input/Output Input/Output Jump Miscellaneous Interrupt Input lOut put Extension Extension Extension Extension Extension Jump Jump Jump Jump Jump Jump Input lOut put Jump Jump Jump Jump Jump Jump M-5035 MNEMONIC JNW JNZ JOF JOP JP JS JSC JW JZ LA LB LBJ LBMP LCI LCT LDIF LICM LIM LLP LLPN LM LNA LSUM LXB M MP MS NLP GROUP NAME JUMP NOT WITHIN LIMITS JUM P A NOr ZEHO JUMP OVERFLOW JUMP ODD PARITY JUMP A POSITIVE JUMP Sy + B JUMP STOP CONDITIONAL SETTING JUMP WITHIN LIMITS JUMP A ZEHO LOAD A LOAD B LOAD B AND JUMP LOAD BASE AND MEMORY PROTECTION LOAD INTERRUPT CMR LOAD TASK CMR LOAD DIFFERENCE LOAD IDe CONTROL MEMORY LOAD, ENABLE IOC MONITOR CLOCK LOAD LOGICAL PRODUCT LOAD LOGICAL PRODUCT NEXT LOAD MAGNITUDE LOAD NEGATI VE LOAD SUM LOAD A & INDEX B MULTIPLY A MEMORY PROTECTION SELECTIVE SUBSTITUTE A SUBTRACT LOGICAL PRODUCT (Add Negative Logical Product) 11-12-32 Jump Jump Jump Jump Jump Jump Jump Jump Jump ;Load & St ore Load & Store Jump Load & Store Control Memory Control Memory Load & Store I nput/Out put Miscellaneous Logical Logical Load & Store Load & Store Load & Store Load & Store Arithmetic Extension Logical Logical M-5035 MNEMONIC NOOP OB OMIR OR PEl RA RALP RAN RD RI RJ RJC RJSC RLP RMS RNLP ROR RP RSC RXOR SA SB SC SCI NAME NO OPEHATION INITIATE OlITPUl' BUFFEH SET OlITPlIT MONITOH INTERRUPT REQUEST INCLUSIVE OR (SELECTIVE SET) PREVENT ENABLE INTERRUPT HE PLACE ADD REPLACE A + LOGICAL PHODUCT REPLACE SUBTRACT (Replace Add Negative) REPLACE DECREMENT REPLACE INCREMENT RETURN JUMP RETURN JUMP CONDITIONAL RETURN JUMP STOP CONDITIONAL SETTING REPLACE LOGICAL PRODUCT REPLACE MASK (SEL. SUBSTITUTE) REPLACE A - LOGICAL PRODUCT (Replace Add Negative Logical Product) REPLAC,E INCLUSIVE OR (Replace Selective Set) REPEAT REPLACE S~LECTIVE CLEAR REPLACE EXCLUSIVE OR (Replace Selective Complement) STORE A STORE B SELECTIVE CLEAR STORE INTERRUPT CMR 11-12-33 GROUP Extension I nput / Ou t. put Input/Output. Logical Interrupt Arithmetic Logi ca I Arithmetic Arithmetic Arithmetic Jump Jump Jump Logical Logical Logical Logical Miscellaneous Logi ca 1 Logical Load & Store Load & Store Logical Cont rol Memory M-5035 MNEMONIC SCT SDIF SICM SLP SM SNA SSUM 5XB 5Z TBS TBZ TFB TIB TOB TSF TXB XB XMIR XOR XR XRL XS ZA ZR NAME STORE TASK STORE DIFFERENCE STORE IOC CONTROL MEMORY STORE LOGICAL PRODUCT STORE MAGNITUDE STORE NEGATIVE STOHE SUM STOHE A AND INDEX B STORE ZERO TEST BIT SET TEST BIT CLEARED TERMINATE EXTERNAL FUNCTION BUFFER ON Cj TERMINATE INPUT BUFFER ON Cj TERMINATE OUTPUT BUFFER ON Cj TEST AND SET FLAG TERMINATE EXTERNAL INTERRUPT BUFFER INITIATE EXTERNAL INTERRUPT BUFFER SET EXTERNAL INTERRUPT MONITOR INTERRUPT REQ UEST ON Cj EXCLUSIVE OR (SELECTIVE COM PLEMENT ) EXECUTE REMOTE EXEClITE REM(YfE LOWER ENTER EXECUTIVE STATE CLEAR A CLEAR B 11-12-34 GROUP Control Memory Load & Store Input lOut put Logi cal Load & Store LOnd & Store Load & Store Load & Store Extension Input/Output Input/Output Input/Output Input/Output Input/Output Miscellaneous Input/Output Input/Output Input/Output Logical Miscellaneous Miscellaneous Miscellaneous Extension Extension M-5035 Change 1 12.4.1 Load and Store Instructions Generally, load instructions load a register or rt!gisters with: 1) th(' con- tents of memory; 2) the contents of memory plus or minus the contents of im accumulator register; or 3) the contents of memory in absOlute magnitude or complemented. In format I instruction, k is the normal read designator. instructions store the following in memory: or registers; 2) registers; or 3) plemented. 1) Store the contents of a register the sum or difference of consecutively numbered accumulator an accumulator register in absolute magnitude or com- The following are the formats for load and store instructions: DOUBLE LOAD A )'l''1Z!l'I, zr IZl u12-1 n n12 '1 ° "1'11'7 " '51'-I's "I "I ,01'J 11 71'1 51 41 sI I I ' 10 ' n 05 4 b i s DL Y a,y,b,s Not character addressable. Not repeatable. Load the double length register (formed with the lease significant half in A and the most significant half in A +1) with the content of the a a double length memory word, formed with the least significant half as (Y) and the most significant half as (Y + 1). OOUBlE STORE A "l'~ztlZlIZ7II' 02 ula-In ul"IIO "1'11" " 111'-1" () 7 b i '~1I1'01',11 7J '1 51 4 1s I zI s y Not character addressable. Not repeatable. 11-12-35 '1 0 DS a,y,b,s M-5035 Change 1 Store the content of the double length register (formed with the least significant half in Aa and the significant half in A + ) at the a l double length memory word (formed with Y as the least significant half and Y + I as the most significant half). LOAD A a 10 y k b i s y LA a,y,k,t,s s y LXB a, y , k, b , s -A.a Load A with Y. a J~JjEX LU ..\lJ ..\.\ND 11 a B k ___ ---l. •..•.. .____ "_ y - ., " (B.) a lJ ·1 1 -.. B h Not rl:'peat.able. Load Aa ~ith Y and add one to (B ). b LOAD B !'1sOTziTzlfzifn ulz.lu utzllzo "T'll,1' II ',TI411! lifliTlo\'\ll1TITaj41 sTzTi fo 20 a I k b i s y LB a,y,k,b,s w_ Y .... B -. lhe M ~ suh-field specifies an index register. Load B with Y. a If 8 a is 8 , the effect is a no-operation. 0 11-12-36 M-5035 Change 1 LOAU BASE ANU MEMORY PROTECTION "i,Tiolz'tlzllulze u1z.123 ZZ[I'lZO 111'1117 II ,sl'.I" 'zl''I,01111(1('1 s141' I z I' OS 4 ;) b i s (0 Y LBMP a,y,b,s Y - Sa Y + 1 - SPR a S - SIRa 19-17 y + (Bo) - SIRa 15-0 b Not character addressable. Not repeatable. This instruction loads the task state base register, specified by the afield, with the lower 18 bits at address Y, and loads the Storage Protection Register specified by tha a-field, with the lower 21 bits of address Y + 1. The Segment Identification Register, specified by the a- field, receives the s-field value in bits 19 through 17 and the sum of y+ (BD~ in bits 15 through O. This instruction can be executed in the task state under the following conditions: 1. Bit 0 of the Active Status Register must be set. 2. The s-field must equal seven. 3. The a-field must not equal seven. A violation of these conditions shall cause a privileged instruction int~rrupt (class II). The following condition applies to this instruction in both the task and interrupt states: The'17-bit relative address quantity, y + (BO)b must be an even number. Its violation shall be an illegal instruction error causing a class II interrupt. 11-12-37 M-5035 Change 1 LUAD B WITH B b n I' I ,. r ,T 2 J I I I I J10 -r-T7 7-1 312 3 H (B 'I s I" II ° j h IILB a,b ) - Ba t) Thp a sub-field specifies an index register. Load Ba with (B b ). If Ba is Bo' the effect is a no-operation. n ,H is cleared to zero. o If Bb is a U }t\/l J) I FFERENCE 31 T,01u12l1z "\21 uh"{u ulZllzo "\"1 '1 " 15114jl' 121"1101'1117111114111 zI' 10 k () 12 Load a Y , LDIF a,y,k,b,s (A ) i = (A ) f y - (A ) ..... A - s i b a+1; a a Aa+l with the difference formed by subtracting (Aa) from I. remnins unchanged. LOAD MAGNITUDE "T,0InI2lIz 7121 ulz 41u ulzllzo "1 )'7 " 17 k () b I' 1511411' 121"110I'J 1171-1114111 zII 10 i s LM a,y,k,b,s y -A a Load A with the absolute value of a LOAD NEGATIVE "I,oInf2l1Z1(z, z51z 4Tu ulz1fz o "1 1'7 " ] /, " k lJ I. I' 11'1'41'1 121"1101'1111111114111 i s y Z 1'10 LNA a,y,k,b,s Y' - A Cl l.oaci t\ Cl wi th the logical complement (ones complement) of Y. I 1-12-38 (A ) a M-5035 Change 1 LOAU SUM 31\30\21\21\ 21 121 u\z.\n uT2 11zo "1 '11'1 II IsII.I" 'alII I'01'1111 11\ a\4 I ' \ z \ ' \ 0 k a l~ h i LSUM a,y,k,b,s y s -Y + (A a ) - Aa +1; (A a ).1 = (A a ) f Load A + with the sum of I and (A a ). a 1 (A ) remains unchanged. a STORE A 31\3012l\ZII21\2I u\Z 4 ln Ullllzo "1 11 '1 ,. 'sl'·I" Izl" 1'01. Til 7T. Ta14 1' \ 2 I' 10 ' () s k y b i 24 SA a,y,k,b,s (A ) - Y a Store (A ) at Y. a STORE A AND INDEX B 3113012l\111 21 lz, ulz 41n 1211'110 "1'11 '7 ,. 'Sl '.[1' 'aI' , I'0 I., I 171.1a I 4 III 2I ' I0 25 II k b i s y SXB a,y,k,b,s Not repeatable. Store (Aa) at Y; add one to (B ) and store the sum !n the Bb register. b STORE B 311Io121lz112112. u\a4\n 12111 lao "1 11,7 ,. ' a k b i 23 "r'·l" s ,aT"T,ol. TIT 7T. TSI.III 2I ' 10 y (B ) - a y. The a sub-field specifies an index register. Store (B ) at Y . a II-12-:l9 SB a,y,k,b,s M-5035 Change 1 STUHL IHFFEHENCE 311)0129121127121 2~124123 221 Zl lzo 1'1 11 111 II 1!l11411) 0:2 6 () h 1~llllol'11111~I!l14Islzl s j I 10 SDIF a,y,b,s y ~--------- Subt rClC t (Aa) from C'(1+1). The resul t is noted rtt Y and Aa+lo (A ) a remnins unchrtngedo STORE ~lAGNITl!DE SM a,y,k,D,s Stor e the mel 9 nit u de 0 f (A ) el ~t Y. STORE NEGATIVE 'I1,01n1zel27l21 ul z41n zz111 1zo 1t111111 II 1511411) Izl"II01' 111' I I 151 41 s I z II 10 20 k () b i s SNA a,y,k,b,s y (A )' - Y rt Telke the complement of (A ) and store the result in Y. el STORE SUM ________ ~ __ ~ 5 b ____-L____ Add (Aa) to (A + ). a l unchanged. ~ s J __ _ _ _ _ _ _ _ _ _y_ _ _ _ _ _ _ _ _ _ ____ ~ SSUMa,y,b,s The result is stored in Aa+land Y. 11;..12-40 (A ) remai ns a M-5035 Change 1 12.·1.:2 Tht·sc· Arithml'tic Instructions i~:sl rllc'i()n~ chnn~,(' Sl)('(~ifipd ttw conU'nl.s of a rf'~JistC'r or r(luislc'rs accordinu to the operation sppcifif'd, except for ttw replacp instructions which also modify the contents of memory. Some instructions in the LOAD AND STORE and LOGICAL sections also involve arithmetic operations. ADD A 311501nlllll1l21 ul2-ln 1212 '(20 "1'11" 1·1 k (] b 'I i III'-I's '~"1,01'111111ItI415rzr'To s y AA a,y,k,b,s (A ) + Y - A a a Form the sum of (Aa) and ¥b and store the result in Aa. ADD (SUM) 151 1_1']1 12 1"1'0 .J I t 1 11 5/ 4 3/ Z I' ?1 71 1 a b i llA a,b Form the sum of (Aa) and (A b ) and store the result in Aa. ADD B ]1150In/lIll1l21 ul2-ln ul2'lzo 111'11" 21 a k b 'I i 'II'-I's Izi "110111111 III It 141 1I z II r0 s Y AB a,y,k,b,s (B a ) + -Y - Ba , where reference is to an index register in sub~field a. If Sa is Bo ' the effect is a no-operation. k is normal read. COMPLEMENT A 151'-111112111110 '111 70 ' II III- 31zl1 0 a 2 b i HCP a (A )' - A a a Complement (A ) and store the result in A . a a 11-12-41 M-5035 Change 1 UIrIUE A 311301u12l1271za 2512 .1 23 2212 '1 20 "1"1 11 ,n h k () ( . \ () -.-',1' Aa ) • 'I '51'.1'5 Izl"llol'l_P 11 1'1 4 15 1z1 '1 0 j r :. . Aa ; s U a,y,k,b,s y rf'mn i nder ..... A H+] IJi\'id(' I hi' content of t h(' dOllu1(' length register (formed with the least si~lnifican1 half in Aa and tIl(' most significant half in A + ) by Y. The a 1 quot ient is stored in A and the remainder in A I" Uivide overflow a a+ shaJ I occur if the quotif'n1. exceeds 31 data bits and one sign bit. DJ\,IUE HI·:C;lSTEH '51'.('51 12 1,,110 -'1'1 ' II ~l. 31 zI' /.\ () II I 0 i 1m [J, h (~ () -+l' A) ~ CAb) - A() ; rf'mainder - Aa+l , Divide the double length n~gister (formed with (Aa) as the least signi- ficant half and (A +]) as the most significant half) by (A ). The a b quot ient is stored in Aa and the remainder' in A + " (Ab)i = (Ab)f if a l a I band a+1 t b. DOtJBLE ADD A os b s DA a,y,b,s y Not character addressahle. Nol r('IH-'atahlc. Form the sum of the content of the double length register (formed with t 1](' ]('ast significant half in Aa and the mostsignificatn half in A + ) a l and the content of the doublf' length memory word (formed with the least significant half at Y and the most significant half at Y+ 1). I('nst siunificant half of th(~ Store the n'sult in A and the most significant half a 1 J -l2-12 M-5035 Change 1 UOUBLE COMPLEMENT A 1'1 "lis 112111110 '111 ' -I' ,_ I I Z II 70 3 () 0 B[iep a i h Complement the double length register (formed with (A ) as the leRst a significant half, and (A a + ) as the most significant half} and store the 1 most significant half of the result in Aa+l and the least significant half in . Aa . OOUBLE SUBT RACT A 05 2 b s ..L-_--L.-'--_~ DAN a,y,b,s Y _ _ ._ _ _ _ ._... _ _ _ _ __ Not character addressable. Not repeatable. Subtract the content of the double length memory word (formed with the least significant half at Y and the most significant half at Y + 1) from the content of the double length register (formed with the least signif~ icant half in Aa and the most significant half in Aa+ l ). Store the least significant half of the result in Aa and the most significant half in Aa+ l • FLOATING POINT ADD 311501111 ziia '111 ulz-In Uli l l20 1'1.11 11 II ISl14rl3 06 n 0 b i s 1~lijl~.T'1111Isl-lllzll Y Not character addresable. Not repeatable. 11-12-43 10 FA a,y,b,s M-5035 Change l' Compare thp characteristic stored at Y with the characteristic located in the lower 16 bits of A. The mantissa located at Y + 1 or the mantissa a located in Aa+l is tlH'n shifted, depending on the comparison of the characteristics. + 1) is then added to (A + ). The normalized shift a l count is t.hen subtract(~LI from, or added to the final characteristic 10(Y cat.pd in A • a . FLO,\TI;'\(; POI:'-JT AUD WITH HOl~ND fj\ rl Cl, Y , b , s· Not character addressable. Not rep{'atab1e. Compare the characteristic stored at Y with the characteristic located in the lower 16 bits of A. The mantissa stored at Y + I or the mantissa a located in Aa+l is shifted, depending on the comparison of the characteristics. The final mantissa is round~d as required. The normalized shift count is subtracted from, or added to, the final characteristic located in A . a FLOATING POINT DIVIDE 31130129121121128 25 124123 2211 1120 111 1'1 17 II 1511411S 121"11011 I '17 II 151 .. 131 2 II 10 .) U() () ,) b i S Y FD a,y,h,s Not character addressable. Not repeatable. Sllbt ract t he characteristic located at Y from the characteristic located in the lower 16 bits of A. The mantissa located in A I is then divided a ~ hy the mantissa located a1 Y + 1. The. final mantissa located in Aa+1 is norma] izcd right one place if necessary and the characteristic adj usted accordingly. J] -12-4,1 M-5035 Change 1 FLOATING POINT DIVIDE WITH ROUND 7 U6 s b y FU H (l, Y, 1>, s Not character addressable. Not repeatable. Subtract the characteristic located at Y from the characteristic located in the lower 16 bits of Aa. The mantissa located in Aa+l is then divided by the mantissa located at Y + 1. The mantissa located in Aa+l is normalized right one place if necessary and the characteristic adjusted accordingly. The final quotient mantissa, (A + ), is rounded as required. a l FLOATING POINT MULTIPLY r--r. '~ 1":~O:"9Iz'lz11z. 06 nlz-In Ull11 Z0 1'111111 II Isj ,-jls (l 2 h i '2j"jlol II IUI-lsI"lsl z111c s y FM a,y,L,s Not character addressable. Not. repeatable. Add the characteristic located at Yto the characteristic located in the lower 16 bits of Aa. The mantissa located in Aa+l is then multiplied by the mantissa located at Y + 1. The final mantissa located in Aa+l is normalized left one place if necessary and the characteristic adjusted accordingly. FLOATING POINT MULTIPLY WItH ROUND FMR a,y,b,s Not character addressable. Not repeatable. M-5035 Change 1 Add the characteristic located at Y to the characteristic located in the IOl\'('r }() bits of Aa' The mantissa located in Aa+l is then multiplied by thf' mantissa located at Y + 1. The mantissa located in Aa+l is norma I ized left one place if necessary and the characteristic adjusted accordinuly. Thc final mantissa, (A + ), is then rounded as required. a l FLUr\TI\(; P!)I\T St:BTRACT ]11]01 291"1 21 121 2512·lu 221 Zl lzo 11111117 II 1511.(1] 1211 q 10111'1 7III '1 415 I z III ° (II ) - -- -- - -- il I' t> s i Y FAN a,y,b,s .. Not character addressable. Not repeatable. Compare the characteristic stored at Y with the characteristic located in the lower 16 bits of A. The mantissa located at Y + 1 or the mantissa a located in Aa+l'is then shifted depending on the comparison of the charact.t~ristics. is then subtracted from the (A + ). The normalized a l shift count is then subtracted from, or added to, the final characteristic (Y + 1) located in A , a FLOATING POINT SUBTRACT WITH ROUND 5 11]01211 nl 27 In 2512·lu 2212 1120 "1 1'1 17 () I) :1 5 h II j 1511.11] 12111110 II I '1 7I-I 5141 5 I 2I I 10 s Y FANR a,y,b,s Not character addressable. Not. repeatable, Compare the characteristic stored at Y with the characteristic located in lower III hits of A. The mantissa located at Y + I or the mana tjssa ,located in Aa+ I is shifted depending on the comparison of the characteristics. (Y + 1) is then subtracted from(A + ). The final a I manf issa is rounded as required. The normalized shift count is then tlH~ suhtracted from, or added to, the final characteristic located in A • a I I -12-46 M-5035 Change 1 Mll.TIPLY A 3,13012112112 'In nT241n ul 21 1zo Itllll17 I- 1111_11' Izl"llo f t f I f 7I_ 1'1-1 , I z II 10 ,10 () k i b y s .- ~1 Cl, Y, k , b , ~; Multiply (A ) by I, store the leClst signific,Rnt half of the double length, (1 result in AR' and the most significant half in ACl+lo MULTIPLY REGISTER 1'11411'1'21"110 .1117 -1'1- 3121 1 0 74 a 0 j 11 ~.b HM M~ltiply (Aa) by (A ). The least significant half of the double length b result is stored inA , and the most significClnt half in Aa + · (Ab)i = l a (Ab)f if a 1 band a+l # b. REPLACE ADD Si lsoTu12lTuT2I uTz-ln ulzllzO 1'1 11 111 'i a i 34 k b 111'4115 ,zl"IIO It I I (1 (-( 'I 4 J SJ Z II J0 s Y RA a,y,k,b,s Y + (A ) - Y and A +1;' (A ). = (A ) - a a a1 af Form the sum of ! and (A >, and store the result at Y and A • . a a+] remains unchanged. I 1-12-47 (A ) a M-5035 Change 1 HLPL\CL INCRE\lENT ___ L s _;_1- - 1 . . . _ ~ y Lo ad t\ y ~---~~--~--------------------~ HI a,y,k,b,s I - A{] and Y with I, then add one to (A ) and store the result at A and Yo (1 a a REPLACE DECRE'lENT k Y - I --+ y s b RD a,y,k,b.s A and Y a Load A wi th a r. then sub trae t one from (r\ ) a and s tore the resul tat A and Y. a REPLACE SlJBT RACT . 'IJJOl211 Zll 27121 nl2 41n UI21[ZO a 36 IIJ k lll 11 II h i l'll411S 121" 110 I • I I 11 I lIs 141 SJ 2J I 1 0 s Y RAN a,y.k,b,s -Y - (A a ) - Y a nd Aa +1; (A a ).1 = (Aa) f Subtract (Aa) from unchanged. ro, then store the result in Y and A + . a l (A ) remains a SQUARE ROOT l'lI41ISI'21"1IO 11117 lis 14 S\z II 0 74 a h i HRT a,b Calculate the squ:.re root of fhe content of the double length register (formed with the- most significant half in Aa+ I and the least significant half in AaL The result is stored in Ab and the residue is stored in Ab+lo (A +1). = fA a J ) a+ 1 f if a+l 1: band a+l :f b+l if a :f b and a :f b+l lI-12-tlB M-5035 Change 1 SUBTRACT (UJ FFEHENCE) ',sri-II'I,zl"llo 11111 'I ~ 14 31z r I 0 n 71 2 i h . l:AN n, h (A ) - (A ) - A a b a SUBTRACT A ,,130fu lzII 11111 nil-In 12111\10 11111111 a 13 k II I~I b i 14113 121"110111'11 1'1 ~ I 41 3I 11110 s ANA a,y,k,b,s Y (A ) - Y - A a - a Subtract Y from (A ) and store the result inA. a. a SUBTRACT B 31 130lulzalulll nlz-In ZZl111z0 111 1'1 11 I' 11.11-113 111"1 10111'1111111-1 3I IT ITo a ~~ k (B ) - Y ..,.. B 8 - a b i s Y ANB a,y,k,b,s a = index register Subtract Y from (B ) and store the result in B. a a is a no-operation. 11-12-49 If B is B t the effect a·O M-5035 Change 1 12.4.3 Jump Instructions There are 20 jump instructions and all are Format III. Zero is the only possible value in the K field of an assembled jump instruction, so the Assembler ignores any value in the k sub-field of a corresponding source line. In the descriptions below, Y is regarded as a relative address formed by adding b )15_0 to y zero extended. If the jump is taken, this quantity is transferred to P(15-0) and the s-designator is transferred to P(19-17). If the jump is not taken, the next instruction in sequence is executed. (B JUMP s h 3 y J y,k,t,s y - P Jump unconditionally to address Y. INDEX JC~lP ~ll,ojnl21121j2' 2512-123 nl21 20 "1'11'7 <, .J", r: (J If (B a ) If Ba I ~ ) h 'I i '511_(" '21"1,01'llj71111141112111o s JBNZ a,y,k,b,s Y 0, then (B ) - 1 - B , and jump to Y. = B0 , a a If (B a ) = 0, take NI. the effect is a no-operation .. DOUBLE JUMP A NOT ZERO "110119121121121 251 2-1 23 n12' 20 "1 111'1 'I '51'-('3 '2("llol'1111111514131211{0 50 ,) 3 ) h s i Y DJNZ a,y,k,b,s If (Aa+l' Aa) ~ 0, jump to Y. where (Aa+l' Aa) is the contents of by Aa+l and Aa' I I -12-50 ~he double length register formed M-5035 OOUBLE JUMP A ZERO 51T50TullllulZl ul1 41n 21111 10 1'11'117 II 11114115 111"llol'I'1 7 1-111 415111ITo a SO 2 ) h s i y DJZ a,y,k,b,s If (A a + , Aa) = 0, jump to Y. l where (A a + , Aa) is the contents of the double length register formed 1 by Aa+l and Aa· JUMP A NEGATIVE SITsoIullllUIZI ull·ln 21111 10 "11'117 II 11)14)IS 111"1101 '1.!7 1-!11 4151 aT 110 a 51 1 P s i b y JN a,y,k,b,s If (A ) < 0, jump to Y. a JUMP A NOT ZERO 51150Iulll[U[Z1 ul1 41n 21111 10 1'1 111 17 a 51 3 p b II 11114111 11111110111'17 I-I 1141 5[ a II r0 s i y JNZ a,y,k,b,s If (A ) 1 0, jump to Y. . a JUMP A POSITIVE 5tl501ulilluiZi ula 41n 21111 ao 1111'117 51 a If (A ) a 0 ~ p b II 11114111 111"llolll.!71111141 I I I II 10 i s y JP a,y,k,b,s 0, jump to Y. JUMP A ZERO II [lolulallulll ul1 41n 21111 20 1'11'117 II 11114111 121"1 10 111'1 7 Illl)4ls h II 10 51 a If (A ) a 2 = 0, p b i s y jump to Y. 11-12-51 JZ a,y,k,b,s M-5035 JUMP .CONDITIONAL SETTING 31130121121127121 ul2 41n nlll 20 "1'11'1 3 a 53 '51'41" 121"1'01'11111_111411121' 10 s i b ) II JC a,y,k,b,s Y If the value of the a sub-field, (1, 2, or. 3) corresponds to a manua 1 switch which has been selected, then jump to Y. SPECIAL a-VALUE FUNCTION PERFORMED 1 2 Jump if switch 1 is selected Jump if switch 2 is selected Jump if switch 3 is selected 3 JUMP CONDITIONAL STOP SETTING (PI) "11012112'121121 25(241n nlll 20 "1"('1 I_ 151'41" 121"110 (. I '1 1 (- I 51 411( 21110 53 3p b i s a JSC a,y,k,b,s Y If the value of the a sub-fie·ld (4,5,6, 'or 7) corresponds to a manual switch setting, then stop the,processor, and transfer Y to P. FUNCTION PERFORMED SPECIAL a-VALUE Always stop, then jump. Stop and jump if switch 5 selected. Stop and jump if switch 6 selected. Stop and jump if switch 7 selected. 4 5 6 7 JUMP EVEN PARITY "l'01u(2'121(2' ul241n nlll 20 "11'1'1 ;'0 a 0 b b II i 1511411' ,21111,0('1111 1-1514( .( 21110 s Y JEP a,y,k,b,s If the logical product of (Aa) and (A a + ) contains an even number l of binary ones, jump to Y. 11-12 -52 M-5035 JUMP EQUAL I'IJolnla'luJu nla-l u lulll ao 1'111111 .. 111 1_1 11 lal" J101'1 11 II J114) II a II 10 ' ;, ;,:\ 0 h ~ s Y JE y,t,b,s If CD is set to equal, jump to Y. JUMP GREATER THAN 3113OJZt121jUJU ulz-lululll 20 "1 11 111 .. 1111-J13 lalllllol'l '1' I' I • 14 ' S I a 'I 10 11 53 0 b ~ s Y JG y,k,b,s If the CD is set to greater than, jump to Y. JUMP GREATER THAN· OR EQUAL 31Isolnlz·lz1IZ. nlz-Iuluizi zo 1'1 11 111 .. 1'1 14 113 lal li llol' III' Ill s1 4) s la 111 0 15 53 0 b s i Y JGE y,k,b,s If the CD is set to greater than or equal, jump to Y. JUMP LESS THAN 311s01ZtlZIlUlu ulz-lululz I 20 "111111 .. Isll-113 lall II 10 1' III' IIIsl41 s 1111 10 21 53 0 b ~ s Y JLT y,t,b,s If CD is set to less than, jump to Y. JUMP LESS THAN OR EQUAL sllsolnl2'l u lu zslZ4lul22lz I zo "11111' II Isl1411S lal"llol' 1'1' III t 141 s I a II 10 25 53 0 b i s Y JLE y,k,b,s If CD is set to less than or equal, jump to Y. . JUMP LOWER Jllsol ZtIZl1Z11al uJz-lu 12121 ao "1'11 17 .. Isl1411s lal"llol' Ill' IIIsl41 s1 zJ 110 52 a 3 l> b i s Y JL y,k,b,s Y - p. L ' Jump to the 16-bit instruction contained in the lower half of the word whose addre~s is Y. 11-12-53 M-5035 JUMP NO OVERFLOW ,11,0Inlzll21 l21 ulz41nluizi zo 11111117 II Is114!1' IZ!II!10!1!'17 1_11141 • I ZII 10 00 53 0 b ~ s Y JNF y,k,b,s If the 00 is not set, jump to Y. JUMP NOT EQUAL '1 1101 n! "121111 ulz41nlulz1 zo "111 !11 53 01 0 b II 11!14!11 IZ! II!IO!I!II" 1-1114111 ZII 10 s i Y JNE y,k,b,s If the CD is set to not equal, jump to Y. JUMP NOT WITHIN LIMITS '1IIolnIZll u l21 ulz 41nlulzl 20 '11 111 11 II 15114111 121"1 10111'171-lsI411IzI I I0 31 53 0 b ~ s Y JNW y,k,b,s If the CD is set to outside limits, jump to Y. JUMP ODD PARITY :!1~'oritri'lzr111 ulz 4!n U!ll zo 1.!11!11 a 50 1 0 b II i IS!14!IS IZ!II!10!.!.!1 !I! 5!4111 z II 10 s JOP a,y,k,b,s Y If the logical product of (Aa) and (Aa + > contains an odd number of l binary ones, jump to Y. JUMP OVERFLOW sllsolnlzllulZ. ull4lulUIZI ZO 1'1 111 11 I- 11114!11 IZ!II!101'1111 I_III 41 II ZII 10 50 04 0 b ~ s Y If the 00 is set, clear 00, jump to Y. 11-12-54 JOF y,k,b,s M-5035 Change 5 JUMP SY + B 31110lulzIII11u ululu uIzl 10 "111117 I' 11114111 111"1 10 1'111 711 I 114111 Z II 10 52 2 n ) h i s Y JS s,y,k,b Jump to Y, where Y in this case is defined as the address formed by the 16-bit sy-field and indexed by (B b )15-O. The base register designator, (B b )17-l9' is transferred to P17 - 19 . An example of usage of this instruction is as an exit from a subroutine entered through the LOAD B AND JUMP instruction. JUMP WITHIN LIMITS 3111011111111 iJu ull-[uluI21 201'1 111 17 II 1.1 '4)1' 111"1101'1111 1'1.141.1 Z II 10 53 35 0 b s ~ Y JW y,k,b,s If the CD is within limits, jump to Y. LOAD B AND JUMP SII,oll'IIII21111 ull·lu ull' 10 1'1 11 111 52 o0 a b I' '11141" i s tll"IIOltII111'1114Islzll [0 LBJ a,y,k,b,s Y The a sub-field specifies an index register. Load B with the a contents of P (address of NI).P19-l7 ... Ba 19-17' P15 - 0 .. Ba 15-0· Jump to Y. If B = B , no address is saved and an unconditional jump to Y occurs. a 0 RETURN JUMP 11)10111111121111 1SI141ul nil I 10 "1'11" 'I "1141" 111''1'01'1111 1'111 4Islal' 10 53 02 0 b P, (address of NI) ~ s Y -I. Jump to Y+l. 11-12-55 RJ y, I< , b, s I M-5035 RETURN JUMP CONDITIONAL SETTING IIIIolz t lzel:t1lz, 2512 4 125 2212.1 20 Itll'117 a 53 .2 0 b. It i 15114111 121111101 t 1117 1.111411 12 II 10 s RJC a, y , k , b ,s ' y If the value of the a sub-field (1,2, or 3) corresponds to a manual switch which has been selected, then execute the Return Jump, (see RETURN JUMP instruction). FUNCTION PERFORMED SPECIAL a-VALUE Return jump if switch 1 is selected. Return jump if switch 2 is selected. Return jump if switch 3 is selected. I 2 3 RETURN JUMP CONDITIONAL STOP SETTING (PI) 1111012912'127121 1512 4125 22121 20 11111117 a 53· 2 0 b II i 15114111 121"1 101.1.1711111411121110 s Y RJSC a,y,k,b,s If the value of the a sub-field (4,5,6,7) corresponds to a manual switch which has been selected, then stop before executing the Return Jump (see RETURN JUMP instruction). FUNCTION PERFORMED SPECIAL a-VALUE 4 5 6 7 Always stop before execution of Ret urn Jump. Stop if switch 5 is selected, Ret urn Jump. Stop if switch 6 is selected, Ret urn Jump. Stop if switch 7 is selected, Return Ju~p. 11-12-56 M-5035 Change 1 1:2.;1.4 instructions involvinq Comparison Operations All the instructions in this,group set the compare designator according to conditions indicated. They are usually followed by one of the jump instructions which act upon the condition of the compare designator. ,II'olulZII Z7 lz1 nlz-In zzlz'IIO 11111111 " 1511-111 121" 1101'1111 I. 11141 112 (I 44 a (A): a k b i s y !; set CD Compare (A ) with I, and set the CD to: a Equal, if (Aa) = Une~ual, if (Aa) X ¥X Greater than or equal, if (Aa ) Less than, if (A ) < X a ~ X COMPARE, REGISTER '51'-11'('21 11 110 '1111 .'SI4 'I Z II 0 74 4 b i a HC a,b Compare (Aa) with (A ), and set the CD to: b Eq ua l, if (Aa) = (-\) Unequal, if (Aa) ¥ (A ) b Greater than or equal, if (Aa) Le sst han, i f (A a) < (A ) b ~ (A ) b 11-12-57 (0 C a,y,k,b,s M-5035 Change 1 COMPARE Bb WITH Ba 74 a 7 b HCB a,b i Compare (B ) with (B ), and set the CD to: a b Equal, if (Ba) = (B b ) Unequal, if (Ba) ~ (B b ) Greater than or equal if (B ) ~ (Ba) b Less than, if (B b ) < (Ba) COMPARE BIT TO ZERO )11501nI2l121121 nl2-ln u121lzo 1'11'117 II Isl14111 121 11 110 1' 1'17 111114111 aT 110 a 42 (Y) ak : 0: k s i b BC ak,y,b,s y set CD Not character addressable. The ak-designator specifies the bit of (Y) to be compared to zero where O$ak~31. Test the bit specified by the ak-designator; then set the CD to: Equal, if (f)ak= 0 Not equal, if (Y) ak 10 COMPARE GATED IIlloln12l12 112. 15124121 2112 1120 1'1 1'1 17 II IsI14111 121 I I1101' 1'1 7 1III14111a I I10 47 a k b (A i s CG a.y,k,b,s y a+1); set CD Compare the absolute value of Y - (Aa) with (Aa+1)v and set the CD to: Equal, if I! Unequal, if ,! - (Aa)1 = (Aa +1 ) (Aa)1 # (A a +l ) Greater than or equal, if I! - (Aa)1 Less than, if 11: - (Aa) I <: (A a +1 ) 11-12-58 ~ (A a + ) 1 M-5035 Change 1 COMPAHE INUEX, INCHEMENT 1'llolnIZllz712. nla-In Ull'12O '11'11" ,. '11'-111 '21"1101'111711111411121 I 10 43 a k i b s Y CXI a,y,k,b,s If (B ) ~ X, 0 - B and set CD outside limits: a a If (B ) < XV (B ) + 1 - B and set CD within limits. a a a a - equals B register designator. Set the CD for outside limits and clears B if (B ) ~ Y. a aincrement (B ) by one and set the CD for within limits. a COMPARE LIMITS a 45 ( A) a' (A k a+1 ) .s i b y y. set CD -' Compare (Aa) and (A + ) with a l X. Within limits, if (A +1) > Y ~ a - Set the CD to: (A ) Outside limits, if Y < (Aa) or ! a ~ (A a + 1 ) COMPARE LIMITS,· REGISTER , 0 i HCL a,b Compare (Aa) and (A + ) to (A ) and set the CD to: a l b Within limits, if (A + ) > (A ) ~ (Aa) a 1 b Outside limits, if (A + ) ~ (A ) or (A ) < (Aa) a l b b 11-12-59 Otherwise, CL a,y,k,b,s M-5035 Change 1 COMPARE MASKED 1lllolzlllIlnl21 ulz-(n zzl211zo 11111117 II 1511-111 Izl li llollll17 Illsl"l I I zI I} 0 46 a (A a+l k b s i Y CM a,y,k,b,s ): (A )0 y. set CD a -' Compare the logical product of (Aa) and Y with (A + ) and set the CD to: a l Equal, if (A +l ) = (Aa) 0 ! a Unequal, if (A a + ) f:- (Aa) 0 ! l Greater than or equal, if (A a +l ) ~ (A a ) 0 y Less than, if (A a +1 ) < (Aa) 0 ! COMPARE MASKED, REGISTER 1511-1 111 121"1 10 11'17 Ilsl- 11211 74 a (A + a l 6 )0 (Aa) : 0 HCM a ,b i b (A ); set CD b Compare the logical product of (A ) and (A + ) with (A ) and set the a l b CD to: a Equal, if (A a +1 ) 0 (Aa) Unequal t if (A a +l ) 0 (Aa) =\ f Ab Greater than or equal, if (A a +1 ) 0 Less than, if (A + ) 0 (Aa) < Ab a 1 II-12-W (Aa) ~ \ M-5035 Change 1 DOUBLE COMPARE Sllsolz'lululz, nll·ln ulzillo 1.11.111 I' 1II1411s 111111101.1.-111.111 41 SI z II 10 05 () 3 b i s DC a,y,b,s y Not character addressable. Not repeatable. Compare the content of the double length register (formed with the least significant half in Aa and the most significant half in Aa+ l ) with the content of the double length memory word (formed with (Y) as the least significant half and (Y + 1) as the most significant half), and set the CD to: Unequal, if (A a+l 9 A ) ta (y Greater than or equal, if (A + I, Y) a+l ,A) a Less than, if (A a + , Aa) < (Y + 1, Y) l 11-12-61 ~ (Y + 1, Y) M-5035 Change 1 12.4.5 Instructions Involving Logical Operations The following instructions perform a variety of logical operations involving' register and memory: ADD LOGICAL PRODUCT S'il5olnlz'I21lz' nlz41n ull'lzo '11"1''1 'I '51'41 ,s ,zl"I,olll'I'I III 5141 5121' 10 01 4 () b i s y ALP a,y,b,s Add to (A a +l ) the logical product of (Aa) and Y and store the result Aa+l" AND 1'1'41 151'21"1 10 11'1'1 11514 5121' 71 a 5 b 0 HAND a,b i L- Form the logical product of (Aa) and (A ) and store the result in Aa. b (Ab)i=(Ab)f. Logical product or logical AND is defined by the following: o I o 1 o o o 1 EXCLUSIVE OR (SELECTIVE COMPLEMENT A) 01 () 3 b i s y XOR aty,b,s ... A a Complement the individual bits in A corresponding to the ones in It a leaving the remaining bits in A unaltered. a 11-12-62 The result is stored in A . a M-5035 Change 1 EXCLUSIVE OR A '51'-1"1'21"1'0 '1'1 ' 115J4 'j21' 'i 1 n 3 0 i h HXOR a,b -- Aa Form the logical difference between (Aa) and (A ). The result is stored b in A. Logical difference, exclusive OR q or selective complement is a defined by the following: o 1 001 1 1 0 INCLUSIVE OR (SELECTIVE SET A) .11,0Iulall27lal asla 41n 22111 lao 1'1 11111 01 0 a y - E9 (A) a b 'I i '11'4111 121"1101'111'111'14J I JaI' L0 s y OR a,y,b,s .. A a Set the individual bits of A corresponding to ones in Xv leaving the a remaining bits in A unaltered. The result is stored in A . a a 11-12-63 M-5035 Change 1 INCLUSIVE OR A 1511-IIS1121 11 110 • 1'11 _1514 S12 II 0 71 a 0 HOR a, b i b Form the logical sum of (Aa) and (A b ). The result is stored in Aa' (Ab)i = (Ab)rif a f. band a+l =j:. b. Logical sum, inclusive OR, or selective set is defined by the following:! o I o 0 I 1 I 1 LOAD LOGICAL PRODUCT IN SI Aa Tsolz'II'111f21 251 141n 2211'1 10 1'1 1'1 11 " 1511411s 121"110\'1' r1 I- I 5141 S 12 II Io 01 5 () Y - 0 (A) a b s i LLP a,y,b,s Y A a Form the logical product of (A ) and Y. a The result is stored in A . a LOAD LOGICAL PRODUCT IN Aa+l IllI01zlIz·1 1111• ulZ4lzs 1211 1110 Itll'111 I_ 11114111 121"11°1_1'111_)514111 I II 10 01 7 () b s i y LLPN a,y,b,s Y (;) (A ) - AI; (A ) i = (A ) f a a+ a a Form the logical product of (Aa) and Y. (Aa) is unchanged. 11-12-64 The result is stored in Aa + • 1 M-5035 Change 1 REPLACE A - LOGICAL PRODUCT SI1s0129LZllZ 71u zslz&In 2211 11zo 1'1111 11 II 1511&11S 121111101'(111 111 51 4J SI Z II (0 ()~\ j' (, h i s Y HNLP a,y,h,s Subtract from (A a +l ) the logical product of yand (A ), then store the a result in Y and A + . a 1 REPLACE A + LOG I CAL PRODUCT '11,olnlzlluIZI ulz~Iu 22111 1zo 1'1 11 117 " 15 11&1 I' ,zll'l lol'11171 1 Isj4jslzl l lo 03 '-I () h s i Y RALP a,y,b,s Add to (A a + l ), the logical product of I and (A ); then store the result a in Y and Aa+l" REPLACE EXCLUSIVE OR (REPLACE SELECTIVE COMPLEMENT) sll,olnIZllula. as12~n 221 1'1 ao I'IIIL 11 " Isll&jIS 121"11°1'1'11111s141'lz(11° 3 03 a b i s y Y e RXOR a,y,b,s Y and A a (A ) a Not character addressable. Complement the individual bi ts in Aa corresponding to ones in I, leaving the remaining bits' in A unaltered. a The result is stored in A and Y. a REPLACE INCLUSIVE OR (REPLACE SELECTIVE SET) s11101a'1alIa 1111 ula~u 2211 'lao 1'1 111" 1'15J 14 111 I2JI IJ 101'1 11 1 1'151 4I SI z I I 10 03 0 a Y $(A ) - a ~ Y b i and A s Y ROR a, y, b, s a Set the individual bits in Aa corresponding to ones in I, leaving the remaining bits in A unaltered. The result is stored in A and Y. a a 11-12-65 M-5035 Change 1 REPLACE LOGICAL PRODUCT 11)101nl21J2712' 25J2 4 )23 ulzI120 1'1 1'1 11 I_ 15114111 121" 110 I • I • l' I • I 5I 41 1I 2II I 0 03 5 tl b s i Y HLP a, y, b ,S Load Aa+l with the logical product of Y and (A ); then storp the rpsult a at Y. REPLACE SELECTIVE SUBSTITUTE A 1'1 1012112'127121 2512 4 123 ulzI120 1'1"1 17 I_ 15114111 121"1101'1'1'1_/5/413/2/110 03 2 () b For each bit, s i Y HMS a,y,b,s which is equal to one in A v substitute the nth bit of a Y for the nth bit of the Aa +l . The result in Aa+l is stored at Y. hv REPLACE SELECTIVE CLEAR 11110121121127(21 25124123 ulzIJzo 1'1 1'1 11 .. 151 14 113 12(11110 I' (. l' I-I 5 I 41 3I 2 II 10 03 1 () h .. _ .. 0 -y t (A ) a ~ _- s i -- ._-_. Y Y and A a Clear the individual bits in A corresponding to ones in X, leaving the a remaining bits in A unaltered. The result is stored in A and 4. a a SELECTIVE CLEAR A 01 1 a (A ) a 0 yt - ... b s i y SC a, y ,b, s A a Form the logical product of (A . a ) and the complement of -Y, The result is stored in A. Selective clear is defined by the following: a o 1 o 1 o o 1 o I I -12-6() M-5035 Change 1 SEl.ECTfVE SllASTTTlITE 01 il ,) s h "" MS a,y,b,s For each bit, n, which is equal to one in A , substitute the nth bit of Y a for the nth bit of Aa+ . l STORE LOGICAL PRODUCT ,. f,oIZ9I21I27I11 25IZ4I21 ul2 11zo 1'1 11 1" 11 151'.1" •z1"11 oJ • I I 11 I , I 51 4 I sfa1.1 0 02 il 4 b i s Y Store at Y the logical product of (Aa) and (Aa+ll. SLP a,y,b,;) The contents of the A-registers are unchanged. SUBTRACT LOGICAL PRODUCT 01 6 b i s y Subtract from (A + ) the logical product of (Aa) and a 1 stored in Aa + . 1 11-12-67 NLP a,y,b,s X. The result is M-5035 Change 1 12.4.6 Shift Instructions DOUBLE SHIFT LEFT CIRCULARLY 1511·1151121"jI0 - l' 17 I 5 51 z 1I 4 0 63 a HDLe a,m 63 a 10 (J b 0 63 a 1 1 0 b () m HDLe a, b,l m 1 2 HDLC a,b,2 normal shift count shift count in Bb shift count in Ab Shift the content of the double length register (formed with (A ) as the a least significant half and (A + ) as the most significant half) to the a l left circularly, where the shift count is specified by the m-field. DOUBLE SHIFT RIGHT FILL SIGN 15114115112111110 _1'1 7 • 5 4 :s 1211 67 a. 67 a 67 a 0 HDRS aim m m 10 U b 0 HDRS a,b,l b 0 HDRS a,b,2 1 2 1 1 0 normal shift count shift count in ~ shift count in Ab Shift the content of the double length register (formed with (A ) as the a least significant half and (A + ) as the most significant half) to the a 1 rigbt m places, end-off with sign filion the l~ft. The maximum allowable shift count is 26 -1 = 63. DOUBLE SHIFT RIGHT FILL ZEROS 151141111121"110 '1'17 65 a 65 a I 514 51211 0 HDRZ a,m m m 10 U b 0 HDRZ a ,b, 1 1 2 65 a 1 1 0 b 0 normal shift count shift count in Bb shift count in Ab HDRZ a,b,2 Shift the content of the double length register (formed with (A ) as the a least significant half and (A + ) as the most significant half) to the a l right, end-off anc fill with zeros on the leftv where the shift count is specified by the m-field. The maximum allowable shift is 26 -1 = 63. 11-12-68 M-5035 SHIFT LEFT CIRCULARLY 11114111112111110 11'1 ' 62 a 62 a 62 a • 1 .. 'I Z II 0 m HLC a,m m 10 U 1 10 b 0 HLC a ,b, 1 b () HLC a,b,2 1 2 normal shift count shift count in Bb shift count in Ab Shift (A ) left circularly where the shift count is specified by the a m-field. SHIFT RIGHT FILL SIGN 15114111112111110 11'1' 66 a 66 a 66 a • 5 4 'j211 0 HRS a,m m 10 U m b 0 HRS a,b,l b () HRS a,b,2 1 2 1 I 0 normal shift count shift count in Bb shift count in Ab Shift (A ) to the right, end-off with sign filIon the left, where the a shift count is specified by the m-field. 6 2 -1 = 63. Example of right shift, sign fill ~, m = 9. r~ :1:000111111000001111100 III 000 1111 :: t:~_______~.. '-----~ LlJ))))J)J.~OOOIIIlllOOOOOIIIIIOOl 11-12-69 The maximum allowable shift is M-5035 ., SHIFT RIGHT FILL ZEROS 1,(1-11'112111110 -1'1' a 64 'I zll 4 0 HHZ a,m m 64 a 10 0 b 0 HRZ a,b,l 64 a 1 10 b 0 HRZ a,b,2 m I 2 normal shift count shift count in Bb shift count in Ab Shift (Aa) to the right, end-off and fill with zeros on the left, where the shift count is specified by the m-field .. The maximum allowable shift is 26_1 = 63. Example of right shift A2 , m = 9. (A2 l i froOOllllllOOOOOlllllOOlllOOOllll I :~ '- iQ~QQOPPP~1pOOllllllOOOOO-l-ll-l-l-O~ 11-12-70 M-5035 12.4.7 Instructions Referencing Control Memory There are eight instructiQns referencing control memory~ four are Format I full-word instructions, and the other four are half-word instructions, Format lV-A. The instructions which refer to the interrupt set of registers are all privileged instructions (PI) while the other instructions are privileged for certain control memory address reference. LOAD INTERRUPT CMR (PI) ulz~Julzzlzllzo "1'0129l2l 1271Z' ak 55 Itll'117 I' b i utll~ll'llz s "110 It 1,, 7 I- I a 141 , I z II y r 0 LCI ak,y,b,s Y - CMR The a-designator and k-designator form a six-bit (central processor) control memory address (100-177)8 of the interrupt mode registers as follows. 6FFECTIVE ADDRESS I HARDWARE ASSIGNED ak-VALUE 1 1 • 1 1 1 t 1 1 CONTROL MEMORY REGISTER , 00 01 CMR address 100 CMR address 101 26 27 30 CMR address 126 (56 ) CMR address 127 (57 ) CMR address 130 (unassigned) (AO) (AI) + ; • 75 16 77 CMR address 175 (SIRS) CMR address 176 (SIR ) 1 CMR address 117 (SIR6 ) 7 Load the CMR address (specified by the special ak-value) with !. NOTE In the repeat mode, ak + 1 ~ ak. This instruction is not interruptable in the repeat mode. 11-12-71 M-5035 LOAD INTERRUPT CMR WITH A (PI) 61 i HLCI afLlb ~------~.------~~--~ specifies an accumulator register; i (bit 0 or 16) = 1 b The a-designator and k-designator form a six-bit address in (central processor) control memory in conjunction with the i-designator to access control memory locations as follows: i =1 af t1 VALUE CONTROL MEMORY REGISTER CMR address 100 (AO) CMR address 101 (AI) 00 01 • • • 26 27 30 CMR address 126 (S6 ) CMR address 127 (S7 ) CMR address 130 (~nassigned) 75 76 77 CMR address 175 (SIRS) CMR address 176 (SIR6 ) CMR address 177 (SIR 7 ) • Load the CMR address specified by the af4 -designator wi th (Ab)" 11-12-72 M-5035 Change 1 LOAD TASK eMU sllsolnlllll'lu u)ululul111lo 1-1 1'1 17 IIIIII·IIS 121"1101-1'17 I_ I !t 141 sI 211 To :.ill nk b i s LeT ak,y,b,s y Y - CMR The a-designator and k-designator form a six-bit (central processor) control memory address (0-77 ) of the task mode registers as follows: 8 The a-designator and k-designator form a six-bit (central processor) control memory address (0-778 ) of the task mode registers ns follows: CONTROL MEMORY REGISTER ak-VALUE 00 01 CMR address o (AO) CMR address I (AI) 26 27 30 CMR address 26 (S )* CMR address 27 (S6)* CMR address 30 (uAassigned) 57 6X 7X CMR address 57 (unassigned) Breakpoint* Active status • t t t Load the CMR address (specified by the special ak-value) with 1_ NOTE In the repeat mode, ak + 1 ~ ak. This instruction is not interruptable in the repeat mode. This instruction is privileged when repeated. • Addresses 60-778 and 20-278 are addressable in the interrupt mode only. 11-12-73 M-5035 Change 1 LOAD TASK CMR WITH A I 61 0 i HLCT af ,b b --------~--------~--~ 4 specifies an accumulator register i (bit 0 or 16) = 0 b The a-designator and f - designator form a six-bit (central processor) 4 control memory in conjunction with the i-designator to access control memory locations as shown below. i =0 SPECIAL Af4 VALUE 00 01 t 26 27 30 t 56 57 6X 7X CONTROL MEMORY REGISTER CMR address o (AO) CMR address 1 (AI) ~MR addresses 20-27 access~ (5) ible in interCMR address 26 (56) rupt mode only CMR address 27 CMR address 30 (u~assigned) + CMR address 56 (unassigned) CMR address 57 (unassigned) Breakpoint (accessible in interrupt mode only) Active status (accessible in interrupt mode only) Load the CMR address specified by the af4-designator with (Ab). 11-12-74 M-5035 Change 1 STURE INTEHRUPT CMR (PI) ak h i s y . _ _ _ _ _" - -_ _ _ _--L_----JL......L_ _L--_ _ _ _ _ _ _ _--.J SCI llk,y,b,s (CMR) - Y The a-designator and k-designator form a six-bit (central processor) control memory address (100 through 177)8 of the interrupt mode registers as follOWS: EFFECTIVE, ADDRESS HARDWARE ak-VALUE ASSIGNED 1 ! 1 1 1 • 1 I CONTROL MEMORY REGISTER 00 If CMR address 100 (AD) CMR address 100 (AI) 26 27 30 CMR address 126 (5 ) CMR address 127 (56) CMR address 130 (uAassigned) ! • + CMR address 175 (SIRS) CMR address 176 (SIR6 ) CMR address 177 (SIR7 ) 7S 76 1 77 Store t he content of the CMR address (specified by the ak-value) at Y. NOTE In the repeat mode. a k + I - ak. This instruction is not interruptable in the repeat mode. 11-12-75 M-5035 Change 1 STORE INTERRUPT CMR IN A (PI) 1511.113112111110 t 60 I • I 7J • I 5 I 4 sf 4 3121 b 1 0 i (CMR) - Ab b specifies an accumulator register; j i (bi t 0 or 16) ::: 1 The a-designator and the f4-designator form a six-bit < (cen~ral pr0cessor) control memory address in conjunction with the i-designator to access control memory locations as fOllows: i ::: 1 5£4 VALUE 00 01 + CONTROL MEMORY REGISTER CMR address 100 (AO) CMR address 101 (AI) ~ 26 27 30 CMR address 126 (S6 ) CMR address 127 (S7) , CMR address 130 (unassigned) 75 76 77 CMR address 175 (SIRS) CMR address 176 (SI R6 ) CMR address Iii (SIR"'9) I ~ Load Ab wi t h (CMR f ). a 4 ~ M-5035 Change 1 STonE TASK CMR 56 nk s i b seT ak,y,b,s y (CMR) .... Y ~orm The a-designator and k-designator a six-bit (central processor) control memory address (0 through 77)0 of the task mode registers as follows~ ak-VALUE CONTROL MEMORY REGISTER CMR address o (AO) CMR address I (AI) 00 01 ~CMR addresses 20-27 addressable in i nt errupt mode only CMR address 26 (S) CMR address 27 (S~) CMR address 30 (unassigned) • + 26 27 30 t • 57 6X CMR address 57 (unassigned) Breakpoint (accessible in interrupt mode only) Activate status (accessible in interrupt mode only) 7X Store the content of the CMR address (specified by the ak-valuel . :, NOTE • • C'.~. \, . ." --~ ...... .... --..... .....: . • • ,-, o " • . ~ ., .. ~ ' " ...... ' , : ,. • ',R." .. ,'.: .. flip p.. ' • • . .. .. :'.:' - .. ' ~ ... I i"::'12-77 .... " . '. .. . .. .. :! ;.:..... ... . . ' -. • .. " .... .. , . ~t , Y. M-5035 Change 1 STORE TASK CMR IN A 15\1.11'112111110 -\11'1 6 15 14 'izil 0 .. f -4 60 c. i b (CMR) - Ab b specifies an accumulator register; i (bit U or 16) =0 The a-designator and f -designator form a six-bit (central processor) 4 control memory address in conjunction with the i-designator to access control memory location as follows: i = 0 af 4 VALUE CONTROL MEMORY REGISTER CMR address o (A ) CMR address 1 (AD) {CMR addres ses 20-27 1 addressable in interrupt mode only CMR addriss 26 (56) CMR address 27 (57) CMR address 30 (unassigned) 00 01 + 26 27 30 .~ ~ CMR address 56 (unassigned) CMR address 57 (unassigned) Brea~Qoint (accessible in interrupt mode only·f . - Active status (accessible in interrupt mQde •only1 _.~. ~ 56 57 6X 7X .. Load Ab with (CMR f ). a 4 ..... • . . • .. .... .1'*. ..•• .. .. 11-12-78 M-5035 12.4.8 Interrupt Handling Instructions These are all privileged instructions, and none are chara~ter addressable or repeatable. ALLOW CLASS III JNTERRUPTS Isll-IIS 1121"1 10 77 (PI) 1111' II \ I- s 1111 0 5 0 0 HAl 0 Release the lockout for input/output Class III interrupts .. This shall not affect the individual channel interrupts enable/disable logic as set by AEI and PEl instructions. 11-12-79 M-5035 ALLOW ENABLE INTERRUPT (PI) 07 a I b AEI sy a,sy~b The a-designator specifies which IOC will receive the enable interrupt information: SPECIAL a-VALUE 0 I 2 3 4-7 IOC TO RECEIVE ENABLE INTERRUPT INFORMATION IOC IOC IOC IOC Not #() receives enable interrupt ttl receives enable interrupt #:2 receives enable interrupt tt3 receives enable interrupt used The s-designator in conjunction with the y-operand forms a 16-bit syfield. The 16-bit sy-field enables interrupts on a channel basis in the specified IOC as follows: SPECIAL sy-VALUE sy sy sy sy sy sy sy sy sy sy sy sy sy sy sy sy (bit (bit (bi t (bi t (bit (bi t (bi t (bi t (bi t (bi t (bit (bit (bi t (bit (bi t (bit FUNCTION PERFORMED AT SPECIFI ED IOC =I =I 2) = I 3) = I 4) = I 5) = I 6) = I 7) = 1 8) = 1 9) = I 10) = 1 11) = 1 12) = 1 13) = 1 14) = 1 15) = 1 0) Enable Enable Enable Enable Enable Enable Enable Enable Enaole Enable Enable Enable Enable Enable Enable Enable 1) channel channel channel channel channel channel channel channel channel channel channel channel channel channel channel channel 0 I 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Enable the interrupt request for each IOC channel specified in the 16-bit sy-field. 11-12-80 M-5035 INTERPROCESSOR INTERRUPT (PI) I PI sy. b A class II interrupt is generated for each processor selected by the syfield after Bb modification. The processor number is bit-encoded in the lower 18 bits of sy + (B b )15 as follows: 16-bit result of sy + (B b )15-O 15 14 8 7 6 5 4 3 1 oI Interrupt Processor No. 0 Interrupt Processor No. I Int errupt Processor No. 2 Not used Self interrupt control bit 2 Interrupt Processor No. 3 Interrupt Processor No. 4 Interrupt Processor No. 5 Interruot Processor No. 6 Interrupt Processor No. 1 I I I I I I I 1 This instruction interrupts all processors whose corresponding bit is set as indicated above. If bit 15 is set, and if the processor executing this instruction is selected to be interrupted, then the processor executing the instruction will ignore the interrupt. If bit 15 is clear and the processor executing the instruction is selected to be interrupted, then the interrupt request will occur. 11-12-81 M-5035 INTERRUPT RETURN (PI) 31 1301 2'1 zel21l21 251 24123 2212 1120 1.(,.,'7 ,. '51'4}'31'2 "1'01-1.171115141 312" 10 07 0 5 0 ~ 0 IR 0 Return control to the processor state designated by the DSW corresponding to the state control field in the active status register. PREVENT CLASS III INTERRUPTS (PI) "1'4( '31'21"1'0 _1'1 7 11'14 31zl' 0 77 0 4 0 0 HPI Lock out the input/output class III interrupts. The interrupts are held pending until this lockout is removed. PREVENT ENABLE INTERRUPT 07 a b 2 (PI) sy PEl a,sy,b --------~----~------~------------------------~ The a-eesignator specifies which IOC will receive the disable interrupt information: loe TO RECEIVE DISABLE INTERRUPT INFORMATION SPECIAL a-VALUES receives receives receives receives Not used loe loe loe loe 0 1 2 3 4-7 11-12-02 #0 #1 #2 #3 disable disable disable disable interrupt interrupt interrupt interrupt M-S035 Change 1 The s -des igna tor in conjunction with the y-field forms a 16-bit sy-field. Th(~ I ()-bi t sy-field disables interrupts on a channel hnsis in the spf'ci- fied IOe as fo llows : sy-VALUE sy-VALUE FUNCTION PERFORMED AT SPECIFIED ION sy (bit 0) = 1 sy (bi t 1 ) = 1 Disable channel 0 Disable channell ~ ~ sy (bit 14) = I 2y (bi t 15) = 1 Disable channel 14 Disable channel 15 Disable the interrupt request for each IOC channel specified in the 16-bit sy-field. WAIT FOR INTERRUPT (PI) l'li-IIS 112)11110 ')'1 ' '1'1- ~ 77 0 6 1211 () 0 1 HWFI This instruction causes the computer to stop referencing memory until an interrupt occurs (any class not currently locked out). After an interrupt request is detected, the processor honors the interrupt, saving the address of the instruction following the wait for interrupt. from the interrupt, normal processing continues. 11-12-83 Upon return M-5035 Change 5 12.4.9 Miscellaneous Instructions CLEAR BIT 31130129111127121 2512-123122121120 111 1'1 11 32 iik b II Isil-IIS 12["1 10 111'1 1 111&1-11121 110 s i BZ y ak,y,b,s (Y) ak () - Not character addressable. The ak-designator specifies the bit of (Y) to be cleared, where o sak s31. o 02 Numbe r 0 s b y crIT a Y b , f, I I f "1' s" in Y - A a Count the bits in ! which are set to one and store the count in AH . OOUBLE SCALE FACTOR A 1511-11'112111110 -1'1 115(_ '1211 0 ' h i a 70 1 Normalize (A a+ HDSF a,b l' A ); normalized shift count .... Ah • a Shift the content of the double length register (formed with (A ) as the least a signficant half and (A 1) as the most significant half) to the left circularly a+ until normalized. The required shift count is stored in~. If a or a+1 the registers shall be normalized with no shift count available. If (A I i = 0 or all 1 's, the resultant shift count is 63. 11-12-84 a+ = b, l' A ) a M-5035 Change 1 EXECUTE HEMOTE o U" I. •> h s Execute instruction at!; y (P) is unchanged. Not character addressable. Not repeatable. Execute the whole-word instruction or two half-word instructions which is at !, without changing (P). EXECUTE REMOTE LOWER o 02 h - -..... Execute ins I ruct ion s ~---""" at. ~ .. ; Not character addressahlc. Not rep~atahle. y ... ----_._------' (P) XHL y,b,s is unchanged. t-:xpcute the low(;r hair-word jnstruction at I, without chan!}ing (1'). ENTEH EXECUTIvE STATE o U7 o b sy XS sy,b Interrupt to executive entrancp address. Not character addressable, Not repeatable. The s-desi\Jnator and t.he y-designat or are combined to form a H>-bi t sy-field which, after B modification, is used as follows: YO-I~ form the intprrupt code word. Switch control to the interrupt state and transfer control to the executive entrance address as determined by the initial condition word pointer associated with the Class IV interrupt state. 11-12 -85 M-5035 Change 1 INITIATE INPUT/OUTPUT (PI) 111501u12l12 7121 ul241n 2212 1120 1'1 1'1 17 " 1511 4115 121")101'1'1 7111' 141 s 1z 1110 07 4 II b i s I () r., y , b , s y --- Not character addressable. Not repeatable. The a-designator specifies which JOC will' as recei~e the processor command follows~ SPECIAL a-VALUE IOC to RECEIVE COMMAND ADDRESS 0 10C tt{) receives address IOC #1 receives addr!~s s IOC ~ receives address IOC #3 receives adress Not used 1 2 3 4-7 Provide the IOC specified by the a-field with the absolute address Y (address of the first command in an input/output program sequence). i • 11-12-86 M-5035 Change I UC MON I TO H CLOCK 07 a ( 1'1 ) h 3 sy LIM a, sy ,b Y ..... mo nit 0 r c 10 c k Not character addressable. Not repeatable. The a-designator specifies which IOC monitor clock will be entered with Y: IOC MONITOR CLOCK TO BE ENTERED WITH Y a-VALUE o IOC IOC IOC IOC 1 2 3 #0 #1 #2 #3 Not used 4-7 The s-designator and the y-field form a 16-bit sy-field which, after B modification, is used to load the lOG monitor clock specified by the a-value. If the 16-bit sy-field (after B modification) is negative, the monitor clock in the specified IOC is disabled; if the 16-bit sy-field (after B modification) is equal to zero, the IOC monitor clock (that was entered with zero) generates a Class III interrupt in an attempt to interrupt any central processor conrtected to the IOC; otherwise, the IOC monitor clock is counted down in the normal manner at the rate of 1,024 counts per second. 11-12-87 M-5035 Change 1 REPEAT .. ~"tlz·121Iz. Hl z41Z3 221 21 120 07 I II J 7 J 6 r~ I -I 3 rzI 11111117 I'I~ 114113112111110 I 6 a b j I RP a,sy,b :;y --- Repeat NI (B-) r0 t.imes or until test condition is satisified. I Not character addrt'ssable. Not repeat.able. The a-dpsianator controls thp repeated instruction termination conditions as ·'-fo 110ws: NON-COMPARE INSTRUCTIONS a-VALUE Terminate if A :f 0 Terminate if A = 0 Terminate if A ~ 0 Terminate if A < 0 Do not terminate Terminate if A contains an even nUIT!ber of binary ones. Terminate if A contains an odd number of binary ones. Do not terminate 0 1 2 3 4 5 6 7 COMPARE INSTRUCTIONS a-VALUE The b-dpsi t0 ~ to < to ~ 2 3 ·1 5 6 Terminate if CD set toOL 7 Terminate if CD set to WI.. USt' if if if if if if set set set set set set Terminate Terminate Terminate Terminate Terminate Terminate 0 1 of S() on ff'pluce inst.ruct ions liS follows: I f b f. (), ? @ XS-3 Equiva1ent-1004M or (1004 REX) (37) A-I Standard Card Punch 0-5-9 12-5-8-9 blank 12-7 -8 7-8 M-5035 ASCII Character ASCII Code XS-3 Equivnlent Standard Card Punrh 24 25 2h 27 30 12-4 12-5 31 32 33 34 44 12-h 12-7 12-8 ]2-9 11-1 45 46 47 50 51 11-2 11-3 11-4 11-5 11-6 120 121 122 ]23 ] 24 52 53 54 65 66 11-7 11-8 11-9 0-2 0-3 U V W 125 ]26 67 70 0-4 0-5 ] ... ')1 X 130 131 71 72 73 0-7 132 133 1:14 13:i 136 74 17 15 01 00 0-9 12-2-8 0-2-8 11-2-8 11-7 -8 l:n 00 0-5~8 A H>1 B C f) 102 10:) 1(),I E 10;1 F 10() G H I .1 ]07 K L M N 0 P Q R S T Y Z c: I J • • ]]() 11] 11:2 ] l:~ 114 11;; 1] 6 117 12-1 12-'-2 12~3 0-6 O-A A-2 M-5035 Change 5 SPECIAL CHARACTER CODES FOR THE OPTIONS DECLARATION Standard Card Punch U (ULTRA) 029 026 046 053 053 12 042 042 047 7-8 075 075 076 6-8 047 047 072 5-8 0100 047 047 4-8 043 075 075 3-8 072 072 053 2-8 077 077 051 0-7-8 076 076 0134 0-6-8 0137 0137 050 0-5-8 045 050 050 0-4-8 054 054 054 0-3-8 0134 0134 012 0-2-8 0136 0136 015 11-7-8 073 073 073 11~-8 051 051 0135 11-5-8 052 052 052 11-4-8 044 044 044 11-3-8 0135 0135 042 11-2-8 041 041 075 12-7-8 053 053 074 12-6-8 050 050 0133 12-5-8 074 051 051 12-4-8 056 056 056 12-3-8 0133 0133 0100 12-2-8 A-:YA-4 (Blank) M.;.5035 APPENDIX B SlJMMAHY OF SYSTEM STATEMENTS '.1 NOTATION OF STATEMENTS AND OPERATIONS Wherever a statement or operation is discussed in this appendix, a uniform system of notation is used to define the structure. This notation is not a part of CMS-2, but is a standardized notation that may be used to describe the syntax (construction) of any programming language. It provides a brief but precise means of explaining the general patterns that the language permits. It does not describe the meaning of the statements or operations; it merely describes structure; that is, it indicates the order in which the operands must appear, the punctuation required, and the options allowed. The following rules explain this standard notation: 1. 2. ·3. 4. A word wri tten in lowercase letters represents the type of entry to be made by the programmer. This word may be hyphenated. name denotes an entry of a name. data-uni t-name denotes an entry of a data uni t name. A word written in uppercase letters or special characters denotes an actual occurrence of that word or character in the language. name DISPLAY data-unit-name $ This example denotes the entry of a name followed by the entry of the reserved word DISPLAY followed by an entry of a data unit name. Braces{ } are used to denote a choice. The units from which a choice may be made are stacked vertically within the braces. At least one of the units within the braces must occur in the statement. This example indicates that either REGS REGS } {. da ta -un it-name . or a data unit name must appear in the statement. Square bracke t8 [ ] are used to denote options. When one uni tis enclosed in brackets, the unit mayor may not appear. When more than one unit is enclosed in brackets, anyone of the alternative units may B-1 M-5035 . or may not be chosen to appear. In either case, it is possible that no unit may appear. It is generally not possible that more than one unit will appear. This example indicates that a name may [name ] appear in the statement format. lIow5. The use of • ever, this unit is not required. denotes tha t the type of entry i ndi- • •• cated by the word preceding • •• may appear one or more times in succession, where each entry is delimited by the word preceding. This does ~ot imply that all entries should be identical. It does imply, however, that all entries should be the same type of entry indicated by the word preceding the three dots. , • data unit name • • • This example indicates that one or more data unit names may occur in succession as entries, separated by commas. Thus, the following would be a legal entry: ALPHA, BETA, GAMMA B.2 MONITOH STATEMENTS $SE() , ddd [non-numeric-nonspace-non-$ character] [$ [comments]] $JOB [; [user identification], [project identification], [time limit in decimal], [page limit in decimalJ. [~sJ . B-2 [26JJ [$ Lcomm"ntsJJ M-S03S Change 5 $1-:01 [$ 1(~()mrnnntsJJ $ENDJOB l$ [comments]] $CMS-2 [$ [comments]] $ASM [, U] [$ [comments]] $UTILITY [$ [comments]] $LIBEXEC [$ [comments]] $LOAD [, $A. REG [ • • t $BREG [ , TRACE PTRACE SNAP RANGE DISPLAY I • • • ] [$ [comments]] roct~l J ••• ] number Ldeclmal number 0 J ] octal number • [ deClma . 1 numb er D · · · $KEYSET [. • [g;F] ••• ] $CALL, [$ [commentsj] [$ [comments J] [$ [comments]] address section name + {octal number }] external definition name [ . - decimal number D bound section name [ + {oc tal number B-3 decimal number }~ J [$ [comments]] M-5035 $TYPE, message $HALT, message $REMARK, message address section name } { external definition name $TRA, bound section name [ [{+}- {octal number }] decimal number D + {doct~~ eClma nlUmbebr numer}] [$ [comments]] I 0 H Q $DUMP. D C IC [rJ · • OC HC QC DC CC address section name } { external definition name bound section name [{+}- {octal number }] decimal number D [+ {~~~~a~u~~er n}] 13-4 • • • [$ [comments] M-5035 address section name { $SNAP, extc rna 1 de r j ni ti on name oe tn 1 numhe r { dec ima 1 numb\.! r } bound section name octal number { decimal number I o H Q o C IC OC HC QC [decimal dumps count] DC CC [decimal dump frequency ] , [ decimal start dump count] {:~~~::l s~~:!~~ t~:~ naE} ( L$ ~} {~~~~a~u::er D} ] [+ bound section name octal number of words } { decimal number 0 of words $PATCH [{ • •• {octal number } ] decimal :number 0 [$ [commentsJJ [comments]) Pa tch S ta temen t: external defi ni ti on .name [{~} bound section name [ {address section name } + D} ] { oc tal number decimal number D} ] {octal number decimal number I, • up to twe 1 ve oc ta 1 d i gi ts • • • 0, • up to eleven octal digi ts • • • (.. K, • up to thi rteen octal digi ts • • • . C, (character string) B-5 I [$ Lc omme n t s j J M-5035 SIP, Tl T2 T3 T4 T5 T6 T7 T8 CR KB PR SOP, Tl T2 T3 T4 T5 T6 T7 T8 CP PP SHC, Tl T2 T3 T4 T5 T6 T7 T8 HP KB Tl T2 T3 T4 T5 T6 T7 T8 CR CP HP Tl T2 T3 T4 T5 T6 T7 T8 CH CP HP KB KB PR PP PH PP $ASG, [$ [commen ts ] ] 0 H-6 M-5035 Change 5 I $LDUYK-20[$ [comments]] $FORTRAN [$ [commentsjj $SYSMAKER [$ [comments]] B.3 LOADER STATEMENTS Table Size Declaration: TSD, .name = decimal integer ••• [$ [comment]] Library Selection: LIBS, .internal library naillC [ (external library name)] ••• [$ [ commen t] ] Element Selction: SEL-ELEM [element name] [(key)] [ [$ [comment]] Loader Options Select: LOPTIONS • r~g~~El. •• [tg~~~CT 1 lNOMA~ SAVLODGOJ B-7 'i : ALL } ] ONLY decimal integeI M-5035 Combine Elements Selection: ~:~~~~g~L} { [Section name] [ (octal digit)] BASE LOCDDPOOL , • element name ••• [ (octal integer)] [ $ [c 0 mme nt ] ] End Card: END L$ [commentJJ B.4 LIBRARIAN STATEMENTS /LIST /BUILD internal-library-name /EDIT old-internal-library-name [ (old-external-library-name)J [, new-internal-library-nameJ /ENDLIB /TAPlD , . internal-tape-name [ (external-tape-name)] • • • /RELEASE , • internal-tape-name [ (external-tape-name)] • • • /HISTENT notes IADD name [(key)] ~ (~l ] ~nternal_tape-nam;Y~~=xternal_tape-name)~ [NOLlST] B-8 M-5035 ALI, /CUI'Y name l (key) j [. [n ] [TilRIl name L ] SUB-TABLE maximum-number-of-items [label] SWAP initial-item-number [major-index-name] data-element • data-element name SWITCH name [ ( name-a, •• switch-point •••] name-b s ta tement -npme { procedure-name [ , statement-name]} $ [ • procedure-name] constant statement~name $ constant procedure~name $ name SYS-DD [comment] name SYS-PROC name SYS-PROC-REN [comment] $ $ [comment] $ 8-23 [THEN I $ statement] $ $ M-5035 H V A label VARY (type) } wo rd s - pe r - it em NONE MEDIUM UENSE (type) words-per-item NONE MEDIUM OENSE loop-index THRU final-value} { WITHIN name [INDIRECT] number-of-items LINDIRECTJ [FROM , . d imens ion • • • initial-value] [±J [BY increment] $ NOTE FROM, THRU, WITHIN and BY may appear in any order. EXTREF EXTDEF ( TRANSREF I I number-of -bi ts {~} A number-of-bits {~} S list-of-status-constants number-of-characters H B F number-of-fractional-bits [(R)] [P constant] [V(x,y) J $ 8-24 [major-index-nameJ $ M-5035 B.7 ASSEMBLER STATEMENfS Start Assembly (ULTRA) Card: D p *ULTRA [[. [~][. ~! [ ·[Hi] J]] PS SP Stop Assembly (OFF) Card: *OFF Absolute Directive Card: ASS label Byte Directive Card: BYTE el [,e2] Character Directive Card: CHAR ,_ (c,e} - - - DO Directive Card: (label] DO e , (statement) END Directive Card: END B-25 [name [. verSionJJ ] M-5035 Equate Directive Card: label' EQU e EVEN Directive Card: I~VEN OUD Directive Card: ODD FOHM Directive Card: label FORM , • tel • • • List Cross Reference Table Directive Card: LCR Library Select Directive Card: LIBS , . linternal-name} [(external-name)] • • • Library Element Directive Card: LIB , • [ na me] [( ve r s ion) J • • • . LINK Directive Card: LINK , • (name} • • • LIST Directive Card: LIST ELIST Directive Card: fLIST B-26 M-5035 B.7 ASSEMBLER STATEMENTS Start Assembly (ULTRA) Card: o p *ULTRA [[. [~] ~i [ ·[Hi] ]]] [. PS SP Stop Assembly (OFF) Card: *OFF Absolute Directive Card: ABS label Byte Directive Card: BYTE el [,e2] Charac ter Di recti ve Card: CHAR , . [c ,e) • • • DO Directive Card: [label] 00 e , (statement} END Directive Card: END 8-25 [name [. version] ] ] M-5035 Equate Directive Card: label' EQU e EVEN Directive Card: EVEN ODD Directive Card: OUD FORM Uirective Card: label FORM •• te} • • • List Cross Reference Table Directive Card: LCR Library Select Directive Card: LIBS •• linternal-name} [(external-name)] • • • Library Element Directive Card: LIB , • [ na me ] L(ve r s ion) J • • • LINK Directive Card: LINK •• (name} • • • LIST Directive Card: LIST ELIST Directive Card: FLIST B-26 M-5035 NOlIST Directive Card: NOlIST J] literal Directive Card: f$ L (e) [, label label lIT Punch External labels Directive Card: PXl Reserve Directive Card: [label] RES e Relocation Field Directive Card: RF$ e , . (h, I t c} • • • Segment End Directive Card: SEGEND Set Address Directive Card: SETADR e t. [a] • • • Word Directive Card: WRD e 8-27 M-5035 MACRO Directive Card: label [~(] MACRO [e,[,e ]] 2 MACRO Name Directive Card: label [*] NAME [eJ GO Directive Card: GO label 8-20 M-5035 APPENDIX C SUMMARY OF SERVICE ROUTINE CALLING SEQUENCES Request Packets Reference Words I' IW Ytbts o S mod. 0 Y portion of pkt. address Standard Input Request Packet function code status user code data ad~ress (in indirect word fo~at) number of characters Standard Output Request Packet 1')10)1')1'11111'11111.11111111'110["1"1'11" "1'.1 111 111" L,01'1' 1 ttJ II • till I I I 0 user code da ta addres s (in indirect word format) number of characters Standard Hardcopy Output Request Packet data address (in indirect word number of characters C-l fO!'ll8t) IWS YtS M-5035 Change 3 Tape Assignment/Release Packet Tape Control Selection Packet Device Get Device NamePacket Centralized I/O Request Packet I I .111011....1.'1••1..1•• ....111 '1101'.1'.1"1'. ,. ,. "1'11"1'°1'1' '1'111.11111'1 0 logical unit no. R CC user code data add res s (same forma ts as in request packet addr.) number of words read/ skip count/number of words deposit user code search identifier/deposit data address operation s ta tus C-2 M-5035 Change 3 Scatter /Gather Centralized ·1/0 Request Packet SllsolulzelnlztJulz. UJUIZIIZ~ltll'11711' 15 ,. 151121"1101'" Word 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 operation (015 or 016) status ~ IV C user code 711151.1' pi ' 10 l~ical un t no. V///U/////////i/////////ULfLL number of areas in this gather write/scatter read data address of first area (same format as req. pkt. ) number of words/ character s in this area data address of second area (same format as req. pkt. ) number of words/chars. data address of third area, if one (same format as req. pkt. ) number of words/chars. data address of fourth area, if one (same format as req. pkt. ) number of words/chars. data address of fifth area, if one (same format as req. pkt. ) number of words/chars. data address of sixth area, if one (same format as req. pkt. ) number of words/chars. Service Request Call Type of Packet Centralized I/O Request XS 0 nv (packe t add re s s ) Centralized I/O request packet Standard Input Request XS lOa IW (packet address) Standard input request packet C-3 M-5035 Change 3 Service Request Call Type of Packet Standard Output Request Standard output request packet XS 118 IW (packet address) Standard Hardcopy Request standard hardcopy request packet XS 128 IW (packet address) Tape Assignment/Release packet Tape Assignment/Release Request XS 3 IW (packet address) Tape Control Selection packet Tape Control Selection Request XS 2 IW (packet address) Get Device Name Request Get Device Name packet XS 1 IW (packet ~ddr,ess) Check Simulated Jump Key 1 Selection Request None XS 40 8 return if simulated key 1 is "on u return if simulated key 1 is "off" Check Simulated Jump Key 2 Selection Request None XS 418 return if simulated key 2 is "on" return if simulated key 2 is "off" C-4 M-5035 Change 3 Type of Packet Sprvice Request enll rhf'ck Simulatf'd ,lump Key 3 Splection Request XS ,1'>'-8 re turn if simula ted key 3 is "on" None re turn if s imula ted key 3 is "off" Check PTRACE Selection Request XS ,13 None 8 return if not selected return if selected Check TRACE Selection Request None XS ,148 return if not selected re turn if selec ted Check OISPLAY Selection Request XS .15 None 8 re turn if no t se lee ted return if selected Check RANGE Selection Request XS 46 None 8 return if not selected return if selected Check SNAP Selection Request None XS 478 re turn if not se lee ted return if selected Check Floating Point Error Request None XS 508 return if floating point error has occurred return if no floating point error has occurred Terminate User Program Req1!est XS 518 None or XS 528 C-5 M-5035 Change· 3 Type of Packet Service Request Call Current Time Request None XS 608 IW (address where data is wanted)- data occupies one word Current Data Request XS 618 IW (address where data is wanted) - data occupies two words C-6 None M-5035 Change 5 APPENDIX D CMS-2 COMPILER RESERVED WORD LIST The following symbols are compiler reserved words and may not be used as identifiers in a CMS-2 program. ABS DECODE FUNCTION OCM SPILL ALG DEFID GOTO ODDP STOP AND DENSE GT ONLY SWAP BASE DEP GTEQ OPEN SWITCH BEGIN DffiECT OPTIONS SYSTEM BIT DISPLAY HEAD OR TABLE BY ELSE IF OUTPUT THEN CAT ENCODE INDffiECT OVERFLOW THRU CHAR END FILE INPUT OVERLAY TO CHECKID END INTO PACK TRACE crnc EQ INVALID POS UNTIL CLOSE EQUALS LENGTH PRINT USING CMODE EVENP LIBS PTRACE CNT EXCHANGE LOG PUNCH VARY COMMENT EXEC LT RANGE VARYING COMP EXIT LTEQ READ VRBL CORAD FIELD MEANS REGS WHILE CORRECT FIL MEDIUM RESUME WITH CSWITCH FILE MODE RETURN WITllN FIND NITEMS SAVING XOR DATA FOR NONE SET DATAPOOL FORMAT NOT SIflFT DEBUG FROM tD t I tH to Not allowed as a tabular identifier or function. D-l I VALID SNAP I M-5035 Change 2 NOTE Programmers expecting to make use of CMS-2 run-time routines (high-level input/output, debug, and math routines) should avoid the use of identifiers beginning with R T to prevent duplication of identifiers. Any duplication of identifiers, globally defined within the run -time library, would not be detected until load time. D-2 _.. ,.- M-5035 Change 3 APPENDIX E COMPILER' ERROR MESSAGES AND LIMITS Source Errors and Warning Messages (Warnings Flagged with *) I The following error messages appear as a result of errors detected by the source syntax analysis phase of a compilation (OPTIONS SOURCE): *0 DEBUG REQUffiES MONITOR A DEBUG statement is only processed if the MONITOR OPTION has been specified. 1 I IDENTIFIER GT 8 CHARS Attempt to define an identifier greater than eight characters long. 2 LITERAL GT 132 CHARS Hollerith or literal constant greater than 132 characters. 3 RESERVED WORD USED AS ID illegal use of reserved word as an identifier. 4 CHARACTER NOT RECOGNIZED illegal ASCII input character. 5 DECIMAL POINT MISPLACED Erroneous use of period not in a constant or illegal label definition. *6 I COMMENT TERMINATED BY $ Double prime comment not completed before end of statement. 7 INCORRECT OCTAL CONSTANT The digits 8 or 9 appear in an octal constant. 8 MISPLACED SEL-POOL Identifier definition appears prior to SEL-POOL statement. E-1 M-5035 Change 3 9 ILLEGAL INTEGER TAG Symbol or constant must bean integer. 10 NO STATEMENT TERMINATOR Missing $ statement terminator. 11 IDENTIFIER MISSING Missing name in a data unit declaration. 12 DUPLICATE IDENTIFIER Attempt to define a previously defined identifier. 13 OUTSIDE TABLE BOUNDS Subtable not contained within table; field not contained within item; or multi-word field in a horizontal table. 14 NO DESCRIPTIVE OPERATOR Missing descriptive or separator term. 15 ILLEGAL IN MINOR HEADER Statement is not allowed in minor header (must be placed in major header). 16 TOO MANY DIMENSIONS More than seven dimensions in an array declaration. *17 COMMA MISSING Comma missing in statement. *18 OVERLAY PARENT MISMATCH Data units on right of overlay exceed size of parent data unit. 19 DUPLICATED OVEHLAY Data unit appears on right of more than one overlay. £-2 M-5035 Change 5 20 OVEIlLAY SE()lJENCE EHHOH Ua t. a un ito n rig h t () f 21 0 v{' r I it Y il PPt' a rc ~ don 1(~ f t 0f pre v i 0 u S 0 ve r 1n y • UNDEFINED IDENTIFIER Referenced dnta unit hns not been previously defined. 22 SCOPE CONFLICT Definition of a global procedure with local parameters. 23 STATEMENT NOT RECOGNIZED Statement placed in the wrong type of element or within the wrong type of declarative brackets. 24 ILLEGAL OPTIONS . CCOMN has been designated the output unit for both LISTING and OBJECT options - options that are produced simultaneously. Only the OBJECT option is produced: the LISTING option on CCOMN is ignored. *25 PARENTHESIS MISSING Parenthesis missing within statement. 26 SUB/LIKE-TABLE PROHIBIT Subtable or like-table declared in an array. 27 ILLEGAL OVERLAY DATAUNIT Illegal data unit appears in overlay. 28 ILLEGAL OVERLAY PARENT Specified data unit may not be used as a overlay parent. 29 DUPLICATE RANGE More than one range statement for the same data unit. 30 PRESET NOT ALLOWED Data unit preset not allowed in AUTO-DD or on an externally referenced data unit. E-3 I M,-5035 Change 5 31 ILLEGAL HARDWARE NAME Illegal hardware device name specified infile declaration. 32 ILLEGAL FORMAT DESCRIPTOR Illegal conversion descriptor specified in format statement. 33 MORE THAN 1 LEVEL NESTED Format descriptors nested (parenthesized) to more than one level. 34 ILLEGAL IDENT REFERENCE Illegal use of identifier in an expression. 35 I ILLEGAL srZE DESCRIPTOR Illegal data unit size attribute (e. g., Hollerith over 132 characters, table defined with 0 words per item, too many bits for I- or A-type.) *36 END BRACKET MISPLACED Misplaced or missing END - statement. *37 STATEMENT REQUIRES MONITOR MONITOR OPTION must be declared for processing of this statement. *38 CNV REQUffiES NONRT Processing of a CNV statement requires the NONRT (or MONITOR) OPTION. 39 SYSTEM LIMIT nn EXCEEDED One of the following compiler limitsdenoted by nn has been exceeded. The code nn has the following values: 1. Constant conversion limit was exceeded; the value of the constant lies outside the decimal limits (IE57, IE-3S) or the octal limits (IE77, IE-52). 2. The number of nested subexpressions within the Boolean condition of an IF statement may not exceed ten. 3. The number of libraries requested for retrieval may not exceed ten. E-4 M-5035 Change 5 4. The number of operands in a DISPLAY statement has exceeded the compiler limit. The card column indicator in the error output listing points to the operand which first exceeds the limit. This and following operands should be written as a separate DISPLAY statement. The limit may be calculated as follows: a) Allow 3 + n words for each operand, where n is the number of words required to contain the operand as a character string; b) the sum of the above may not exceed 94. 5. The maximum number of exit parameters per PROCEDURE declaration is ten. 6. The lllll'~ her of format descriptors exceeds 94 or the number of ope rands of an input/output list for INPUT, OUTPUT, ENCODE or DECODE statements exceeds 94. (For each operand that is a Hollerith constant, also add in the number of ·words required to contain the constant value.) 7. A maximum of seven levels of subscripting and function calls per operand is allowed. 8. An item beyond item 255 was specified in a field preset. 9. The length of a dynamic statement is too long for the compiler to process properly. This may be due to the complexity of an expression or an abundance of embedded notes. 10. The maximum number of elements declared dependent of another is 58. 11. A VRBL declaration may define no more than 25 names. 12. . The offset of a sibling overlayed data unit relative to its parent data unit must not exceed 65535 words. I 13. More than 250 elements. 14. Symbol table overflow -- number of global and local identifiers. 15. Field defined or complier packed beyond word 255. 16. More than 15 combined nested VARY and BEGIN blocks. E-4A/E-4B (Blank) I M-5035 Change 5 17. More than 10 nested VARYs. 18. CC»1ENT (or "-type comment) between FIND and IF DATA too long. 19. CG1MENT (or "-type comment) between last TIffiN clause and ELSE clause too long. 20 through 29. 30. Not used. A dependent retrieval level greater than 255 was requested. 255 is assumed. 31. A magnitude value greater than 32767 was specified in a magnitude specification. 32767 is, assumed. E-5 M-5035 Change 5 I I *40 OVER 10 NESTED CSWITCH BRACKETS. Nesting of CSWITCH brackets exceeded. 41 ILLEGAL EXTERN MODIFIER Illegal or misplaced EXTREF, EXTDEF or LOCREF declaration. * 42 END DEClARATION MISSING ,Missing program structure EN D- declaration. 43 HEADER NOT RECOGNIZED Unrecognizable or illegal statement appearing in a header. * 44 END HEAD MISSING END-HEAD statement missing after major header. *45 FUNCTION RETURN MISSING Return statement missing from function. 46 ILLEGAL EXIT PARAMETER nl~gal 47 name specified as a formal exit parameter. COMPOOL REQUEST IGNORED Requested COMPOOL generation run not made due to detection of SYS-PROC statement. 48 INCOMPATIBLE DATAUNIT Expression operands do not conform to data unit type restrictions or do not fit context required by operator. * 50 NO DEF CHECK PERFORMED No structural compatibility checking between external compiler-packed table definitions. E-6 M-5035 Change 4 51 FILE TYPE MISSING Type descriptor missing in file declaration. * 52 CMS-2 BRACKET MISSING CMS-2 statement missing as terminator for a direct code block. 53 VALUE SIGNIFICANCE LOST The most significant bits have been lost during alignment of a numeric constant used as a variable or field preset or a value block value. 54 TOO M~NY STATUS CONSTANT More than 12 status constants associated with a data unit. 55 DUPLICATE ALLOCATION Symbol appears on the left of more than one EQUALS statement. 56 ILLEGAL ALLOCATION Attempt to establish EQUALS allocation via a constant (absolute allocation) or illegal 57 EQU~LS expression. LIBS NOT DEFlNED PHIOR Library selection statement appearing prior to a LIBS statement. 58 nnnnnnnn NOT HETRI EVED The request element, named nnnnnnnn, WRsnot fOllno in Rny of thp dpclared libraries. *59 FIELD LIST MISSING No fields specified for a compiler packed table. 60 WRONG ARGUMENT COUNT Procedure call parameter list mismatched. E-7 I :\1-5035 Change 3 HI FORl\IAT NOT INDICATED :\Iissing fornlllt statement rpference in ENCODE/DECODE statenu'nt. ... ( )") \\'OHD :\IOHE THAN 12 CIIAItS ~all1e, ():~ identifier, or symhol more than 12 characters. :\1 U ST BE FUB :\IAT N A :\11< Syntax requirt's name to IH' I '()·l :l format statement reference, \\'HONG END NAI\IE Incorrect naille on END- statement. U5 SYNTAX Erroneous statenlent syntax or punct uation. {iG COl\IPILEH PHOBLEl\I, SYNTAX Syntax of statement cannot he analyzed by compiler. y G7 INCOHHECT END KEY\\,OHD \\'rong EN D- bracket stat ement used. • GIj !'JO SYSTEl\1 DECLAHATION :\Iissing 8YSTE1\1 declaration as first statement of source input . .. (j!) NO EN D-8YST E 1\1 ;\Iissing END-SYSTEI\J statplllent .. 70 SYNTAX Syntax of statement not correct. .. 71 OPTIONS ST1\lT MIHSIN(i Options statenlent missing from Jnajor header. output. E-8 Syntax diagnostics will he only 1\1-5035 Change 4 t 7~ PAHAl\I PROCESSED AS VnUL Paranleters are not allowed in function definitions. 7J PROCEDUHE I/O LIST ERROR Procedure call paranleters do not match procedure definition. 7-1 ILLEGAL KEY TYPE Key type not legal for this element. 75 DUPLICATE KEY KEY previously declared. 7H ELEIV[ENT KEY GREATER 4 CHS Library element key is greater than four characters. +< 77 l\tIISPLACED STATEl\IENT A misplaced or extraneous EN D statement has been encountered at a point in the progranl where all VARY declarations and their END delimiters have been paired. *78 VALUE PRECISION LOST The least significant bits have been lost during alignment of a numeric constant used as a variable or field preset or as a value block value. 79 ILLEGAL DECREMENT WITHIN nlegal VARY containing explicit FROM and WITHIN parameters with a negative BY parameter. *80· 32D UNSIGNED DATA UNIT Variable is 32 bits unsigned (requiring 2 words). E-9 I M-5035 Change 4 81 ILLEGAL FORWARD REF Forward reference PROCEDURE and FUNCTION calls may not have STATUS constants as input or output parameters. 82 TOO MANY PARAMS LISTED More parameters listed in call than specified in definition. *83 TRUNCATED TO INTEGER Scaled value has been truncated to an integer value where integer is syntactically required. 84 MEANS OR EXCHANGE GT 132 Character string in MEANS or EXCHANGE statement greater than 132 characters. 85 NESTED MEANS OR EXCHANGE Referenced MEANS or EXCHANGE name contains another MEANS or EXCHANGE I name in its substitution string. *86 NON-STRUCTURED STATEMENT The current statement violates CMS-2 structured programming conventions. * 87 CONSTANT PRECISION LOST Precision bits of converted constant in the decimal range of 1E-24 to lE-38 or the octal range of lE-32 to IE-52 have been lost. 88 ILLEGAL EQUALS Illegal operator or operands in EQUALS expression. * 89 ILLEGAL LEVEL REQUEST LEVEL OPTION argument must be 0 or 1. 90 DUPLICATE REGISTER PARA METER registers duplicated. E-10 M-5035 Change 4 91 VARY VRBL IS THRU VALUE VARY loop index is the same data unit as the THRU clause data unit; hence, an illogical VARY statement. 92 DEFINITION MISMATCH External definition or external reference does not match previous external definition or reference. 93 DUPLICATE SYS-INDEX Definition of an index register as a system index which has already been declared as a system index. * 94 IDENTIFIER EXTERNALIZED Local identifier definition which has been made global because of a previous external reference. 95 STATUS CONSTANT GT 8 CHAR More than eight characters specified in a status constant. 96 MONITOR CONTROL READ Missing TERMINATE statement; hence Compiler attempts to read a Monitor control card. 97 TYPE NOT SPECIFIED A FOR-type was not specified for a FOR-expression which requires an explicit type specification. 98 ERROR LIMIT EXCEEDED More than 100 syntax errors if options OBJECT requested or more than 1000 syntax errors if options SOURCE requested. E-IOA I M-5035 Change 5 99 DUPLICATE VALUE The same value was specified more than once for the same FOR block o 100 VALUE MISSING A value is not present on the BEG1N statement of a value block. 101 VALUE BLOCK MISS1NG A BEGIN with associated value is not present following a FOR statement or a value block which is not the last value block of a FOR block. 102 1NCOMPATIBLE TYPE The type of an operand (numeric, Boolean, status, or Hollerith) is not compatible with its associated operator or operator. 103 MISPLACED VALUE BLOCK A BEG1N with an associated value is present in a context other than immediately following a FOR statement or another value block. 104 CONDITIONAL NOT BLOCKED A decision statement not enclosed within BEG1N-END brackets is present in the compound statement of another decision statement. I *105 UNCOMPLETED CONDITIONAL The compound statement of a. decision statement was not completed at the end of the containing block, procedure, or function. I *106 CONSTANT TRUNCATED The rightmost characters have been truncated during alignment of a Hollerith constant used as a variable or field preset or as a value block value. E-10B M-5035 Change 5 107 ILLEGAL REGISTER A register other than 0 through 7 was specified as a PARAMETER register. ~109 NO END-CSWITCH xxxxxxxx Named. CSWlTCH does not have a corresponding END -CSWITCH bracket declara- tion. *110 NO CSWITCH FOR TmS END END -CSWITCH bracket declaration does not have corresponding CSWITCH bracket declaration. E-ll M-5035 Change 3 , Object Errors and Warning Messages (Warnings Flagged with *) The following additional error messages may appear in a compilation which goes through the object code generation phase (OPTIONS OBJECT): I 200 INCOMPATIBLE DATA TYPES Attempted assignment or comparison of incompatible data unit type. 201 ILLEGAL OPERAND REF Operand reference illegal in context used in statement. *202 ABS OF UNSIGNED DATA Absolute value of unsigned data unit requested. 203 DIRECT CODE SYNTAX ERROR Illegal or undefined operand, operator, or separator in a direct code statement. 204 SYSTEM LIMIT nn EXCEEDED One of the following compiler limits denoted by nn has been exceeded. The code nn has the following values: 20. The allocation table for generated labels has overflowed. A maxi- mum of 1000 generated labels ,per system procedure is allowed. This error may also occur for cases of more than 96 generated labels for a given procedure. 21. Compiler use and allocation of temporary words have exceeded certain limits which, depending upon the distribution of temporary word usage and number of procedures, range from 2460 to 3840 temporary words per system procedure. 22. A maximum of 1536 binary constants can be generated per system procedure. 23. A maximum of 4800 words of Hollerith constants can be generated per system procedure. 24. A maximum of 4000 indirect words can be generated per system procedureo E-12 M-5035 Change 3 205 REMAINDER NOT AVAILABLE SAVING remainder specified in statement without fixed-point division. 206 STMT REQUffiES NONRT OPT. Run-Time call will be generated. This requires the NONRT (non-real time) option to be present. It is present by default if the MONITOR option is used. 207 I EXTERNAL DEF MISMATCH External reference does , not match subsequent external definition. 208 UNDEFINED IDENTIFIER Forw.ard reference to an identifier which is not subsequently defined. 209 SYSTEM ERROR Notify CMS-2Y maintenance personnel. 210 COMPILER ERROR Compiler or undetected hardwaie error. 211 TRANSREF IN P-SWITCH Illegal transient reference to procedure in a P-SWITCH. 212 TOO MANY FRACTION DIGITS Too many fractional digits specified in a direct code constant. 213 NON-NUMERIC CONSTANT I1lega1constant or improper punctuation ia a direct code statement. 214 TOO MANY CHARACTERS Illegal MEANS or EXCHANGE character substitution in a direct 'code statement. 215 ILLEGAL CHARACTER Illegal ASCII character appearing in a direct code statement. E-l~~ I M-5035 Change 3 216 UNRESOLVED EQUALS STMT Reference to an EQUALS tag which is not resolvable at the time of reference. 217 ILLEGAL FORM PARAMETER Illegal parameter in a direct code FORM statement. 218 FORM LABEL MISSING Label missing from direct code FORM statement. I * 219 RIGHT TERM TRUNCATED Truncation of operand has occurred. 220 ILLEGAL SPECIAL COND Illegal STOP special condition specified on GOTO or RETURN statement. 221 COMPILER PROBLEM, SYNTAX Syntax of statement cannot be analyzed by compiler. I 222 PARAMETER TRANSFER ERROR Statement results in alteration of contents currently held in PARAMETER register. Allocation Errors The following codes may appear on the output listing to flag allocation errors: A Allocation error. Reference to an undefined label or incorrect program allocation. C Compiler error. Incorrect instruction generation or undetected hardware error. Library Retrieval Errors, Messages and Operator Messages Bee paragraph 3.4.2. 3 and 3.4.2.4 in Volume I. E-14 M-5035 Change 5 Compiler Limits In addition to the various compiler limits given in the explanation of the preceding error messages, the following limits are described here: Generated Indirect Words Compiler generated indirect words are locally defined within system procedures. A maximum of 4,000 indirect words can be generated per system procedure. words are grouped into 100 blocks of 40 words per hlock. These Within each block, all indirect words are unique. Generated Binary Constants Compiler generated binary constants are locally defined within system procedures. A maximum of 1,536 binary constants can be generated per system procedure. These constants are grouped into 32 blocks of 40 constants per block. Within each block, all constants are unique. Generated Hollerith Constants Compiler generated hollerith constants are locally defined within system procedures. A maximum of 4,800 words of Hollerith constants can be generated per system procedure. per block. These constants are grouped into 32 blocks of 150 constants Within each block, all Hollerith character strings are unique. Identifiers The compiler dictionary for user defined identifiers contains a minimum of 10,240 words and a maximum of 32,768 words. The minimum sized dictionary is standard I for a 49K ANjUYK-7 configuration. The number of dictionary words per identifier is variable depending upon type of identifier. The normal entry is six to nine words (see Table E-1). The dictionary is divided into a global segment and a local segment. Table overflow occurs whenever the size of the global segment plus the global hash table plus the largest local segment exceeds the size of the dictionary. The compilation is terminated at this point. E-15 I M-5035 Change 5 TABLEE-l DICTIONARY ENTRIES Number of Words Per Entry Types of Identifier Dictionary Entries 1) I I I I I abnormal exit name n=5 2) auto data name n=7 3) cswitch name n=3 4) data pool name n=8 5) display label n=6 6) equals name n= 5 +2p 7) dum my loop, label n=4 8) exchange name n= 5 ~rc:j 9) field name U= 6 + 2s 10) file name n = 8 + 2s 11) for block n = 3 + 2s 12) format name n=7 13) form label n=7 14) function name n =7+i 15) header name n=4 16) index switch name n=7 17) item -area name n=8 18) item switch name n=7 19) like-table name n=9 20) local data name n=7 21) local index name n=7 22) local pool name n=8 23) major index name n=8 24) means name n=5 25) nitems name n=5 26) procedure index switch name n = 7 + max (i, 0) 27) procedure item switch name n=8+max(i, 0) 28) procedure name n = 8 + max (i, o)e 29) program base name n=8 E-16 if:j M-5035 Change 5 Number of Words Per Entry Type of Identifier Dictionary Entries 30) ranged data name n=9 31) statement name n=7 32) sub-table name n=9 33) system data name n=4 34) system index name n=4 35) system name n=4 36) syste m procedure name n=7 37) table name n 38) table pool name n=8 39) value block n=5 40) variable name n = 7 + f + 2s =9 + d + t Legend: c = num her of characters {C : 3}s an integer such that[C : 3] ~ C : 3 d = zero for horizontal or vertical tables = number of dimensions for an array e = num her of exit parameters f = 1 for fixed ;>oint data = 0 otherwise i = number of input parameters n = number of dictionary words per name o = number of output parameters p =number of names in the equals expression that are relocatable s = number of status constants t = 1 with table typing = 0 without table typing E-17 I (1 + 2 s) I M-5035 Change 2 Generated Labels Compiler generated statement labels are locally defined within system procedures. A maximum of 1,000 generated labels per system procedure is allowed. Each procedure is limited to 128 generated labels; the ~orst case is 96 generated labels for a procedure that follows one with 32 or fewer generated labels. Whenever one of these limits is exceeded, the remaining generated labels assigned to the offending procedure or system procedure will be unallocated. Generated Temporary Words Compiler generated temporary words are locally defined within system procedures. A maximum of 32 blocks of temporary words can be generated per system procedure. The maximum number of temporary words per block is 120. The length and starting address of a temporary block is established at the end of a procedure if the number of reserved temporary words is at least 80 or at the end of the system procedure. The number of temporary words per procedure is at most 120 and 40 for the worst case. Depending upon the distribution of temporary words and the number of procedures, the best case maximum number of temporary words per system procedure is 3,840, the worst case is 2,460. Cross Reference Errors *****COMPLETE GLOBAL CROSS REFERENCE UNAVAILABLE TOO MANY ELEMENTS***** Whenever the number of elements per compile is 160 or greater, a global cross reference cannot be produced. The local cross reference for each element will still be available and printed. The major header and all system data designs and system procedures are counted as elements; minor headers are not inCluded in the element count since they are considered as part of the succeeding system element. *****LOCAL CROSS REFERENCE INCOMPLETE***** This message may appear at the end of a local cross reference listing. It indicates that the table for collecting reference data .overflowed and no more references for that element were collected. E-18 M-5035 Change 2 *~:~U::~CERHOR EI'K;OUNTEHElJ DUllING CROSS HEFEHENCE DATA COLLECTIONf.:~:f.(f.n:: This message may appear at the end of a local cross reference listing. It indicates that an invalid condition was detected during cross reference data collection and was caused by a compiler error. ~:*f.C~C*TOO MANY IDENTIFIERS FOR SORTING -- NOT OUTPUT GIVEN)::)::;::~C):; This message informs the user that he will not receive his requested cross reference or symbol analysis output because there are too many identifiers for the compiler alphabetized identifier table. Tape Errors The user is notified of tape related errors detected during compilation. Error messages are provided on the standard hardcopy device and on the operator communication device. **~C~;~CMAG TAPE ERROR UNIT Tn name This message is printed on the standard hardcopy device for any unrecoverable hardware errors or compiler detected checksum errors. Tn identifies the offending tape unit and the name identifies which compiler output tape or compiler scratch tape encountered the error. normal range of n in Tn is I through R. The tape names are: The compiler outputs, CCOMN, CSRCE, COBJT, CLIST; compiler fCRATCHm (internal compiler scratch numbers m = I . . . , 4); and COMPOOL input (for COMPOOL and TO, the SEL-POOL req~est could not be satisfied; if Tn is a normal tape unit, a bonafide error was detected). ****~~OMPILE TERMINATED This companion message to the one above states that the tape error or the checksum error detected against one of the compiler scratch tapes necessitates termination of the compilation. E-19 M-5035 Change 3 *****OUTPUT TERMINATED This companion message to the first one above states that the tape error detected against CCOMN, CSRCE, COBJT, CLIST, or COMPOOL necessitates that output to that tape be discontinued. Compilation and optional outputs to other tapes will be continued. *****WRITE ERROR Tn This message on the operator communication device informs the operator or user. that an unrecoverable hardware error has been detected during a write operation to tape. Tn designates individual tape units Tl through T8. *****CHECKSUM ERROR Tn This message on the operator communication device informs the operator or user that an unrecoverable hardware error 9r a compiler detected checksum error has been detected during a read operation from tape. Tn designates individual tape units Tl through T8. (A TO tape designator may indicate a SEL-POOL request that could not be satisfied. The assigned tape number is not available to the compiler under such circumstances. ) Run-Time Errors The following error messages are printed by the rUQ. time programs during execution of the CMS-2 debug and high-level I/O operations. During a Debug DISPLAY or SNAP operation, the following error messages are printed in place of the expected results: ** INVALID DATA REFERENCE ** An illegal data unit was referenced. Legal data 'units are an array, field, item, REGS, sub-table, table, and a word reference. ** INVALID STATUS ** A data unit, with status attributes, has a status value without its corresponding status constant. E-20 M-5035 Change 3 :le* INVALID USE OF MAGNITUDE ** A magnitude was specified on a non-numeric data element. Errors detected by the run-time high-level I/O operations are flagged by a one line location message and a one line description message. The run time abort message will repeat the location message. The location message has the following format: ERROR IN RTxxxx RTDSL AT yyyyyyyy LOGICAL UNIT zzzzzz. where RTxxxx - Name of run-time routine detecting the error. yyyyyyyy - zzzzzz - Hardware device name. Core address of the first entry in the Run-Time Data Specification List (RTDSL). The error description message, with its symptoms and disposition, are as follows: ALREADY OPEN A file was OPENed twice without an intervening CLOSE statement - job abort .. BAD READ FOR FORMATTED INPUT An unrecoverable hardware error has invalidated the input data prior to internal conversion - job abort. BAD WRITE FOR FORMATTED OUTPUT An unrecoverable hardware error is detected while outputting a formatted message - job abort. BUFFER SMALLER THAN DATA UNIT The formatted buffer or source data unit is smaller than the decoded target unit during a DECODE or formatted INPUT operation - job abort. The cumulative character position counter of the converted data unit is larger than the literal buffer or target unit on an EN CODE or formatted OUTPUT operation - job abort. E-21 M-5035 Change 3 DATA EXHAUST/END OF TAPE An End of Tape (EOT) mark has been detected on a previous INPUT or OUTPUT operation - job abort. END ITEM SMALLER THAN START ITEM A ranged data element specified by the form «a) ... (b», has an ending item (b) smaller than the starting item (a) - only the starting entry is processed. ILLEGAL FORMAT SPECIFICATION Incompatible structure within the RTDSL's associated with the specified operation - job abort. Data is incompatible with format specification. ILLEGAL INPUT CHARACTERS Input characters for an I, E, and F format contains a character other than a "+", "_", "blank", If. " , or a number 0 through 9 - flush the target data unit with zeros. Number of octal characters (for a 0 format) exceed 21 - flush the target data unit with zeros. LABEL INCORRECT The first record of a tape file doesn't match the specified label during a CHECKID operation - job abort. LOST FILE REFERENCE A file data unit specification wasn't located as the first entry in the parameter list associated with a file operation - job abort. NOT AT LOAD POINT A magnetic tape fUe was not at load point during a CHF;CKID or DEFID operation - job abort. E-22 M-5035 Change 3 NOT OPEN A file operation was requested before the file was OPENed - job abort. NaT OPENED AS INPUT OR SCRATCH A file operation (CHECKID, INPUT, OUTPUT) was requested before the user-defined file was OPENed as an input or scratch file - job abort. NO AVAILABLE TAPES No available tape units remaining. NOT OPENED AS OUTPUT OR SCRATCH A file operation (DEFID, ENDFIL) was requested before the user-defined file was OPENed as an output or scratch file - job abort. OUTSIDE TAPE PHYSICAL FILE An End of Tape (EOT) mark was detected while positioning a file - job abort. OUTSIDE FILE BOUNDARY A file operation (INPUT, POS) was requested which either exceeds the number of records declared for that file or an EOT mark was detected job abort. OUTPUT NUMBER TOO LARGE Number of converted characters exceeds the width specified by the format descriptor - flush the formatted target data unit with an ASCII character (*). PROGRAM TERMINATED BY RUN TIME 10 Job abort message. E-23 lM-5035 Change 3 UNRECOVERABLE HARDWARE ERROR The monitor has detected an Unreco'verable Hardware Error (UHE). For a current unformatted INPUT or OUTPUT statement, processing will continue as normal with one exception. If a multipl~ read or a multiple write operation occurs as a result of a single INPUT or OUTPUT statement on a stream file, job abort will be invoked. Job abort will be invoked for all current formatted INPUT and OUTPUT operations, file and record positioning (FIL, POS). **** USER ERROR DISPLAY FLOATING POINT MAGNITUDE E+21 EXCEEDED Display table allows only E+21 characters to be displayed. **** USER ERROR MAGNITUDE E-22 EXCEEDED--TRUNCATION OCCURRED Display table allows only E-22 characters to be .displayed. E-24 M-5035 APPENDIX F SUMMARY OF ASSEMBLER ERROR CODES E 'Error Code Expression errors result from illogical expressions such as a decimal digit within an octal number; element type inconsistent with arithmetic operators; express ion improper in con text such as a GO I ine used outside a MACRO or a DO count in excess of 2 16 _1. D Error Code Duplicate errors result from labels defined more than once with different values. A label used in an expression affecting an address counter is not defined prior to its use resulting in a different addressing sequence in the first and second assembly passes. U Error Code An Undefined error results from a reference made to a label which is nowhere defined in the program. A reference is made to a label which was not externalized properly by a (A.+l )'" Y II X X 02 5 SSUM a,y,b,s STORE SUM (Aa) + (A.+l)-+Y and AI +l : (Aa)i = (Aa )r II X X 02 b SDIF a,y,b,s STORE DIFFERENCE (Aa +I ) - (Aa )'" Y and Aa+l: (Aa) i (Aa)e II X X 02 7 OS a,y,b,s DOUBLE STORE A (Aa+l,A.) 03 0 ROR a,y,b,s REPLACE INCLUSIVE OR (Y) RSC a,y,b,s 03 Y + I, Y II ED (Aa ) ... Y and Aa II X X REPLACE SELECTIVE CLEAR (Y)' O(Aa)"'Y and Aa II X X X 03 2 RMS a,y,b,s REPLACE SELECTIVE SUBSTITUTE For (Aa)n = I'!n"' Y andA.+ l 1I X 03 3 RXOR a,y,b,s REPLACE EXCLUSIVE OR 4 RALP a,y,b,s REPLACE A+ LOGICAL PRODOCT (Y) (Aa )"'Y and Aa II (A + ) + (Y.) 0 (A )'" II a l a Y and Aa+l X 03 X X 03 5 RLP a,y,b,s REPLACE LOGICAL PRODUCT (Y) 0 (A.) -+Y and Aa II X X 03 6 RNLP I,y,b,s REPLACE A- LOGICAL PRODUCT (Aa +}) - (Y) Y and AI+l 0 (Aa) -+ II X X 03 7 TSF y.b, s TEST AND SET FLAG Set i G-l CD; 1 "'Y31 II X M-5035 Processor Instructions Function Codes O~ 0 05 2 05 Mnemonic (Continued) Instruction Delcription Forma t DL a,y,b,s OOUBLE LOAD A (Y + I, Y)· A.+I,A. II DA a,y,b,s DOUBLE ADD A (Y+'1, Y) + (A.+ , A.) • 1 A.+1 , A. II DAN a,y,b,s DOUBLE SlETRACT - (A.+ 1 , A. ) (Y + 1, Y) • II (Y+l,Y); II HPT PI CA A.+1 , A. 05 3 DC a,y,b,s DOUBLE COMPARE (A a +1 , AI) Set CD 05 4 LBMP B,y,b,s LOAD B4SE AND ME.\lORY PROTECTION ! . Sa;!!! 04 SPR a : I 04 II SIR. 19-17; Y + (BO)b SIR. 15-0 Ob 0 Of> FA a,y,b,s FLOATING POINT ADD fAN a,y,b,s FLOAT! NG POI NT SIJBTRACT (A a +1 , Aa) + (Y + I, Y) Aa +1 , Aa (A a +1 , Aa) - (Y + 1, Y) - II II Aa +}, Aa lib 2 FM a,y,b,s FLOATI NG POINT MIJLTI PLY 06 3 FD a,y,b,s FLOATING POINT IJIVIDE Ob 4 FAR a,y,b,s FLUATING POINT ADD WITH ROUND Dt> 5 FA~R B,y,h,s FLOATl NG POI NT SIJBTRACT WlTH ROUND 06 6 FMR B,y,b,s 06 7 FDR 07 0 07 0 (A.+ 1 , Aa) x (Y + I, Y) - II (Y -+ I, Y) - II Aa+l' Aa (A a +I , Aa) + Aa+I' Aa 07 + 1. Y) result II + I, Y) result II FLUATING POINT MULTIPLY WITH ROUND (Aa +I , Aa) x (Y + I, Y) Aa +1 , Aa; r,ound resul t II 8,y.b,s FLOATING POINT OI\iIDE WITH ROUND II X5 sy,b ENTER EX EC I;},} VE 5T ATE (AA+l' Aa) + (Y + I, Y) Aa + 1 , Aa; round result Interr,upt to Executive Entrance Address I PI sy,b (a=1 ) INTERPROCE550R INTERRUPT Allow selective interrupts to other processors II X AEI a,sy,b AI1.0W ENABLE INTERRUPT Enable Interrupt Request for lOG Channel Specified a Disable Interrupt Requelt for IOG Channel Specified a Y lOG a Monitor Clock AD DR , Y=y + eBb) + (5 ) _ lOG S II X II X II X II X X 07 2 PEl a,sy,b PREVENT ENABLE INTERRUPT 07 3 LIM a,sy.b 07 4 IO a.y.b,s LO AD, EN ABLE I OC MON nOR CLOCK INITIATE INPl'T.iOL'TPlJr 07 ~ lR 07 b RP LA J() (A a +1 , Aa) -+ (Y Aa +I , Aa; round (A a+1 , Aa) - (Y Aa+l' Aa; round 04 II I NTERRIiPT RETIJRN Return to Processor St.te designated by D5W II lI,sy,b REPEAT Repeat NI (B7) times Or until telt condition is sati died II B,y,k,b,s LOAD A -Y - G-:! . A X X M-5035 Processor Instructions (Cont 1nued) function Codes Mnemonic Ins true t i O'n Description for- RPT PI CA l1li t 11 LXB a,y,k,b,s LOAD A AND INDEX B X -+Aa i (f\) +l-+f\ 12 LDIF a,y,k,b.s LOAD DIFFERENCE (Y-A) X X 13 ANA B.y.k.b.s ADD NEGATIVE A X X 14 AA a.y.k.b.s ADD A X - (Aa )-+A a +1 (A ) - X-+ Aa a (Aa) + X-+ Aa X X 1;, LSUM a.y.k.b.s LOAD SUM (Y+A) X + (Aa) -+Aa+l X X It» LNA a.y,k.l.J,s LOAD NEGATIVE X' -+Aa X X 17 LM a.y.k.u.s LOAD MAGNITI:OE I xl X X 20 LB a.y.k.b.s LOAD B X X 21 AB a.y.k.u.s ADD B X X 22 ANB a.y.k.b.s SUBTRACT B X X 23 SB a.y.k.b.s STORE B y ... B a (Ba) + -Y-+Ba (B ) - y ... B a a (Ba )"'Y X X X X X -+ Aa (A )-+ Y a (Aa) -+Y; 24 SA a.y.k.u.s STORE A 25 SXB a.y.k.b,s STORE A ANn INDEX B 26 SNA a.y.k,b,s STORE NEGATIVE (A )'-+Y a X X SM a,y,k,b.s STORE MAGNI ruDE \Aal"'Y X X 32 8Z al<.y.b,s CLEAR BIT O-+Y n ; (n = ak) X 33 BS ak,y.b.s SET BIT I"' Yn i (n = ak) X 34 RA a,y,k,b.s REPLACE AUO X + (A.) "'Y and Aa+l X X 3!'i RI a,y.k.b.s REPLACF. INCREMENT X + 1 ... Y and Aa X X 36 RAN a,y.k.b,s REPLACE SUBTRACT X X 37 RD a,y.k.b.s REPLACE DECREMENT X X 40 M a.y.k.L.s MULTIPLY A X - (Aa) ... Yand "a+l X - 1... Y and Aa X x (Aa)-+ Aa+l' Aa X X ·11 0 a.y,k,b,s DI \'1 OF. A (A8+1• Aa) ~ X-+Aa i Remainder ... "a+l X X ·12 BC ak.y,b,s CO~ARE (Y)n: 0: Set CD to equal if (Y) n = 0 and nonequ&l if (¥)n f. (l.(n=ak) X ·13 eXI a,y.k,h,1 CO\1PARE INDEX INCREMF.NT (B ) : X if (B;l) ~ X, a O-+LI. set CLI to OL; if (B ) < y, (Ba) + 1-+ Ba' a set CD to WL X '( 44 C a.y.k.b,s COMPARE CAa) : Xi Set CO X X 45 CL a,y.k.h.s COMPARE L1MITS X X ·16 CM a.y.k.h.s COMPARE MASk.EU (Aa) , (Aa +1) : Xi Set CD (A3+1 ) : (Aa) 0 X; Set CD X X 47 CG 8.r,k.h.s COMPARF GATED IX - X X .,.. ..' BIT TO ZERO (Aa) (~) I: + 1-+~ X (A8 +1 ); Set CD 50 0 JEP a.y.k.b.s If (A + ) 0 (Aa) even, 8 1 jump to 1.; else NI JUMP EVEN PARITY G-3 III M-5035 Processor Instructions Functlon Code, 50 Mnemonic Instruction (Continued) Format Oe.cription 0 (A.) odd, I: else NI JOP .,y,k,b,s JUMP ODD PARITY a.y,k.b,s DOUBLE JUMP A ZERO If (AI +1 , AI) 0 jump to I: else NI III If (A + , AI) ~ 0, I I jump to 1: else NI III jump to 50 2 DJZ 50 3 DJNZ I,y,k,b,s DOUBLE JUMP A NOT ZERO 51 0 JP a,y.k.b,s JUMP A POSY TI VE III It (A&+l) = ~ If (A.) 0, jump to.!; III III e1ae NI 51 51 2 IN a,y,k,b,s JUMP A NEGATIVE If (A ') < 0, jump to X: JZ 8,y.k.b,s JUMP A ZERO If (AI) I else NI = O. jump to !; III If (Aa) ~ 0, jump to !: III else NI 51 3 JNZ I.y.k,b,s JUMP A NOT ZERO else NI 52 0 LBJ a,y.k.b.s LOAD B AND JUMP (P)-+Ba • jump to r III (X-+P) S2 JIIa a,y,k,b.s JUMP B NOT ZERO If (B.) > 0, (B ) - I a -+ B , jump to a else NI III I: = (Bb)+sy 52 2 JS sy,k,b JUMP SY + b ! 52 3 JL y,k,b,s JUMP L(JIJER Jump to S3 0 JNF y,k,b.s JUMP NO OVERFLOW If 00 not set, jump to else NI 53 01 JNE y.k.b.s JUMP NOT EQUAL If CD set ~, jump to X: else NI 53 10 Jor y,k,b,s JUMP OVERFL(JIJ If 00 set, jump to else NI 53 11 JE y,k,b.s JUMP EQUAL ~f CD ,let else NI 53 21 JG y,k,b,s JVMP GREATER THAN If CD set >. jump to else NI 1: III 53 31 JGE y.k.b,s JUMP GREATER THAN OR EQUAL If CO set ~, jump to else NI X; III 53 ~I JLT y.k.b.s JUMP LESS THAN If CD set < , jump to I: III X: III .1: III ! III III Lower =. I: .!; jump to III III III I: III else NI 53 51 JLE y,k,b,s JL'MP LESS THAN OR EQUAL If CD set S , jump to else NI 53 61 JNW y.k. b. s JUMP NOT WITHIN LI MITS If CD set OL. jump to else NI :,:\ 71 JW y.k. b. s JUMP WITHIN LIMITS I f CD aet WL. jump to .I: else NI III 53 2 RJ Y,k, b. 5 RI':TIJRN Jl1MP (P) ... !. III ! + I+P RPT PI CA M-5035 (Continued) Processor Instructions function Cod •• Description Instruction Mn_oni~ ForIIIIt 53 2 RJC 8,y,k,b,s RETURN JUMP CONDITIONAL SEtTING If jump key, 'et, (P) "'X, X + I ..P: ehe NI III 53 2 RJSC 8,y,k,b,s RETURN JUMP, STOP DITJONAL SETT1NG (P)"'y, X + l-+P; it stop key let. stop: else NI a III J3 3 J Y,k, b, 5 JUMP X... P III JC a,y,k,b,s JUMP CONDITIONAL SETTING If j umP a set, Jump to else NI III 1.; X.. P ; if Stop KeY set, a stop; else NI III 53 53 3 ~ 54 CO~- RPT PI CD fD a> fD JSC a,y,k,b,s JUMP, STOP CONDITIONAL SETTING LCT ak,y,b,s UlAD TASK CMR X"CMR X ll' X X X t7:> X X 5;1 LCI ak,y,h,s LOAD INTERRUPT CMR X "'Interrupt CMR 56 SCT ak,y,b,S STORE TASK CMR (CMR) 5i SCI ak.y,b,s STORE INTERRUPT CMR (Interrupt CMR) -+1 STORE TASK CMR IN A (CMR) ... A b (Interrupt CMR) -+ Ab IV-A IV-A X (A ) -+CMR b (A ) . . Interrupt. CMR b Shi ft (Aa) left. end around IV-A 9J IV-A X hO HSCT 60 HSCI af ,b 4 af 4' h STORE INTERRUPT CMR IN A "'1 61 HLCT af 4h LOAD TASK CMR WITH A 61 HLCI af 4b LOAD INTERRUPT CMR WITH A a,m a, b,l a,b,2 SHIFT LEFT CIRCLLARLY a,m a, b,l a,b,2 DOUBLE SHIFT LEFT CIRWLARLY Shift (A&+l' A8 ) left, end around a,m a, b,l a, b,2 SmFT RIGHT FILL ZEROS Shift (A ) right, end off, IV-8 a zero fi 11 on left DOUBLE SIIlF'T RIGHT fiLL ZEROS Shift (A + , Aa) right, a 1 end off, 7.f'TO fill on left IV-B SHIn RtGHT FIl.l. SIGN Shi ft (A ) riqht eond (Iff. J sign fi 11 on left IV-8 Shift (..\ a ... l' Aa) riyht, lIon left IV-B Normal i:re shift IV-.\ A ). ihp. (~ :1'''': . a ' (:ount .... Ab I V-\ HL~ 62 HLC HlC HDL~ 63 HDLe HDLC H~ 64 HRZ HRZ HD~ a,m 65 HDRZ a,b,l a.h.2 IfRS® a,m I10RZ 60 67 70 0 BRS HRS HDRSJ:> HDRS HDRS a,b.2 a,m a, b,l 8.b,:! OOtBLE SHIFT kiGHT FILL nSF a,b SCAlE FACTOR a. b, I SIG~; CA ~ IV-B IV-B end 0:'(. si~tn fi (A,) ; co'.'··· ...... AI) HDSF 70 D[Il;BLI': SCALE F!i.l::rOR a,b ~orllUl shif~ 70 2 HCP :1 COMPL.E~ENT iO ~ HD(P a [)(}!'BI E COMPU.MrNT A 71 0 HOR a,h INCLt:S1VE OR A .\ (1\ Priv11 eI,Jed hUructi on G> Privtlel,Jed in.truction if 208 ~8f4 ~ ~7A C]) if4s8~7. b()H ~ a f 4 c 77 , 8 (;-.1 a+1 . A )' A A a .... "~'l' a _--_ _-- (At!) Ef> ....... __ . M-5035 Processor Instructions (Continued) function Mnemonic Instruction Forllll t De.cription RPT PI Codes 71 HA ',b ADD (SUM) (A.) + (\) 004 A. IV-A 004 A. IV-A 004 A. IV-A 71 2 HAN ',b SUBTRACT (DIFFERINCE) (A.): ('\); Set CD IV-A 74 7 HCB ',b COMPARE B. WITH Bb (B.) :(B ); Set CD IV-A 77 o HSlM ',b STORE I/O MONITOR CLOCk (IOC. Monitor Clock) HSTC ',b STORE REAL-TIME CLOCk (IOC. RTC) ... '\ 77 .004 b 004 '\ IV-A x 1 V- A 77 4 HPI PRE VENT CLASS I I I INTERRUPTS Lock out Cl,sl III Interrupts lV-A x 77 5 HAl ALLOW CLASS III INTERRUPTS Allow Cl,sl III Interrupts lV-A x 77 b HALT STOP PROCE;SOR Stop Processor Oper.tion. IV-A x 77 b HWFI WAIT fOR INTERRUPT Stop referencing lIIelllory until interrupt occurl IV-A x CD G) @ 1=1 Privll1'1ged taltruction if 4 c 8 C Privileged instruetion it b0 s af 4 c 77 8 , 208 c .f4 c 278 8 7. S.. Ut tutructions hIVe three possible forlllltl: f f is Ihift count) ',111 (III I,b,l (shitt count inB ) b ",b,2 (Ihitt eount i n \ ) G-6 CA M-5035 Extension Instructions Function Instruction Memoni c • NO OPERATION (Full Word) STORE ZEROS o ... ! x NO OPERATION (Half Word) (Bo> ... Bo 20 ZB CLEAR B 20 NOOP 23 SZ 3 HNO c =2 IW y,b,s INDIRECT WORD c = 1 IWe y,w,p,b,s INDIRECT WORD CHARACTER c =3 IMCI y,w,p,b,s INDIRECT WORD CHARACTER INCREMENT IWS sy,b INDIRECT WORD, SPECIAL BASE IWB sy,b INDIRECT WORD, SPECIAL INDEX MP r,i,or,ow,ia,ir HK e HAU -WORD Bew y,l BUfFER CONTROL WORD BCWE y, c = 0, bit c 29=0 = 0, bit 29=1 1. k RPT x x x ZA 74 Forllllt o ... A. o ... B. o ... Bo CLEAR A 10 y,k,b,s Description e~STANT BUFfER CONTROL WORD ESI G-7 IV-A PI CA M-5035 Input/Output Controller Ins true tlons Function Mnemonic Instruction OllcrSpUon 10 IB J.y,k,c,m INITIATE INPUT BUFFER ON Cj Ini t1lte input butter on CJ 11 OB j,y,k,c,m INITIATE OOTPt:T BUFFER ON CJ In1th te output butter on Cj 12 FB jfy,k.c,m INITIATE EF BUFFER ON Cj Inlt1lte EF butter on Cj 13 XB j,y,k,c,m INITIATE EI BUFFER = 0) TIB j,c,m TERMINATE INPUT BUFFER TOB j,e,m TERMINATE OUTPUT BUFFER ON Cj Terminate output buffer on Cj TFB j ,c, m TERMINATE EF BUFFER ON Cj Terminate EF butter on Cj TXB j,c,m TERMINATE EI BUFFER ON Cj Terminate EI butter on Cj (k = 1) = 2) = 3) = 0) IMIR j ,c SET INPUT MONITOR INTERRUPT REQUEST ON Cj Set input monitor interrupt request on Cj 15 (k = 1) OMIR j ,c SET OUTPUT MONITOR INTERRUPT REQUEST ON Cj Set output monitor interrupt request on Cj 15 (k = 2) FMIR j.c SET EF MONITOR INTERRUPT REQ:JEST ON Cj Set EF monitor on ·Cj IS (k = 3) XMIR j.c SET EI MONITOR INTERRUPT REQUEST ON Cj Set Ell monitor interrupt reque.t on Cj 16 (k = O) = }) = 2) = 3) =O) = 1) AIC j .y, c ACTIVATE INPUT CHAIN ON Cj Aetivate input ehain on Cj AOC j .y.e ACT! VATE OUTPUT CHAIN ON CJ Activate output ehaSn on Cj AFC j.y. c ACT! VATE EF CHAIN ON Cj Aetivate EF chain on Cj AXe j,y.c ACT! VATE £1 CHAIN ON Cj Activate EI ehain on Cj TBZ kj.y TEST BIT CLEARED It (Y)kj TBS kj.y TEST BIT SET If (Y}kj '" 0, skip; else NI 20 JIO y,e JUMP (INPUT/OUTPUT) Y.... Chain Pointer 22 LICM kj.y,e LOAD IOC CONTROL MEMORY (Y} .... IOC Control Memory address kj 23 ILTC y.c LOAD REAL-TIME CLOCK (Y} .... RTC 24 SICM kj ,y.e STORE IOC CONTROL MEMORY (lOC Control llemorY\j ... Y 25 IDS kj.y.e SET BIT 1.... Ykj 26 IBZ kj.y.e CLEAR BIT O.... Ykj 27 ITSF 1 fC TEST AND SET FLAG clear~A: 14 (k 1-1 lk 14 (k 14 (k 15 16 (k 16 (Il 16 (Il 17 (m 17 (m G-8 ~ Cj ~ Initiate EI butter on Cj Cj Terminate output butter on Cj = 0, Int~rrupt reque.t skip; else NI I .... Y • if (Y}~l .a. originally .kip; Ie NI M-5035 Change ii APPENDIX II CMS-2 SYSTEM TAPE DUPLICATION Addition~l copies of the CMS-2 system tape may be m~de by the followin~l: Form~t $.10B $SYSMAKER I ENDSYSBD $END.I0B input name, output namp .Explanation input name One to eight character name of the system tapp be copied. to To copy the system tape that is curn'ntly running, code the name CMS2SYST or leave this fif'ld blank. output name One to eight character copy is to be written. n~me of the tape on which thf' If this field is not Slwcifipd, the copy will be written on a tape Example "JIGS I I I II I I I I I I ~fN,D,l,OIBI , I I , ,., I , This would duplicate the system tape IN on to tape OUT H-l/H-2 Blank nam~d NEWC0PTP. M-5035 Change 2 APPENDIX I SYSTEM MODIFICATION INTRODUCTION 1.1 There are two basic methods of modifying the CMS-2. -bil Sf'1 fi(~ld. The op<'raLion is allowed if the bit is s('I. Bi t Numbpr ~ 4 :~ 2 1 Type I on ow fA IH IR = 1 - Allows the use of interrupt index and base registers in indirect nctctressing~ IA 1-15 =1 - Allows indirect actdressinu. M-5035 Change 2 ow = 1 - Allows operand writing. OR = 1 - Allows operand reading. I = 1 - Allows instruction execution. NOTE If the memory protection code is not specified (default mode), the SYSMAKER inserts a code of 36 for type 2 or4 records (instruction records) or a code of 16 for type I or 3 records (data records)o A 1 indicates that the corresponding record has no initial length. The SYSMAKER puts no data on tape. The record name appears in the segment directory; and when the segment requests the Monitor to expand the record, the record is given space in memory (if dynamic). Length I .2.1.4 Loader Ini tiate Card The loader initiate card commands the SYSMAKER to transfer control to the Object Code Loader (described in Volume I, Section 3 of the User's Reference Manual). The cards following the Loader initiate card are inputs to the Object Code Loader until an END card appears. Then the Loader returns control to the SYSMAKER. Format LOAD counter release code Explanation Counter Release Code A code that informs the SYSMAKER whether or not the SYSMAKER is to use previously derived data during the current processing and whether or not the SYSMAKER is to save the data (such as bound data or linkage tables) as follows: Blank - Compute new tables as required and discard when finished. 1-16 M-5035 Change 2 - Sflve load information for npxl loader command. :.! - Use }o;ld information generatpd by previous IOlldnr processing llnd s;)\'(' currenl lOlld informal ion for 111'\.1 loader command. :\ - Use load information <]enpral!'d hy pn'violls loader pr()r,f!Ssjn~1 nnd di scant when f ini shed. NOTE Wh e n II :2 0 r :3 j sus ed nolo;) de r directives or END card follow o I 1.2.1.5 Example Build or Insert Requests Loader directives May have an object deck 1-17 M-5035 Change 2 Loader dirp.ctives May have an object deck Loader directives May have an object deck l:::::~:S:y :S:a:D: \ : : : : : : : : : l ::: I : : : : : \ : : : : : : : : : l :: The last card indicates the end of input to the SYSMAKER (see paragraph I.2.~). The above (!xample cffeetjvely adds a new r.omponent (number 0) behind component S to the system on tafH~ SYS0:36 and placp.s the new system on lapp. SY~~\7. The new componpnL consisls of three segments. 1-180 M-5035 Change 2 Loader direcl ives May have an object t1pck I :: :::~:S~ :':9:1: : : : ::: : : J : : : : : : : : : : : : : : : The last. card indicates the end of input 10 the SYSMAKER. examp Ie cffec t i ve ly adds a new segmen t (number t}) : : : : : : i:: The above to componen t n on t (1(lP SYS~J7 and places the new system on tape SYS0:JO. I.2.2 R(~plllCP Funetion Thp r<~place function is the process which replnces old spuments with ones. The new f(~cords of' tlte sevmf~nt nt'\\' retain all old tiirf'ctory infornl lank when the routine is to move the componl'nt con t a i n i n9 1. he s (~g me n t position. If the Asg Name eomp s t () a new r e III I i v(.\ t.his field contains data, £los field must be b'lank. An up to fOllr character name or version the routin(' assigns to the np\\! tape. name appears in the second word of the res i den t tHrec tory. 1-23 This M-5035 Change 2 The up to eight chari1cl('r nflme of ttw input Input Tape t.ape thilt the SYSMAKER is to use in the console messag('s. If this fi{'ld is blilnk, the routine will use th(~ current system tape. ~Ion The nbsolute oelal Loc of Ih(' ~lonilor nddr{'~s of Ull' sli1rl. b()olslfi1P load an'a. The current. Monitor is alwi1Ys boot('eI inlo the upper aren of memory. This valU(~t hen specifies the bottom of the resident ~lonitor load area and the top address available to the non-resilient If this fipld is blank, the assumes address routin(~s. rou1.in(~ o. NOTE The SySMAKER uses the output tape, assign name, input tape, and Monitor octal load data on the first card processe,d after the $SYSMAKER card. The rputine ignores these fields on subsequent cards; therefore, these fields may be left blank. Examples Move component number 5 to a position just behind component number 8. Notice lhal fields Seg No. and Seg Pos are blank on this card as they mus t be for a move componen I ~~ommand. Move segment 3 of componc'n! () !o () position just hehind number~. s(~gmcnt. Noticp that field Comp Pos is blank on this card as it must. be for a move s('gmcnt. command. 1-24 M-5035 Change 5 I.2.tl The Delet.e Function dl~h~te funct ion prcv(\nl s specified (',omponents or segments from appearing on !.he new system tape; thus, deleting t.hem from th(~ neW systpm. The SYSMAKER, after processing an initiate delete card, removes all directory references to the specified component or segment. An initiate delete commands thp routine eit.her to remove an entire component or to remove one segmen t of a componl~n I • Format DELETE output tape, comp no., seg no., asg name, input tape, mon loc, resdir offset, asg 2 name. Explanation Output Tape The up to eight character name of the output system tape the SYSMAKER is to use in the console messages. If this field is blank, the routine assumes the name NEWSYSTP. Comp No. The number assigned to the component that the SYSMAKER is to delete from the new system or the number of the component containing the segment that the SYSMAKER is to delete from the new system. Seg No. The number of the segment within the component specified by the Comp No. field the SYSMAKER is to delete from the new system. If this field is blank, the routine deletes the entire component specified by the Camp No. field. Asg Name An up to four character name or version the routine assigns to the new tape. This name appears in the second word of the resident directory. 1-25 I M-5035 Change 2 The up to eight character name of the input. t.ape the SYSMAKER is to use in Input Tape the console messages. If this field is blank, the routine will use the current syst.em tape. The absolute oclal address of the start of the Monitor bootstrap load area. The current Monitor is always booted into the Mon Loc upper area of memory. This valu~ then specifies the bottom of the resident Monitor load area and the top address available to the non-resident routines. If this field is blank, the routine assumes address O. Resd i r Offset The offset from the beginning of the boot block (first jump cell) to the first address of the resident directory. If this field is blank, the input system tape offset will be assumed. Asg 2 Name A name or version, up to eight characters, which the routine assigns to the new tape. This name appears in the fourth and fifth words of the resident directory. The two assigned names are output upon completion of each job in the accounting summary. NOTE The SYSMAKER uses the output tape, assign name, input tape, resdir offset, and Monitor octal load point on the first 'card processed after the $SYSMAKER card. The rotitine ignores these fields on subspquent cards; therefore, these fields may be left blank. 1-26 M-5035 Change 2 I .2.5 End of Input The SYSMAKER continues to buiJd a scratch tape containing all of the changes to the old system required to produce the new system until the routine processes an end of input card. The routine then copies the rest of the input tape onto the scratch and uses the accumulated change data to produce the new system. Format ENDSYSBD 1.2.6 System Tape Patching The System Tape Patching routine reads system patch statement cards (see paragraph 1.2.8), processes system patch cards, and outputs a new system tape with all patches inserted. After the SYSMAKER reads the initiate patch card control is given to the System Tape Patching routine. This routine is independent of the other four SYSMAKER functions and cannot be used concurrently with them. Upon initiation of this routine, patch cards are read until a $ card is read. The patch information is stored during the reading phase. In the next phase, the System Tape Patching routine copies from the input tape, inserts the patches, and copies onto the scratch tape. In the final phase, this routine inserts the new resident directory into the Monitor while copying from the scratch tape to the output tape. The following control card initiates this routine: Format PATCH input tape, output tape Explanation Input Tape Up to eight-character name of the input tape the SYSMAKER is to use in console messages. If this field is left blank, the routine assumes the current system tape. 1-27· M-5035 Change 2 Output Tape Up to eight-character name of the system output 1.ape 1.he SYSMAKER is to use in con- sole messages. If this field is blank, the routine assumes the name NEWPATTP. Asg Name An up to eight character name or version the routine assigns to the new tape. This name appears in the second and third words of the resirlcnt directory. Resdir Offset The offset from the beginning of the boot block (first jump cell) to the first address of the resident directory. If this field is blank, the input system tape offset will Asg 2 Name be assumed. A name or version up to eight characters which the routine assigns to the new tape. This name appears in the fourth and fifth words of the resident directory. The two assigned names are output upon completion of each job in the accounting summary. Mon Loe The absolute octal address of the start of the Monitor bootstrap load area. The current Monitor is always booted into the upper area of memory. This value then specifies the bottom of the resident Monitor load area and the top address a va i I a hIe ton 0 n - re sid e nt ro uti ne s . If this field is hlank, the routine assumes address O. M-5035 Change 2 1.2.7 Copying System Tape The SYSMAKER duplicates a system tape when by an ENUSYSBD card. th(~ $SYSMAKER control is followed The operation reads from an input system tape and writes on an output tape. Format ENDSYSBD Input Tape, Output Tape Explanation The up to eight character name of the input tape Input Tape the SYSMAKER is to use in the console messages. If this field is blank, the routine will use the current system tape. Output Tape The up to eight character n~me of the new copy of the system tape that the SYSMAKER is to use in the console messages. If this field is blank, the routine assumes the name NEWCOPTP. The SYSMAKER requests a scratch tape during the initialization phase and releases the scratch tape during the copy function. The operator may assign the output tape to the previously assigned scratch tape. names must be declared for multiple copies in one job. comparison of the input tape and output tape can be made Different output A word-by-word vi~ the peripheral utilities compare function. 1.2.8 System Patch The sys1(~m patch control card calls the system patch stat(~ment processor to process sJstem patch statements that fOllow the specify corrcction(s). corrected. syst~m program A patch statement must precede the Ioauof tht~ program l)(~ing 1-29 M-S035 Change 2 Format $SPATCH Patch statement cards following the system patch control canl conlain the actual data. The statement processor modifies the specified component. pach time it is loaded into memory. Commas are used to separate all parameters. Spaces may be used to separate func1ional parts of a patch. Any number of consecutive spaces may surround 1:.0 comma. No more than one starting location may be specified on one system patch statement. Forma t component, location, type, patch, patch ••• Each successiv(~ patch affects successive memory locations. Explanation Component A decimal number specifying one of the system components on the system tape. Location A location specified by a system record name (compound section name in a component of up to eight characters) followed by an optional octal or decimal increment, where a decimal value is fOllowed by a D. This parameter specifies a starting location for a half-word or more of patch information. Type The patch statement type is as follows: I - Instruction K - I/O Controller command o - Octal (a signed number consisting of up to eleven octal digits). C - Variable length Hollerith character string converted to ASCII. If the length of this character string is not a multiple of four characters, the last patched word will be filled on the right with space codes. 1-30 M-5035 Change 5 Patch Informa tion in a format determined by the patch type. Patch type formats include the following: 1. Central Processor Instruction (1) The patch processor interprets the function code (FF) to determine the proper form at. The patch processor considers all function codes legal. Non -assigned function codes 00 and 04 are treated as format n instructions, and non- assigned function codes 72, 73, and 75 are tre ated as form at IV A instructions. As shown below, all full length instructions consist of octal digits. The first six digits are interpreted as FFAKm, FFAF 2BI, or FFAF 3BI, as applicable. The lower digits form SYYYYY. If there are less than twelve digits, the left six digits form the upper half of the word. The remaining digits form the S, Y, and SY fields, right-justified. Half-word instructions consist of six digits for each half-word. If only six digits are specified, the patch processor places the instruction in the upper half and all zeros in the lower half (a no-op). 1-31 I M-5035 Change 2 The fo]]owin~J hnrdwClrt~ list shows formats and the c,orresponding cod i ng seq ue nc'(~ : HClrdwarp Format Coding SeqlH'neC I FFAKBISYYYYY I I FF AF2 BI SYYYYY III FFAF KBISYYYYY 3 F~lK is codpd as one octal digit IVA FFAF4Bl IVB FF AF_~lM (F ,.. ;) J - ° U) FFAF_RBI ;) F_H ;) = /1 Shift count in Bb F R = (, J Shi ft count in Ah • o 2. I/O Controller Commands (K) I/O Controller Commands arc coded in one of two formats: Hardware Format Cal1inq Seqw!ncp I (FF ::.: 10-1(d FFKJJ~lC YYYYYY I I (FF = 17-20, FFKJMC YYYYYY 22-27 ) Any function code (FF) not in range 10 to 20, ~2 to ~7 shall be interpreted as a format I IOC command. 1-32 th{~ M-S035 Change 2 ~l. Oe tal (0) The patch statement processor ar.Cf!pl s a If!ading plus or minus sign followed by as many as cleven or.tal dig its • A val i doc t a I n umbe r b.eg i n- ning wi I.h an octal digi t i s s I Oft'd as codpd. si~ln A leading minus causes thf! number following it complcm"nt(~d 10 hI" (sevens complempnl) before s l.orage. I f fewer than th(~ eleven octal digits are coded. resultant value is righ1.-justifi('d within the word (before complementin~ if precedpIl by a minus sign). 4. Character ef) Thl' pat ch s tat emf'n t processor accepts chnracter strings contnining graphic ASC1I characters coded as follows: (C C .0.Cn) Wh,'relhp desired variable' j('nlJth character string is ('nclospd in parenlht'ses. Tf it i s des i r cd () spa r t right pnrpnthesis 0 f t h f' St r i n9 , i I is nf'cessary to code two for caeh right par'enthesis wanted. The chararter string terminates wi than odd number of rinht parf'nth('ses. r.onse(~ut iv(' If tht' character string does not r('sult in a numher of characters which is an even multiple of four, thl' Inst word patched is filled on thl! right with ASCII space codes. 1-33 M-5035 Change 2 Exallll'i(!s (system patch cards) : : :: l: :: Change the inst.ruction locnted in word 50 of record C!\RIJSCAN in B component 1 to thp instruction indicated (load A:~ with n vniup of 7:i n '. Change the character- string starting at word ;jUDO of record CARDSCAN in component I to the string indicated. This string occupies five word s. C~ange the instruction located in word 776 of record RALPH in component 1 to the instruction indicated (compare (A4) with a value of 25 ). 0 Because the lower digits describe a constant, nIl six digits nrc not rpI{U ired. Change the instructions located in words 543 and 544 of record INSORT in component 2 to the instructions indicated (half add (A2) + (A3) and complement (A4) instructions in word 543 with a square root (AS) instruction followed by all zeros in word 544). The patch processor ignores the space between the two half-word instructions listed for word 543. 1-34 M-5035 Change 5 I. 2. 9 User Segment Addition and Execution User segments can be added to the utili ties component of the system tape and subsequentlyexecuted. A typical SYSMAKER run to add a utility segment might appear as follows: $JOB $SYSMAKER BUILD NEWTAPE, 3, XXLYY"OLDTAPE,115000 SEG 2 REC DATAREC, U, 2, 36 CRECINSTREC, 1,2,36 LOAD DATAREC (1),· SYSDD1, SYSDD2 INSTREC (4), SYSPROC1, SYSPROC2 LIBS CCOMN(REELNUM) SEL-ELEM END ENDSYSBD $ENDJOB The user's program is contained in records DATAREC and INSTREC. The five statements after LOAD are loader commands discussed in Section 3. The first two statements after LOAD are combine elements commands for the loader. To execute the added segment, the following sequence of operations may ~ used: $JOB $UTILITY EXECUTE 2 $ENDJOB Segment 2 is accessed in the execute with no return mode. utility commands may not follow the EXECUTE command. Therefore, further The user added segment is operating in the sytem mode,not the user mode, with all system facilities (such as those XS ·calls not available to a user program) available for use. 1-35/1-36 (Blank) M-5035 Change 5 CMS-2 KEYWORD INDEX ADS , 11-9-3 BASE, 11-7-4, 11-7-17 ABS Directive, 11-11-21 BASE Directive, 1-3A-3 ABS Modifier, 11-5-10 BC Directive, I-3-1B Accessing the Compiler, 11-7-1 BEGIN Block, 11-5-60 AC Directive, 1-3-12 BIT Modifier, 11-5-10 ACKN, 1-2-30, 1-2-31 BKFILSKP, 1-5-6 Active State Register, 11-12-9 BKRECSKP, 1-5-7 Address Counter, II-II-55 Blocks, I I - 5 - 59 Address Counter Declaration, II-II-53 Boolean Assignment Statement, 11-5-33 Allocated Map Listing, 1-3-36 Boolean Expressions, 11-5-6 Allocation Header Statements, 11-7-124 BOOTWRT, 1-5-14 BP Register, 11-12-5 AN/UYK-20 Loader, I-3A-1 B Register, 11-12-3 A Register, 11-12-3 BYTE, I I - 9 - 3 Arithmetic Assignment Statemen t, I I - 5 - 27 BYTE Directive, 11-11-21 Arithmetic Expressions, 11-5-1 CARD - I D, I I - 9 - 2 Arithmetic CARDTAPE, 1-5-12 Operators~ 11-11-64 Asseinb1er, I-1-B, II-1-B, _11-11-1 Card-to-Tape, 1-5-22 Assembler Diagnostics, 11-11-76 CHAR, I I - 9 - 3 Assembler Outputs, 11-11-72 CHAR Directive, 11-11-22 Assembly Errors, 11-11-76 CHAR Modifier, 11-5-12 AUTO-DD Declarative, 11-4-1, 11-4-7 Character Strings, 11-9-B, 11-11-60 K-1 I M-S035 Change 5 CMS-2 KEYWORD INDEX (contd) CHECKID, 11-6-35 CONVERT, 1-5-15 11-6-26 CORAD Modifier, 11-5-14 CMODE, 11-7-4, 11-7-32 CORRECT, 11-7-4, 11-7-25 CNT Modifier, 11-5-13 CPMCR Register, 11-12-5 Combine Elements, 1-3-9 Cross Reference Listing, 11-11-76 Commands Available, 1-6-9 CS Directive, 1-3-14, 1-3A-2 COMMENTS, 11-11-7 CSWITCH, 11-7-4 COMPARE, 1-5-19 CSWITCH Brackets, 11-7-30A Compare Tape, 1-5-24 CSWITCH Declarations, 11-7-30 Compiler, 1-1-7, 11-1-7 CSWITCH-DEL, 11-7-30B Compiler Error Summary, 11-10-12 CSWITCH Deletion, 11-7-30B Compiler Outputs, 11-10-1 CSWITCH-OFF, 11-7-4, 11-7-30 Compile-Time System Facilities, 11-7-1 CSWITCH~ON, CLOSE~ 11-7-4, 11-7-30 Data Declarations, 11-4-14 Complex Macros, 11-11-52 11-4-35 FIELD, 11-4-25 ITEM-AREA, 11-4-30 LIKE-TABLE, 11-4-34 SUB-TABLE, 11-4-31 TABLE, 11-4-19 VRaL, I I - 4 - 1 5 ~ND-TABLE, Compound Decision Statements, 11-5-1 Computer Instruction Repertoire, 11-12-26 Conditional Operators, 11-11-67 DATA Declarative, 11-4-61 Console Message Output, 1-1-9, 1-2-63 Data Expressions, 11-9-9 Constants, 11-9-6, II-II-59 Data Modes, II-II-58 Control Dec1aratives, 11-4-62 DATA, I I - 4 - 61 MODE, I 1- 4 - 63 DATAPOOL, 11-7-4, 11-7-18 Data Referencing, 11-4-44 Control Statements, 11-5-41 Data Words, 11-11-59 K-2 M-5035 Change 5 CMS-2 KEYWORD INDEX (contd) DEBUG, 11-7-4, 11-7-29 Direct Code, 11-9-1 ABS, I 1- 9 - 3 BYTE, I 1- 9 - 3 CARD - I D, I I - 9 - 2 CHAR, . I I - 9 - 3 DO, I 1- 9 - 4 FORM, I 1- 9 - 4 RES, I 1- 9 - 4 Debugging Aid Cards, 1-2-7, 1-2-18, 1-2-60 Memory Dump Card ($DUMP), 1-2-18 Patch Card ($PATCH), 1-2-26 Snap Card ($SNAP), 1-2-21 Direct Constant Entries, 11-9-11 Debug Statements, 11-8-1 Directives, 11-11-8, 11-11-21 Dl SPLAY, I 1- 8 - 2 PTRACE, I 1- 8 -11 RANGE, I I - 8 - 7 SNAP, I I - 8 - 5 TRACE, I I - 8 -" 9 ABS, 11-11-21 BYTE, I I - 11 - 21 CHAR, I I - 11 - 2 2 DO, I I - 11 - 2 3 ELIST, 11-11-32 EMBED, I I -11- 25 END, I I -11 - 26 EQU, II-11-26A EVEN, I I -11 - 26 B FORM, 11-11-27 LCR, 11-11-28 LIB, II - 11 - 29 L I BS, I I -11- 29 LINK, 11-11-31 LIST, 11-11-32 LIT, 11-11-32 LLT, 11-11-34 NOLIST, 11-11-32 ODD, II-11-26B PXL, 11-11-34 RES, II~11-35 RF$, 11-11-35 SEGEND, 11-11-36 SETADR, 11-11-37 WRD, I I ... 11 - 38 Decimal Numbers, 11-9-6, II-II-56 Decision Statements, 11-5-45, 11-5-50, 11-5-54, 1~-5-55, 11-5-58 Declarative Statements, 11-2-2 DECODE Statememt, 11-6-15 DEFID, 11-6-33 DENSE, I 1-4 - 39 DEP, 11-7-4, 11-7-25 Device Identification Operations , 11-6-33 , 11-6-35 . CHECKID, 11-6-35 DEFID, 11-6-33 DISMOUNT, 1-5-5 Device Positioning, 11-6-28 Dismount Tape Message, 1-5-22 Device State Checking, 11-6-26 DISPLAY, 1-2-61 K-3 M-5035 Change 5 CMS-2 KEYWORD INDEX (contd) DISPLAY Statement, 11-8-2 END-HEAD, 11-7-3 DO, I 1- 9 - 4 END-HEAD 11-4-3 DO Directive, 11-11-23 11-4-1, END-LOC-DD Declarative,II-4-1, 11-4-7 Double Procedure Switch Declarative, 11-4-56 DP Register 11-12-6 END-PROC Declarative, 11-4-1, 11-4-8 DSW Register ASR, 11-12-6 END Statement, 11-5-60, 11-5-67 DSW Register ISC, 11-12-6 END-SYS-DD Declarative, 11-4-1, 11-4-4 DUPLICATE, 1-5-10 Duplicate (D),11-11-72 END-SYS-PROC Declarative, 11-4-1, 11-4-13 Duplicate Tape, 1-5-22 END-SYSTEM Declarative, 11-4-1, 11-4-14 Dynamic Statements, 11-2-2, 11-5-1 I Dec1arative~ END-TABLE Declarative, 11-4-35 ELSE Statement, 11-5-56 END VARY Statement, 11-5-67 ELIST Directive, 11-11-32 EP Directive, 1-3-17 EMBED Directive, 11-11-25 EQUALS. , 11-7-4 , 11-7-19 ENCODE Statement, 11-6-15 EQU Directive, 11-11-26A END, 1-3-11, 11-11-39 Error Codes, 11-11-72 END-AUTO-DD Declarative, 11-4-1, 11-4-8 ' ESI Mode, 11-12-17 EVEN Directive, 11-11-26B END-CSWITCH, 11-7-4 EX~HANGE, END-CSWITCHS, 11-7-4 11-7-4, 11-7-28 EXEC Function, 11-5-22 END Directive, 11-11-26 EXECUTIVE, 11-1-4, 11-7-31 ENDFILE, 11-6-24 Expression (E), 11-11-72 END-FUNCTION Declarative, 11-4-1, 11-4-11 Expressions, 11-5-2, 11-11-11 K-4 M-5035 Change 5 CMS-2 KEYWORD INDEX (contd) Expression Statements, 11-11-54 Format IV-A, 11-12-14 EXTDEF Linkage, 11-4-65 Format IV-B, 11-12-14 Externalizing Labels, II-II-SO FORMAT Statement, 11-6-8 EXTREF Linkage, 11-4-66 FORM Directive, 11-11-27 Field, 11-4-47, 11-11-5 Full-word, 11-11-11 FIELD Declarative, 11-4-25 Function Call, 11-5-18 FILE, 11-6-20 EXEC, 11-5-22 RETURN, 11-5-19 File and Record Position Determination, 11-6-31 File Search FUNCTION Declarative, 11-4-1, 11-4-11 Operation, 11-6-35 Functional Modifiers, 11-5-9 SEARCH, 11-6-36 ABS, II - 5 -10 BIT, 11-5-10 CHAR, I I - 5 - 12 CNT, 1 1 - 5 - 13 CO RAD, I 1 - 5 - 14 FIL, 11-5-14 LENGTH, I I - 5 -15 POS, I 1- 5 -15 FIL Modifier, 11-5-14 FILSKP, 1- 5 - 6 FIND Statement, 11-5-48 Fixed.Point Number, II-II-58 I Floating Point (F), 11-11-74 Generation Formats, 11-11-74 Floating-Point Numbers, 11-9-7, II-II-57 Global Cross-Reference Listings, 11-10-5 FOR Block, 11-5-72, 11-5-77 GO, I I - 11 - 4 7 FOR Statement, 11-5-73 GOTO Statement Name, FORCE, 1-3-6A GOTO Switch Name Statement, 11-5-42 FORM, 11-9-4 Format I, 11-12-12 Format II, 11-12-13 Format III, 11-12-13 1I-5~41 Half-word, 11-11-11 HALT, 1-5 - 3 Hardcopy Output, 1-1-9, 1-2-37 K-5 M-5035 Change 5 CMS-2 KEYWORD INDEX (contd) HEAD, I I - 7 - 3 Instruction Expressions, 11-9-13 HEAD Declarative, 11-4-1, 11-4-2 Instruction Formats, 11-12-12 Instruction (I), 11-11-73 ICW Register, 11-12-5 Instruction Repertoire, 11-12-1 ID Directive, 1-3-17 Interrupt, 1-2-7 Index Clause 11-5-64 Interrupt State, .11-12-8 Index Procedure Switch Declarative, 11-4-55 I/O Command Formats, 11-12-16 Index Switch Declarative, 11-4-50 Indirect Word, I/O Device Card, 1-2-12 I tern, I I - 4 - 4 5 II-12~15 Item-Area, 11-4-49 Initial A-Register Values ($AREG), 1- 2 -16 ITEM-AREA Declarative, 11-4-30 Initial B-Register Values ( $BRE G), I ~ 2 - 16 Item Procedure Switch Declarative, 11-4-58 Initial Condition Cards, 1-2-16 Item Switch Declarative, 11~4-53 Item-to-Item Statement, 11-5-36 Initial Hardware Setup, 1-6-1 Job Definition Cards, 1-2-9 Initiate Execution Cards, 1-2-17 End Qf Input Card ($EOI) 1-2-12 End of Job Card ($ENDJOB), , 1-2-12 I/O Control Cards ($ASG), I/O Device Card, 1-2-12 Job Limits Card ($JOB), 1-2-10 Sequence Card ($SEQ) , 1-2-9 Jump Key Set Card ($KEYSET), I-2~17 Transfer Control Card ($TRA) , 1-2-18 User Program Call Card ($CALL), 1-2-17 Input/Output Statements, 11-6-1 LABEL, I I -11- 2 Label Field, 11-11-15 INPUT Statement, 11-6-4 Labels, 11-11-16, 11-11-55 K-6 M-5035 Change 5 CMS-2 KEYWORD INDEX (contd) LC~ OiTe~tjve, 11-11-28 List Job (/LIST), 1-4-6 Start Corrections (/CORRECT) , 1-4-20 Start Element Corrections (/ELname), 1-4-20 Tape Release (/RELEASE), 1-4-8 Tape Select (/TAPID), 1-4-8 LENGTH Modifier, 11-5-15 Level 0, 11-11-75 Levell, 11-11-75 Level (L), 11-11-74 LIB Directive, 11-11-29 Librarian Error Messages, 1-4-30 Librarian, 1-1-7, 1-4-1, 11-1-7 Librarian Operator Messages, 1-4-32 Librarian Control Cards, 1-4-5 LIBS, 1-3-7, 11-7-4, 11-7-23 Add Element (/ADD) , 1-4-10 Begin Element (/BEGINEL), 1-4-19 Build New Library (/BUILD), 1-4-6 Change Element Name (/CHANGE), 1-4-17 Copy Elements (/COPY) , 1-4-12 Declare Dependent Elements (/DEP) , 1-4-19 Delete Elements (/DEL) , LIBS Directive, 11-11-29 LIKE-TABLE Declarative, 11~4-34 LINK Directive, 11-11-31 Linking, 11-11-12 List Options, 11~7-8 LIST Directive, 11-11-32 LISTING, 11-7-5, 11-7-10 Listing of Labels, 11-11-75 1~4-15 Delete Items (/D), 1-4-22 Edit (/EDIT), 1-4-7 End Corrections (/ENDCOR) , 1-4-20 End Element (/ENDEL) , 1-4-19 End Element Corrections (lEND), 1-4-21 History Entry (/HISTENT), 1-4-9 Insert Items (II), 1-4-21 Librarian Terminate, (/ENDLIB), 1-4-7 LIT Directive, 11-11-32 Literal Assignment Statement, 11-5-31 Literal Expressions, 11-5-8 Literals, 11-9-11, 11-11-58 LLT Directive, 11-11-34 LLT Sample Listing, 11-11-75 Loader Control Cards, 1-3-2, 1-3-6 K-7 I M-5035 Change 5 CMS-2 KEYWORD INDEX (contd) Logical Operators, 11-11-67 Combine Elements, 1-1-9 Element Select (SEL-ELEM), 1-3-8 End (END), 1-3-11 Library Select (LIBS), 1-3-7 Table Size Declaration (TSD) , I-3-7 I Logical Statement, 11-S-46 Loop Statements, II-S-S0A LOPTI0NS, 1-3-6A LR Directive, 1-3-16 Loader Diagnostic Messages, 1-3-32 MACRO, 11-11-39 Loader Directives, 1-3-12 Macros, 11-11-10 Address Counter Directive (AC) , 1-3-12 Binary Code Directive (BC), 1-3-18 Compound Section Directive (CS), 1-3-14 End of Element Directive (EP), 1-3-17 Library Reference Directive (LR), 1-3-16 Program Element Identification Directive (ID), 1-3-17 User Correction Directive (UC) , 1-3-26 Loader ,Options Select, 1-3-6A Macro Reference Lines, II-II-52 Macro Statements, II-11-39 Major and Minor Headers, 11-7-3 BASE, 11-7-4, 11-7-17 CMODE, 11-7-4, 11-7-32 CORRECT, lI-7-4, 11-7-2S CSWITCH, 11-7-4, 11-7-30 DATAPOOL, 11-7-4, lI-7-18' DEBUG, II-7-4, 11-7-29 DEP, 11-7-4, 11-7-2S EQUALS, 11-7-4, 11-7-19 END-HEAD, 11-7-3 EXCHANGE, 11-7-4, 11-7-28 EXECUTIVE, 11-7-4, 11-7-31 HEAD, I I- 7 - 3 LIBS, 11-7-4, 11-7-23 LISTING, 11-7-5, 11~7-10 LOCDDPOOL, 11-7-4, 11-7-14 MEANS, 11-7-4, 11-7-27 MONITOR, 11-7-5, 11-7-11 NITEMS , 11-7-4 , . 11-7-22 OBJECT, 11-7-5, 11-7-7 OPTIONS, 11-7-4, 11-7-S SEL-ELEM, 11-7-4, 11-7-24 SEL-HEAD, II-7-4, 11-7-24 SEL -POOL, 11,-7 - 4, I I -7 - 24 SEL-SYS, 11-7-4, 11-7-24 SOURCE, 1I-7-~,II-7-6 SPILL, 11-7-4, 11-7-32 SYS-INDEX, 11-7-4, 11-7-27 TABLEPOOL, 11-7-4, 11-7-16 LOBJECT, 1-3-6B Local Cross-Reference Listings, 11-10-4 Local Indexes, 11-4-S9 LOC-DD Declarative, 11-4-1, 11-4-6 LOCDDPOOL, 11-7-4, 11-7-14, I LO DGO, I - 3 .. 6 B LOCREF Operator, 11-4-67 K-8 I M- 5035 Change 5 CMS-2 KEYWORD INDEX (contd) No1ist Directive, 11-11-32 MEANS, I1-7-4, II-7-27 MED I UM , 1 I - 4 - 38 NOMAP, 1-3-6A NONE, 11-4-38 Miscellaneous Header Statements, II-7-27 NONRT Option, 11-7-12 Mnemonics, 11-11-20 Nonstandard File Control, II-6-18 CLOSE, II-6-26 ENDFILE, 11-6-24 FILE, 11-6-20 OPEN, 11 - 6 - 24 Mnemonic Listing Format, 11-4-63 MODE Declarative, 11-4-63 MODEVRBL Option, 11-7-12 Normal Mode, 11-12-16 Modes of Operation 11-12-8 OBJECT, 11-7-5, II-7-7 Monitor, 1-1-6, 1-2-1, 11-1-6, lI-7-5, 11-7-11 Object Code Loader, 1-1-6, 1-3-1, 11-1-6 Monitor Control Cards, 1-2-2, 1-2-5, 1-2-8 ODD Directive, I1-11-26 OFF, 11-11-14B Monitor I/O, 1-2-5, 1-2-6 OFO, I I -11-l4B Monitor Loader, 1-2-3 MOUNT, 1-5-4 Octal Numbers, II-9-7, II-II-56 OPEN, 11-6-24 Mount Tape Message, 1-5-21 Operand Field, 11-11-44 Mu1tiword Assignment Statemen t, I 1- 5 - 35 Operation, 1-6-1 NAME, . I I -11- 45 Operation Field, 11-11-19 Name (N), 11-11-73 Operator Communication, I-3-36 Decision Statements, 11-5-58 Operator Communication Cards, 1-2-30 NITEMS, 11-7-4, 11-7-22 Enter Executive State (XS), I-2-32 N~sted NOID, 1-3-6A I K-9 I M-5035 Change 5 CMS-2 KEYWORD INDEX (contd) Hardcopy Message ($REMARK), 1-2-31 Peripheral Utilities, 1-1-7, 1-5-1 Operator Message Ca!ds, 1-5-2 Pooling Statements, 11-7-12A Dismount Tape (DISMOUNT) 1-5-5 Mount Tape (MOUNT), 1-5-4 Operator Acknowledge (HAL T), I - 5 - 3 Operator Information (TYPE), 1- 5 - 3 Positioning by Files, Positioning by Records, 11-6-30 Position Tape Cards, 1-5-5 Rewind (REWIND), 1-5-7 Skip Backward Specified Number of Files (BKFILSKP), 1-5-6 Skip Backward Specified Number of Records (BKRECSKP), 1-5-7 Skip Forward Specified Number of Files (FILSKP), 1-5-6 Skip Forward Specified Number of Records (RECSKP), 1-5-6 Operator Priorities, 11-11-69 Operators, 11-11-61 OPTIONS, 11-7-4 OUTPUT Statement, 11-6-7 Overflow (0), 11-11-73 OVERLAY, 11-4-40 Packing Rules, 11-4-37 DENSE, I 1- 4 - 39 MEDIUM, 11-4-38 NONE, I I - 4 - 38 OVERLAY, 11-4-40 11-6~28 POS Modifier, 11-5-15 P Register, 11-12-2 Procedure Call, 11-5-16 PACK Statement, 11-5-40 PROCEDURE Declarative, 11-4-1, 11-4-8 Paraforms, 11-11-40 Procedure Linking, 11-5-15 PARAMETER, 11-4-18A Procedure Switch Cal1,11-5-23 Parenthetical Grouping, 11-11-70 Processing Conventions, 11-9-15 Parity Decision Statement, 11-5-55 Program Structure Declaratives, 11-4-1 AUTO-DD, 11-4-1, 11-4-7 END-AUTO-DD, 11-4-1, 11-4-8 PAUSE, 1-2-30, 1-2-31 Performing the Bootstrap Load, 1-6-3 K-lO M-5035 Change 5 CMS-2 KEYWORD INDEX (contd) END-FUNCTION, 11-4-1, Record Length Determination, 11-4-11 II-6-32 END-HEAD, 11-4-1, 11-4-3 END-LOC-DD, 11-4-1, II-4-7 RECSKP, 1-5-6 END-PROC, 11-4-1, 11-4-8 END- SYS- DD, 1 1- 4 -1, 1) - 4 - 4 REFORMAT, 1 - 5 -11 END-SYS-PROC, 11-4-1, 11-4-13 ,Reformat Tape 1-5-22 END-SYSTEM, 11-4-1, 11-4-14 FUNCTION, 11-4-1, 11-4-11 Relational Expressions, 11-5-5 HEAD, II-4-1, 11-4-2 LOC-DD, 11-4-1, II-4-6 Re1ocatabi1ity, 11-11-70 PROCEDURE, 11-4-1~ 11-4-8 SYS-DD, 11-4-1, 1I-4-4 Relocation (R), 11-11-73 SYS-PROC, 11-4-1, 11-4-5 SYS-PROC-REN, 11-4-1" Replacement Statements, 11-5-26 11-4-6 SYSTEM, II - 4 -1, 11 - 4 - 2 , RES, 1 I - 9 - 4 Pseudo-operations (MACROS), I-1-8 RES Directive, II-11-35 RESUME Statement, 11-5-66 P-SWITCH Declarative, 11-4-55 RETURN Function, 11-5-19 , PTRACE, 1-2-61 REWIND, 1-5-7 PTRACE Statement 11-8-11 RF$ Directive, 11-11-35 PXL Directive, 11-11-34 I SAVLODGO, 1-3-6B RANGE, 1-2-61 Scaled Decimal Numbers,- 1I-9-9 RANGE Statement, 11-8-7 Search Decision Statement, 1I-5-50 READ, I - 5 - 1 7 SEGEND Directive, 11-11-36 READ/Compare Tape Cards, 1-5-17 Segmentation, 11-11-8 Compare Tapes (COMPARE), 1-5-19 Read into Memory (READ), 1-5-17 SEL-ELEM, 1-3-8, 11-7-4, READ to Cards or Printer (TAPEOUT), 1 ~ 5 -18 SEL-POOL, 1I-7-4, 11-7-24 Read Formatted Tape Record, I-5-23 lI-7~24 SEL-HEAD, 11-7-4, II-7-24 SEL-SYS, 11-7-4, 11-7-24 SETADR Directive, 11-11-37 K-11 M-5035 Change 5 CMS-2 KEYWORD INDEX (contd) SET Statement, 11-5-26 Statements, 11-11-5 SHIFT Statement, 11-5-39 Statement Blocks, 11-5-59 Side-by-Side Listing, 11-11-72 Status Assignment Statement, 11..,5-32 Simple Statement, 11-5-1 STQP Statement, 11-5-45 Single Word-to-Mu1tiword Statemen t, I 1- 5 - 36 Subfie1ds, 1 1-11- 5 SIR Registers, 11-12-7 SUB-TABLE Declarative, 11-4-31 SNAP, 1-2-61 SWAP Statement, 11-5-38 SNAP Statement, 11-8-5 SWITCH Declarative, 11-4-50 SOURCE, 11-7-5, 11-7-6 Switch Referencing, 11-4-59 Source Deck Organization, 11-11-79 Symbol Analysis Format, 11-10-6 Symbol Definitions, 11-12-19 Source Listing Format, 11-10-1 Symbolic Conventions, 11-12-17 Special Considerations, 11-11-82 Symbols, 11-11-62 SPILL, 11-7-4, 11-7-32 SYS-DD Declarative, 11-4-1, 11-4-4 SPR Registers, 11-12-6 SYS-INDEX, 11-7-4, 11-7-27 S Register, 11-12-3 SYSMAKER, 1-2-15 Standard Input, 1-1-9, 1-2-33 Standard Output, 1-1-9, 1-2-35 DISPLAY, 1-2-61 PTRACE, 1-2-61 RANGE, 1-2-61 SNAP, I - 2 - 61 Tape Assignment/Release, SYS-PROC Declarative, 11-4-1, 11-4-5 SYS-PROC-REN Declarative, 11-4-1, 11-4-6 System (CMS-2),I-l-3, 1-2-3, 11-1-3 I .., 2 - 3 3, I - 2 -4 9 TRACE, 1-2-61 Type Message ($TYPE), 1-2-30 System Component Call Cards, 1-2-14 Call Assembler ($ASM, U), Type Message PAUSE (ACKN) 1- 2 -15 ($HALT), 1-2-30, 1-2-31 K-12 I M-5035 Change 5 CMS-2 KEYWORD INDEX (contd) Call CMS-2 Compiler ( $CMS - 2), I - 2 - 15 Call Librarian ($LIBEXEC), 1-2-15 Call Peripheral Utility Routines C$UTILITY), 1-2-15 Call Relocatable Object Code Loader ($LOAD), 1-2-15 TRACE Statement, 11-8-9 Transfer Declaratives, II-4-50 Double Procedure Switch, 11-4-56 Index Procedure Switch, 11-4-55 Index Switch, 11-4-50 Item Procedure Switch, 11-4-58 Item Switch, 11-4-53 P-SWITCH, 11-4-55 SWITCH, II -4-50 SYSTEM Declarative, 11-4-1, 11-4-2 System Linkage, 11-4-64, EXTDEF, 11-4-65 EXTREF, 11-4-66 TRANSREF, 11-4-66 TRANSREF Linkage, 11-4-66 Truncation (T), 11-11-73 TSD, 1- 3-7 System Messages, 1-6-14 Tw~-Level System Tape Generator, 11-1-8 Diagnostics, 11-7-12 1~1-8, Table, 11-4-44 TABLE Declarative, 11-4-19 TYPE, 1-5-3 Type Message and Await Response, 1-5-21 Type Operator Messages, 1-5-21 TABLEPOOL, 11-7-4, 11-7-16 Table Search Statement, 11-5-48 Table-to-Table Statement, 11-5-35 TAPEOUT, 1 .. 5-18 I UC Directive, 1-3-26 ULTRA, 1 1 -11 -12 Undefined Labels, 11-11-75 Undefined CU), 11-11-73 UNTIL Clause, 11-5-66 Tape-to-Card or Printer, 1-5-23 User I/O Chains, 1-2-48 Task State, 11-12-8 User Program Execution Cards, 1-2-15 TRA Directive, 1-3A-4 TRACE, 1-2-61 User Routine Execution, 1-5-27 K-13 I I M-5035 Change 5 CMS-2 KEYWORD INDEX (contd) I Utility Control Cards, 1-5-2 XS, 1-2 -32 Validity Statement, 11-5-48 $AREG, 1-2-16 Value Block, 11-5-76 $ASG, 1-2-12 VARY Block, I 1- 5 - 61, I 1- 5 - 6 7 $ASM, U, I - 2 -1 5 VARY Statement, 11-5-62 $BRE G, I - 2 -16 VRBL Declarative, 11-4-15 $CALL, . I - 2 -1 7 Warning, 11-11-75 $CMS-2, 1-2-15 WHILE Clause, 11-5-65 $DUMP, 1-2-18 Whole Table, 11-4-45 $ENDJOB, 1-2-12 WRD Directive, 11-11-38 $EOI, 1-2-12 WRI TE, 1- 5 - 8 $FORTRAN , 1-2-15 Write Formatted Tape Record, 1-5-22 $HALT, 1-2-30, 1-2-31 I $JOB, 1-2-10 Write on Tape Cards, 1-5-8 $KEYSET, 1-2-17 Convert to System Data Card (CONVERT), 1-5-15 Duplicate Tape (DUPLICAT) , 1-5-10 Reformat Tape (REFORMAT), 1-5-11 Write End .of File Mark (WRTFILMK), 1-5-10 Write from Memory (WRITE), 1-5-8 Write in Bootstrap Format (BOOTWRT), 1-5-14, 1-5-23 Write Tape from Cards (CARDTAPE), 1-5-12 WRTFILMK, 1-5-10 $LDUYK-20, 1-2-15, 1-3A-1 I $LIBEXEC, 1-2-15 $LOAD, I - 2 - 15 $PATCH , 1-2-26 $REMARK , 1-2-31 $SEQ, I - 2 -19 $SNAP, 1 - 2 - 21 $SYSMAKER, 1-2-15 $TRA , I - 2 - 18 K-14 I M-S035 Change 5 CMS-2 KEYWORD INDEX (contd) $TY P E , I - 2 - 30 $UT1L1TY, 1-2-15 IADD, 1-4-10 IBEGINEL, 1-4-19 IBUILD, 1-4-6 /CHANGE, 1-4-17 /COPY, 1-4-12 /CORRECT, 1-4-20 /D, 1-4-22 /DEL, 1-4-15 /DEP, 1-4 -19 / ED 1 T, 1 - 4 - 7 /EL name, 1-4-20 / END, I - 4 - 21 /ENDCOR, 1-4-20 /ENDEL, 1-4-19 /ENDLIB, 1-4-7 /H1STENT, 1-4-9 /1, 1-4-21 / LIST, 1 - 4 - 6 /RELEASE, 1-4-8 ITAPID, 1-4-8 ,K-15/K-16 (Blank) •
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.3 Linearized : No XMP Toolkit : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37 Create Date : 2014:02:24 18:44:30-08:00 Modify Date : 2014:02:24 18:14:49-08:00 Metadata Date : 2014:02:24 18:14:49-08:00 Producer : Adobe Acrobat 9.55 Paper Capture Plug-in Format : application/pdf Document ID : uuid:99112020-dfd8-3f4a-b5a9-1b2e93c52811 Instance ID : uuid:885a3520-6858-d142-9bbd-63eef5a3b731 Page Layout : SinglePage Page Mode : UseNone Page Count : 702EXIF Metadata provided by EXIF.tools