Hi Olin When I installed my C compiler I had to use a different asmbler/linker the one in the mcc18 dir as opposed to the one on the MPLAB which I use for the 18F6520 ( or in the microchip dir (the one I use for my 16F676). In my mind if I don't precompile the module as a library just putting in a separate module means that my C environment will still call the same assembler/linker that its calling right now and I am right back with the same trouble. 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! -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Olin Lathrop Sent: Thursday, June 01, 2006 1:06 PM To: Microcontroller discussion list - Public. Subject: Re: [PIC] undefined label message for asm in C Phillip wrote: > Said another way do you mean write it in a different project make a > precompiled library and link to it? No, just a different module. You can link MPASM and C18 modules together in the same project. > Can you show me a two or three line example of how to write a function > directly in asm and to call it from my C routine?....assuming it is > doable from my C compiler. Since you can do anything you want in MPASM, of course you can use it to create a subroutine that is callable from C18. There is really nothing special to do if the subroutine doesn't take arguments or return a function result. C18 passes arguments on the data stack, and uses FSR1 as the stack pointer. There is no need for me to go into the details here since they are described in the manual. What part of the description in particular are you asking about? ****************************************************************** Embed Inc, Littleton Massachusetts, (978) 742-9014. #1 PIC consultant in 2004 program year. http://www.embedinc.com/products -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist