Mercurial > hg > CbC > old > device
comparison test/short.c @ 427:0c256ea2a97e
Bitfield left value for ia32
author | kono |
---|---|
date | Sat, 30 Oct 2004 18:49:25 +0900 |
parents | 5b50813d0c45 |
children | 32737bad7489 |
comparison
equal
deleted
inserted
replaced
426:fb136af3bf09 | 427:0c256ea2a97e |
---|---|
31 i = -3; | 31 i = -3; |
32 j = 3; | 32 j = 3; |
33 k = 44; | 33 k = 44; |
34 k = i*j+3+k; | 34 k = i*j+3+k; |
35 m = i*j-7+k; | 35 m = i*j-7+k; |
36 printf("%d %d %d\n",i,k,m); | 36 printf("#0035:%d %d %d\n",i,k,m); |
37 | 37 |
38 g0 = 123; | 38 g0 = 123; |
39 g0++; --g0; | 39 g0++; --g0; |
40 ++g0; g0--; | 40 ++g0; g0--; |
41 printf("g0=%d\n",g0); | 41 printf("#0040:g0=%d\n",g0); |
42 g1 = -123; | 42 g1 = -123; |
43 g1++; --g1; | 43 g1++; --g1; |
44 ++g1; g1--; | 44 ++g1; g1--; |
45 printf("g1=%d\n",g1); | 45 printf("#0044:g1=%d\n",g1); |
46 | 46 |
47 sg0 = 123; | 47 sg0 = 123; |
48 sg0++; --sg0; | 48 sg0++; --sg0; |
49 ++sg0; sg0--; | 49 ++sg0; sg0--; |
50 printf("sg0=%d\n",sg0); | 50 printf("#0049:sg0=%d\n",sg0); |
51 sg1 = -123; | 51 sg1 = -123; |
52 sg1++; --sg1; | 52 sg1++; --sg1; |
53 ++sg1; sg1--; | 53 ++sg1; sg1--; |
54 printf("sg1=%d\n",sg1); | 54 printf("#0053:sg1=%d\n",sg1); |
55 | 55 |
56 pg0 = &g0; | 56 pg0 = &g0; |
57 ph0 = &h0; | 57 ph0 = &h0; |
58 *pg0 = 123; | 58 *pg0 = 123; |
59 //*pg0++; *--pg0; | 59 //*pg0++; *--pg0; |
60 //*++pg0; *g0--; | 60 //*++pg0; *g0--; |
61 printf("g0=%d\n",*pg0); | 61 printf("#0060:g0=%d\n",*pg0); |
62 pg1 = &g1; | 62 pg1 = &g1; |
63 ph1 = &h1; | 63 ph1 = &h1; |
64 *pg1 = -123; | 64 *pg1 = -123; |
65 //*pg1++; --*pg1; | 65 //*pg1++; --*pg1; |
66 //++*pg1; *pg1--; | 66 //++*pg1; *pg1--; |
67 printf("g1=%d\n",*pg1); | 67 printf("#0066:g1=%d\n",*pg1); |
68 | 68 |
69 psg0 = &sg0; | 69 psg0 = &sg0; |
70 psh0 = &sh0; | 70 psh0 = &sh0; |
71 *psg0 = 123; | 71 *psg0 = 123; |
72 //*sg0++; *--sg0; | 72 //*sg0++; *--sg0; |
73 //*++sg0; *sg0--; | 73 //*++sg0; *sg0--; |
74 printf("sg0=%d\n",*psg0); | 74 printf("#0073:sg0=%d\n",*psg0); |
75 psg1 = &sg1; | 75 psg1 = &sg1; |
76 psh1 = &sh1; | 76 psh1 = &sh1; |
77 *psg1 = -123; | 77 *psg1 = -123; |
78 //*sg1++; *--sg1; | 78 //*sg1++; *--sg1; |
79 //*++sg1; *sg1--; | 79 //*++sg1; *sg1--; |
80 printf("sg1=%d\n",*psg1); | 80 printf("#0079:sg1=%d\n",*psg1); |
81 | 81 |
82 | 82 |
83 h0 = g0 - 20; | 83 h0 = g0 - 20; |
84 c[33] = g0; | 84 c[33] = g0; |
85 | 85 |
86 if (i==j) { printf("i==j\n"); } else { printf("i!=j\n"); } | 86 if (i==j) { printf("#0085:i==j\n"); } else { printf("i!=j\n"); } |
87 | 87 |
88 a[33] = i; | 88 a[33] = i; |
89 b[33] = 105; | 89 b[33] = 105; |
90 printf("i=%d\n",i); | 90 printf("#0089:i=%d\n",i); |
91 printf("j=%d\n",j); | 91 printf("#0090:j=%d\n",j); |
92 i++; --i; | 92 i++; --i; |
93 j++; --j; | 93 j++; --j; |
94 printf("i=%d\n",i); | 94 printf("#0093:i=%d\n",i); |
95 printf("j=%d\n",j); | 95 printf("#0094:j=%d\n",j); |
96 gi = 3333; | 96 gi = 3333; |
97 gj = 6666; | 97 gj = 6666; |
98 gi++; --gi; | 98 gi++; --gi; |
99 gj++; --gj; | 99 gj++; --gj; |
100 printf("gi=%d\n",gi); | 100 printf("#0099:gi=%d\n",gi); |
101 printf("gj=%d\n",gj); | 101 printf("#0100:gj=%d\n",gj); |
102 | 102 |
103 printf("k=%d\n",k); | 103 printf("#0102:k=%d\n",k); |
104 printf("m=%d\n",m); | 104 printf("#0103:m=%d\n",m); |
105 printf("a[33]=%d\n",a[33]); | 105 printf("#0104:a[33]=%d\n",a[33]); |
106 printf("b[33]=%d\n",b[33]); | 106 printf("#0105:b[33]=%d\n",b[33]); |
107 printf("a[33]=%d\n",++a[33]); | 107 printf("#0106:a[33]=%d\n",++a[33]); |
108 printf("b[33]=%d\n",b[33]--); | 108 printf("#0107:b[33]=%d\n",b[33]--); |
109 | 109 |
110 printf("g0=%d\n",g0); | 110 printf("#0109:g0=%d\n",g0); |
111 printf("h0=%d\n",h0); | 111 printf("#0110:h0=%d\n",h0); |
112 printf("c[33]=%d\n",c[33]); | 112 printf("#0111:c[33]=%d\n",c[33]); |
113 | 113 |
114 p = data; | 114 p = data; |
115 printf("*p++ = %d\n",*p++); | 115 printf("#0114:*p++ = %d\n",*p++); |
116 printf("*++p = %d\n",*++p); | 116 printf("#0115:*++p = %d\n",*++p); |
117 *p++ = -343; | 117 *p++ = -343; |
118 printf("*p-- = %d\n",*p--); | 118 printf("#0117:*p-- = %d\n",*p--); |
119 printf("*--p = %d\n",*--p); | 119 printf("#0118:*--p = %d\n",*--p); |
120 up = udata; | 120 up = udata; |
121 printf("*up-- = %d\n",*up--); | 121 printf("#0120:*up-- = %d\n",*up--); |
122 printf("*--up = %d\n",*--up); | 122 printf("#0121:*--up = %d\n",*--up); |
123 *up++ = 65530; | 123 *up++ = 65530; |
124 printf("*up-- = %d\n",*up--); | 124 printf("#0123:*up-- = %d\n",*up--); |
125 printf("*--up = %d\n",*--up); | 125 printf("#0124:*--up = %d\n",*--up); |
126 | 126 |
127 | 127 |
128 ii = f(i,j,k,m,a[33]); | 128 ii = f(i,j,k,m,a[33]); |
129 printf("f()=%d\n",ii); | 129 printf("#0128:f()=%d\n",ii); |
130 ii = g(i,j,k,m,a[33]); | 130 ii = g(i,j,k,m,a[33]); |
131 printf("f()=%d\n",ii); | 131 printf("#0130:f()=%d\n",ii); |
132 return 0; | 132 return 0; |
133 } | 133 } |
134 | 134 |
135 short f(short i,unsigned short j,unsigned short k,short m,short a) | 135 short f(short i,unsigned short j,unsigned short k,short m,short a) |
136 { | 136 { |