cosmic 怎样处理结构体

[复制链接]
 楼主| eng588 发表于 2010-8-10 10:42 | 显示全部楼层 |阅读模式
我的一个程序将结构体用@near修饰程序就出错,不用(放在头256字节里)就不出错,查了@near的空间还有很多剩余。真想不通
香水城 发表于 2010-8-10 10:53 | 显示全部楼层
什么样的结构体?
 楼主| eng588 发表于 2010-8-10 14:27 | 显示全部楼层
香大侠看看,最下面的那个struct _iPod不能用@near修饰


enum PinStatus{
        LOW_HIGH,
        HIGH,
        HIGH_LOW,
        LOW
  };
struct DoubleByte{
        unsigned char byte0;
        unsigned char byte1;
        };
union BytesToWord{
        unsigned int word16;
        struct DoubleByte bytes;
  };
struct _iPod{
        enum PinStatus pin;
        unsigned char IdentifyStatus;
        unsigned char IDPS;
  union BytesToWord DockTID;
        union BytesToWord iPodTID;
  };
香水城 发表于 2010-8-10 18:31 | 显示全部楼层
1)@near的空间还有多少剩余?
2)看看map文件,不放在头256字节里时占用多少空间?
3)怀疑enum类型占用较多。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

82

主题

179

帖子

0

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

82

主题

179

帖子

0

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