c18 assembly inside function problem. unidentified label (bit names)
For the commented out C part, you don't appear to have have any ending semicolons (e.g. first line should be EECON1bits.EEPGD = 0;) , so the compiler certainly won't like that.

For the inline assembly, IIRC the register names hould b e usable, but I think you have to specify operands fully (e.g. instead of movwf  EECON2,A you do movwf  EECON2,0)
It's possible the bit names must be specified by number instead of name too, for example instead of bcf    EECON1,EEPGD,A you do bcf    EECON1, 7, 0 (EEPGD is bit 7 of EECON1) The A at the end is not right anyway, this should be 1 or 0 (or W or F in MPASM)
It's been a while since I used the inline assembly for anything like this so memory is fuzzy, but try it and let us know how it goes.