467
|
1 int printf(const char *format, ...);
|
|
2
|
|
3
|
375
|
4 #define ARG_ADDRESS 0
|
|
5
|
97
|
6 double ggg = 0.134;
|
|
7 float fff = 0.0;
|
|
8
|
|
9 extern double eggg;
|
|
10 double eggg = 0.134;
|
|
11 extern float efff;
|
|
12 float efff = 0.1345;
|
|
13
|
|
14 double ggg0;
|
|
15 float fff0;
|
|
16
|
|
17 #if 0
|
|
18 extern double reggg;
|
|
19 extern float refff;
|
|
20 #endif
|
89
|
21
|
496
|
22 int
|
89
|
23 print(double d)
|
|
24 {
|
|
25 float f;
|
|
26 int *dd;
|
|
27
|
97
|
28 #if 0
|
|
29 f = refff;
|
|
30 f = reggg;
|
|
31 #endif
|
|
32
|
89
|
33 f = d;
|
|
34
|
|
35 dd = (int*) &d;
|
491
|
36 printf("#0035:d %g\n",d);
|
|
37 printf("#0036:dx %08x %08x\n",*(dd),*(dd+1));
|
89
|
38
|
|
39 dd = (int*) &f;
|
491
|
40 printf("#0039:f %g\n",f);
|
|
41 printf("#0040:dx %08x \n",*(dd));
|
488
|
42 return 1;
|
89
|
43 }
|
|
44
|
|
45 void
|
|
46 tmp () {
|
|
47 char c;
|
|
48 int i;
|
|
49 c=-1;
|
|
50 i=c;
|
491
|
51 printf("#0050:%d %d %d\n",!i,~i,-i);
|
|
52 printf("#0051:%d\n",i);
|
89
|
53 }
|
|
54
|
96
|
55 int
|
|
56 g(
|
|
57 int a0,int a1,int a2,int a3,int a4,int a5,int a6,int a7,int a8
|
|
58 )
|
|
59 {
|
491
|
60 printf("#0059:g: %d\n",
|
96
|
61 a0+a1+a2+a3+a4+a5+a6+a7+a8
|
|
62 );
|
|
63 return a8;
|
|
64 }
|
|
65
|
103
|
66 int
|
119
|
67 i50(
|
|
68 int a0,int a1,int a2,int a3,int a4,int a5,int a6,int a7,int a8,int a9,int a10,int a11,int a12,int a13,int a14,int a15,int a16,int a17,int a18,int a19,int a20,int a21,int a22,int a23,int a24,int a25,int a26,int a27,int a28,int a29,int a30,int a31,int a32,int a33,int a34,int a35,int a36,int a37,int a38,int a39,int a40,int a41,int a42,int a43,int a44,int a45,int a46,int a47,int a48,int a49
|
108
|
69 )
|
|
70 {
|
375
|
71 #if ARG_ADDRESS
|
491
|
72 printf("#0071:i50: a0 %x a49 %x\n",&a0,&a49);
|
375
|
73 #endif
|
491
|
74 printf("#0073:i50: %d\n",
|
119
|
75 a0+a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17+a18+a19+a20+a21+a22+a23+a24+a25+a26+a27+a28+a29+a30+a31+a32+a33+a34+a35+a36+a37+a38+a39+a40+a41+a42+a43+a44+a45+a46+a47+a48+a49
|
108
|
76 );
|
|
77 return a8;
|
|
78 }
|
|
79
|
119
|
80 float
|
|
81 f50(
|
|
82 float a0,float a1,float a2,float a3,float a4,float a5,float a6,float a7,float a8,float a9,float a10,float a11,float a12,float a13,float a14,float a15,float a16,float a17,float a18,float a19,float a20,float a21,float a22,float a23,float a24,float a25,float a26,float a27,float a28,float a29,float a30,float a31,float a32,float a33,float a34,float a35,float a36,float a37,float a38,float a39,float a40,float a41,float a42,float a43,float a44,float a45,float a46,float a47,float a48,float a49
|
|
83 )
|
|
84 {
|
491
|
85 printf("#0084:f50: %g\n",
|
119
|
86 a0+a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17+a18+a19+a20+a21+a22+a23+a24+a25+a26+a27+a28+a29+a30+a31+a32+a33+a34+a35+a36+a37+a38+a39+a40+a41+a42+a43+a44+a45+a46+a47+a48+a49
|
|
87 );
|
|
88 return a8;
|
|
89 }
|
|
90
|
|
91 double
|
|
92 d50(
|
|
93 double a0,double a1,double a2,double a3,double a4,double a5,double a6,double a7,double a8,double a9,double a10,double a11,double a12,double a13,double a14,double a15,double a16,double a17,double a18,double a19,double a20,double a21,double a22,double a23,double a24,double a25,double a26,double a27,double a28,double a29,double a30,double a31,double a32,double a33,double a34,double a35,double a36,double a37,double a38,double a39,double a40,double a41,double a42,double a43,double a44,double a45,double a46,double a47,double a48,double a49
|
|
94 )
|
|
95 {
|
491
|
96 printf("#0095:d50: %g\n",
|
119
|
97 a0+a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17+a18+a19+a20+a21+a22+a23+a24+a25+a26+a27+a28+a29+a30+a31+a32+a33+a34+a35+a36+a37+a38+a39+a40+a41+a42+a43+a44+a45+a46+a47+a48+a49
|
|
98 );
|
|
99 return a8;
|
|
100 }
|
|
101
|
|
102
|
108
|
103 int
|
103
|
104 h( int a0,int a1,int a2,int a3,int a4,int a5,int a6,int a7,int a8)
|
|
105 {
|
|
106 g( a0,a1,a2,a3,a4,a5,a6,a7,a8);
|
|
107 }
|
|
108
|
|
109
|
96
|
110 double
|
|
111 f(
|
|
112 double a0,double a1,double a2,double a3,double a4,double a5,double a6,double a7,double a8
|
|
113 )
|
|
114 {
|
491
|
115 printf("#0114:f: %g\n",
|
96
|
116 a0+a1+a2+a3+a4+a5+a6+a7+a8
|
|
117 );
|
|
118 return a8;
|
|
119 }
|
|
120
|
89
|
121 void
|
|
122 tmp1 () {
|
375
|
123 #if ARG_ADDRESS
|
|
124 int a0;
|
491
|
125 printf("#0124:tmp1: a0 %x\n",&a0);
|
375
|
126 #endif
|
89
|
127
|
491
|
128 printf("#0127:%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n",
|
119
|
129 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49
|
|
130 );
|
491
|
131 printf("#0130:%g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g \n",
|
119
|
132 0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0
|
|
133 );
|
|
134
|
|
135 i50(
|
|
136 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49
|
|
137 );
|
|
138 f50(
|
|
139 0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0
|
|
140 );
|
|
141 d50(
|
|
142 0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0
|
|
143 );
|
|
144
|
103
|
145 h(0,1,2,3,4,5,6,7,1);
|
96
|
146 g(g(0,1,2,3,4,5,6,7,0),
|
|
147 g(0,1,2,3,4,5,6,7,1),
|
|
148 g(0,1,2,3,4,5,6,7,2),
|
|
149 g(0,1,2,3,4,5,6,7,3),
|
|
150 g(0,1,2,3,4,5,6,7,4),
|
|
151 g(0,1,2,3,4,5,6,7,5),
|
|
152 g(0,1,2,3,4,5,6,7,6),
|
|
153 g(0,1,2,3,4,5,6,7,6),
|
|
154 g(0,1,2,3,4,5,6,7,7));
|
|
155 f(f(0,1,2,3,4,5,6,7,0),
|
|
156 f(0,1,2,3,4,5,6,7,1),
|
|
157 f(0,1,2,3,4,5,6,7,2),
|
|
158 f(0,1,2,3,4,5,6,7,3),
|
|
159 f(0,1,2,3,4,5,6,7,4),
|
|
160 f(0,1,2,3,4,5,6,7,5),
|
|
161 f(0,1,2,3,4,5,6,7,6),
|
|
162 f(0,1,2,3,4,5,6,7,6),
|
|
163 f(0,1,2,3,4,5,6,7,7));
|
|
164
|
89
|
165 }
|
|
166
|
496
|
167 void
|
|
168 double_int()
|
|
169 {
|
|
170 printf("#0169:%d %f %f %f %f %f %f %f %f %f %f %f\n",
|
|
171 1,0.1,.2,.3,.4,.5,.6,.7,.8,.9,.1,.2);
|
|
172 printf("#0171:%d %d %f %f %f %f %f %f %f %f %f %f\n",
|
|
173 1, 1,.2,.3,.4,.5,.6,.7,.8,.9,.1,.2);
|
|
174 printf("#0173:%d %d %d %f %f %f %f %f %f %f %f %f\n",
|
|
175 1, 1, 2,.3,.4,.5,.6,.7,.8,.9,.1,.2);
|
|
176 printf("#0175:%d %d %d %d %f %f %f %f %f %f %f %f\n",
|
|
177 1, 1, 2, 3,.4,.5,.6,.7,.8,.9,.1,.2);
|
|
178 printf("#0177:%d %d %d %d %d %f %f %f %f %f %f %f\n",
|
|
179 1, 1, 2, 3, 4,.5,.6,.7,.8,.9,.1,.2);
|
|
180 printf("#0179:%d %d %d %d %d %d %f %f %f %f %f %f\n",
|
|
181 1, 1, 2, 3, 4, 5,.6,.7,.8,.9,.1,.2);
|
|
182 printf("#0181:%d %d %d %d %d %d %d %f %f %f %f %f\n",
|
|
183 1, 1, 2, 3, 4, 5, 6,.7,.8,.9,.1,.2);
|
|
184 printf("#0183:%d %d %d %d %d %d %d %d %f %f %f %f\n",
|
|
185 1, 1, 2, 3, 4, 5, 6, 7,.8,.9,.1,.2);
|
|
186 printf("#0185:%d %d %d %d %d %d %d %d %d %f %f %f\n",
|
|
187 1, 1, 2, 3, 4, 5, 6, 7, 8,.9,.1,.2);
|
|
188 printf("#0187:%d %d %d %d %d %d %d %d %d %d %f %f\n",
|
|
189 1, 1, 2, 3, 4, 5, 6, 7, 8, 9,.1,.2);
|
|
190 printf("#0189:%d %d %d %d %d %d %d %d %d %d %d %f\n",
|
|
191 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1,.2);
|
|
192 printf("#0191:%d %d %d %d %d %d %d %d %d %d %d %d\n",
|
|
193 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2);
|
|
194
|
|
195 printf("#0194:%f %d %d %d %d %d %d %d %d %d %d %d\n",
|
|
196 .1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2);
|
|
197 printf("#0196:%f %f %d %d %d %d %d %d %d %d %d %d\n",
|
|
198 .1, .1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2);
|
|
199 printf("#0198:%f %f %f %d %d %d %d %d %d %d %d %d\n",
|
|
200 .1, .1,.2, 3, 4, 5, 6, 7, 8, 9, 1, 2);
|
|
201 printf("#0200:%f %f %f %f %d %d %d %d %d %d %d %d\n",
|
|
202 .1, .1,.2,.3, 4, 5, 6, 7, 8, 9, 1, 2);
|
|
203 printf("#0202:%f %f %f %f %f %d %d %d %d %d %d %d\n",
|
|
204 .1, .1,.2,.3,.4, 5, 6, 7, 8, 9, 1, 2);
|
|
205 printf("#0204:%f %f %f %f %f %f %d %d %d %d %d %d\n",
|
|
206 .1, .1,.2,.3,.4,.5, 6, 7, 8, 9, 1, 2);
|
|
207 printf("#0206:%f %f %f %f %f %f %f %d %d %d %d %d\n",
|
|
208 .1, .1,.2,.3,.4,.5,.6, 7, 8, 9, 1, 2);
|
|
209 printf("#0208:%f %f %f %f %f %f %f %f %d %d %d %d\n",
|
|
210 .1, .1,.2,.3,.4,.5,.6,.7, 8, 9, 1, 2);
|
|
211 printf("#0210:%f %f %f %f %f %f %f %f %f %d %d %d\n",
|
|
212 .1, .1,.2,.3,.4,.5,.6,.7,.8, 9, 1, 2);
|
|
213 printf("#0212:%f %f %f %f %f %f %f %f %f %f %d %d\n",
|
|
214 .1, .1,.2,.3,.4,.5,.6,.7,.8,.9, 1, 2);
|
|
215 printf("#0214:%f %f %f %f %f %f %f %f %f %f %f %d\n",
|
|
216 .1, .1,.2,.3,.4,.5,.6,.7,.8,.9,.1, 2);
|
|
217 printf("#0216:%f %f %f %f %f %f %f %f %f %f %f %f\n",
|
|
218 .1, .1,.2,.3,.4,.5,.6,.7,.8,.9,.1,.2);
|
|
219
|
|
220 printf("#0219:%f %d %f %d %f %d %f %d %f %d %f %d\n",
|
|
221 .1, 1,.2, 3,.4, 5,.6, 7,.8, 9,.1, 2);
|
|
222
|
|
223 printf("#0222:%d %f %d %f %d %f %d %f %d %f %d %f\n",
|
|
224 1, .1, 2,.3, 4,.5, 6,.7, 8,.9, 1,.2);
|
|
225 }
|
|
226
|
|
227
|
488
|
228 int
|
89
|
229 main() {
|
|
230 print(1.0);
|
|
231 print(0.1234);
|
|
232 print(1.234e10);
|
|
233 print(1.234e-10);
|
108
|
234 tmp1();
|
496
|
235 double_int();
|
172
|
236 return 0;
|
89
|
237 }
|