53
|
1 #include "stdio.h"
|
|
2
|
|
3 struct arg {
|
|
4 int a0;int a1;int a2;int a3;int a4;
|
|
5 };
|
|
6
|
193
|
7 void *exit_env;
|
|
8 code (*exit_code)();
|
|
9
|
55
|
10 code carg1(int arg0,int arg1,int arg2,int arg3,int arg4,code(*exit1)(),void *env)
|
|
11 {
|
193
|
12 printf("arg1: %d %d %d %d %d : %x %x\n",arg0,arg1,arg2,arg3,arg4,exit1==exit_code,env==exit_env);
|
55
|
13 goto carg2(arg1,arg2,arg3,arg4,arg0,exit1,env);
|
|
14 }
|
|
15
|
|
16 code carg2(int arg0,int arg1,int arg2,int arg3,int arg4,code(*exit1)(),void *env)
|
53
|
17 {
|
|
18 struct arg args0;
|
193
|
19 printf("arg1: %d %d %d %d %d : %x %x\n",arg0,arg1,arg2,arg3,arg4,exit1==exit_code,env==exit_env );
|
53
|
20 args0.a0 = arg0;
|
|
21 args0.a1 = arg1;
|
|
22 args0.a2 = arg2;
|
|
23 args0.a3 = arg3;
|
|
24 args0.a4 = arg4;
|
55
|
25 goto cargs(args0,exit1,env);
|
53
|
26 }
|
|
27
|
55
|
28 code cargs(struct arg args0,code exit1(),void *env)
|
53
|
29 {
|
|
30 printf("args: %d %d %d %d %d : %x %x\n",
|
|
31 args0.a0,args0.a1,args0.a2,args0.a3,args0.a4,
|
193
|
32 exit1==exit_code,env==exit_env);
|
77
|
33 // goto exit1(321),env;
|
172
|
34 goto (*exit1)(0),env;
|
53
|
35 }
|
|
36
|
|
37
|
57
|
38 code carg3(struct arg args0,struct arg args1,int i, int j,int k,int l)
|
|
39 {
|
79
|
40 printf("args3: %d %d %d %d %d : %x %x %x %x\n",
|
|
41 args0.a0,args0.a1,args0.a2,args0.a3,args0.a4,i,j,k,l);
|
172
|
42 if (args0.a0==args1.a0) exit(0);
|
57
|
43 goto carg4(args0,args1,j,k,l,i);
|
|
44 }
|
|
45
|
|
46 code carg4(struct arg args0,struct arg args1,int i, int j,int k,int l)
|
|
47 {
|
79
|
48 printf("args4: %d %d %d %d %d : %x %x %x %x\n",
|
|
49 args0.a0,args0.a1,args0.a2,args0.a3,args0.a4,i,j,k,l);
|
57
|
50 goto carg5(args1,args0,j,k,l,i);
|
|
51 }
|
|
52
|
|
53 code carg5(struct arg args0,struct arg args1,int i, int j,int k,int l)
|
|
54 {
|
79
|
55 printf("args5: %d %d %d %d %d : %x %x %x %x\n",
|
|
56 args0.a0,args0.a1,args0.a2,args0.a3,args0.a4,i,j,k,l);
|
57
|
57 goto carg6(i,j,k,l,args0);
|
|
58 }
|
|
59
|
|
60 code carg6(int i, int j,int k,int l,struct arg args0)
|
|
61 {
|
79
|
62 printf("args6: %d %d %d %d %d : %x %x %x %x\n",
|
|
63 args0.a0,args0.a1,args0.a2,args0.a3,args0.a4,i,j,k,l);
|
57
|
64 goto carg3(args0,args0,i,j,k,l);
|
|
65 }
|
|
66
|
54
|
67 int main1(int n)
|
|
68 {
|
193
|
69 goto carg1(0,1,2,3,4,exit_code=return,exit_env=environment);
|
54
|
70 return n;
|
|
71 }
|
|
72
|
79
|
73 struct arg a00;
|
|
74 struct arg a01;
|
|
75
|
53
|
76 int main( int ac, char *av[])
|
|
77 {
|
|
78 int n;
|
54
|
79 n = main1(123);
|
|
80 printf("321=%d\n",n);
|
79
|
81
|
|
82 a00.a0 = 11;
|
|
83 a00.a1 = 22;
|
|
84 a00.a2 = 33;
|
|
85 a00.a3 = 44;
|
|
86 a00.a4 = 55;
|
|
87 a01.a0 = 66;
|
|
88 a01.a1 = 77;
|
|
89 a01.a2 = 88;
|
|
90 a01.a3 = 99;
|
|
91 a01.a4 = 10;
|
|
92 goto carg3(a00,a01,1,2,3,4);
|
53
|
93 }
|
|
94
|