Hello! Could All kindly tell me where is to be specified which registers are defined with "DEFR" instructions automatically (when C166 compiles C code to ASM), and which aren't. E.g. I need to get "ADDRSEL2" name available to include my own ASM code to C project, so I have to manually define it as follows:
ADDRSEL2 DEFR 0FE1AH
You do that by including a header file:
#include <reg167.h>
Mike, Not all registers defined in reg167.h are included in .SRC file. Thus the instruction:
MOV ADDRSEL2, #0F007H
can't find info about __asm keyword Look in Keil\C166\EXAMPLES\XC16x Devices\APNT172.htm - mike
Already found :-) And what about registers not DEFR'ed in .SRC for some reason? What's the reason?
What's the reason? No idea... Sorry.
I determined that if I use those registers (which are not DEFR'ed on default) in C-part of a function, and then use them in asm insertion, then there's no error (for they are DEFR'ed in this case), and all works fine. So that's a better solution I know at the moment -- to "declare" these registers by assigning them some value before using them in asm insertions.