Hello, We used,in our project,parts of code written in C code and parts written in Assembler code. Somme variables, particulary bit type, need to be access by the two parts. Our actual solution is to use declaration for each part, for exemple : Assembler code : p_BP BIT P3.000D C code : sbit p_BP=P3^0; Is there a solution to have only one declaration for assembler and C code?
You need just one definition, and then all other references must be via extern (in 'C' speak) declarations. Otherwise you will get Linker "duplicate symbol" errors, or your 'C' and assembler will be accessing different variables!
also note that Keil's assembler understands .H files... just write #include "some.h" in your asm file.