* src/regression/add.c, src/regression/add2.c, src/regression/add3.c,
[fw/sdcc] / src / regression / configword.c
1 #include "gpsim_assert.h"
2 /* configword.c - illustrates how the configuration word can
3  * be assigned */
4
5 unsigned char failures=0;
6
7 /* copied from 16f877.inc file supplied with gpasm */
8
9 #define _CP_ALL          0x0FCF
10 #define _CP_HALF         0x1FDF
11 #define _CP_UPPER_256    0x2FEF
12 #define _CP_OFF          0x3FFF
13 #define _DEBUG_ON        0x37FF
14 #define _DEBUG_OFF       0x3FFF
15 #define _WRT_ENABLE_ON   0x3FFF
16 #define _WRT_ENABLE_OFF  0x3DFF
17 #define _CPD_ON          0x3EFF
18 #define _CPD_OFF         0x3FFF
19 #define _LVP_ON          0x3FFF
20 #define _LVP_OFF         0x3F7F
21 #define _BODEN_ON        0x3FFF
22 #define _BODEN_OFF       0x3FBF
23 #define _PWRTE_OFF       0x3FFF
24 #define _PWRTE_ON        0x3FF7
25 #define _WDT_ON          0x3FFF
26 #define _WDT_OFF         0x3FFB
27 #define _LP_OSC          0x3FFC
28 #define _XT_OSC          0x3FFD
29 #define _HS_OSC          0x3FFE
30 #define _RC_OSC          0x3FFF
31
32 typedef unsigned int word;
33
34 word at 0x2007  CONFIG = _WDT_OFF & _PWRTE_ON;
35
36
37 /* to do -- write a test that puts the PIC to sleep,
38  * and verify that the WDT wakes it up */
39
40 void
41 done()
42 {
43   ASSERT(MANGLE(failures) == 0);
44   PASSED();
45 }
46
47 void main(void)
48 {
49   dummy = 0;
50
51   done();
52 }