* device/lib/medium/Makefile: added for new memory model medium
[fw/sdcc] / device / include / asm / mcs51 / features.h
1 /** MCS51 specific features.
2  */
3 #ifndef __SDC51_ASM_MCS51_FEATURES_H
4 #define __SDC51_ASM_MCS51_FEATURES_H   1
5
6 #define _REENTRANT      reentrant
7 #define _CODE           code
8
9 /* define _AUTOMEM to indicate the default storage class for
10    automatic variables. To be used with pointers to automatic variables.
11    Cannot be used in reentrant declared functions!
12
13    void foo(void)
14    {
15      char Ar[10];
16      char _AUTOMEM * pAr = Ar;
17    }
18 */
19 #if defined(SDCC_STACK_AUTO)
20   #if defined(SDCC_USE_XSTACK)
21     #define _AUTOMEM pdata
22   #else
23     #define _AUTOMEM idata
24   #endif
25 #elif defined(SDCC_MODEL_SMALL)
26   #define _AUTOMEM data
27 #elif defined(SDCC_MODEL_MEDIUM)
28   #define _AUTOMEM pdata
29 #else
30   #define _AUTOMEM xdata
31 #endif
32
33 /* define _STATMEM to indicate the default storage class for
34    global/static variables. To be used with pointers to static variables.
35
36    char Ar[10];
37    void foo(void)
38    {
39      char _STATMEM * pAr = Ar;
40    }
41 */
42 #if defined(SDCC_MODEL_SMALL)
43   #define _STATMEM data
44 #elif defined(SDCC_MODEL_MEDIUM)
45   #define _STATMEM pdata
46 #else
47   #define _STATMEM xdata
48 #endif
49
50 #endif