Hi, I've been using MPASM up to now, but I am considering the benefits of developing in C, since I'm a C++ programmer by trade, and a PIC hobbyist. It'll make development much simpler for me. C being a higher level language obviously introduces some potential issues for efficiency. But how severe are these? Some of the features of the PIC16 instruction set allow some neat coding techniques that create fast, small code. For example, recent experimentation I've done with an LCD in a 4 bit interface mode called for code to take a byte and output it as 2 4-bit nibbles . The outputnibble function in the following handles the writing value to PORTC, and fiddling with the E line (which was on PORTA). In C, this could optimally be coded somethng along the lines of:- void OutputByte( unsigned char w) { unsigned char nibble; nibble = w >> 4; OutputNibble(nibble); nibble = w & 0xF; OutputNibble(nibble); return; } That seems all well and good in C. But will it compile to anything as effient as an ASM ecquivalent of:- cblock temp endc outputbyte: ; byte to output is in W movwf temp swapf temp,W ; get the hi nibble in the lo 4 bits andlw 0xF call outputnibble movf temp,W ; recover the lo nibble & send andlw 0xF call outputnibble return So, the ASM version is 8 instructions and 1 temp variable. How does the C version compile? I can see lots of oppurtunities for some serious wastage:- - a few instrunctions fiddling with popping the argument off the stack. - I'm guessing the compiler would use two variables - "w" and "nibble"- my ASM only needs one. - "w >> 4" - will this map to 4 occurences of rrf + bcf STATUS,C ? - more stack usage calling outputnibble() twice? So, all in all I'd appreciate some comments as to just how much code space I throw away for using C. I haven't picked a C compiler yet, or tried any C, I'm still evaluating whether my project can afford it, both monetarily (although PiCC-Lite is free) and code speed & size wise. Thanks Jon -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads