PDP-11 C Guide to PDP-11 C

Total Page:16

File Type:pdf, Size:1020Kb

PDP-11 C Guide to PDP-11 C PDP-11 C Guide to PDP-11 C Available tables: ● Contents (316 entries) ● Examples (29 entries) ● Figures (7 entries) ● Tables (24 entries) ● Index (887 entries) Contents (316 entries) CONTENTS ● Title Page ● Copyright Page ● Preface ● 1 Developing PDP-11 C Programs ● 1.1 DCL Commands for Program Development ● 1.2 Creating a PDP-11 C Program ● 1.2.1 Using EDT ● 1.2.2 Using VAXTPU ● 1.2.3 Using KED ● 1.3 Compiling a PDP-11 C Program ● 1.3.1 The Compile Command http://www.sysworks.com.au/disk$vaxdocsep953/decw$book/d33vaa11.decw$book (1 of 15)1/25/06 3:39 PM PDP-11 C Guide to PDP-11 C ● 1.3.1.1 Compiling a Program on RSX Systems ● 1.3.1.2 Compiling a Program on RSTS/E Systems ● 1.3.1.3 Compiling a Program on RT-11 Systems ● 1.3.1.4 Compiling a Program on VMS Systems ● 1.3.2 Prompt Mode ● 1.3.3 Indirect Command Files ● 1.3.4 The PDP-11 C Command Qualifiers ● 1.3.5 Compiler Error Messages ● 1.3.6 Compiler Listings ● 1.4 Copying Files Among Target Environments ● 1.4.1 File Transfer (FIT) Program ● 1.4.2 File Transfer Utility (FLX) ● 1.4.3 VMS EXCHANGE Utility ● 1.5 Linking a PDP-11 C Program ● 1.5.1 Linking a Program on RSX Systems ● 1.5.2 Linking a Program on RSTS/E Systems ● 1.5.2.1 Invoking the RSX Task Builder on RSTS/E ● 1.5.2.2 Invoking the RT-11 Linker on RSTS/E ● 1.5.3 Linking a Program on RT-11 Systems ● 1.5.4 Linking a Program on VMS Systems ● 1.5.5 Task Builder Command-Line Elements ● 1.5.5.1 Creating CMD and ODL Files for Task Building http://www.sysworks.com.au/disk$vaxdocsep953/decw$book/d33vaa11.decw$book (2 of 15)1/25/06 3:39 PM PDP-11 C Guide to PDP-11 C ● 1.5.5.2 Command-Line Elements in CMD Files ● 1.5.5.3 Task Builder Qualifiers ● 1.5.6 Task Builder Error Messages ● 1.5.7 Storage Considerations ● 1.5.8 Library Usage ● 1.5.8.1 PDP-11 C Run-Time System Object Libraries ● 1.5.8.2 Using System Libraries ● 1.5.8.3 Creating User Libraries ● 1.5.8.4 Using the supervisor-mode Library ● 1.5.9 Overlays ● 1.6 Running a PDP-11 C Program ● 1.7 Debugging a PDP-11 C Program ● 2 Program Structure ● 2.1 C Programming Language Background ● 2.2 The PDP-11 C Programming Language ● 2.3 Writing a Program ● 2.4 Producing Input/Output ● 2.5 Controlling Program Flow ● 2.5.1 Testing for a Condition ( if Statement) ● 2.5.2 Testing for Multiple Conditions ( switch Statement) ● 2.5.3 Loops ● 2.6 Values, Addresses, and Pointers http://www.sysworks.com.au/disk$vaxdocsep953/decw$book/d33vaa11.decw$book (3 of 15)1/25/06 3:39 PM PDP-11 C Guide to PDP-11 C ● 2.7 Function Definitions ● 2.7.1 Main Function and Function Identifiers ● 2.7.2 Parameter List Declarations ● ● 2.7.4 Variable-Length Parameter Lists ● 2.8 Function Declarations ● 2.8.1 Function Prototypes ● 2.9 Using Parameters and Arguments ● 2.9.1 Function and Array Identifiers as Arguments ● 2.9.2 Passing Arguments to the Function Main ● 2.10 Identifiers ● 2.11 Keywords ● 2.12 Blocks ● 2.13 Comments ● 2.14 Lexical Continuation ● 2.15 String Literal Concatenation ● 2.16 Trigraphs ● 3 Statements ● 3.1 The Labeled Statement ● 3.2 Compound Statement ● 3.3 The Null Statement ● 3.4 The Expression Statement http://www.sysworks.com.au/disk$vaxdocsep953/decw$book/d33vaa11.decw$book (4 of 15)1/25/06 3:39 PM PDP-11 C Guide to PDP-11 C ● 3.5 Selection Statements ● 3.5.1 The if Conditional Statement ● 3.5.2 The switch Statement ● 3.6 Iteration Statements (Looping) ● 3.6.1 The while Statement ● 3.6.2 The for Statement ● 3.6.3 The do Statement ● 3.7 Jump Statements ● 3.7.1 The goto Statement ● 3.7.2 The continue Statement ● 3.7.3 The break Statement ● 3.7.4 The return Statement ● 4 Expressions and Operators ● 4.1 Addresses (lvalues) and Objects (rvalues) of Variables ● 4.2 Overview of the PDP-11 C Operators ● 4.3 Primary Expressions and Operators ● 4.3.1 Parenthetical Expressions ● 4.3.2 Function Calls ● 4.3.3 Array References ● 4.3.4 Structure and Union References ● 4.4 Unary Operators ● 4.4.1 Negating Arithmetic and Logical Expressions http://www.sysworks.com.au/disk$vaxdocsep953/decw$book/d33vaa11.decw$book (5 of 15)1/25/06 3:39 PM PDP-11 C Guide to PDP-11 C ● 4.4.2 Incrementing and Decrementing Variables ● 4.4.3 Computing Addresses and Dereferencing Pointers (& * ) ● 4.4.4 Calculating a One's Complement ( ~ ) ● 4.4.5 Forcing Conversions to a Specific Type (Cast Operator) ● 4.4.6 Calculating Sizes of Variables and Data Types (sizeof) ● 4.5 Binary Operators ● 4.5.1 Additive Operators (+ -) ● 4.5.2 Multiplication Operators ( * / %) ● 4.5.3 Equality Operators (= = !=) ● 4.5.4 Relational Operators (< > <= >=) ● 4.5.5 Bitwise Operators (& | ^) ● 4.5.6 Logical Operators (&& | | ) ● 4.5.7 Shift Operators (<< >>) ● 4.6 Conditional Operator (?:) ● 4.7 Assignment Expressions and Operators ● 4.8 Comma Expression and Operator ( , ) ● 4.9 Data Type Conversions ● 4.9.1 Converting Operands ● 4.9.2 Converting Function Arguments ● 5 Data Types and Declarations ● 5.1 Constants ● 5.2 Variables http://www.sysworks.com.au/disk$vaxdocsep953/decw$book/d33vaa11.decw$book (6 of 15)1/25/06 3:39 PM PDP-11 C Guide to PDP-11 C ● 5.2.1 Classification of Variables ● 5.2.1.1 Data Type Keywords ● 5.2.1.2 Format of a Variable Declaration ● 5.3 Integers (int, long, short, char, signed, unsigned) ● 5.3.1 Integer Constants ● 5.3.2 Character Constants ● 5.3.3 Escape Sequences ● ● 5.5 Pointers ● 5.6 Enumerated Types (enum) ● 5.7 Arrays ([ ]) ● 5.7.1 Initialization of Arrays ● 5.8 Character-String Variables and Constants (char * , char[ ]) ● 5.9 Structures and Unions (struct, union) ● 5.9.1 Declaring a Structure or Union ● 5.9.2 Referencing Members of Structures or Unions ● 5.9.3 Initialization of Structures and Unions ● 5.9.4 Variant Structures and Unions ● 5.9.5 Bit-Fields ● 5.10 Aggregates ● 5.10.1 Arrays and Character Strings ● 5.10.2 Structures and Unions http://www.sysworks.com.au/disk$vaxdocsep953/decw$book/d33vaa11.decw$book (7 of 15)1/25/06 3:39 PM PDP-11 C Guide to PDP-11 C ● 5.11 The void Keyword ● 5.12 The typedef Keyword ● 5.13 Interpreting Declarations ● 6 Scope, Storage Classes, and Allocation ● 6.1 The Scope of an Identifier ● 6.1.1 The Compilation and Linking Process ● 6.1.2 Position of the Declaration ● 6.1.3 Lexical Scope and Link-Time Scope ● 6.1.4 Program Example ● 6.2 Storage Allocation ● 6.3 Internal Storage Class ● 6.3.1 Defining a Variable for Automatic Storage Allocation ( auto ) ● 6.3.2 Defining a Variable for Placement in a Machine Register ( register ) ● 6.4 Static Storage Class ● 6.5 Global Storage Class ● 6.5.1 Global Names on PDP-11 Systems ● 6.5.2 Global Definitions ● 6.6 Defining Global Definitions ( globaldef ) and References ( globalref ) ● 6.7 Defining Global Values ( globalvalue ) ● 6.8 Explicit psect Control ● 6.8.1 Reducing Storage Requirements in Overlaid Tasks ● 6.8.2 Data Sharing Using psects http://www.sysworks.com.au/disk$vaxdocsep953/decw$book/d33vaa11.decw$book (8 of 15)1/25/06 3:39 PM PDP-11 C Guide to PDP-11 C ● 6.9 Data Type Qualifiers ● 6.9.1 The const Qualifier ● 6.9.2 The volatile Qualifier ● 6.10 Storage-Class Specifiers ● 7 Preprocessor Directives ● 7.1 Token Definitions (#define, #undef) ● 7.1.1 Object-Like Macros ● 7.1.2 Canceling Definitions (#undef) ● 7.1.3 Function-Like Macros ● 7.1.3.1 Stringizing Preprocessing Operator ( # ) ● 7.1.3.2 Token Concatenation Preprocessing Operator (##) ● 7.1.4 Listing Substituted Lines ● 7.2 Conditional Compilation (#if, #ifdef, #ifndef, #else, #elif, #endif) ● 7.2.1 The defined Operator ● 7.3 The #error Directive ● 7.4 File Inclusion (#include) ● 7.4.1 Inclusion Using Angle Brackets ( <> ) ● 7.4.2 Inclusion Using Quotation Marks ( " " ) ● 7.4.3 Token Substitution in #include Directives ● 7.5 Specification of Line Numbers (#line, #) ● 7.6 Specification of Module Name and Identification (#module) ● 7.7 Implementation-Specific Preprocessor Directive (#pragma) http://www.sysworks.com.au/disk$vaxdocsep953/decw$book/d33vaa11.decw$book (9 of 15)1/25/06 3:39 PM PDP-11 C Guide to PDP-11 C ● 7.7.1 #pragma charset ● 7.7.2 #pragma psect ● 7.7.3 #pragma module ● 7.7.4 #pragma list ● ● 7.7.6 #pragma [no]standard ● 7.8 Predefined Macros ● 7.8.1 PDP-11 C Predefined Macros ● 7.8.2 Digital Extension Macros ● 7.8.3 The _ _ DATE_ _ Macro ● 7.8.4 The _ _ TIME_ _ Macro ● 7.8.5 The _ _ FILE_ _ Macro ● 7.8.6 The _ _ LINE_ _ Macro ● 7.8.7 The _ _ STDC_ _ Macro ● 7.8.8 The _ _ RAD50 and _ _ RAD50L Macros ● 8 PDP-11 C Implementation Notes ● 8.1 Use of Memory Management Functions ● 8.1.1 Providing Alternative Space for Memory Management ● 8.2 Compilation Performance and Capacity on PDP-11 Host Systems ● 8.2.1 Data Caching ● 8.2.2 PDP-11 C Work File ● 8.3 PDP-11 C Run-Time Psects http://www.sysworks.com.au/disk$vaxdocsep953/decw$book/d33vaa11.decw$book (10 of 15)1/25/06 3:39 PM PDP-11 C Guide to PDP-11 C ● 8.4 Overlaying Tasks ● 8.5 RT-11 User Service Routine (USR) Load Area ● 8.6 Event Flags ● 8.7 Argument Passing Using Linkages ● 8.8 Defining Your Own Locales ● 8.9 Excluding printf Format Support Code ● A PDP-11 C Compiler Messages ● A.1 Introduction ● A.2 Compiler Messages ● ALC_TEMPOVERFLOW .
Recommended publications
  • VAX VMS at 20
    1977–1997... and beyond Nothing Stops It! Of all the winning attributes of the OpenVMS operating system, perhaps its key success factor is its evolutionary spirit. Some would say OpenVMS was revolutionary. But I would prefer to call it evolutionary because its transition has been peaceful and constructive. Over a 20-year period, OpenVMS has experienced evolution in five arenas. First, it evolved from a system running on some 20 printed circuit boards to a single chip. Second, it evolved from being proprietary to open. Third, it evolved from running on CISC-based VAX to RISC-based Alpha systems. Fourth, VMS evolved from being primarily a technical oper- ating system, to a commercial operat- ing system, to a high availability mission-critical commercial operating system. And fifth, VMS evolved from time-sharing to a workstation environment, to a client/server computing style environment. The hardware has experienced a similar evolution. Just as the 16-bit PDP systems laid the groundwork for the VAX platform, VAX laid the groundwork for Alpha—the industry’s leading 64-bit systems. While the platforms have grown and changed, the success continues. Today, OpenVMS is the most flexible and adaptable operating system on the planet. What start- ed out as the concept of ‘Starlet’ in 1975 is moving into ‘Galaxy’ for the 21st century. And like the universe, there is no end in sight. —Jesse Lipcon Vice President of UNIX and OpenVMS Systems Business Unit TABLE OF CONTENTS CHAPTER I Changing the Face of Computing 4 CHAPTER II Setting the Stage 6 CHAPTER
    [Show full text]
  • PDP-11 Systems and Options Catalog
    Systems & Options Catalog October-December 1983 The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any error that may appear in this catalog. This Product Catalog was designed, produced, and typeset by Digital's Corporate Marketing Services using an in-house text-processing system. Correspondent, DATATRIEVE, DEC, DECmate, DECnet, DECmailer, DECstart, DECword, DECword/DP, DECwriter, Digital logo, FALCON, FMS-11, lAS, Internet, LA, Letterprinter 100, Letterwriter 1 00, MICRO/PDP-11 , MICRO/J-11 , MICRO/PDP-11, MICRO/T-11, MicroPower/Pascal, PACKETNET, PDP, P/OS, Professional 325 and 350, PROVUE, Q-bus, Rainbow 100, ReGIS, RSTS, RSX, RT-11 , UNIBUS, VAX, VMS, VT are trademarks of Digital Equipment Corporation. COPYRIGH"f©1983 DIGITAL EQUIPMENT CORPORATION New Products From DIGITAL MICRO/PDP-11-the performance of a minicomputer in a compact, economical microcomputer. Now there is Micro/RSX, especially designed for use on the MICRO/PDP-11. New Packaging for PDP-11/24s and PDP-11/44s- from boxes to building blocks to complete packaged sys­ tems. New Q-bus Mass Storage Packaging -Adds 10MB to the MICRO/PDP-11 -Adds removable floppies to Q-bus systems Table of Contents Introduction . Overview and How to Use . ii Ordering and Configuring Information. iv Supporting Products . viii Systems . ......... · 1-1 System Selection Chart . · 1-3 Q-bus System Chart. · 1-5 MICRO/PDP-11 Computer Models & Systems. · 1-8 PDP-11 /23-PLUS Computer Models & Systems. 1-12 UNIBUS System Chart.
    [Show full text]
  • Systems & Options Catalog
    Systems & Options Catalog July-September 1983 The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any error that may appear in this catalog. This Product Catalog was designed, produced, and typeset by DIGITAL's New Products Marketing Group using an in-house text-processing system. Correspondent, DEC, DECmate, DECnet, DECstart, DECsystem-10, DECSYSTEM-20, DECtype, DECUS, DEC­ word, DECword/DP, DECwriter, DIGITAL logo, DIBOL, FALCON, FMS-11, GIGI, Internet, Letterprinter 100, Letterwriter 100, LSI-11, MICRO/PDP-11, MICROIT-11, MICROPOWER/PASCAL, PACKETNET, Professional 325 and 350, PROVUE, ReGIS, RT-11, TMS (Telephone Management System, WPS-8 PDP, RT, RSX, RSTS, SBI, UNIBUS, VAX, VMS, and VT are trademarks of Digital Equipment Corporation. COPYRIGHT©1983 DIGITAL EQUIPMENT CORPORATION New Products From .DIGITAL MICROIPDP-11- the performance of a minicomputer in a compact, economical microcomputer. New Packaging for PDP-11124s and PDP-11144s- from boxes to building blocks to complete packaged sys­ tems. Flexible Option Ordering Plan- a new easier way to order options for system integration in the factory or as upgrades in the field. Table of Contents Introduction . Overview and How to Use . ii Ordering and Configuring Information. iii Supporting Products. vi Systems . ......... · 1-1 System Selection Chart . 1-3 LSI-11 Bus System Chart . · 1-5 MICRO/PDP-11 Computer Models & Systems . · 1-7 PDP-11 123-PLUS Computer Models & Systems . 1-10 UNIBUS System Chart. 1-20 UNIBUS Rackmountable Computer Models 1-23 UNIBUS Kernel Systems.
    [Show full text]
  • RSTS/E Documentation Directory Order Number: AA-2642H-TC
    RSTS/E Documentation Directory Order Number: AA-2642H-TC RSTS/E Documentation Directory Order Number: AA-2642H-TC This document contains general descriptions of RSTS/E software documentation. It describes the documents specific to RSTS/E as we" as some of the optional software and documenta­ tion associated with the operating system. This document also contains ordering information for RSTS/E documentation. Operating System and Version: RSTS/E Version 10.0 Software Version: RSTS/E Version 10.0 digital equipment corporation maynard, massachusetts August 1990 The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any errors that may appear in this document. The software described in this document is furnished under a license and may only be used or copied in accordance with the terms of such license. No responsibility is assumed for the use or reliability of software on equipment not supplied by Digital Equipment Corporation or its affiliated companies. Restricted Rights: Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c){1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013. © Digital Equipment Corporation 1990. All rights reserved. Printed in U.S.A. The postpaid READER'S COMMENTS form on the last page of this document requests the user's critical evaluation to assist in preparing future documentation. The following are trademarks of Digital Equipment Corporation: ALL-IN-1 DEUNA RSX DEC/CMS DIBOL RT DECdx EDT RT-11 DEC/FMS-11 lAS TOPS-10 DECmail LA TOPS-21 DECnet LN01 ULTRIX DECnetiE Micro/RSX UNIBUS DECSA OS/8 VAX DECserver PDP VAXmate DECsystem-10 PDP-11 VMS DECSYSTEM-20 PDT VT DECUS Q-BUS WPS-PLUS DECworld RMS-11 Rainbow DELUA RSTS DEQNA ~DmDDmDTM IBM is a registered trademark of international Business Machines Corporation.
    [Show full text]
  • Openvms Introduction
    G O Y O S Id gm vaxvms Version Date Septemb er Revised August GSI Online Oine S Ystem Op enVMS Intro duction HG Essel M Richter W Schieb el August GSI Gesellschaft fur Schwerionenforschung mbH PostfachPlanckstrae D Darmstadt Tel List of Figures GSI Computer Network IBM VT Terminal Keyb oard Op enVMS LSE Terminal Keyb oard Op enVMS Debug Terminal Keyb oard A Alpha AXP or VAX Terminal Keyb oard Version August Version August Conventions used in this Do cument Chapter Preface GOOSY Copy Right The GOOSY software package has b een develop ed at GSI for scientic applications Any distribu tion or usage of GOOSY without p ermission of GSI is not allowed To get the p ermission please contact at GSI Mathias Richter tel or EMail MRichtergside or HansGeorg Essel tel or EMail HEsselgside Conventions used in this Do cument Fn PFn Do or Return key All key in frame b oxes refer to the sp ecial keypads on VTx compatible terminals like VT VT VT VT VT VT PECAD PERICOM terminals or DECterm windows under DECwindowsMotif on top or rightto the main keyb oard to control characters or to the delete and return keys of the main keyb oard Fn PFn KPn DoorCtrl This is the alternativeway of writing the keypad or control keys GOLD GOLD The PF key is called GOLD in most utility programs using the keypad PERICOM On the PERICOM terminal keyb oard the function keys are marked opp osite to all other terminals ie the PFn of the rightmost VTx compatible keypad are named Fn and the Fn keys on the
    [Show full text]
  • Ersatz-11 Pdp-11 Emulator Version 7.3
    ERSATZ-11 PDP-11 EMULATOR VERSION 7.3 Copyright c 1993{2017 by Digby's Bitpile, Inc. All rights reserved. Release date: 01-Mar-2017 §¤¤ ¤ ¤¥ ¦¥¥ ¥ D Bit • 139 Stafford Road • Monson, MA • 01057 • USA • www.dbit.com § ¤ ¤¤ Digby's Bitpile, Inc. DBA D Bit ¤¥ 139 Stafford Road Monson, MA 01057 ¦ ¥¥ ¥ USA +1 (413) 267-4600 [email protected] www.dbit.com Copyright c 1993{2017 by Digby's Bitpile, Inc. All rights reserved. The following are trademarks of Digby's Bitpile, Inc.: £ ¡ D Bit E11 Ersatz ¢¡¡ ¡ The following are trademarks or registered trademarks of Digital Equipment Corporation: DEC DECnet DECtape DECwriter DIGITAL IAS MASSBUS PDP PDT P/OS Q-BUS RSTS RSX RT-11 ULTRIX UNIBUS VT The following are trademarks or registered trademarks of S&H Computer Systems, Inc.: TSX TSX-Plus Other product, service, and company names that appear in this document are used for identification purposes only, and may be trademarks and/or service marks of their respective owners. Contents 1 Introduction 1 1.1 Emulated block device types . 2 1.2 Emulated sequential device types . 3 1.3 Emulated serial device types . 3 1.4 Emulated network device types . 4 1.5 Emulated DDCMP device types . 4 1.6 Miscellaneous device types . 5 1.7 PC hardware support . 5 1.8 Device names . 7 1.9 Filenames . 8 1.10 Time durations . 8 1.11 Notes . 9 1.11.1 Interrupts . 9 1.11.2 Host systems . 9 1.11.3 Copyright and licensing . 10 1.12 Acknowledgments . 10 1.13 History . 11 2 Installation and Configuration 13 2.1 System requirements .
    [Show full text]
  • Openvms User's Manual
    OpenVMS User’s Manual Order Number: AA–PV5JF–TK June 2002 This manual describes how to use the Compaq OpenVMS operating system. The information contained in this manual is intended for all OpenVMS users and is applicable to all computers running the OpenVMS operating system. Revision/Update Information: This manual supersedes the OpenVMS User’s Manual, Version 7.3. Software Version: OpenVMS Alpha Version 7.3–1 OpenVMS VAX Version 7.3 Compaq Computer Corporation Houston, Texas © 2002 Compaq Computer Corporation Compaq, the Compaq logo, AlphaServer, OpenVMS, POLYCENTER, Tru64, VAX, VMS, and the DIGITAL logo are trademarks of Compaq Information Technologies Group, L.P. in the U.S. and/or other countries. UNIX and X/Open are trademarks of The Open Group in the U.S. and/or other countries. All other product names mentioned herein may be trademarks of their respective companies. Confidential computer software. Valid license from Compaq required for possession, use, or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information in this document is provided "as is" without warranty of any kind and is subject to change without notice. The warranties for Compaq products are set forth in the express limited warranty statements accompanying such products. Nothing herein should be construed as constituting an additional warranty. ZK6489 The Compaq OpenVMS documentation set is available on CD-ROM.
    [Show full text]