home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / misc / smc203.ark / CC.DEF < prev    next >
Encoding:
Text File  |  1983-07-28  |  3.9 KB  |  176 lines

  1.  
  2. /*
  3. ** Small-C Compiler Version 2.0
  4. **
  5. ** Copyright 1982 J. E. Hendrix
  6. **
  7. ** Macro Definitions
  8. */
  9.  
  10. #define DATE  "(5/11/88)"       /* date this version was created */
  11. #define VERSION  "2.03 (LASM)"         /* current version of compiler */
  12.  
  13. /*
  14. ** compile options
  15. */
  16. #define N_CMD_LN /* new command line processing */
  17. #define FULLC    /* bootstrap compiler can handle full C */
  18. #define C80      /* bootstrap compile with C/80 compiler */
  19. #define M80      /* generate m80 compatable library calls */
  20. #define PHASE2   /* 2nd and later compiles */
  21. #define SEPARATE /* compile separately */
  22. #define OPTIMIZE /* compile output optimizer */
  23. /*#define NOCCARGC  no calls to CCARGC */
  24. #define HASH     /* use hash search for macros */
  25. #define CMD_LINE /* command line run options */
  26. /*#define DYNAMIC   allocate memory dynamically */
  27. /* #define POLL      poll for operator interruptions */
  28. #define COL      /* terminate labels with a colon */
  29. #define NEWLINE 13 /*newline value */
  30. #define TAB  9   /* put out tabs of this value */
  31. #define UPPER    /* force symbols to upper case */
  32. /*#define LINK      will use with linking loader */
  33.  
  34. /*
  35. ** machine dependent parameters
  36. */
  37. #define BPW     2   /* bytes per word */
  38. #define LBPW    1   /* log2(BPW) */
  39. #define SBPC    1   /* stack bytes per character */
  40. #define ERRCODE 7   /* op sys return code */
  41.  
  42. /*
  43. ** symbol table format
  44. */
  45. #define IDENT    0
  46. #define TYPE     1
  47. #define CLASS    2
  48. #define OFFSET   3
  49. #define NAME     5
  50. #define OFFSIZE (NAME-OFFSET)
  51. #define SYMAVG  10
  52. #define SYMMAX  14
  53.  
  54. /*
  55. ** symbol table parameters
  56. */
  57. #define NUMLOCS   25
  58. #define STARTLOC  symtab
  59. #define ENDLOC   (symtab+(NUMLOCS*SYMAVG))
  60. #define NUMGLBS   200
  61. #define STARTGLB  ENDLOC
  62. #define ENDGLB   (ENDLOC+((NUMGLBS-1)*SYMMAX))
  63. #define SYMTBSZ   3050  /* NUMLOCS*SYMAVG + NUMGLBS*SYMMAX */
  64.  
  65. /*
  66. ** System wide name size (for symbols)
  67. */
  68. #define NAMESIZE 9
  69. #define NAMEMAX  8
  70.  
  71. /*
  72. ** possible entries for "IDENT"
  73. */
  74. #define LABEL    0
  75. #define VARIABLE 1
  76. #define ARRAY    2
  77. #define POINTER  3
  78. #define FUNCTION 4
  79.  
  80. /*
  81. ** possible entries for "TYPE"
  82. **    low order 2 bits make type unique within length
  83. **    high order bits give length of object
  84. */
  85. /*      LABEL   0 */
  86. #define CCHAR   (1<<2)
  87. #define CINT    (BPW<<2)
  88.  
  89. /*
  90. ** possible entries for "CLASS"
  91. */
  92. /*      LABEL     0 */
  93. #define STATIC    1
  94. #define AUTOMATIC 2
  95. #define EXTERNAL  3
  96.  
  97. /*
  98. ** "switch" table
  99. */
  100. #ifdef PHASE2
  101. #define SWSIZ   (2*BPW)
  102. #define SWTABSZ (25*SWSIZ)
  103. #else /* PHASE2 */
  104. #define SWSIZ    4
  105. #define SWTABSZ 100
  106. #endif /* PHASE2 */
  107.  
  108. /*
  109. ** "while" statement queue
  110. */
  111. #define WQTABSZ  30
  112. #define WQSIZ     3
  113. #define WQMAX   (wq+WQTABSZ-WQSIZ)
  114.  
  115. /*
  116. ** entry offsets in while queue
  117. */
  118. #define WQSP    0
  119. #define WQLOOP  1
  120. #define WQEXIT  2
  121.  
  122. /*
  123. ** literal pool
  124. */
  125. #define LITABSZ 800
  126. #define LITMAX  (LITABSZ-1)
  127.  
  128. /*
  129. ** input line
  130. */
  131. #define LINEMAX  127
  132. #define LINESIZE 128
  133.  
  134. /*
  135. ** command line
  136. */
  137. #define MAXARGS  32     /* maximum number of option arguments */
  138.  
  139. /*
  140. ** output staging buffer size
  141. */
  142. #define STAGESIZE   800
  143. #define STAGELIMIT  (STAGESIZE-1)
  144.  
  145. /*
  146. ** macro (define) pool
  147. */
  148. #ifdef HASH
  149. #define MACNBR   100
  150. #define MACNSIZE 1100 /*(MACNBR*(NAMESIZE+2))*/
  151. #define MACNEND  (macn+MACNSIZE)
  152. #define MACQSIZE 500  /*(MACNBR*5)*/
  153.  
  154. #else /* HASH */
  155. #define MACQSIZE 950
  156. #endif /* HASH */
  157.  
  158. #define MACMAX  (MACQSIZE-1)
  159.  
  160. /*
  161. ** statement types
  162. */
  163. #define STIF      1
  164. #define STWHILE   2
  165. #define STRETURN  3
  166. #define STBREAK   4
  167. #define STCONT    5
  168. #define STASM     6
  169. #define STEXPR    7
  170. #define STDO      8 /* compile "do" logic */
  171. #define STFOR     9 /* compile "for" logic */
  172. #define STSWITCH 10 /* compile "switch/case/default" logic */
  173. #define STCASE   11
  174. #define STDEF    12
  175. #define STGOTO   13 /* compile "goto" logic */
  176. σσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσ