| |||||
Technical Support On-Line Manuals C166 User's Guide | Using the bdata TypeSome users have reported difficulties in using the bdata memory type. Using bdata is similar to using the sfr modifier. The most common error is encountered when referencing a bdata variable defined in another module. For example: extern char bdata xyz_flag; sbit xyz_bit1 = xyz_flag^1; In order to generate the appropriate instructions, the compiler must have the absolute value of the reference to be generated. In the above example, this cannot be done, as the address of xyz_flag is not known until after the linking phase has been completed. Follow the rules below to avoid this problem.
For example, declare the bdata variable and the bit component in the same source module: char bdata xyz_flag; sbit xyz_bit1 = xyz_flag^1; Then, declare the bit component external: extern bit xyz_bit1; As with any other declared and named C variable that reserves space, simply define your bdata variable and its component sbits in a module. Then, use the extern bit specifier to reference it as the need arises. | ||||
| |||||