annotate test/tmp1.c @ 935:7672a37e7545 default tip

Raspbery PI ARM support begin
author kono
date Sat, 24 Dec 2016 03:02:57 +0000
parents 5313ed059cee
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
1 /* easy test */
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 720
diff changeset
2 #define __environment _CbC_environment
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 720
diff changeset
3 #define __return _CbC_return
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 720
diff changeset
4
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
5
720
6b7372e17970 *** empty log message ***
kono
parents: 622
diff changeset
6 extern int printf(const char *,...);
6b7372e17970 *** empty log message ***
kono
parents: 622
diff changeset
7
622
682c8ec38d45 _code へ
kono
parents: 575
diff changeset
8 __code (*ret)();
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
9 void *env;
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 720
diff changeset
10 __code exit1(int ac,void *);
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
11
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
12 main0(ac,av)
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
13 int ac;
d35df41eac69 Initial revision
kono
parents:
diff changeset
14 char *av[];
d35df41eac69 Initial revision
kono
parents:
diff changeset
15 {
720
6b7372e17970 *** empty log message ***
kono
parents: 622
diff changeset
16 ret = __return;
6b7372e17970 *** empty log message ***
kono
parents: 622
diff changeset
17 env = __environment;
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
18 printf("#0017:main0 %d start.\n",ac);
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
19 if (ac>=1)
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
20 goto code0(ac,av,__return);
172
096559f07a70 some check
kono
parents: 0
diff changeset
21 goto code1(ac,av,exit1);
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
22 // not reached. (warning?)
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
23 printf("#0022:main0 %d end.\n",ac);
172
096559f07a70 some check
kono
parents: 0
diff changeset
24 }
096559f07a70 some check
kono
parents: 0
diff changeset
25
622
682c8ec38d45 _code へ
kono
parents: 575
diff changeset
26 __code exit1(int ac)
172
096559f07a70 some check
kono
parents: 0
diff changeset
27 {
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
28 // exit(0);
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
29 goto code3(0,1,2,3,4,5);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
30 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
31
622
682c8ec38d45 _code へ
kono
parents: 575
diff changeset
32 __code code3(a,b,c,d,e,f)
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
33 char a,b;
d35df41eac69 Initial revision
kono
parents:
diff changeset
34 int c,d,e,f;
d35df41eac69 Initial revision
kono
parents:
diff changeset
35 {
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
36 printf("#0035:code3: %d %d %d %d %d %d\n",a,b,c,d,e,f);
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
37 if(a<10)
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
38 goto code3(a+1,b,c,d,e,f);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
39 else
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
40 goto code4(a+3,b+3,c+3,d+3,e+3,f+3);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
41 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
42
622
682c8ec38d45 _code へ
kono
parents: 575
diff changeset
43 __code code4(a,b,c,d,e,f)
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
44 char a,b;
d35df41eac69 Initial revision
kono
parents:
diff changeset
45 int c,d,e,f;
d35df41eac69 Initial revision
kono
parents:
diff changeset
46 {
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
47 int i=1,j=2;
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
48 printf("#0047:code4: %d %d %d %d %d %d\n",a,b,c,d,e,f);
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
49 if(a<20) // cyclic binary dependency
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
50 goto code3(a+b,b+c,c+d,d+e,e+f,f+a);
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
51 else if(a<30)
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
52 goto code3(a,b,c,d,e,f);
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
53 else if(a<40) // cyclic dependency
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
54 goto code3(b,c,a,e,f,d);
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
55 else if(a<50)
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
56 goto code4(a+i,b+j,c+i,d+3,e+3,f+3);
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 720
diff changeset
57 else goto ret(0,env);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
58 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
59
622
682c8ec38d45 _code へ
kono
parents: 575
diff changeset
60 __code code0(ac,av,ret)
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
61 int ac;
d35df41eac69 Initial revision
kono
parents:
diff changeset
62 char *av[];
720
6b7372e17970 *** empty log message ***
kono
parents: 622
diff changeset
63 __code (*ret)(int);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
64 {
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
65 goto code1(ac,av,ret);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
66 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
67
622
682c8ec38d45 _code へ
kono
parents: 575
diff changeset
68 __code code1(ac,av,exit)
720
6b7372e17970 *** empty log message ***
kono
parents: 622
diff changeset
69 int ac;
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 720
diff changeset
70 __code (*exit)(int,void*);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
71 char *av[];
d35df41eac69 Initial revision
kono
parents:
diff changeset
72 {
725
3f1f6c0610c1 goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 720
diff changeset
73 __code (*f)(int,void *);
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
74 printf("#0073:code1: %d\n",ac);
172
096559f07a70 some check
kono
parents: 0
diff changeset
75 f = exit;
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
76 if (ac>3)
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
77 goto code1(ac,av,f);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
78 else if (ac>2)
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
79 goto code1(av,ac,f);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
80 else
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
81 goto (*f)(ac,env);
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
82 }
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
83
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
84 int
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
85 main(int ac,char *av[])
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
86 {
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
87 main0(1,av);
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
88 printf("#0087:main continue.\n");
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
89 main0(0,av);
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
90 printf("#0089:main end.\n");
575
a4445cb1aa91 Example filex.
kono
parents: 573
diff changeset
91 return 0;
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
92 }
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
93
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 172
diff changeset
94 /* end */