> Now my personal view is that all the above work can also be achieved
> by using a cross complier but for that we have to make the changes in
> the complier backend. Instead of doing that cant we make a tool which
> convert the assembly language of one architecture to another
> architecture machine language.
I doubt it is a reasonable idea. If you wish just to port the code so
that it just works on another platform, then it is theoretically
possible (though it may take less efforts to write an emulator). If
you wish to gain a reasonable performance, then avoiding back-end's
work is impossible.
Optimizing compilers do a lot of hi-tech work on allocating data on
registers, selecting better instructions, scheduling them for better
performance, etc. Suppose you do a conversion from platform with N
registers to a platform with M<N registers. How will you deal with
lacking registers? Spill them to memory? into stack? load and unload
from time to time? The work seems to be compared with fighting in a
[People have been translating assembler and machine code for 40 years.
Since the target is usually a newer machine than the source,
sufficient registers et al aren't usually a problem. Incompatible
data formats and byte orders, though ... -John]