struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / push_pop_sp.c
blobfaf8061bfd36fd85cdfdc082ffad11adf8149d8d
1 /** push/pop tests for mcs51.
2 */
3 #include <testfwk.h>
5 __data unsigned char _SP0, _SP1, _SP2;
7 void test(void)
9 #ifdef __SDCC_mcs51
10 __asm
11 mov __SP0,SP
12 push SP
13 mov r0,SP
14 mov __SP1,@r0
15 mov @r0,#0xFE
16 pop SP
17 mov __SP2,SP
18 mov SP,__SP0
19 __endasm;
21 ASSERT(_SP0 == _SP1);
22 ASSERT(_SP2 == 0xFE);
23 #endif