Fixed several pointer related bugs in the PIC port
[fw/sdcc] / src / regression / string1.c
1 unsigned char success=0;
2 unsigned char failures=0;
3 unsigned char dummy=0;
4 //unsigned bit bit1;
5
6 typedef unsigned char byte;
7 data at 0x06 unsigned char  PORTB;
8
9 byte uchar0;
10 const byte arr[] = { 1,2,8,9,0 };
11
12 bit at 0x30 B1;
13
14 void done()
15 {
16
17   dummy++;
18
19 }
20
21 void  isr(void) interrupt 1 using 1
22 {
23
24   if(arr[3]!=9)
25     failures++;
26   PORTB = 7;
27   B1=1;
28 }
29
30 void lcd1(const unsigned char *str)
31 {
32   const char *p = "hellow world!\r\n";
33
34   if(!str)
35     failures++;
36
37  if(str && str[2] != 'r')
38     failures++;
39
40   if(arr[3]!=9)
41     failures++;
42
43   while (1) {
44     if (0 == *p) break;
45     PORTB = *p;
46     p++;
47   }
48
49 }
50
51 void main(void)
52 {
53   dummy = 0;
54
55   lcd1("str");
56   B1=0;
57   success = failures;
58   done();
59 }