I'm trying to access SFR memory using the hexa address of the SFR
and using only "C" instructions.
Since SFR memory is accessed by direct addressing mode, like the first
128 bytes of internal RAM, I tried to use the following instruction :
* ((unsigned char data *) 0xA8) = 0x1;
* ((unsigned char idata *) 0xA8) = 0x1;
Sure but I want to name an SFR with a specific name within the local scope of a function. As you do with other parameters.
And it appears that sfr can't be a parameter of a function.
No! SFR's cannot be parameters. Parameters are pushed onto the stack or placed in fixed locations in regular memory - you cannot do this with registers. Please stop attempting to do this - these are not memory mapped registers like external device registers.
As I mentionned before, the SFR register to modify is unknown at compile time.
C51 doesn't know about any SFR's at compile time. By including reg51.h you define them. Give me the address and description of you mystery SFR and I'll show you how to access it. For that matter, what chip are you using?