Coral 66 Language Reference Manual

Coral 66 Language Reference Manual

Coral 66 Language Reference Manual For mission-critical applications www.xgc.com Coral 66 Language Reference Manual For mission-critical applications Order Number: XGC-C66-1.7-RM-001120 XGC Technology London UK <www.xgc.com> Coral 66 Language Reference Manual: For mission-critical applications by Ministry of Defence Publication date November 2000 © 1970 Crown Copyright © 1999, 2000 XGC Technology Acknowledgments The information in this reference manual is based on the text of the HMSO publication Official Definition of Coral 66, first published in 1970 and reprinted with amendments in 1974. ISBN 0 11 470221 7. This document was prepared using DocBook XML from docbook.org [http://www.docbook.org/]. Contents Preface xi 1 Related Documents xi 2 Reader©s Comments xii 3 Preface to the 1974 Edition xii Chapter 1 Introduction 1 1.1 Special-Purpose Languages 1 1.2 Real Time 2 1.3 Syntax 2 1.4 Implementation 3 Chapter 2 The Coral 66 Program 5 2.1 Objects 5 2.2 Program 6 Chapter 3 Scoping 7 3.1 Block Structure 7 3.2 Clashing of Names 8 v Coral 66 Language Reference Manual 3.3 Globals 9 3.4 Labels 9 3.5 Restrictions Connected with Scoping 9 Chapter 4 Reference to Data 11 4.1 Numeric Types 11 4.2 Simple References 12 4.3 Array References 13 4.4 Packed Data 15 4.4.1 Table Declaration 15 4.4.2 Table-Element Declaration 16 4.4.3 Example of a Table Declaration 19 4.4.4 Reference to Tables and Table Elements 19 4.5 Storage Allocation 20 4.6 Presetting 21 4.6.1 Presetting of Simple References and Arrays 21 4.6.2 Presetting of Tables 23 4.7 Preservation of Values 24 4.8 Overlay Declarations 24 Chapter 5 Place References±Switches 27 Chapter 6 Expressions 29 6.1 Simple Expressions 30 6.1.1 Primaries 31 6.1.2 Word-Logic 35 6.1.3 Evaluation of Expressions 37 6.2 Conditional Expressions 38 6.2.1 Conditions 38 Chapter 7 Statements 41 7.1 Assignments 42 7.2 Goto Statements 43 7.3 Procedure Statements 44 7.4 Answer Statements 45 7.5 Code Statements 45 7.6 Compound Statements 46 7.7 Blocks 46 7.8 Dummy Statements 47 7.9 Conditional Statements 47 7.10 For Statements 48 vi Coral 66 Language Reference Manual 7.10.1 For-elements with STEP 49 7.10.2 For-elements with WHILE 50 Chapter 8 Procedures 51 8.1 Answer Specification 52 8.2 Procedure Heading 52 8.3 Parameter Specification 53 8.3.1 Value Parameters 54 8.3.2 Data Reference Parameters 54 8.3.3 Place Parameters 55 8.3.4 Procedure Parameters 56 8.3.5 Non-Standard Parameter Specification 58 8.4 The Procedure Body 59 Chapter 9 Communicators 61 9.1 COMMON Communicators 61 9.2 LIBRARY Communicators 62 9.3 EXTERNAL Communicators 63 9.4 ABSOLUTE Communicators 63 Chapter 10 Names and Constants 65 10.1 Identifiers 65 10.2 Numbers 66 10.3 Literal Constants 68 10.4 Strings 68 Chapter 11 Text Processing 71 11.1 Comment 71 11.1.1 Comment Sentences 71 11.1.2 Bracketed Comment 71 11.1.3 END Comment 72 11.2 Macro Facility 72 11.2.1 String Replacement 72 11.2.2 Parameters of Macros 73 11.2.3 Nesting of Macros 73 11.2.4 Deletion and Redefinition of Macros 74 11.2.5 Syntax of Comment and Macros 74 Appendix A Syntax Summary 77 vii Coral 66 Language Reference Manual Appendix B List of Language Symbols 97 Appendix C Levels of Implementation 99 Appendix D Implementation-Defined Characteristics 101 D.1 Language Profiles 101 D.1.1 Official Definition Profile 102 D.1.2 The XGC Profile 102 D.1.3 The Custom Profile 103 D.2 Implementation Details 103 Appendix E Format of Code Statements 107 E.1 Format of Code Statements 107 E.2 Constraints for Operands 111 E.2.1 Simple Constraints 111 E.2.2 Multiple Alternative Constraints 115 E.2.3 Constraint Modifier Characters 115 E.2.4 M68000 Constraints 117 Index 119 viii Tables 8.1 Parameters of Procedures 54 D.1 Encoded Type in a Formal Pair 105 ix x Preface This document describes the programming language supported by the XGC family of Coral 66 compilers. The text of this document is based on the 1974 edition of Official Definition of Coral 66, published by HMSO, London. The text includes details of the options and extensions that XGC Coral 66 offers along with additional examples. 1. Related Documents Getting Started with Coral 66, which offers examples and advice for the new user. The Coral 66 User©s Guide, in three volumes, which describes the commands and options used to run the toolset. The XGC Libraries, which documents the library functions available with the XGC compilers. xi Preface 2. Reader©s Comments We welcome any comments and suggestions you have on this and other XGC user manuals. You can send your comments in the following ways: · Internet electronic mail: [email protected] Please include the following information along with your comments: · The full title of the book and the order number. (The order number is printed on the title page of this book.) · The section numbers and page numbers of the information on which you are commenting. · The version of the software that you are using. 3. Preface to the 1974 Edition Coral 66 is a general-purpose programming language based on Algol 60, with some features from Coral 64 and Jovial, and some from Fortran. It was originally designed in 1966 by I. F. Currie and M. Griffiths of the Royal Radar Establishment in response to the need for a compiler on a fixed-point computer in a control environment. In such fields of application, some debasement of high-level language ideals is acceptable if, in return, there is a worthwhile gain in speed of compilation with minimal equipment and in efficiency of object code. The need for a language which takes these requirements into account, even though it may not be fully machine independent, is widely felt in industrial and military work. We have therefore formalized the definition of Coral 66, taking advantage of experience gained in the use of the language. Under the auspices of the Inter-Establishment Committee for Computer Applications, we have had technical advice from staff of the Royal Naval Scientific Service, the Royal Armament Research and Development Establishment, the Royal Radar Establishment, the Defence ADP Training Centre, from serving officers of all three services and from interested sections of industry, to whom all acknowledgments are due. The present definition is an inter-service standard for military programming, and has also been widely adopted for civil purposes in the British control and automation industry. Such civil usage is supported by RRE and the National Computing Centre in Manchester, on behalf of the Department of Industry. The NCC has agreed to provide information xii Preface to the 1974 Edition services and training facilities, and enquiries about Coral 66 for industrial application should be directed to that organization. Royal Radar Establishment P. M. Woodward xiii xiv Chapter 1 Introduction It is virtually impossible to design a standard language such that programs will run with equal efficiency in all types of computer and in any applications. Much of the design of Coral 66 reflects this difficulty. For example, the language permits the use of non-standard code statements for any parts of a program where it may be important to exploit particular hardware facilities. A special feature is scaled fixed-point for use in small fixed-point machines; the floating point facilities of the language can be omitted where hardware limitations make the use of floating-point arithmetic uneconomical. Other features also may be dropped without reducing the power of the language to an unacceptably low standard. Some reduced levels of implementation are suggested in Appendix C, Levels of Implementation [99] to this definition. 1.1. Special-Purpose Languages A clear distinction must be made between general-purpose languages for use by skilled programmers, and more limited languages designed to incorporate the inbuilt assumptions of specialized applications or to make direct computer access practical for the non-specialist user. Coral 66 belongs to the first category. Languages in this class are suitable for writing compilers and interpreters as well as for direct application. 1 Chapter 1. Introduction Special-purpose languages can therefore be implemented by means of software written in Coral 66, backed up as required with suites of specialized macros or procedures. It is largely for this reason that the facilities for using the procedures have been kept as general as possible. The main differences between Coral 66 procedures and those of Algol 60 lie in the replacement of the Algol 60 dynamic name parameter by the more efficient location or reference parameter used in Fortran, and the requirement to declare recursive procedures explicitly as such, again in the interest of object-code efficiency. 1.2. Real Time The theory and structure of programming real-time computer applications has not yet advanced to such a point that a particular choice of language facilities is inevitable. Further, the design of real-time language is handicapped by the lack of agreed standard software interfaces for applications programmers or compiler writers. This does not imply that real-time programs cannot yet be written in a high-level language. The use of Coral 66 in real-time applications implies the presence of a supervisory system for the control of communications, which may have been designed independently of the compiler.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    135 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us