comparison test/tmp1.c @ 748:c2c709727221

i64 continue... basic.s assembled.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 13 Nov 2010 22:39:40 +0900
parents 3f1f6c0610c1
children 5313ed059cee
comparison
equal deleted inserted replaced
747:d4bc10fe7362 748:c2c709727221
13 int ac; 13 int ac;
14 char *av[]; 14 char *av[];
15 { 15 {
16 ret = __return; 16 ret = __return;
17 env = __environment; 17 env = __environment;
18 printf("#0012:main0 %d start.\n",ac); 18 printf("#0017:main0 %d start.\n",ac);
19 if (ac>=1) 19 if (ac>=1)
20 goto code0(ac,av,__return); 20 goto code0(ac,av,__return);
21 goto code1(ac,av,exit1); 21 goto code1(ac,av,exit1);
22 // not reached. (warning?) 22 // not reached. (warning?)
23 printf("#0017:main0 %d end.\n",ac); 23 printf("#0022:main0 %d end.\n",ac);
24 } 24 }
25 25
26 __code exit1(int ac) 26 __code exit1(int ac)
27 { 27 {
28 // exit(0); 28 // exit(0);
31 31
32 __code code3(a,b,c,d,e,f) 32 __code code3(a,b,c,d,e,f)
33 char a,b; 33 char a,b;
34 int c,d,e,f; 34 int c,d,e,f;
35 { 35 {
36 printf("#0030:code3: %d %d %d %d %d %d\n",a,b,c,d,e,f); 36 printf("#0035:code3: %d %d %d %d %d %d\n",a,b,c,d,e,f);
37 if(a<10) 37 if(a<10)
38 goto code3(a+1,b,c,d,e,f); 38 goto code3(a+1,b,c,d,e,f);
39 else 39 else
40 goto code4(a+3,b+3,c+3,d+3,e+3,f+3); 40 goto code4(a+3,b+3,c+3,d+3,e+3,f+3);
41 } 41 }
43 __code code4(a,b,c,d,e,f) 43 __code code4(a,b,c,d,e,f)
44 char a,b; 44 char a,b;
45 int c,d,e,f; 45 int c,d,e,f;
46 { 46 {
47 int i=1,j=2; 47 int i=1,j=2;
48 printf("#0042:code4: %d %d %d %d %d %d\n",a,b,c,d,e,f); 48 printf("#0047:code4: %d %d %d %d %d %d\n",a,b,c,d,e,f);
49 if(a<20) // cyclic binary dependency 49 if(a<20) // cyclic binary dependency
50 goto code3(a+b,b+c,c+d,d+e,e+f,f+a); 50 goto code3(a+b,b+c,c+d,d+e,e+f,f+a);
51 else if(a<30) 51 else if(a<30)
52 goto code3(a,b,c,d,e,f); 52 goto code3(a,b,c,d,e,f);
53 else if(a<40) // cyclic dependency 53 else if(a<40) // cyclic dependency
69 int ac; 69 int ac;
70 __code (*exit)(int,void*); 70 __code (*exit)(int,void*);
71 char *av[]; 71 char *av[];
72 { 72 {
73 __code (*f)(int,void *); 73 __code (*f)(int,void *);
74 printf("#0067:code1: %d\n",ac); 74 printf("#0073:code1: %d\n",ac);
75 f = exit; 75 f = exit;
76 if (ac>3) 76 if (ac>3)
77 goto code1(ac,av,f); 77 goto code1(ac,av,f);
78 else if (ac>2) 78 else if (ac>2)
79 goto code1(av,ac,f); 79 goto code1(av,ac,f);
83 83
84 int 84 int
85 main(int ac,char *av[]) 85 main(int ac,char *av[])
86 { 86 {
87 main0(1,av); 87 main0(1,av);
88 printf("#0081:main continue.\n"); 88 printf("#0087:main continue.\n");
89 main0(0,av); 89 main0(0,av);
90 printf("#0083:main end.\n"); 90 printf("#0089:main end.\n");
91 return 0; 91 return 0;
92 } 92 }
93 93
94 /* end */ 94 /* end */