home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume5 / smallc / part1 / README < prev   
Encoding:
Text File  |  1986-11-30  |  2.9 KB  |  61 lines

  1.             Small C version C3.0R1.1
  2.                   (SCC3)
  3.  
  4.                 Chris Lewis
  5.  
  6. This directory contains the source for a version of Ron Cain's Small C 
  7. compiler that I have heavily modified - beyond the Small-C V2.0 later
  8. published in Dr. Dobbs.  This compiler generates assembler source code that
  9. needs to be assembled and linked to make a running program.
  10.  
  11. Small C is a public domain compiler for a subset of C.  The main things
  12. lacking are "#if", structs/unions, doubles/floats/longs and more than
  13. one level of indirection.  Even so, it's powerful enough to be able to
  14. compile itself.  It's also lots of fun to play around with.  It could
  15. use lots of more work (eg: a real scanner), but what the heck...
  16. Retargetting the compiler requires only relinking the frontend with a new
  17. code generator.
  18.  
  19. Code generators for 6809 (MIT UNIX-like assembler), M68K (Motorola V/68 UNIX
  20. assembler), VAX (BSD 4.1 assembler), and 8080 (RMAC assembler) are provided.
  21.  
  22. Users having access to System V make should be able to use the Makefile 
  23. without any modification except for INCDIR and LIBDIR (where you'd like 
  24. to put the compiler itself).
  25.  
  26. Users not having access to System V will probably have to rewrite the Makefile.
  27. [ I have provided a Makefile that seems to work with bsd systems - mod]
  28.  
  29. WARNING: you will probably see a great deal of compilation warnings when
  30. you compile this compiler with a "real" UNIX C.  Don't worry - this is
  31. *perfectly* normal - Small C is a subset of real C, and in order to
  32. keep the compiler in this subset you have to bend the rules somewhat.
  33. The only time where this might cause a problem is where pointers are
  34. "different" from ints (ie: different length or on non-byte-addressible
  35. machines).  Small C assumes that ints are the same as pointers.
  36.  
  37. Invocation:
  38.     scc<6809|vax|m68k|8080> filename
  39.  
  40. There are other options available - see main.c for details.
  41.  
  42. The code generated by these compilers need a run-time support library
  43. for two things: operations that are "hard" on a particular processor
  44. (eg: 16 bit multiply on an 8080), or O/S interface (vax is BSD 4.1,
  45. 6809 is FLEX, 8080 is CPM, never had one for M68k).
  46.  
  47. Status: the 6809, VAX and 8080 versions work last I checked - a problem or
  48. two may have crept in during the implementation of the compile/assemble/and
  49. link code for machines that support it.  The M68k version has never been
  50. tested.  I don't have a Pyramid version because Pyrcorp seems reluctant
  51. to publish instruction set information.
  52.  
  53. So you want to write a new coder do you?  Well, it's easy - read the
  54. comments in one of the coders.  You should not have to modify *any* of
  55. the existing files, just write a new codexxx.c file.  Please contact
  56. me if you run into trouble.  I would be greatly interested in any new
  57. coders or bug reports in the compilers.  As far as I am aware, the
  58. major restriction on porting this thing for different targets is that
  59. pointers and integers *must* be the same length, alignment, and be
  60. interchangeable.
  61.