home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_10 / DEVELOP.LZH / DSP / C56K / C56.DOC next >
Text File  |  1979-12-09  |  4KB  |  100 lines

  1. c56:    
  2.  
  3.     Dave Dunfield's Micro C compiler (mc121a.zip) modified by Steve
  4. Moshier to generate DSP56000 code.
  5.  
  6.  
  7. 1. c56 features
  8.  
  9.     Register variables may be declared; these reference the index
  10.     registers r2 - r5.  They should ordinarily be used as pointers.
  11.  
  12.     Registers are allocated in the sequence r2, r3, ... as
  13.     encountered in the source code. Registers may be globally
  14.     declared.  Locally declared registers are allocated in sequence,
  15.     then decallocated on returning from the function.
  16.  
  17.     Stack variables and subroutine arguments work, but are not
  18.     usually as fast as if global symbols are used.  Subroutine
  19.     results are returned in the DSP56K "a" accumulator.  If any stack
  20.     code is actually emitted, r6 is used as the stack pointer.
  21.  
  22.     A data type "fractional" has been added.  It replaces "char" and
  23.     uses the multiply instruction appropriately.  Multiplication of
  24.     "int" types is also implemented but takes longer. "char" is still
  25.     recognized but is treated as "fractional."  All of char, int,
  26.     unsigned, and fractional are the same size, one 24-bit location.
  27.  
  28.     The hardware do loop instruction is generated by the special
  29.     statement hwloop(n){ } where n, an expression, is the loop count,
  30.     and the code in curly brackets will be executed n times.  Both
  31.     "break" and "continue" work in this context, and hwloops may be
  32.     nested to the hardware stack limit.  A (sometimes spurious) nop
  33.     instruction is generated as the last loop statement, to catch
  34.     jump targets that might land on the end of the loop.
  35.  
  36.     Command line switch -s in c56 will pass C source through to the
  37.     output as comments.
  38.  
  39.     Command line switch -l in c56 will defeat numerical evaluation of
  40.     logical expressions.  This saves two instruction cycles per
  41.     compare operation but means that the result of the comparison
  42.     cannot be treated as a number equal to 1 or 0.
  43.  
  44. 2.c56 problems
  45.  
  46.     Integer constants are limited to 16 bits due to the compiler
  47.     arithmetic.  Type char is left unimplemented; it may produce 8086
  48.     garbage if string variables or character constants are declared.
  49.     Type char and type fractional are equivalent, as far as the
  50.     compiler is concerned.
  51.  
  52.     All variables are put in X memory space.
  53.  
  54.     Nested multiple register indirections of the form  *( *p ), where
  55.     p is a register pointer, sometimes do not work.  However, *( *p +
  56.     n ), *( *p + **q ) and similar expressions *do* work.
  57.  
  58.     There is no DSP pipeline optimization except for a few simple
  59.     combinations that have been incorporated into the peephole optimizer.
  60.  
  61.  
  62. 3. mc problems
  63.  
  64.     The original compiler code expects (c << 8), where c is a char,
  65.     to produce a 16 bit result.
  66.  
  67.     It does not understand #include "filename" or #include <filename>
  68.     but only #include filename (i.e. with no punctuation).
  69.  
  70.     Complicated expressions such as y = *a * *b + *c * *d + *e * *f
  71.     sometimes do not work.  The compiler front end produces incorrect
  72.     variable stacking.  At least part of the problem was traced to a
  73.     confusion about register declarations.
  74.  
  75.     The peephole optimizer has various troubles with storing and
  76.     recognizing wildcard patterns.
  77.  
  78.     The above problems have been addressed in the c56 version, in
  79.     which "filename" and <filename> both refer to the current
  80.     default directory.
  81.  
  82.     The compiler has been compiled sucessfully in MSDOS with
  83.     Microsoft C.  It compiled on a Unix system but did not work.
  84.     Portability problems have not been addressed.
  85.  
  86. 4. c56 files
  87.  
  88.         c56.mak     MSDOS Microsoft makefile
  89.  
  90.         cc56.bat    To run the compiler and optimizer in MSDOS,
  91.                     enter "cc56 filename" without the .c
  92.  
  93.         c56.c       front end
  94.         c56cg.c     code generator  
  95.         c56io.c     file i/o
  96.         o56.c       peephole optimizer
  97.  
  98.     Note, cc56.bat invokes Microsoft's C preprocessor -- but then
  99.     #asm, #endasm don't work.
  100.