

C language                   Overview                  C language




The following summarizes how COHERENT implements the C language.

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

Reserved Identifiers (Keywords)
    See CC kkeeyywwoorrddss, above.

Data Formats (bits)
    cchhaarr           8
    uunnssiiggnneedd cchhaarr  8
    ddoouubbllee        64
    ffllooaatt         32
    iinntt           16
    uunnssiiggnneedd iinntt  16
    lloonngg          32
    uunnssiiggnneedd lloonngg 32
    pointer       16

Limits
    Maximum bitfield size:  16 bits
    Maximum number of ccaassees in a sswwiittcchh:  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 iinntts
    Two available for pointers

Function Linkage
    Return values for iinntts: AX
    Return values for lloonnggs: DX:AX
    Return values for SMALL-model pointers: AX
    Return values for LARGE-model pointers: DX:AX
    Return values for ddoouubbllees in DX:AX
    Parameters pushed on stack in reverse order, cchhaarrs and sshhoorrtts pushed
       as words, lloonnggs and pointers pushed as lloonnggs, 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


