On Aug 4, 2007, at 1:58 PM, Peter P. wrote: >> Don't suggest m4. > > Awk ? Perl ? ;-) I don't doubt that you can write a preprocessor in awk or perl, but I was hoping for something that already implemented the "traditional" forms of ASM-style macro processors and cpp syntax, and had dealt with the thorny issues you probably run into trying to get them to work together: #define S_PORT 12 #macro set_bit port, bit #if CONSTANT(port) && CONSTANT(bit) sbi(port, bit); #else set_bit_func(port, bit); #endif #endmacro #macro counted_string var, s #equ $s_n 0 #irpc s #equ $s_n $s_n+1 #end // irpc to count chars unsigned char var[$s_n+2] = { $s_n, // store count #irpc s 's', // store characters #end //irpc to store chars 0}; // null terminate just in case #endmacro (I suppose if something like this is IMPLEMENTED in m4, that would be fine. I just didn't find m4 particularly nice on its own the one time I used it...) BillW -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist