Uckfield, UK MicroAPL's Relogix is a software conversion tool which takes assembly-language source files and automatically re-codes them in readable, maintainable C.
The company claims that the tool produces results close to what a skilled human programmer would produce if asked to re-write an assembler source file in C. To do the conversion, Relogix reorganizes the program flow to use natural C constructs such as “if,” “for,” and “case” statements, usually without recourse to “goto.”
By analysis of the source program, it is able to select valid C data types for local and global variables, including automatically detecting structures and unions, and it also deduces function prototypes in a natural C style. Parameters originally passed to assembler subroutines either in registers or on the stack become parameters to the corresponding C function.
Relogix will initially be made available for conversion of Motorola 680×0, CPU32 and ColdFire assembly language, with a version to convert x86 assembler following soon. Other architectures will be supported later. It will be sold both as a standalone tool and as a cost-effective porting service over the internet. MicroAPL will also offer consultancy services based on the Relogix technology.
Richard Nabavi, Managing Director of MicroAPL, said, “We believe that corporations with a heavy investment in old assembler code will be delighted at the ease of conversion and the high quality of the results. Even 'spaghetti' code comes out as well-structured C source, which is much more readable than the original.”
The software selects meaningful names for variables which were originally represented in registers or on the stack, using a unique algorithm which analyzes the usage, type, and origin of data, and which also examines comments in the original source file. The C code which is output by Relogix follows user-specified style guidelines, and is intelligently commented even where the code flow has been substantially altered during the conversion.