打印

S3C44B0用大端方式可以吗?

[复制链接]
1607|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
jackwu1780|  楼主 | 2007-4-20 11:24 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
沙发
jackwu1780|  楼主 | 2007-4-20 11:25 | 只看该作者

测试代码

address32=0x12345678;      
    //first test big endian,the data will be stored as the way:
    //  31    24 23     16 15    8 7     0  
    //0x   12        34       45      78
    
    lAddress=(unsigned short)(address32&0xffff);  //should be 0x5678
    hAddress=(unsigned short)(address32>>16);   //should be 0x1234
    printf("the sizeof long is %x,the sizeof short is %x ",sizeof(long),sizeof(short));
    printf("the Address is %x ",address32);
    printf("the lAddress is %x ",lAddress);
    printf("the hAddress is %x ",hAddress);
    printf("finished");

使用特权

评论回复
板凳
jackwu1780|  楼主 | 2007-4-20 11:27 | 只看该作者

应该放到arm论坛的,呵呵

使用特权

评论回复
地板
新马甲求职| | 2007-4-20 13:13 | 只看该作者

兄弟初次搞32位机吧

big endian和little endian
字节的存放顺序是反的,

little endian的程序肯定不能放到big endian设置的CPU上跑啊

使用特权

评论回复
5
jackwu1780|  楼主 | 2007-4-20 14:25 | 只看该作者

可是我把endian的脚拉高啦!

The S3C44B0X memory controller provides the necessary memory control signals for external memory access.
S3C44B0X has the following features;
— Little/Big endian(selectable by an external pin)

我现在把它拉高了,还是不行,为什么啊

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

11

主题

29

帖子

0

粉丝