Page 1 of 34Free preview · 1–5

About this document

Dated April 23, 1998, this manual describes C--, a portable assembly language designed as a compiler backend for high-level languages, particularly those using garbage collection. It covers syntax, names and constants, memory and types, data layout, procedures and control flow, foreign language interfaces, expressions, exception handling, and integer and floating-point operations. A final Further Work section records unresolved issues and planned additions.

Free preview text

The first 5 pages, shown as text so search engines and readers can find this document.

Page 1

The C-- Language Reference Manual Simon Peyton Jones Thomas Nordin Dino Oliva Pablo Nogueira Iglesias April 23, 1998 Contents 1 Introduction 3 2 Syntax definition 3 2.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.4 Name scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.5 The import and export declarations . . . . . . . . . . . . . . . . . . . . . . . . 6 2.6 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.6.1 Integer and floating point numbers . . . . . . . . . . . . . . . . . . . . . . . 7 2.6.2 Characters and strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3 Fundamental concepts in C-- 7 3.1 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2 Data segment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.3 Code segment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.4 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.5 Local variables (or registers) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.6 Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.7 Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.8 Foreign language interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4 Data layout directives 9 4.1 Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.2 Initialisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.3 Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1

Page 2

5 Procedures 12 5.1 Procedure definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 5.2 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.2.1 skip; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.2.2 Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.2.3 Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.2.4 Memory write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.2.5 if and relational operations . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.2.6 switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 5.2.7 Local control labels and goto . . . . . . . . . . . . . . . . . . . . . . . . . 16 5.2.8 Procedure call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 5.2.9 jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5.2.10 return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5.3 Foreign language interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 6 Expressions 20 6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.2 Memory read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.3 Operators, precedence, and evaluation order . . . . . . . . . . . . . . . . . . . . . . 21 6.4 Primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.5 Exception handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6.6 Casting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 6.6.1 wordn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 6.6.2 floatn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 6.7 word operators and primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 6.7.1 + and - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.7.2 * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.7.3 / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.7.4 % . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 6.7.5 neg and abs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 6.7.6 sign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 6.7.7 &, |, and ˆ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 6.7.8 ˜ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 6.7.9 << and >> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.8 float operators and primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.8.1 +f, -f, and *f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2

Page 3

6.8.2 /f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 6.8.3 signf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 6.8.4 negf and absf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 6.8.5 exponentf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 6.8.6 fractionf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 6.8.7 scalef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 6.8.8 succf and predf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 6.8.9 ulpf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 6.8.10 truncf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 6.8.11 roundf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 6.8.12 intpartf and fractpartf . . . . . . . . . . . . . . . . . . . . . . . . 32 7 Further Work 33 1 Introduction C-- is a portable assembly language designed to be a good backend for high level languages (par- ticularly for those that make use of garbage-collection) and to run fast on a number of todays major computer architectures. It is also designed to have as few dependencies as possible on the under- lying hardware, but speed and ease of use has sometimes taken precedence over orthogonality and minimality. C-- should be rich enough to be a viable backend for most mainstream and research compilers. This paper should be sufficiently self-supporting so that anyone who knows an imperative language and is acquainted with computers should be able to write her/his own C-- programs after reading this document. 2 Syntax definition The syntax of C-- is given in Figures 1 and 2. 2.1 General A C-- program file is written in eight bit ASCII characters. It consists in a sequence of data layout directives (Section 4), and/or procedure definitions (Section 5), and/or import declarations, and/or export declarations (Section 2.5), interleaved in any order. A C-- compilation unit is a C-- program file that can be successfully compiled and that is suitable for linking. C-- does not support input/output. Nevertheless, it can be accomplished using a foreign language call (Section 3.8). 3

Page 4

P r og r am pr og r am ! pal [pr og r am] P al pal ! data j [conv ] N ame(ar g 1 , : : : ar g n ) [data] bl ock n  0 j import N ame 1 , : : : N ame n ; n  1 j export N ame 1 , : : : N ame n ; n  1 D ata data ! data {datum 1 : : : datum n } n  1 D atum datum ! N ame : j ty pe[[sconst]][{expr 1 , : : : expr n }] ; n  1 j ty pe[]{expr 1 , : : : expr n } ; n  1 j word1[]AsciiS tr ing ; Abbr ev iation j word2[]U nicodeS tr ing ; Abbr ev iation j alignn ; Al ig nment dir ectiv e S impl e C onstants sconst ! N um I nteg er constant j ’char ’ Ascii char: constant j unicode(’char ’) U nicode char: constant C onstants const ! sconst S impl e constants j F N um F l oat number constant j N ame S y mbol ic constant j AsciiS tr ing S tr ing constant j U nicodeS tr ing U nicode str ing constant S tr ing s AsciiS tr ing ! "char 1 : : : char n " n  0 U nicodeS tr ing ! unicode("char 1 : : : char n ") n  0 C onv ention conv ! foreign conv k ind C onv ention decl ar ation C onv entions conv k ind ! C C al l ing C onv entions j Pascal j : : : F or mal Ar g uments ar g ! ty pe N ame T y pe ty pe ! wordn j floatm n 2 f1; 2; 4; 8g; m 2 f4; 8g B l ock bl ock ! {stm 1 : : : stm n } n  0 Figure 1: C-- syntax 4

