Re: It has been done before



Charles A. Crayne wrote:
"PortAsm/86 for PowerPC is a source-code translator which converts 80x86
assembly-language code into efficient and maintainable PowerPC
assembly-language. It automatically deals with architectural differences
such as segmented addressing and alignment of memory accesses, and applies
aggressive optimizations to ensure good performance of translated code."

http://www.microapl.co.uk/Porting/PortAsm86.html


If you look at the manual, you'll see why this is so hard to do, even with a processor with 32 registers. I stand by my original observations and comments made on Betov's original posts on this subject. Machine translation of x86 assembler to another platform is much more complex than outputting equivalent code sequences, and approaches and even exceeds the effort necessary to write a compiler. This is not the only attempt; FX!32 for the Alpha did x86 translation on the fly, and there are lots of research papers and code out there; do a serach on "binary translation", or start here; http://www.cs.uq.edu.au/~cristina/uqbt.html.


--
Regards
Alex McDonald


.