This is a multi-part message in MIME format. --===============1451058905== Content-Type: multipart/related; boundary="----=_NextPart_000_0038_01C684E3.34D3DBA0" This is a multi-part message in MIME format. ------=_NextPart_000_0038_01C684E3.34D3DBA0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi I was going to use my previously asm routines to do EEPRM reads and writes in my C program. So I tried using the _asm directive to make a function out of them. Here is the write function. void write_EEPROM(unsigned char data_EE_data) { _asm movlw DATA_EE_ADDR_H //Address to be written to movwf EEADRH movlw DATA_EE_ADDR_L movwf EEADR movf data_EE_data,W //Data to be written to EEPROM movwf EEDATA bcf EECON1, EEPGD bcf EECON1, CFGS bsf EECON1, WREN bcf INTCON, GIE movlw 0x55 movwf EECON2 movlw 0xAA movwf EECON2 bsf EECON1, WR bsf INTCON, GIE bcf EECON1,WREN _endasm } The C18 compiler is whinging that it can't find these literals. Error [1111] undefined label 'WR' in 'write_EEPROM' Error [1111] undefined label 'GIE' in 'write_EEPROM' Error [1111] undefined label 'WREN' in 'write_EEPROM' Error [1111] undefined label 'CFGS' in 'write_EEPROM' Error [1111] undefined label 'EEPGD' in 'write_EEPROM' Error [1111] undefined label 'W' in 'write_EEPROM' I looked in the header (p18f6520.h) and they are all defined in there. Can any one tell me how to make the inline asm code see the literals in the h file? Phillip Things should be as simple as possible but no simpler Phillip Coiner CTO, GPS Source, Inc. Your source for quality GNSS Networking Solutions and Design Services, Now! ------=_NextPart_000_0038_01C684E3.34D3DBA0 Content-Type: image/jpeg; name="image002.jpg" Content-Transfer-Encoding: base64 Content-ID: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIf IiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/wAALCAA9AHIBAREA/8QAHwAAAQUBAQEB AQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1Fh ByJxF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hOlzbTGK6jmZW2SgAnaVGCpyCPrUusT3FzrVno8V49lFL BLcTzRkCQqhUBVJHHLZJ9B71J4Vu7i90GKe4nNx+9lWOdgAZY1kYI5xxyoBz361R1fW57O+1t458 R6dpiOsfHMzl9p/8dUfjW3a2m6wtkvlS4nSJRI7oCWYAZP51ydnqOp3fjRre3muIbdbuRVVigt3g iVVdVX72/wAw5zxx7V1mq3p03Sby+EfmG2geUJ/e2qTj9KqaDaXEdst3d6pNez3MSu4LDykJGfkU Dgdu+cVW8XXl7b2dlb6cZPtN3eJGBE6o5QAu4DNwPlU81PHoUjRqW1jVVYgZH2hTg/8AfNef3unm 1v5LYzb9r43FcZ5+tdDpngmG7iWae9faf4UQD9STXRWPhrSdPIaK0V3H8cvzH9a1egxUc8EVzA8E 8ayRSKVdGGQwPUGo7KxtNOtxb2VvHbxAk7I1wMnqfrTL/StP1VEXULKG5EZyglQNt9cVZRFjRURQ qqMKqjAA9Kq3Gkabd3kd5cWMEtxFgJK8YLDByOfY81cqumn2cbxulrErRO8iEIMqz53Ee5yc/Wp2 UMpVgCCMEHvVWw0rT9KR0sLOG2WQ5YRIFBpNQ0nT9WjSPUbOG6SNtyCVAwU4xkVajjSKNY41CIgC qo6ADoK//9k= ------=_NextPart_000_0038_01C684E3.34D3DBA0-- --===============1451058905== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --===============1451058905==--