* as/mcs51/asexpr.c (expr): disabled warning "not in .flat24 mode",
[fw/sdcc] / support / regression / tests / sfr16.c
1 /*
2    sfr16.c
3 */
4
5 #include <testfwk.h>
6
7 #if defined (SDCC_mcs51)
8 sfr at 0x8A TL0; //timer 0 low byte
9 sfr at 0x8C TH0; //timer 0 high byte
10
11 sfr16 at 0x8C8A TMR0; //timer 0
12 #endif
13
14 void
15 test_sfr(void)
16 {
17 #if defined (SDCC_mcs51)
18   TMR0 = 0x00FE;
19   ASSERT (TH0 == 0x00);
20   ASSERT (TL0 == 0xFE);
21
22   TMR0++;
23   ASSERT (TH0 == 0x00);
24   ASSERT (TL0 == 0xFF);
25
26   TMR0++;
27   ASSERT (TH0 == 0x01);
28   ASSERT (TL0 == 0x00);
29
30   TL0++;
31   ASSERT (TMR0 == 0x0101);
32 #endif
33 }