S3C44B0用大端方式可以吗?

[复制链接]
3388|4
 楼主| jackwu1780 发表于 2007-4-20 11:24 | 显示全部楼层 |阅读模式
各位大哥,现在我想测试一下大端和小端的问题,可是用s3c44b0去测试的时候,编译器是ADS1.2,跑下面一段程序,发现把language setting 中的byte order改为big endian后,程序下载后就跑不了;改为little endian后,程序就可以跑,请问这是为什么啊?
 楼主| 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上跑啊
 楼主| 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

粉丝
快速回复 在线客服 返回列表 返回顶部