Target: C8051F0xx
void FLASH_ByteWrite (unsigned char *p_Add, char byte)
{
bit EA_SAVE = EA; // preserve EA
char xdata * data pwrite; <---------// FLASH write pointer
EA = 0; // disable interrupts
WDTCN=0xA5;
pwrite = (char xdata *) p_Add; // initialize write pointer
FLSCL = FLASHSCALE; // enable FLASH writes/erases
PSCTL |= 0x01; // PSWE = 1
*pwrite = byte; // write the byte
PSCTL &= ~0x01; // PSWE = 0
FLSCL |= 0x0F; // disable FLASH writes/erases
EA = EA_SAVE; // restore interrupts
}