While searching archives I found this unanswered question. I might as well post an answer...
======
You don't need EADDR.. registers. The user guide says, "In normal modes, all EADDRHI and EADDRLO bits read zero and are not writable." Instead you set it by writing the data to the actual EEPROM location as if it were RAM.
Data should be written as a 16-bit word, and make sure the address is aligned (even number). Since you are only passing a number for the address, you'll need to change it to pass the actual pointer.
So you might change something like:
BOOL write_EEPROM(unsigned int *addr,unsigned int data)
{
// set contents to write
*addr = data;
=======
Also I notice the line:
// launch the command by writing '1' (clearing) the CBEIF flag
ESTAT |= CBEIF;
That is not writing 1 to CBEIF, but more like writing 1 to every bit that reads a 1. While I don't know if that will cause a problem in this case, The "|=" has caused trouble in many cases like this. Instead, write
ESTAT = CBEIF; // writing '1' to CBEIF executes the command