[03eabf4] | 1 | #include <fstream.hfa> |
---|
[c5fdebf] | 2 | #include <bitmanip.hfa> |
---|
[03eabf4] | 3 | |
---|
| 4 | int main() { |
---|
[c5fdebf] | 5 | signed char sc; |
---|
| 6 | unsigned char usc; |
---|
| 7 | short int si; |
---|
| 8 | unsigned short int usi; |
---|
| 9 | int i; |
---|
| 10 | unsigned int ui; |
---|
| 11 | long int li; |
---|
| 12 | unsigned long int uli; |
---|
| 13 | long long int lli; |
---|
| 14 | unsigned long long int ulli; |
---|
| 15 | |
---|
| 16 | sout | nlOff; |
---|
| 17 | |
---|
| 18 | //============================================================ |
---|
| 19 | |
---|
| 20 | sout | "cl0" | nl; |
---|
| 21 | |
---|
| 22 | sc = 0; |
---|
[03eabf4] | 23 | sout | sc | cl0( sc ) | ","; |
---|
[c5fdebf] | 24 | for ( sc = 1; sc != 0; sc <<= 1 ) { |
---|
| 25 | sout | sc | cl0( sc ) | ","; |
---|
| 26 | } // for |
---|
| 27 | sout | nl; |
---|
| 28 | usc = 0; |
---|
[03eabf4] | 29 | sout | usc | cl0( usc ) | ","; |
---|
[c5fdebf] | 30 | for ( usc = 1; usc != 0; usc <<= 1 ) { |
---|
| 31 | sout | usc | cl0( usc ) | ","; |
---|
| 32 | } // for |
---|
| 33 | sout | nl; |
---|
[03eabf4] | 34 | |
---|
[c5fdebf] | 35 | si = 0; |
---|
[03eabf4] | 36 | sout | si | cl0( si ) | ","; |
---|
[c5fdebf] | 37 | for ( si = 1; si != 0; si <<= 1 ) { |
---|
| 38 | sout | si | cl0( si ) | ","; |
---|
| 39 | } // for |
---|
| 40 | sout | nl; |
---|
| 41 | usi = 0; |
---|
[03eabf4] | 42 | sout | usi | cl0( usi ) | ","; |
---|
[c5fdebf] | 43 | for ( usi = 1; usi != 0; usi <<= 1 ) { |
---|
| 44 | sout | usi | cl0( usi ) | ","; |
---|
| 45 | } // for |
---|
| 46 | sout | nl; |
---|
[03eabf4] | 47 | |
---|
[c5fdebf] | 48 | i = 0; |
---|
[03eabf4] | 49 | sout | i | cl0( i ) | ","; |
---|
[c5fdebf] | 50 | for ( i = 1; i != 0; i <<= 1 ) { |
---|
| 51 | sout | i | cl0( i ) | ","; |
---|
| 52 | } // for |
---|
| 53 | sout | nl; |
---|
| 54 | ui = 0; |
---|
[03eabf4] | 55 | sout | ui | cl0( ui ) | ","; |
---|
[c5fdebf] | 56 | for ( ui = 1; ui != 0; ui <<= 1 ) { |
---|
| 57 | sout | ui | cl0( ui ) | ","; |
---|
| 58 | } // for |
---|
| 59 | sout | nl; |
---|
[03eabf4] | 60 | |
---|
[c5fdebf] | 61 | li = 0; |
---|
[03eabf4] | 62 | sout | li | cl0( li ) | ","; |
---|
[c5fdebf] | 63 | for ( li = 1; li != 0; li <<= 1 ) { |
---|
| 64 | sout | li | cl0( li ) | ","; |
---|
| 65 | } // for |
---|
| 66 | sout | nl; |
---|
| 67 | uli = 0; |
---|
[03eabf4] | 68 | sout | uli | cl0( uli ) | ","; |
---|
[c5fdebf] | 69 | for ( uli = 1; uli != 0; uli <<= 1 ) { |
---|
| 70 | sout | uli | cl0( uli ) | ","; |
---|
| 71 | } // for |
---|
| 72 | sout | nl; |
---|
[03eabf4] | 73 | |
---|
[c5fdebf] | 74 | lli = 0; |
---|
[03eabf4] | 75 | sout | lli | cl0( lli ) | ","; |
---|
[c5fdebf] | 76 | for ( lli = 1; lli != 0; lli <<= 1 ) { |
---|
| 77 | sout | lli | cl0( lli ) | ","; |
---|
| 78 | } // for |
---|
| 79 | sout | nl; |
---|
| 80 | ulli = 0; |
---|
[03eabf4] | 81 | sout | ulli | cl0( ulli ) | ","; |
---|
[c5fdebf] | 82 | for ( ulli = 1; ulli != 0; ulli <<= 1 ) { |
---|
| 83 | sout | ulli | cl0( ulli ) | ","; |
---|
| 84 | } // for |
---|
| 85 | sout | nl; |
---|
[03eabf4] | 86 | |
---|
[c5fdebf] | 87 | //============================================================ |
---|
[03eabf4] | 88 | |
---|
[c5fdebf] | 89 | sout | nl | "ct0" | nl; |
---|
[03eabf4] | 90 | |
---|
[c5fdebf] | 91 | sc = 0; |
---|
[03eabf4] | 92 | sout | sc | ct0( sc ) | ","; |
---|
[c5fdebf] | 93 | for ( sc = 1; sc != 0; sc <<= 1 ) { |
---|
| 94 | sout | sc | ct0( sc ) | ","; |
---|
| 95 | } // for |
---|
| 96 | sout | nl; |
---|
| 97 | usc = 0; |
---|
[03eabf4] | 98 | sout | usc | ct0( usc ) | ","; |
---|
[c5fdebf] | 99 | for ( usc = 1; usc != 0; usc <<= 1 ) { |
---|
| 100 | sout | usc | ct0( usc ) | ","; |
---|
| 101 | } // for |
---|
| 102 | sout | nl; |
---|
[03eabf4] | 103 | |
---|
[c5fdebf] | 104 | si = 0; |
---|
[03eabf4] | 105 | sout | si | ct0( si ) | ","; |
---|
[c5fdebf] | 106 | for ( si = 1; si != 0; si <<= 1 ) { |
---|
| 107 | sout | si | ct0( si ) | ","; |
---|
| 108 | } // for |
---|
| 109 | sout | nl; |
---|
| 110 | usi = 0; |
---|
[03eabf4] | 111 | sout | usi | ct0( usi ) | ","; |
---|
[c5fdebf] | 112 | for ( usi = 1; usi != 0; usi <<= 1 ) { |
---|
| 113 | sout | usi | ct0( usi ) | ","; |
---|
| 114 | } // for |
---|
| 115 | sout | nl; |
---|
[03eabf4] | 116 | |
---|
[c5fdebf] | 117 | i = 0; |
---|
[03eabf4] | 118 | sout | i | ct0( i ) | ","; |
---|
[c5fdebf] | 119 | for ( i = 1; i != 0; i <<= 1 ) { |
---|
| 120 | sout | i | ct0( i ) | ","; |
---|
| 121 | } // for |
---|
| 122 | sout | nl; |
---|
| 123 | ui = 0; |
---|
[03eabf4] | 124 | sout | ui | ct0( ui ) | ","; |
---|
[c5fdebf] | 125 | for ( ui = 1; ui != 0; ui <<= 1 ) { |
---|
| 126 | sout | ui | ct0( ui ) | ","; |
---|
| 127 | } // for |
---|
| 128 | sout | nl; |
---|
[03eabf4] | 129 | |
---|
[c5fdebf] | 130 | li = 0; |
---|
[03eabf4] | 131 | sout | li | ct0( li ) | ","; |
---|
[c5fdebf] | 132 | for ( li = 1; li != 0; li <<= 1 ) { |
---|
| 133 | sout | li | ct0( li ) | ","; |
---|
| 134 | } // for |
---|
| 135 | sout | nl; |
---|
| 136 | uli = 0; |
---|
[03eabf4] | 137 | sout | uli | ct0( uli ) | ","; |
---|
[c5fdebf] | 138 | for ( uli = 1; uli != 0; uli <<= 1 ) { |
---|
| 139 | sout | uli | ct0( uli ) | ","; |
---|
| 140 | } // for |
---|
| 141 | sout | nl; |
---|
[03eabf4] | 142 | |
---|
[c5fdebf] | 143 | lli = 0; |
---|
[03eabf4] | 144 | sout | lli | ct0( lli ) | ","; |
---|
[c5fdebf] | 145 | for ( lli = 1; lli != 0; lli <<= 1 ) { |
---|
| 146 | sout | lli | ct0( lli ) | ","; |
---|
| 147 | } // for |
---|
| 148 | sout | nl; |
---|
| 149 | ulli = 0; |
---|
[03eabf4] | 150 | sout | ulli | ct0( ulli ) | ","; |
---|
[c5fdebf] | 151 | for ( ulli = 1; ulli != 0; ulli <<= 1 ) { |
---|
| 152 | sout | ulli | ct0( ulli ) | ","; |
---|
| 153 | } // for |
---|
| 154 | sout | nl; |
---|
| 155 | |
---|
| 156 | //============================================================ |
---|
| 157 | |
---|
| 158 | sout | nl | "ca1" | nl; |
---|
| 159 | |
---|
| 160 | sc = 0; |
---|
| 161 | for ( int p = 0; p < sizeof(sc) * __CHAR_BIT__ + 1; p += 1, sc = (sc << 1) + 1 ) { |
---|
| 162 | sout | sc | ca1( sc ) | ","; |
---|
| 163 | } // for |
---|
| 164 | sout | nl; |
---|
| 165 | usc = 0; |
---|
| 166 | for ( int p = 0; p < sizeof(sc) * __CHAR_BIT__ + 1; p += 1, usc = (usc << 1) + 1 ) { |
---|
| 167 | sout | usc | ca1( usc ) | ","; |
---|
| 168 | } // for |
---|
| 169 | sout | nl; |
---|
| 170 | |
---|
| 171 | si = 0; |
---|
| 172 | for ( int p = 0; p < sizeof(si) * __CHAR_BIT__ + 1; p += 1, si = (si << 1) + 1 ) { |
---|
| 173 | sout | si | ca1( si ) | ","; |
---|
| 174 | } // for |
---|
| 175 | sout | nl; |
---|
| 176 | usi = 0; |
---|
| 177 | for ( int p = 0; p < sizeof(usi) * __CHAR_BIT__ + 1; p += 1, usi = (usi << 1) + 1 ) { |
---|
| 178 | sout | usi | ca1( usi ) | ","; |
---|
| 179 | } // for |
---|
| 180 | sout | nl; |
---|
| 181 | |
---|
| 182 | i = 0; |
---|
| 183 | for ( int p = 0; p < sizeof(i) * __CHAR_BIT__ + 1; p += 1, i = (i << 1) + 1 ) { |
---|
| 184 | sout | i | ca1( i ) | ","; |
---|
| 185 | } // for |
---|
| 186 | sout | nl; |
---|
| 187 | ui = 0; |
---|
| 188 | for ( int p = 0; p < sizeof(ui) * __CHAR_BIT__ + 1; p += 1, ui = (ui << 1) + 1 ) { |
---|
| 189 | sout | ui | ca1( ui ) | ","; |
---|
| 190 | } // for |
---|
| 191 | sout | nl; |
---|
| 192 | |
---|
| 193 | li = 0; |
---|
| 194 | for ( int p = 0; i < sizeof(li) * __CHAR_BIT__ + 1; p += 1, li = (li << 1) + 1 ) { |
---|
| 195 | sout | li | ca1( li ) | ","; |
---|
| 196 | } // for |
---|
| 197 | sout | nl; |
---|
| 198 | uli = 0; |
---|
| 199 | for ( int p = 0; p < sizeof(li) * __CHAR_BIT__ + 1; p += 1, uli = (uli << 1) + 1 ) { |
---|
| 200 | sout | uli | ca1( uli ) | ","; |
---|
| 201 | } // for |
---|
| 202 | sout | nl; |
---|
| 203 | |
---|
| 204 | lli = 0; |
---|
| 205 | for ( int p = 0; p < sizeof(li) * __CHAR_BIT__ + 1; p += 1, lli = (lli << 1) + 1 ) { |
---|
| 206 | sout | lli | ca1( lli ) | ","; |
---|
| 207 | } // for |
---|
| 208 | sout | nl; |
---|
| 209 | ulli = 0; |
---|
| 210 | for ( int p = 0; p < sizeof(li) * __CHAR_BIT__ + 1; p += 1, ulli = (ulli << 1) + 1 ) { |
---|
| 211 | sout | ulli | ca1( ulli ) | ","; |
---|
| 212 | } // for |
---|
| 213 | sout | nl; |
---|
| 214 | |
---|
| 215 | //============================================================ |
---|
| 216 | |
---|
| 217 | sout | nl | "ca0" | nl; |
---|
| 218 | |
---|
| 219 | sc = 0; |
---|
| 220 | for ( int p = 0; p < sizeof(sc) * __CHAR_BIT__ + 1; p += 1, sc = (sc << 1) + 1 ) { |
---|
| 221 | sout | sc | ca0( sc ) | ","; |
---|
| 222 | } // for |
---|
| 223 | sout | nl; |
---|
| 224 | usc = 0; |
---|
| 225 | for ( int p = 0; p < sizeof(sc) * __CHAR_BIT__ + 1; p += 1, usc = (usc << 1) + 1 ) { |
---|
| 226 | sout | usc | ca0( usc ) | ","; |
---|
| 227 | } // for |
---|
| 228 | sout | nl; |
---|
| 229 | |
---|
| 230 | si = 0; |
---|
| 231 | for ( int p = 0; p < sizeof(si) * __CHAR_BIT__ + 1; p += 1, si = (si << 1) + 1 ) { |
---|
| 232 | sout | si | ca0( si ) | ","; |
---|
| 233 | } // for |
---|
| 234 | sout | nl; |
---|
| 235 | usi = 0; |
---|
| 236 | for ( int p = 0; p < sizeof(si) * __CHAR_BIT__ + 1; p += 1, usi = (usi << 1) + 1 ) { |
---|
| 237 | sout | usi | ca0( usi ) | ","; |
---|
| 238 | } // for |
---|
| 239 | sout | nl; |
---|
| 240 | |
---|
| 241 | i = 0; |
---|
| 242 | for ( int p = 0; p < sizeof(i) * __CHAR_BIT__ + 1; p += 1, i = (i << 1) + 1 ) { |
---|
| 243 | sout | i | ca0( i ) | ","; |
---|
| 244 | } // for |
---|
| 245 | sout | nl; |
---|
| 246 | ui = 0; |
---|
| 247 | for ( int p = 0; p < sizeof(ui) * __CHAR_BIT__ + 1; p += 1, ui = (ui << 1) + 1 ) { |
---|
| 248 | sout | ui | ca0( ui ) | ","; |
---|
| 249 | } // for |
---|
| 250 | sout | nl; |
---|
| 251 | |
---|
| 252 | li = 0; |
---|
| 253 | for ( int p = 0; p < sizeof(li) * __CHAR_BIT__ + 1; p += 1, li = (li << 1) + 1 ) { |
---|
| 254 | sout | li | ca0( li ) | ","; |
---|
| 255 | } // for |
---|
| 256 | sout | nl; |
---|
| 257 | uli = 0; |
---|
| 258 | for ( int p = 0; p < sizeof(li) * __CHAR_BIT__ + 1; p += 1, uli = (uli << 1) + 1 ) { |
---|
| 259 | sout | uli | ca0( uli ) | ","; |
---|
| 260 | } // for |
---|
| 261 | sout | nl; |
---|
| 262 | |
---|
| 263 | lli = 0; |
---|
| 264 | for ( int p = 0; p < sizeof(li) * __CHAR_BIT__ + 1; p += 1, lli = (lli << 1) + 1 ) { |
---|
| 265 | sout | lli | ca0( lli ) | ","; |
---|
| 266 | } // for |
---|
| 267 | sout | nl; |
---|
| 268 | ulli = 0; |
---|
| 269 | for ( int p = 0; p < sizeof(li) * __CHAR_BIT__ + 1; p += 1, ulli = (ulli << 1) + 1 ) { |
---|
| 270 | sout | ulli | ca0( ulli ) | ","; |
---|
| 271 | } // for |
---|
| 272 | sout | nl; |
---|
| 273 | |
---|
| 274 | //============================================================ |
---|
| 275 | |
---|
| 276 | sout | nl | "fls" | nl; |
---|
| 277 | |
---|
| 278 | sc = 0; |
---|
[03eabf4] | 279 | sout | sc | fls( sc ) | ","; |
---|
[c5fdebf] | 280 | for ( sc = 1; sc != 0; sc <<= 1 ) { |
---|
| 281 | sout | sc | fls( sc ) | ","; |
---|
| 282 | } // for |
---|
| 283 | sout | nl; |
---|
| 284 | usc = 0; |
---|
[03eabf4] | 285 | sout | usc | fls( usc ) | ","; |
---|
[c5fdebf] | 286 | for ( usc = 1; usc != 0; usc <<= 1 ) { |
---|
| 287 | sout | usc | fls( usc ) | ","; |
---|
| 288 | } // for |
---|
| 289 | sout | nl; |
---|
[03eabf4] | 290 | |
---|
[c5fdebf] | 291 | si = 0; |
---|
[03eabf4] | 292 | sout | si | fls( si ) | ","; |
---|
[c5fdebf] | 293 | for ( si = 1; si != 0; si <<= 1 ) { |
---|
| 294 | sout | si | fls( si ) | ","; |
---|
| 295 | } // for |
---|
| 296 | sout | nl; |
---|
| 297 | usi = 0; |
---|
[03eabf4] | 298 | sout | usi | fls( usi ) | ","; |
---|
[c5fdebf] | 299 | for ( usi = 1; usi != 0; usi <<= 1 ) { |
---|
| 300 | sout | usi | fls( usi ) | ","; |
---|
| 301 | } // for |
---|
| 302 | sout | nl; |
---|
[03eabf4] | 303 | |
---|
[c5fdebf] | 304 | i = 0; |
---|
[03eabf4] | 305 | sout | i | fls( i ) | ","; |
---|
[c5fdebf] | 306 | for ( i = 1; i != 0; i <<= 1 ) { |
---|
| 307 | sout | i | fls( i ) | ","; |
---|
| 308 | } // for |
---|
| 309 | sout | nl; |
---|
| 310 | ui = 0; |
---|
[03eabf4] | 311 | sout | ui | fls( ui ) | ","; |
---|
[c5fdebf] | 312 | for ( ui = 1; ui != 0; ui <<= 1 ) { |
---|
| 313 | sout | ui | fls( ui ) | ","; |
---|
| 314 | } // for |
---|
| 315 | sout | nl; |
---|
[03eabf4] | 316 | |
---|
[c5fdebf] | 317 | li = 0; |
---|
[03eabf4] | 318 | sout | li | fls( li ) | ","; |
---|
[c5fdebf] | 319 | for ( li = 1; li != 0; li <<= 1 ) { |
---|
| 320 | sout | li | fls( li ) | ","; |
---|
| 321 | } // for |
---|
| 322 | sout | nl; |
---|
| 323 | uli = 0; |
---|
[03eabf4] | 324 | sout | uli | fls( uli ) | ","; |
---|
[c5fdebf] | 325 | for ( uli = 1; uli != 0; uli <<= 1 ) { |
---|
| 326 | sout | uli | fls( uli ) | ","; |
---|
| 327 | } // for |
---|
| 328 | sout | nl; |
---|
[03eabf4] | 329 | |
---|
[c5fdebf] | 330 | lli = 0; |
---|
[03eabf4] | 331 | sout | lli | fls( lli ) | ","; |
---|
[c5fdebf] | 332 | for ( lli = 1; lli != 0; lli <<= 1 ) { |
---|
| 333 | sout | lli | fls( lli ) | ","; |
---|
| 334 | } // for |
---|
| 335 | sout | nl; |
---|
| 336 | ulli = 0; |
---|
[03eabf4] | 337 | sout | ulli | fls( ulli ) | ","; |
---|
[c5fdebf] | 338 | for ( ulli = 1; ulli != 0; ulli <<= 1 ) { |
---|
| 339 | sout | ulli | fls( ulli ) | ","; |
---|
| 340 | } // for |
---|
| 341 | sout | nl; |
---|
[03eabf4] | 342 | |
---|
[c5fdebf] | 343 | //============================================================ |
---|
[03eabf4] | 344 | |
---|
[c5fdebf] | 345 | sout | nl | "fms" | nl; |
---|
[03eabf4] | 346 | |
---|
[c5fdebf] | 347 | sc = 0; |
---|
[03eabf4] | 348 | sout | sc | fms( sc ) | ","; |
---|
[c5fdebf] | 349 | for ( sc = 1; sc != 0; sc <<= 1 ) { |
---|
| 350 | sout | sc | fms( sc ) | ","; |
---|
| 351 | } // for |
---|
| 352 | sout | nl; |
---|
| 353 | usc = 0; |
---|
[03eabf4] | 354 | sout | usc | fms( usc ) | ","; |
---|
[c5fdebf] | 355 | for ( usc = 1; usc != 0; usc <<= 1 ) { |
---|
| 356 | sout | usc | fms( usc ) | ","; |
---|
| 357 | } // for |
---|
| 358 | sout | nl; |
---|
[03eabf4] | 359 | |
---|
[c5fdebf] | 360 | si = 0; |
---|
[03eabf4] | 361 | sout | si | fms( si ) | ","; |
---|
[c5fdebf] | 362 | for ( si = 1; si != 0; si <<= 1 ) { |
---|
| 363 | sout | si | fms( si ) | ","; |
---|
| 364 | } // for |
---|
| 365 | sout | nl; |
---|
| 366 | usi = 0; |
---|
[03eabf4] | 367 | sout | usi | fms( usi ) | ","; |
---|
[c5fdebf] | 368 | for ( usi = 1; usi != 0; usi <<= 1 ) { |
---|
| 369 | sout | usi | fms( usi ) | ","; |
---|
| 370 | } // for |
---|
| 371 | sout | nl; |
---|
[03eabf4] | 372 | |
---|
[c5fdebf] | 373 | i = 0; |
---|
[03eabf4] | 374 | sout | i | fms( i ) | ","; |
---|
[c5fdebf] | 375 | for ( i = 1; i != 0; i <<= 1 ) { |
---|
| 376 | sout | i | fms( i ) | ","; |
---|
| 377 | } // for |
---|
| 378 | sout | nl; |
---|
| 379 | ui = 0; |
---|
[03eabf4] | 380 | sout | ui | fms( ui ) | ","; |
---|
[c5fdebf] | 381 | for ( ui = 1; ui != 0; ui <<= 1 ) { |
---|
| 382 | sout | ui | fms( ui ) | ","; |
---|
| 383 | } // for |
---|
| 384 | sout | nl; |
---|
[03eabf4] | 385 | |
---|
[c5fdebf] | 386 | li = 0; |
---|
[03eabf4] | 387 | sout | li | fms( li ) | ","; |
---|
[c5fdebf] | 388 | for ( li = 1; li != 0; li <<= 1 ) { |
---|
| 389 | sout | li | fms( li ) | ","; |
---|
| 390 | } // for |
---|
| 391 | sout | nl; |
---|
| 392 | uli = 0; |
---|
[03eabf4] | 393 | sout | uli | fms( uli ) | ","; |
---|
[c5fdebf] | 394 | for ( uli = 1; uli != 0; uli <<= 1 ) { |
---|
| 395 | sout | uli | fms( uli ) | ","; |
---|
| 396 | } // for |
---|
| 397 | sout | nl; |
---|
[03eabf4] | 398 | |
---|
[c5fdebf] | 399 | lli = 0; |
---|
[03eabf4] | 400 | sout | lli | fms( lli ) | ","; |
---|
[c5fdebf] | 401 | for ( lli = 1; lli != 0; lli <<= 1 ) { |
---|
| 402 | sout | lli | fms( lli ) | ","; |
---|
| 403 | } // for |
---|
| 404 | sout | nl; |
---|
| 405 | ulli = 0; |
---|
[03eabf4] | 406 | sout | ulli | fms( ulli ) | ","; |
---|
[c5fdebf] | 407 | for ( ulli = 1; ulli != 0; ulli <<= 1 ) { |
---|
| 408 | sout | ulli | fms( ulli ) | ","; |
---|
| 409 | } // for |
---|
| 410 | sout | nl; |
---|
| 411 | } // main |
---|
| 412 | |
---|
| 413 | // Local Variables: // |
---|
| 414 | // tab-width: 4 // |
---|
| 415 | // compile-command: "cfa bitmanip.cfa" // |
---|
| 416 | // End: // |
---|