William Couture gmail.com> writes: > > On 11/15/06, Peter P. yahoo.com> wrote: > > > > There was a discussion in the past where the idea of porting assembly to C > > > for > > portability came up. Now there is a commercial solution for this. I did not > > try > > it but someone may need it: > > > > http://www.microapl.co.uk/asm2c/ > > > > It does not support the PIC (yet - and probably never will), only M68k and > i386+. > > And, unfortunately, there is no "freebie" sample program. > > I'd love to see what it does with some of my old .ASM programs, > but I'm not going to pay $Hundreds to find out... You do not say in what language. In theory 'porting to c' can be done by 'simply' (famous last words) #definig C macros based on each assembly instruction. When a mnemonic does not unambiguously describe the operation then some more work is needed (f.ex. by expanding menmonics to other mnemonics that correspond to unique functions). For better translation groups of instructions must be matched to constructs. Exactly like a loophole optimizer does. A reasonable translator can be built in Perl or Awk probably. On a more interesting CPU (like the Z80 which has about 10 addressing modes) decoding the menmonics could become interesting (LD can stand for a variety of operations). Peter -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist