This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how can define a sfr var in a union or struct?

How can define a union or a struct,and the member is a sfr register?such as
pre
union or struct
{
unsigned long dwData;
unsigned char bData[4];
}
/pre

How can let the bData[4] used the sfr var?

Thanks in advanced./

  • How can define a union or a struct,and the member is a sfr register

    You can't. The specification for the C language prohibits this. All the elements in a structure must reside in sequence in memory. You can't have a structure (or a union) with elements in different memory spaces.

    Jon