Page 5

S tatements stm ! skip; N ul l statement j ty pe N ame 1 , : : : N ame n ; V ar: decl :; n  1 j N ame = expr ; Assig nment j ty pe[{alignn}][expr ] = expr ; M emor y w r ite; al ig n: n j if expr r el expr bl ock [else bl ock ] j switch[[sconst 1 ..sconst n ]] expr {sw t 1 : : : sw t n } n  1 j bl ock S coping j N ame: Local contr ol l abel j goto N ame ; Goto l ocal l abel j jump expr (expr 1 , : : : expr n ) ; n  0; J ump to expr j [conv ] [N ame 1 , : : : N ame m = ] expr (expr 1 , : : : expr n ) ; n; m  0 j [conv ] return(expr 1 , : : : expr n ); n  0 E xpr essions expr ! const j N ame V ar iabl e or l abel j ty pe [{alignn}][expr ] M emor y r ead; al ig n: n j (expr ) j expr op expr j pr im(expr 1 , : : : ,expr n ) n  1 O per ator s op ! +f l ag j -f l ag j *f l ag j /f l ag j %f l ag Ar ithmetic j & j | j ˆ j << j >>f l ag j ˜ B itw ise P r imitiv es pr im ! negf l ag j absf l ag j signf l ag j exponentf l ag j fractionf l ag j scalef l ag j succf l ag j predf l ag j ulpf l ag j truncf l ag j roundf l ag j intpartf l ag j fractpartf l ag j ty pe f l ag T y pe C asts F l ag s f l ag ! N o F l ag j o U nO r der ed j u j t j ut U nsig ned and T r apping j f j fz j fn j fp F l oating and R ounding j ft j ftz j ftn j ftp F l oating and T r apping R el ations r el ! ==f l ag j !=f l ag j >f l ag j <f l ag j >=f l ag j <=f l ag S w itch br anch sw t ! sconst 1 , : : : sconst n : bl ock n  1 j default : bl ock Figure 2: Statements in C-- 5

Tags

Doxxly editorial guide

The C-- Language Reference Manual: summary, contents and background

This guide helps you understand the scope of The C-- Language Reference Manual before or alongside reading the original document. It is based on the catalogue record, credited creator, source, classification and topics shown on this page. It does not replace the original work and does not invent claims about passages that Doxxly cannot verify.

Summary and overview

The C-- Language Reference Manual is a 34-page documentcredited to Freya I. Ingleby. Dated April 23, 1998, this manual describes C--, a portable assembly language designed as a compiler backend for high-level languages, particularly those using garbage collection. It covers syntax, names and constants, memory and types, data layout, procedures and control flow, foreign language interfaces, expressions, exception handling, and integer and floating-point operations. A final Further Work section records unresolved issues and planned additions. It appears in the Technology & Security collection, which groups it with other material that readers may use for comparison and further study.

The item can be approached in several ways. A reader looking for a quick orientation can begin with the free five-page preview, inspect the page structure and use the metadata to judge relevance. Someone undertaking deeper research can work through the complete file, search its indexed text, record useful page references and compare its treatment of C--, Language reference manual, Portable assembly language, Compiler backends, Memory layout, Foreign language interface, Integer arithmetic, Floating-point arithmetic with the related resources linked below.

Rather than reducing the work to a single claim, this page treats it as a source that should be read in context. The title, creator, publication source, licence and format all help explain what kind of evidence it may offer. Readers should distinguish the original author's statements from Doxxly's catalogue description, and should cite the original edition when using the material in academic, professional or published work.

Key topics and reader takeaways

The catalogue connects this document with C--, Language reference manual, Portable assembly language, Compiler backends, Memory layout, Foreign language interface, Integer arithmetic, Floating-point arithmetic. These terms offer practical entry points rather than a substitute for close reading. Start by identifying the definitions, examples, arguments, tables or visual explanations attached to each topic. Then note where the creator draws connections, makes distinctions or moves from background material to a conclusion, recommendation, calculation or narrative development.

A useful reading method is to separate description from interpretation. First record what the item actually presents: names, headings, figures, formulas, quotations or stated propositions. Next consider why those details matter within the whole work. Finally compare them with another source from the same subject area. This process helps turn a long digital file into evidence that can be evaluated rather than merely skimmed.

Table of contents and reading guide

The following is an editorial content guide based on the verified catalogue topics. It is not represented as the original author's formal table of contents. Use it to organise notes while moving through the 34 pages in the player.

  1. Part 1

    C--

    Use this section of the reading guide to identify how C-- appears in The C-- Language Reference Manual, note important terms, and connect the subject to the wider purpose of the work.

  2. Part 2

    Language reference manual

    Use this section of the reading guide to identify how Language reference manual appears in The C-- Language Reference Manual, note important terms, and connect the subject to the wider purpose of the work.

  3. Part 3

    Portable assembly language

    Use this section of the reading guide to identify how Portable assembly language appears in The C-- Language Reference Manual, note important terms, and connect the subject to the wider purpose of the work.

  4. Part 4

    Compiler backends

    Use this section of the reading guide to identify how Compiler backends appears in The C-- Language Reference Manual, note important terms, and connect the subject to the wider purpose of the work.

  5. Part 5

    Memory layout

    Use this section of the reading guide to identify how Memory layout appears in The C-- Language Reference Manual, note important terms, and connect the subject to the wider purpose of the work.

  6. Part 6

    Foreign language interface

    Use this section of the reading guide to identify how Foreign language interface appears in The C-- Language Reference Manual, note important terms, and connect the subject to the wider purpose of the work.

  7. Part 7

    Integer arithmetic

    Use this section of the reading guide to identify how Integer arithmetic appears in The C-- Language Reference Manual, note important terms, and connect the subject to the wider purpose of the work.

  8. Part 8

    Floating-point arithmetic

    Use this section of the reading guide to identify how Floating-point arithmetic appears in The C-- Language Reference Manual, note important terms, and connect the subject to the wider purpose of the work.

When a heading in the original differs from this guide, follow the original heading in your citation. Page numbers can also vary between editions. Doxxly's direct page field is useful for navigation, but formal references should include the title, creator, source and edition details available in the file itself.

About Freya I. Ingleby

Doxxly credits Freya I. Ingleby as the author or creator of The C-- Language Reference Manual. This page does not add an unverified biography, job title or institutional affiliation. The attribution is preserved so readers can distinguish the creator from the hosting library and follow the original record when an external author link is available.

Author context matters because a work reflects a particular purpose, audience and point of view. Before relying on the material, consider what the creator set out to explain, when the source was produced and whether later research or revised guidance should also be consulted. For literature and philosophy, compare translations and editions; for technical material, check whether a newer version has superseded the one shown here.

About the source organisation

The recorded source for this item is microsoft.com. Doxxly provides access and discovery tools but does not claim to be the original publisher unless explicitly stated. Source links, creator attribution and the recorded Publicly available file collected for editorial review licence are displayed to help readers assess provenance and permitted use.

Provenance is especially important for reports, standards, presentations and working spreadsheets. Check the original source for amendments, supporting files and current policy. A trustworthy research workflow keeps the source URL with any notes or downloaded copy, verifies important figures against the original, and avoids treating an archived document as automatically current.

Visit microsoft.com

How to read and use this document

Begin with the title and opening pages, then use the guide above to decide whether to read sequentially or move to a particular topic. The Doxxly player provides previous and next navigation, a direct page field, zoom steps, fit-to-width and fit-to-page modes, rotation and fullscreen. These controls are useful when a page contains small type, a wide table, an image, a scanned layout or a dense sequence of notes.

The first five pages are open to every visitor. A plan unlocks the complete item and full-document search. Search is best used for distinctive names, technical terms or short phrases; broad words can produce too many possible contexts. When you find a useful passage, read the surrounding pages so that a sentence, chart or formula is not separated from its explanation.

If downloading is enabled, members can obtain the original PDF file. Keep the original format when formulas, slide sequencing, pagination or layout carries meaning. Respect the Publicly available file collected for editorial review terms displayed on this page, and use the rights-report link if you believe the attribution or availability needs review.

Research questions to consider

As you read The C-- Language Reference Manual, ask which audience the creator addresses, what problem or idea organises the work, what evidence is presented, and which assumptions remain unstated. Note whether important terms are defined consistently and whether examples represent a broader pattern or a narrow case. For quantitative material, record units, time periods, formulas and data sources. For interpretive material, separate the creator's language from your own summary.

A second set of questions concerns relevance today. Which parts remain durable, which depend on their historical or institutional setting, and what would need confirmation from a newer source? Following the tags and the Technology & Security collection can reveal useful comparisons. Agreement between sources can strengthen confidence, while disagreement can point to changing definitions, methods, evidence or priorities.

Finally, decide what you need from the item: background knowledge, a quotation, a worked example, a model, a visual explanation or a starting bibliography. That purpose should guide the depth of reading and the notes you keep. Doxxly helps locate and navigate the source; careful interpretation remains the reader's responsibility.

Explore more Technology & Security resources

Frequently asked questions about The C-- Language Reference Manual

Practical answers about reading, downloading and understanding this document on Doxxly.

More in Technology & Security