Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Coherent 3.1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


C language                   Overview                  C language




The following summarizes how COHERENT implements the C language.

Identifiers
    Characters allowed: A-Z, a-z, _, 0-9
    Case sensitive.
    Number of significant characters in a variable name:
        at compile time:128
        at link time:16
    C appends `_' to end of external identifiers

Reserved Identifiers (Keywords)
    See C keywords, above.

Data Formats (bits)
    char           8
    unsigned char  8
    double        64
    float         32
    int           16
    unsigned int  16
    long          32
    unsigned long 32
    pointer       16

Limits
    Maximum bitfield size:  16 bits
    Maximum number of cases in a switch:  no formal limit
    Maximum block nesting depth:  no formal limit
    Maximum parentheses nesting depth:  no formal limit
    Maximum structure size:  64 kilobytes

Preprocessor Instructions:
    #define #ifdef
    #else   #ifndef
    #elif   #include
    #endif  #line
    #if     #undef

Structure Name-Spaces
    Supports both Berkeley and Kernighan-Ritchie conventions
    for structure in union.

Register Variables
    Two available for ints
    Two available for pointers

Function Linkage
    Return values for ints: AX
    Return values for longs: DX:AX
    Return values for SMALL-model pointers: AX
    Return values for LARGE-model pointers: DX:AX
    Return values for doubles in DX:AX
    Parameters pushed on stack in reverse order, chars and shorts pushed
       as words, longs and pointers pushed as longs, structures


COHERENT Lexicon                                           Page 1



C language                   Overview                  C language



       copied onto stack
    Caller must clear parameters off stack
    Stack frame linkage is done through SP register

***** Special Features and Optimizations *****


* Branch optimization is performed: this uses the smallest branch
  instruction for the required range.

* Unreached code is eliminated.

* Duplicate instruction sequences are removed.

* Jumps to jumps are eliminated.

*  Multiplication and  division  by constant  powers  of two  are
  changed to shifts when the results are the same.

* Sequences  that can be resolved at  compile time are identified
  and resolved.

***** See Also *****

argc, argv,  C keywords,  C preprocessor, header  files, Lexicon,
libraries, linker-defined symbols, main()































COHERENT Lexicon                                           Page 2


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026