Hi again. I have a custom 8051 processor which has defined a series of sfr, such as "sfr id_custom = 0x32" in the header reg51.h file. When I tried to access from C, throws the error "Error 146: Invalid Base Address". As I can do to disable this protection? or enabling the access to these registers? Thanks.
PS: Sorry about my english. =)
No, it does not.
By Definition, any thing at any address less that 0x80 is not an SFR.
Semantics (My Opinion)
However since the compiler will assume in is RAM you will have to reserve all of them so the compiler does not use them as RAM. This may make the compiler unhappy when it tries to setup the RAM and stack. You may have some issues with the small memory model.
ASM allows you to work around more things. Compilers have expectations.
A Look at how chip makers solved the same issue may help if it is your chip.
SiLabs use paging of the SFR space.
Triscend, IIRC, gave you the choice to have your custom peripherals appear as SFRs, or as memory-mapped in DATA or XDATA space...