PortAsm/68K for 80x86 is a source-code translator which converts 680x0 and CPU32 assembly-language code into efficient, optimized, and maintainable 80x86 assembly-language. It provides a fast, easy and reliable way to port 68000-family assembler to the 80x86 architecture, avoiding the need for a lengthy and difficult re-write, which can introduce new bugs into a mature body of source code.
It can be used either for applications written wholly in assembler, or for translating the assembler portions of applications written partly in 68K assembler and partly in a high-level language such as C or Pascal. It can also be used to help port system-level code and drivers. Supported 68K source assembler formats include Motorola MASM, Microtec Research ASM68K, Gnu gas, Diab Data das, and Apple MPW Asm. The generated x86 assembler is compatible with most of the leading x86 toolsets and runtime environments.
PortAsm/68K analyzes the original source code, and separates the semantic meaning of 680x0 instructions or sequences of instructions from irrelevant side effects such as condition code updates which are not needed. After expanding macros and tokenizing the source file, PortAsm/68K:
- Examines the 680x0 instructions in detail, analyzing content and program flow.
- Maps 680x0 registers on to 80x86 registers, optimizing over blocks of code.
- Replaces sequences of 680x0 instructions with efficient 80x86 equivalents.
- Reproduces only the required behaviour of the 680x0 code, eliminating irrelevant side-effects as much as possible.
- Produces 32-bit code suitable for the 80386, 80486 and Pentium-class processors. The code uses the 32-bit 'flat' segment model.
- Adapts the code to fit into the target runtime environment.
- Generates interface glue for calls to and from native high-level code.
- Outputs a translated 80x86 source file, optionally retaining comments.
- Optionally outputs additional debugging directives.
- Powerful, easy-to-use source-code analyzer and optimizing code generator.
- Produces easy-to-read 80x86 assembler source code that uses the original symbolic labels and variable names.
- Retains the original 680x0 code in the output file as comments, making the translation process transparent and aiding debugging (the original comments may also be retained).
- Users can include hand-written 80x86 assembler in the original 680x0 source, which with conditional assembly directives makes it easy to maintain a single source base for both 680x0 and 80x86 targets.
- Includes support for translation of 68881/68882/68030/68040 floating-point instructions..
- Powerful code generation optimizations can be selectively enabled/disabled.
- Automatic generation of interface glue for calling out to or being called from native C or Pascal code.
- Integrates into the standard build process for easy code maintenance after the initial port.
- Supports source-level debugging, using the original 680x0 code as source, making debugging very simple even for users who have little 80x86 assembler knowledge.
- Linux (x86)
Interoperability with other MicroAPL tools
PortAsm/68K for 80x86 can be used in conjunction with Relogix for translating legacy code partly to x86 assembler and partly to C.