Hi, 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;
MOV R0,#0A8H MOV @R0,#01H
* ((unsigned char idata *) 0xA8) = 0x1;
you can use the sfr keyword in "C" and it seems the easiest method to use? There is the _at_ keyword for absolute memory locations which should do the same (p71 C51 manual). if its only a bit, then sbit can be pointed to a sfr location. ( sbit VAR = 0xA8 )