The BCPL Cintsys and Cintpos User Guide by Martin Richards [email protected]

Total Page:16

File Type:pdf, Size:1020Kb

The BCPL Cintsys and Cintpos User Guide by Martin Richards Mr10@Cl.Cam.Ac.Uk The BCPL Cintsys and Cintpos User Guide by Martin Richards [email protected] http://www.cl.cam.ac.uk/users/mr10/ Computer Laboratory University of Cambridge Revision date: Thu 19 Aug 16:16:54 BST 2021 Abstract BCPL is a simple systems programming language with a small fast compiler which is easily ported to new machines. The language was first implemented in 1967 and has been in continuous use since then. It is a typeless and provides machine independent pointer arithmetic allowing a simple way to represent vectors and structures. BCPL functions are recursive and variadic but, like C, do not allow dynamic free variables, and so can be represented by just their entry addresses. There is no built-in garbage collector and all input-output is done using library calls. This document describes both the single threaded BCPL Cintcode System (called Cintsys) and the Cintcode version of the Tripos portable operating system (called Cintpos). It gives a definition of the standard BCPL language including the recently added features such as floating point expressions and constructs involving operators such as <> and op:=. This manual describes an extended version of BCPL that include some of the features of MCPL, mainly concerning the pattern matching used in function definitions. This version can be compiled using the mbcpl command. This manual also describes the standard library and running environment. The native code version of the system based on Sial and the Cintpos portable operating system are also described. Installation instructions are included. Since May 2013, the standard BCPL distribution supports both 32 and 64 bit Cintcode versions. Since August 2014, standard Cintcode BCPL includes floating point constants and operators, and since March 2018 it includes the FLT feature to make it easier to perform floating point calculations. Keywords: Systems programming language, BCPL, Cintcode, Cintpos 2 Contents Preface v 1 The System Overview 1 1.1 A Cintsys Console Session . 1 1.2 A Cintpos Console Session . 7 2 The BCPL Language 13 2.1 Language Overview . 14 2.1.1 Comments . 14 2.1.2 The GET Directive . 15 2.1.3 Conditional Compilation . 15 2.1.4 Section Brackets . 16 2.2 Expressions . 16 2.2.1 Names . 16 2.2.2 Constants . 16 2.2.3 Function Calls . 20 2.2.4 Method Calls . 20 2.2.5 Prefixed Expression Operators . 21 2.2.6 Infixed Expression Operators . 21 2.2.7 Boolean Evaluation . 22 2.2.8 VALOF Expressions . 22 2.2.9 Expression Precedence . 23 2.2.10 Manifest Constant Expressions . 24 2.3 Commands . 24 2.3.1 Assignments . 24 2.3.2 Routine Calls . 25 2.3.3 Conditional Commands . 25 2.3.4 Repetitive Commands . 26 2.3.5 SWITCHON command . 26 2.3.6 Flow of Control . 26 2.3.7 Compound Commands . 27 2.3.8 Blocks . 28 2.4 Declarations . 28 i ii CONTENTS 2.4.1 Labels . 28 2.4.2 Manifest Declarations . 28 2.4.3 Global Declarations . 29 2.4.4 Static Declarations . 29 2.4.5 LET Declarations . 30 2.4.6 Dynamic Free Variables . 32 2.5 Separate Compilation . 32 2.6 The FLT Feature . 34 2.7 The objline1 Feature . 35 3 The Library 37 3.1 Manifest constants . 37 3.2 Global Variables . 48 3.3 Global Functions . 49 3.3.1 Streams . 85 3.3.2 The Filing System . 87 3.4 Random Access . 88 3.5 RAM streams . 88 3.6 Environment Variables . 89 3.7 Coroutine examples . 90 3.7.1 A square wave generator . 90 3.7.2 Hamming's Problem . 91 3.7.3 A Discrete Event Simulator . 93 3.8 The BMP Graphics Library . 99 3.8.1 The Graphics Functions . 100 3.9 The SDL Graphics Library . 103 3.9.1 sdl.h details . 103 3.9.2 Functions defined in sdl.b . 105 3.9.3 sys(Sys sdl,...) calls . 110 3.10 The GL Graphics Library . 113 3.11 The Sound Library . 114 3.11.1 The Sound Constants . 114 3.11.2 The Sound Global Variables . 115 3.11.3 The Sound Functions . 115 3.12 The EXT Library . 115 4 The Command Language 117 4.1 Bootstrapping Cintsys . 117 4.2 Bootstrapping Cintpos . 119 4.2.1 The Cintpos BOOT module . 119 4.2.2 startroot . 120 4.3 Commands . 123 4.4 cli.b and cli init.b . 150 CONTENTS iii 5 Console Input and Output 153 5.1 Cintsys console streams . 153 5.2 Cintpos console streams . 154 5.2.1 Devices . 155 5.2.2 Exclusive Input . 155 5.2.3 Direct access to the screen and keyboard . 156 6 Cintpos Devices 157 6.0.1 The Clock Device . 157 6.0.2 The Keyboard Device . 158 6.0.3 The Screen Device . 158 6.0.4 TCP/IP Devices . 158 7 The Debugger 161 7.1 The Cintsys Debugger . 161 7.2 The Cintpos Debugger . 165 7.3 Debugging Techniques . 166 8 The Design of OCODE 173 8.1 Representation of OCODE . 173 8.2 The OCODE Abstract Machine . 174 8.3 Loading and Storing values . 175 8.4 Field Selection Operators . 176 8.5 Expression Operators . 177 8.6 Functions and Routines . 178 8.7 Control . 180 8.8 Directives . 180 8.9 Discussion . 181 9 The Design of Cintcode 183 9.1 Designing for Compactness . 184 9.1.1 Global Variables . 185 9.1.2 Composite Instructions . 186 9.1.3 Relative Addressing . 186 9.2 The Cintcode Instruction Set . 187 9.2.1 Byte Ordering and Alignment . 187 9.2.2 Loading Values . 189 9.2.3 Indirect Load . 190 9.2.4 Expression Operators . 190 9.2.5 Simple Assignment . 191 9.2.6 Indirect Assignment . 192 9.2.7 Function and Routine Calls . 192 9.2.8 Flow of Control and Relations . 194 iv CONTENTS 9.2.9 Switch Instructions . 194 9.2.10 Miscellaneous . 195 9.2.11 Floating-point Instructions . 197 9.2.12 Select Instructions . 197 9.2.13 Undefined Instructions . 197 9.2.14 Corruption of B . 198 9.2.15 Exceptions . 198 10 The Design of Sial 199 10.1 The Sial Specification . 201 10.2 Compaction of Sial . 213 11 The MC Package 215 11.1 MC Example . 215 11.2 MC Library Functions . 219 11.3 The MC Language . 220 11.4 MC Debugging Aids . 228 11.5 The n-queens Demonstration . 228 12 Installation 233 12.1 Linux Installation . 233 12.2 Command Line Arguments . 237.
Recommended publications
  • The Control of Routine Fish Maneuvers: Connecting Midline Kinematics to Turn Outcomes
    Received: 16 June 2020 | Accepted: 17 June 2020 DOI: 10.1002/jez.2398 RESEARCH PAPER The control of routine fish maneuvers: Connecting midline kinematics to turn outcomes Stephen P. Howe | Henry C. Astley Department of Biology, Biomimicry Research and Innovation Center, University of Akron, Abstract Akron, Ohio Maneuverability is an important factor in determining an animal's ability to navigate Correspondence its environment and succeed in predator–prey interactions. Although fish are cap- Stephen P. Howe, Department of Biology, Biomimicry Research and Innovation Center, able of a wide range of maneuvers, most of the literature has focused on escape University of Akron, 235 Carroll St., Rm D401, maneuvers while less attention has been paid to routine maneuvers, such as those Akron, OH 44325‐3908. Email: [email protected] used for habitat navigation. The quantitative relationships between body deforma- tions and maneuver outcomes (displacement of the center of mass and change in trajectory) are fundamental to understanding how fish control their maneuvers, yet remain unknown in routine maneuvers. We recorded high‐speed video of eight giant danios (Devario aquepinnatus) performing routine and escape maneuvers and quan- tified the deformation of the midline, the heading of the anterior body, and the kinematics of the centroid (a proxy for center of mass). We found that both routine and escape behaviors used qualitatively similar independent body bending events, which we curvature pulses, that propagate from head to tail but show quantitative differences in midline kinematics and turn outcomes. In routine maneuvers, the direction change and acceleration of the fish are influenced by both the magnitude of the bending pulse and by the duration of the pulse, whereas in escape maneuvers, only pulse duration influenced direction change and turn acceleration.
    [Show full text]
  • ACUCOBOL-GT® Version 8.1.3
    User’s Guide ACUCOBOL-GT® Version 8.1.3 Micro Focus 9920 Pacific Heights Blvd San Diego, CA 92121 858.795.1900 © Copyright Micro Focs (IP) LTD. 1998-2010. All rights reserved. Acucorp, ACUCOBOL-GT, Acu4GL, AcuBench, AcuConnect, AcuServer, AcuSQL, AcuXDBC, extend, and “The new face of COBOL” are registered trademarks or registered service marks of Micro Focus. “COBOL Virtual Machine” is a trademark of Micro Focus. Acu4GL is protected by U.S. patent 5,640,550, and AcuXDBC is protected by U.S. patent 5,826,076. Microsoft and Windows are registered trademarks of Microsoft Corporation in the United States and/or other countries. UNIX is a registered trademark of the Open Group in the United States and other countries. Solaris is a trademark of Sun Microsystems, Inc., in the United States and other countries. Other brand and product names are trademarks or registered trademarks of their respective holders. E-01-UG-100501-ACUCOBOL-GT-8.1.3 Contents Chapter 1: Introduction 1.1 ACUCOBOL-GT Documentation ................................................................................... 1-2 1.2 Product Overview ............................................................................................................1-2 1.2.1 Portability and Compatibility ................................................................................ 1-4 1.2.2 Native Instructions................................................................................................. 1-4 1.2.3 The ACUCOBOL-GT Runtime............................................................................
    [Show full text]
  • Rockbox User Manual
    The Rockbox Manual for Sansa Fuze+ rockbox.org October 1, 2013 2 Rockbox http://www.rockbox.org/ Open Source Jukebox Firmware Rockbox and this manual is the collaborative effort of the Rockbox team and its contributors. See the appendix for a complete list of contributors. c 2003-2013 The Rockbox Team and its contributors, c 2004 Christi Alice Scarborough, c 2003 José Maria Garcia-Valdecasas Bernal & Peter Schlenker. Version unknown-131001. Built using pdfLATEX. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sec- tions, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”. The Rockbox manual (version unknown-131001) Sansa Fuze+ Contents 3 Contents 1. Introduction 11 1.1. Welcome..................................... 11 1.2. Getting more help............................... 11 1.3. Naming conventions and marks........................ 12 2. Installation 13 2.1. Before Starting................................. 13 2.2. Installing Rockbox............................... 13 2.2.1. Automated Installation........................ 14 2.2.2. Manual Installation.......................... 15 2.2.3. Bootloader installation from Windows................ 16 2.2.4. Bootloader installation from Mac OS X and Linux......... 17 2.2.5. Finishing the install.......................... 17 2.2.6. Enabling Speech Support (optional)................. 17 2.3. Running Rockbox................................ 18 2.4. Updating Rockbox............................... 18 2.5. Uninstalling Rockbox............................. 18 2.5.1. Automatic Uninstallation....................... 18 2.5.2. Manual Uninstallation......................... 18 2.6. Troubleshooting................................. 18 3. Quick Start 20 3.1.
    [Show full text]
  • Microcomputers: NQS PUBLICATIONS Introduction to Features and Uses
    of Commerce Computer Science National Bureau and Technology of Standards NBS Special Publication 500-110 Microcomputers: NQS PUBLICATIONS Introduction to Features and Uses QO IGf) .U57 500-110 NATIONAL BUREAU OF STANDARDS The National Bureau of Standards' was established by an act ot Congress on March 3, 1901. The Bureau's overall goal is to strengthen and advance the Nation's science and technology and facilitate their effective application for public benefit. To this end, the Bureau conducts research and provides; (1) a basis for the Nation's physical measurement system, (2) scientific and technological services for industry and government, (3) a technical basis for equity in trade, and (4) technical services to promote public safety. The Bureau's technical work is per- formed by the National Measurement Laboratory, the National Engineering Laboratory, and the Institute for Computer Sciences and Technology. THE NATIONAL MEASUREMENT LABORATORY provides the national system of physical and chemical and materials measurement; coordinates the system with measurement systems of other nations and furnishes essential services leading to accurate and uniform physical and chemical measurement throughout the Nation's scientific community, industry, and commerce; conducts materials research leading to improved methods of measurement, standards, and data on the properties of materials needed by industry, commerce, educational institutions, and Government; provides advisory and research services to other Government agencies; develops, produces, and
    [Show full text]
  • Latest Results from the Procedure Calling Test, Ackermann's Function
    Latest results from the procedure calling test, Ackermann’s function B A WICHMANN National Physical Laboratory, Teddington, Middlesex Division of Information Technology and Computing March 1982 Abstract Ackermann’s function has been used to measure the procedure calling over- head in languages which support recursion. Two papers have been written on this which are reproduced1 in this report. Results from further measurements are in- cluded in this report together with comments on the data obtained and codings of the test in Ada and Basic. 1 INTRODUCTION In spite of the two publications on the use of Ackermann’s Function [1, 2] as a mea- sure of the procedure-calling efficiency of programming languages, there is still some interest in the topic. It is an easy test to perform and the large number of results ob- tained means that an implementation can be compared with many other systems. The purpose of this report is to provide a listing of all the results obtained to date and to show their relationship. Few modern languages do not provide recursion and hence the test is appropriate for measuring the overheads of procedure calls in most cases. Ackermann’s function is a small recursive function listed on page 2 of [1] in Al- gol 60. Although of no particular interest in itself, the function does perform other operations common to much systems programming (testing for zero, incrementing and decrementing integers). The function has two parameters M and N, the test being for (3, N) with N in the range 1 to 6. Like all tests, the interpretation of the results is not without difficulty.
    [Show full text]
  • CP/M-80 Kaypro
    $3.00 June-July 1985 . No. 24 TABLE OF CONTENTS C'ing Into Turbo Pascal ....................................... 4 Soldering: The First Steps. .. 36 Eight Inch Drives On The Kaypro .............................. 38 Kaypro BIOS Patch. .. 40 Alternative Power Supply For The Kaypro . .. 42 48 Lines On A BBI ........ .. 44 Adding An 8" SSSD Drive To A Morrow MD-2 ................... 50 Review: The Ztime-I .......................................... 55 BDOS Vectors (Mucking Around Inside CP1M) ................. 62 The Pascal Runoff 77 Regular Features The S-100 Bus 9 Technical Tips ........... 70 In The Public Domain... .. 13 Culture Corner. .. 76 C'ing Clearly ............ 16 The Xerox 820 Column ... 19 The Slicer Column ........ 24 Future Tense The KayproColumn ..... 33 Tidbits. .. .. 79 Pascal Procedures ........ 57 68000 Vrs. 80X86 .. ... 83 FORTH words 61 MSX In The USA . .. 84 On Your Own ........... 68 The Last Page ............ 88 NEW LOWER PRICES! NOW IN "UNKIT"* FORM TOO! "BIG BOARD II" 4 MHz Z80·A SINGLE BOARD COMPUTER WITH "SASI" HARD·DISK INTERFACE $795 ASSEMBLED & TESTED $545 "UNKIT"* $245 PC BOARD WITH 16 PARTS Jim Ferguson, the designer of the "Big Board" distributed by Digital SIZE: 8.75" X 15.5" Research Computers, has produced a stunning new computer that POWER: +5V @ 3A, +-12V @ 0.1A Cal-Tex Computers has been shipping for a year. Called "Big Board II", it has the following features: • "SASI" Interface for Winchester Disks Our "Big Board II" implements the Host portion of the "Shugart Associates Systems • 4 MHz Z80-A CPU and Peripheral Chips Interface." Adding a Winchester disk drive is no harder than attaching a floppy-disk The new Ferguson computer runs at 4 MHz.
    [Show full text]
  • ALGOL 60 Programming on the Decsystem 10.Pdf
    La Trobe University DEPARTMENT OF MATHEMATICS ALGOL 60 Programming on the DECSystem 10 David Woodhouse Revised, August 1975 MELBOURNE, AUSTRALIA ALGOL 60 Programming on the DECSystem 10 David Woodhouse Revised, August 1975 CE) David Woodhouse National Library of Australia card number and ISBN. ISBN 0 85816 066 8 INTRODUCTION This text is intended as a complete primer on ALGOL 60 programming. It refers specifically to Version 4 of the DECSystem 10 implementation. However, it avoids idiosyncracies as far as possible, and so should be useful in learning the language on other machines. The few features in the DEC ALGOL manual which are not mentioned here should not be needed until the student is sufficiently advanced to be using this text for reference only. Exercises at the end of each chapter illustrate the concepts introduced therein, and full solutions are given. I should like to thank Mrs. K. Martin and Mrs. M. Wallis for their patient and careful typing. D. Woodhouse, February, 1975. CONTENTS Chapter 1 : High-level languages 1 Chapter 2: Languagt! struct.ure c.f ALGOL 6n 3 Chapter 3: Statemp.nts: the se'1tences {'\f the language 11 Chapter 4: 3tandard functions 19 Chapter 5: Input an~ Outp~t 21 Chapter 6: l>rray~ 31 Chapter 7 : For ane! ~hil~ statements 34 Chapter 8: Blocks anr! ',: ock sc rll,~ turr. 38 Chapter 9: PrOCe(:l1-:-~S 42 Chapter 10: Strin2 vp·jaLlps 60 Chapter 11: Own v~rj;lI'.i..es clOd s~itc.hef, 64 Chapter 12: Running ~nd ,;ebllggi"1g 67 Bibliography 70 Solutions to Exercises 71 Appendix 1 : Backus NOlUlaj F\:q'm 86 Appendix 2 : ALGuL-like languages 88 Appenclix 3.
    [Show full text]
  • A History of C++: 1979− 1991
    A History of C++: 1979−1991 Bjarne Stroustrup AT&T Bell Laboratories Murray Hill, New Jersey 07974 ABSTRACT This paper outlines the history of the C++ programming language. The emphasis is on the ideas, constraints, and people that shaped the language, rather than the minutiae of language features. Key design decisions relating to language features are discussed, but the focus is on the overall design goals and practical constraints. The evolution of C++ is traced from C with Classes to the current ANSI and ISO standards work and the explosion of use, interest, commercial activity, compilers, tools, environments, and libraries. 1 Introduction C++ was designed to provide Simula’s facilities for program organization together with C’s effi- ciency and flexibility for systems programming. It was intended to deliver that to real projects within half a year of the idea. It succeeded. At the time, I realized neither the modesty nor the preposterousness of that goal. The goal was modest in that it did not involve innovation, and preposterous in both its time scale and its Draco- nian demands on efficiency and flexibility. While a modest amount of innovation did emerge over the years, efficiency and flexibility have been maintained without compromise. While the goals for C++ have been refined, elaborated, and made more explicit over the years, C++ as used today directly reflects its original aims. This paper is organized in roughly chronological order: §2 C with Classes: 1979– 1983. This section describes the fundamental design decisions for C++ as they were made for C++’s immediate predecessor. §3 From C with Classes to C++: 1982– 1985.
    [Show full text]
  • ZX Computing Magazine (April 1983)
    eCoMIRUOTE]® le For The Sinclair I Over 120 pages of information and A programs for zx Spectrum, ZX81 and zxsi Computers Games, educational and business programs -*^*-^i. - Much more on «. ^4^*-.'- _*&&+-- machine code Check the options in our software lists •News, views and l lYlTlV^r reviews on all that's new •Special feature - a guide to spectrum add-ons Se^J Fn^ ZX 81 Arcade Action List ZX - Spectrum Software £5.95 ZX81 Compiler £5-95 Orbiter Muncher[ZX81) E4.95 Ground Attack £5.95 n £5.95 Asteroids £4.95 Starship Enterprise £5.95 Invaders D £3.95 Muncher £3.95 Alien-dropout a a cheque/PO for £ I enclose Startrek £3-95 a Please send me as indicated, Graphic Golf £3.95 Name Address GENEROUS DEALER DISCOUNTS AVAILABLE PROGRAMMERS. Tired of working for nothing, send your programs to GILVERSDFT for a speedy reply. /Abbes Abeiwft \ii> /_^==fc_. SiiveMftQuiduily /f_^D ZX Spectrum /ZX81 more ofyour BUILT. TESTED A READY FOR USE ZXcomputer! SOLDERING, micrfuci: moduli; plugs Lira rcn. iL PROGRAMMING, Joystick I simulates ' IMMEDIATELY COMPATIBLE WITH ALL SOFTWARl More memory for your ZX81! ZX-PANDA. The uniquely expandable 16 K MM pack The professionally produced 16K RAH Pack thai Is expandable to 32K simply by plugging-m our expansion module. Start with I6K... expand rata to 32K! Solidly built, attractively cased to fit perfectly on to a ZX81 without wobble! Includes LED puweiindicator. The RAM pack that won't become redundant when you went more thao 16 16K Expandable RAM £32.95 16K Expansion Module £19.95 More sound from your ZX Spectrum! Echo Not only moie sound, but better sound and a wide range of MAE£f UK other facilities! Control Volume, and adjust tone of sound Load and Save without switching leads! Audible cue facility for tape pn L'HV::< No additional power supply needed! Attractively cased - -SOUNDS GOOD! E$i*cJ*k K Only £23.50 ' ' '^^nSfc^jS^r-^- i£HS5 HmU T»l«nsn, -Oil,:'.
    [Show full text]
  • Using C-Kermit 2Nd Edition
    << Previous file Chapter 1 Introduction An ever-increasing amount of communication is electronic and digital: computers talking to computers Ð directly, over the telephone system, through networks. When you want two computers to communicate, it is usually for one of two reasons: to interact directly with another computer or to transfer data between the two computers. Kermit software gives you both these capabilities, and a lot more too. C-Kermit is a communications software program written in the C language. It is available for many different kinds of computers and operating systems, including literally hundreds of UNIX varieties (HP-UX, AIX, Solaris, IRIX, SCO, Linux, ...), Digital Equipment Corporation (Open)VMS, Microsoft Windows NT and 95, IBM OS/2, Stratus VOS, Data General AOS/VS, Microware OS-9, the Apple Macintosh, the Commodore Amiga, and the Atari ST. On all these platforms, C-Kermit's services include: • Connection establishment. This means making dialup modem connections or (in most cases) network connections, including TCP/IP Telnet or Rlogin, X.25, LAT, NET- BIOS, or other types of networks. For dialup connections, C-Kermit supports a wide range of modems and an extremely sophisticated yet easy-to-use dialing directory. And C-Kermit accepts incoming connections from other computers too. • Terminal sessions. An interactive terminal connection can be made to another com- puter via modem or network. The Windows 95, Windows NT, and OS/2 versions of C-Kermit also emulate specific types of terminals, such as the Digital Equipment Cor- poration VT320, the Wyse 60, or the ANSI terminal types used for accessing BBSs or PC UNIX consoles, with lots of extras such as scrollback, key mapping, printer con- trol, colors, and mouse shortcuts.
    [Show full text]
  • From: Proauestcompany
    This is an authorized facsimile, made from the microfilm master copy of the original dissertation or master thesis published by UMI. The bibliographic information for this thesis is contained in UMI's Dissertation Abstracts database, the only central source for accessing almost every doctoral dissertation accepted in North America since 1861. Dissertation Services From: ProauestCOMPANY 300 North Zeeb Road P.O. Box 1346 Ann Arbor. Michigan 48106-1346 USA 800.521.0600 734.761.4700 web www.il.proquest.com Printed in 2004 by digital xerographic process on acid-free paper INFORMATION TO USERS 'This was produced from a copy of a document sent to us for microfhing. While the most advanced technological means to photograph and reproduce this document have been used, the quality is heavily depndent upon the quality of the malerial submitted. The following explanation of techniques is provided to help you understand markine or notations which may appear on lhis reproduction. I. The sign or "target" for pagesaearently lacking from the document photographed is "Mining Page(s)". If it was possible to obtain the mining page($ or section, they are spliced into the fdm along with adjacent pages. This may have necessitated cutting through an image and duplicating adjacent pages to assure you of complete continuity. 2. When an image on the film is obliterated with a round black mark it is an indication lhat the film inspector notid either blurred copy because of movement during exposure, or duplicate copy. Unless we meant to delete copyrighted materials that should not have been filmed. you will fmd a good image of the page in the adjacent frame.
    [Show full text]
  • The BCPL Reference Manual
    MASSACHUSETTS INSTITUTE OF TECHNOLOGY PROJECT MAC Memorandum-M-352 July 21, 1967 To: Project MAC Participants From: Martin Richards Subject: The BCPL Reference Manual ABSTRACT BCPL is a simple recursive programming language designed for compiler writing and system programming: it was derived from true CPL (Combined Programming Language) by removing those features of the full language which make compilation difficult namely, the type and mode matching rules and the variety of definition structures with their associated scope rules. 0.0 Index 1.0 Introduction 2.0 BCPL Syntax 2.1 Hardware Syntax 2.1:1 BCPL Canonical Symbols 2.1.2 Hardware Conventions and Preprocessor Rules 2.2 Canonical Syntax 3.0 Data Items 3.1 Rvalues, Lvalues and Data Items 3.2 Types 4.0 Primary Expressions 4.1 Names 4.2 String Constants 4.3 Numerical Constants 4.4 True and False 4.5 Bracketted Expressions 4.6 Result Blocks 4.7 Vector Applications 4.8 Function Applications 4.9 Lv Expressions 4.10 Rv Expressions 5.0 Compound Expressions 5.1 Arithmetic Expressions 5.2 Relational Expressions 5.3 Shift Expressions 5.4 Logical Expressions 5.5 Conditional Expressions 6.0 Commands 6.1 Assignment Commands 6.2 Simple Assignment Commands 6.3 Routine Commands 6.4 Labelled Commands 6.5 Goto Commands 6.6 If Commands 6.7 Unless Commands 6.8 While Commands 6.9 Until Commands 6.10 Test Commands 6.11 Repeated Commands 6.12 For Commands 6.13 Break Commands 6.14 Finish Commands 6.15 Return Commands 6.16 Resultis Commands 6.17 Switchon Commands 6.18 Blocks 7.0 Definitions 7.1 Scope Rules 7.2 Space Allocation and Extent of Data Items 7.3 Global Declarations 7.4 Manifest Declarations 7.5 Simple Definitions 7.6 Vector Definitions 7.7 Function Definitions 7.8 Routine Definitions 7.9 Simultaneous Definitions 8.0 Example Program 1.0 Introduction 1.
    [Show full text]