Mercurial > hg > CbC > old > device
view test/offset.c @ 739:0c7a6ae119ba
i64 continue... compiler compiled.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Nov 2010 22:22:46 +0900 |
parents | 88e364604533 |
children | c2c709727221 |
line wrap: on
line source
extern int printf(const char *,...); #ifndef INLINE #define INLINE #endif #define BIT8 260 #define BIT10 1030 #define BIT12 5000 #define BIT16 (65536*2) int midium[BIT12]; int large[BIT16]; static INLINE int main0(int ac,char *av[]) { int *p; int local_midium[BIT12]; int local_large[BIT16]; #if 0 printf("#0018:int ac =\t%x\n",&ac); printf("#0019:int midium[0] =\t%x\n",&midium[0]); printf("#0020:int midium[BIT12] =\t%x\n",&midium[BIT12]); printf("#0021:int large[0] =\t%x\n",&large[0]); printf("#0022:int large[BIT16] =\t%x\n",&large[BIT16]); printf("#0023:int local_midium[0] =\t%x\n",&local_midium[0]); printf("#0024:int local_midium[BIT12] =\t%x\n",&local_midium[BIT12]); printf("#0025:int local_large[0] =\t%x\n",&local_large[0]); printf("#0026:int local_large[BIT16] =\t%x\n",&local_large[BIT16]); #endif midium[0]=0x55; large[0]=0x55; local_midium[0]=0x55; local_large[0]=0x55; midium[BIT8]=0x50; large[BIT8]=0x50; local_midium[BIT8]=0x50; local_large[BIT8]=0x50; midium[BIT10]=0xa0; large[BIT10]=0xa0; local_midium[BIT10]=0xa0; local_large[BIT10]=0xa0; midium[BIT12-1]=0xaa; large[BIT16-1]=0xaa; local_midium[BIT12-1]=0xaa; local_large[BIT16-1]=0xaa; printf("#0049:%x\n", midium[0]); printf("#0050:%x\n", large[0]); printf("#0051:%x\n", local_midium[0]); printf("#0052:%x\n", local_large[0]); printf("#0054:%x\n", midium[BIT8]); printf("#0055:%x\n", large[BIT8]); printf("#0056:%x\n", local_midium[BIT8]); printf("#0057:%x\n", local_large[BIT8]); printf("#0059:%x\n", midium[BIT10]); printf("#0060:%x\n", large[BIT10]); printf("#0061:%x\n", local_midium[BIT10]); printf("#0062:%x\n", local_large[BIT10]); printf("#0064:%x\n", midium[BIT12-1]); printf("#0065:%x\n", large[BIT16-1]); printf("#0066:%x\n", local_midium[BIT12-1]); printf("#0067:%x\n", local_large[BIT16-1]); p = local_large+BIT16; p[-1] = 0xaa; p[-BIT8] = 0xbb; p[-BIT10] = 0xcc; p[-(BIT12-1)] = 0xdd; p[-(BIT16-1)] = 0xee; printf("#0077:%x\n", p[-1]); printf("#0078:%x\n", p[-BIT8]); printf("#0079:%x\n", p[-BIT10]); printf("#0080:%x\n", p[-(BIT12-1)]); printf("#0081:%x\n", p[-(BIT16-1)]); p = large+BIT16; p[-1] = 0xaa; p[-BIT8] = 0xbb; p[-BIT10] = 0xcc; p[-(BIT12-1)] = 0xdd; p[-(BIT16-1)] = 0xee; printf("#0091:%x\n", p[-1]); printf("#0092:%x\n", p[-BIT8]); printf("#0093:%x\n", p[-BIT10]); printf("#0094:%x\n", p[-(BIT12-1)]); printf("#0095:%x\n", p[-(BIT16-1)]); for(p=local_midium;p<&local_midium[BIT12];p++) *p = p-local_midium; for(p=local_large;p<&local_large[BIT16];p++) *p = p-local_large; for(p=midium;p<&midium[BIT12];p++) *p = p-midium; for(p=large;p<&large[BIT16];p++) *p = p-large; return 0; } int main(int ac,char *av[]) { int i=-1,j=-2,k=-3; main0(ac,av); printf("#0113:%d %d %d %d\n",ac,i,j,k); return 0; }