]> pd.if.org Git - mmurtl/blob - msamples/cm32m/cm32.h
autocommit for file dated 1995-02-09 16:07:42
[mmurtl] / msamples / cm32m / cm32.h
1 /*\r
2  * Global definitions for the C MINUS 32 compiler.\r
3  *\r
4  * Copyright 1990, Dave Dunfield\r
5  * Copyright 1992-1995 R.A. Burgess\r
6 */\r
7 \r
8 #define FALSE           0\r
9 #define TRUE            1\r
10 \r
11 /*\r
12  * Misc. fixed compiler parameters\r
13  */\r
14 #define LINE_MAX        200             /* maximum size of input line */\r
15 #define MACROS          500             /* number of macros allowed */\r
16 #define MAC_BUFF        15000   /* string space alloted to macro pool */\r
17 #define PARAMETERS      10              /* maximum # parameters to a macro */\r
18 #define PARM_BUFF       200             /* parameter names & definitions */\r
19 #define INCL_DEPTH      5               /* maximum depth of include files */\r
20 \r
21 #define GBUFFSIZE   15000       /* n bytes in symbol name pool */\r
22 #define LBUFFSIZE   300         /* n bytes in Local symbol name pool */\r
23 #define SYMBOL_SIZE     31              /* Max chars in symbol name */\r
24 #define EXPR_DEPTH      20              /* maximum depth of expression stack */\r
25 #define MAX_SYMBOLS     300             /* maximum # active symbols */\r
26 #define MAX_ARGS        20              /* maximum # arguments to a function */\r
27 #define MAX_PROTOS      700             /* maximum # params for all functions */\r
28 #define LOOP_DEPTH      10              /* maximum # nested loops */\r
29 #define MAX_SWITCH      80              /* maximum # active switch-case statements */\r
30 #define DIM_SIZE        100             /* maximum # active array dimensions */\r
31 #define DEFINE_SIZE     260             /* maximum # defines - was 150 */\r
32 #define DEFINE_BUFF 2800        /* size of define string space - was 1500*/\r
33 #define LITER_BUFF      10000   /* size of literal string space */\r
34 #define MAX_ERRORS      15              /* # error before termination forced */\r
35 \r
36 /******************************************************************\r
37  Bits found in the "type" entry of symbol table, also\r
38  used on the expression stack to keep track of element types,\r
39  and passed to the code generation routines to identify types.\r
40 \r
41  The POINTER definition indicates the level of pointer indirection,\r
42  and should contain all otherwise unused bits, in the least significant\r
43  (rightmost) bits of the word.\r
44 \r
45  All structure definitions are marked as STRUCDEF.  The TAG is optionally\r
46  the name in the symbol table.  The tag may be reused to dine other\r
47  structure variables. The members of a STRUCDEF follow the it directly\r
48  in the sysbol table and are marked as STRUCMEM.  When a structure\r
49  variable is actually defined it is simply marked as a STRUCT and\r
50 */\r
51 \r
52 #define STRUCMEM        0x04000000L             /* structure member (follows strucdef) */\r
53 #define STRUCDEF        0x02000000L             /* struct TAG define, members follow */\r
54 #define TYPDEF          0x01000000L             /* for type definition & struct tags */\r
55 #define ISR                     0x00800000L             /* function is interrupt type */\r
56 #define REFERENCE       0x00400000L             /* symbol has been referenced */\r
57 #define GLOBAL          0x00200000L             /* symbol is not local - access by name */\r
58 #define INITED          0x00100000L             /* symbol is initialized */\r
59 #define GLABEL          0x00080000L             /* symbol is a goto label - local only */\r
60 #define FUNCTION        0x00040000L             /* symbol is a function */\r
61 #define PROTO           0x00020000L             /* symbol is a prototype function */\r
62 #define VARARGS         0x00010000L             /* function has var nParams */\r
63 #define ARGUMENT        0x00008000L             /* symbol is a function argument */\r
64 #define EXTERNAL        0x00004000L             /* external reference */\r
65 #define FAR                     0x00002000L             /* far - pointers and functions ONLY */\r
66 #define STATIC          0x00001000L             /* symbol is not public or External*/\r
67 #define CONSTANT        0x00000800L             /* warning if assigned a value */\r
68 #define REGISTER        0x00000400L             /* register symbol */\r
69 #define STRUCT          0x00000200L             /* a structure */\r
70 #define ARRAY           0x00000100L             /* symbol is an array */\r
71 #define UNSIGNED        0x00000080L             /* Use unsigned value */\r
72 #define DWORD           0x00000040L             /* 32 bit  */\r
73 #define WORD            0x00000020L             /* 16 bit */\r
74 #define BYTE            0x00000010L             /* 8  bit */\r
75 #define VOID            0x00000008L             /* functions and params only */\r
76 #define POINTER         0x00000007L             /* 7 levels of pointer indirection max */\r
77 \r
78 #define SIZEMASK        0x00000070L             /* mask to test size only */\r
79 \r
80 /*************************************************\r
81   Tokens identifing value types.\r
82 **************************************************/\r
83 \r
84 #define NUMBER          100     /* numeric constant */\r
85 #define STRING          101     /* literal constant */\r
86 #define LABEL           102     /* label address */\r
87 #define SYMBOL          103     /* symbol value */\r
88 #define INEAX           104     /* value in EAX (accumulator) */\r
89 #define INECX           105     /* value is in secondary register */\r
90 #define INEDX           106     /* pointer in EDX reg (indirect access) */\r
91 #define PECX            107     /* pointer in ECX reg (indirect access) */\r
92 #define PEDX            108     /* pointer in EDX register (indirect access) */\r
93 #define PESI            109     /* pointer in index register (indirect access) */\r
94 \r
95 /* EBX is used as the top of the processor stack. It's simply\r
96    for rapid access to stacked items. If another item is placed\r
97    on the stack and a token is the "active EBX item" then it\r
98    must be pushed onto the real stack.\r
99 */\r
100 \r
101 #define STACK_TOP       110 /* Value in EBX for accessibility */\r
102 #define ISTACK_TOP      111 /* Index to value in EBX for accessibility */\r
103 \r
104 #define ON_STACK        112 /* Value actually on Processor stack */\r
105 #define ION_STACK       113 /* Index to value actually on Processor stack */\r