原创 Union application note in HiTech C

2008-10-27 07:44 2421 9 9 分类: MCU/ 嵌入式

In “h3jianan.h” Union define,  see as below


-------------------------<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


typedef    struct cbittag{


        char zer:   1;


        char one:   1;


        char two:   1;


        char thr:   1;


        char fou:   1;


        char fiv:   1;


        char six:   1;


        char sev:   1;


}CBIT;


typedef    union cuntag{


           UCHAR  value;


           CBIT  cb;


}CUN;


typedef    union iuntag{


           UINT value;


           CUN  icun[2];


}IUN;


-------------------------


e.g.1  CUN Appnote


  CUN unionTest;


 


In the C Language code:


<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />



点击看大图


In the assemble view:




b2ed060b-1143-49f6-9c47-89009c0abfdd.JPG
-------------------------



In “h3jianan.h” Union define,  see as below


-------------------------


typedef    struct cbittag{


        char zer:   1;


        char one:   1;


        char two:   1;


        char thr:   1;


        char fou:   1;


        char fiv:   1;


        char six:   1;


        char sev:   1;


}CBIT;


typedef    union cuntag{


           UCHAR  value;


           CBIT  cb;


}CUN;


typedef    union iuntag{


           UINT value;


           CUN  icun[2];


}IUN;


-------------------------


e.g.1  CUN Appnote


  CUN unionTest;


 


In the C Language code:




点击看大图


In the assemble view:




b2ed060b-1143-49f6-9c47-89009c0abfdd.JPG
-------------------------


e.g.2 IUN Appnote


 


In the C language code:




16bd5218-cfd4-4d5f-8fea-595bae2ef50a.JPG
In the assemble view:
87e9d0b2-430d-48cb-9052-7ee4c92b7eaa.JPG

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
9
关闭 站长推荐上一条 /3 下一条