6d4f4dad7fbe22f6512bdcf907c7e8f4aaabfe2c
[fw/sdcc] / device / include / asm / ds390 / features.h
1 /** DS390/DS400 specific features.
2  */
3 #ifndef __SDC51_ASM_DS390_FEATURES_H
4 #define __SDC51_ASM_DS390_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   #elif defined(SDCC_STACK_TENBIT)
23     #define _AUTOMEM __xdata
24   #else
25     #define _AUTOMEM __idata
26   #endif
27 #elif defined(SDCC_MODEL_SMALL)
28   #define _AUTOMEM __data
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 #else
45   #define _STATMEM __xdata
46 #endif
47
48 #endif