if you can initialize the ethernetshield with the mac address you can just use those numbers to write too eeprom.
Here a simple function that converts 2 chars to one byte so it needs only one eeprom location. ( It is not the most efficient but it works.)
char ar[] = "0123456789ABCDEF";
byte ascii2byte(char a, char b)
{
byte v = 0;
for(uint8_t i=0; i < 16; i++)
{
if (ar[i] == a) v += (i * 16);
if (ar[i] == b) v += i;
}
return v;
}
HEX is just a representation of a byte/int/long, just like BIN or DEC is. The value itself does not change
BOoting: some pseudocode how I would do it, to get the idea.
in setup()
{
x = readEeprom(0);
if (x == 1) MAC = readMAcFromEEPROM();
}
void loop()
{
...
if (IhaveAMACaddress)
{
writeMacToEEPROM(byteArray);
writeEEPROM(0, 1);
}
...
}