On Fri, 11 Dec 2009, Bob Axtell wrote: > The easiest way to reliably do this is to generate flowcharts of the > assembly, then write in C from the flowcharts. But if you understand > the code well enough to flowchart it, just change it (if that's what > you want to do) in ASM. Eliminate the 'C' step... > > --Bob A Actually the assembly code may be so optimised that the only way to flowchart it is either (1) instruction by instruction or (2) at a functional level which bares very little relationship to the code on a line by line level. consider this: original code x = x + 1; if (x >= 256) { j = j + 1; x = 0; } optimised to movlw 1 addwf x btfsc STATUS, C incf j What would the flowcharts look like for each case above? Regards Sergio Masci -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist