Cars · Diagnostics

ASM662 Assembler and Disassembler

ASM662 is an assembler and disassembler tool for Oki 66201, 66207, 66301, and NEC 66911 microcontrollers used in various Honda ECUs.

Advanced 6

ASM662 is an assembler and disassembler designed for the Oki 66201, 66207, and 66301 microcontroller architectures. It is released under the BSD license. In addition to the Oki series, the tool supports the NEC 66911 chips found in P13, P14, and P0D ECUs.

Note

ASM662 is currently in an experimental development stage. While functional, it may require manual intervention for complex code structures.

Usage and Command Line Arguments

The disassembler allows for the exclusion of specific memory addresses from table analysis. This is useful for preventing the tool from incorrectly identifying data as pointers.

Syntax: dasm662 [binary_file] [output_asm] [address_to_exclude_1] [address_to_exclude_2] ...

Example: dasm662 p30.bin p30.asm 5e20 5e59 7133 72fa

Technical Limitations

DD Flag Tracking

The Oki 66k architecture utilizes a status flag (DD) that alters the meaning of opcodes at runtime. ASM662 tracks this flag using a basic heuristic approach.

  • Indirect Jumps: The tool does not currently support indirect jumps. While these are absent in P28, P30, and P72 ROMs, they are present in P13 ROMs.
  • Subroutine Calls: The disassembler does not track the impact of subroutines on the DD flag. If a subroutine modifies the DD flag before returning, the disassembly may contain inaccuracies.
  • Safety: Despite potential inaccuracies in logic analysis, the tool is designed to output code that will re-assemble into the original byte sequence, ensuring the integrity of the binary.

Error Handling

The tool includes basic validation for the DD flag. If an instruction requires a specific DD state that contradicts the current tracked state:

  1. A warning is issued.
  2. The internal state is corrected to maintain consistency.
  3. The corrected instruction mnemonic is output.

Important

To achieve perfect disassembly, the tool would require advanced code analysis to track the impact of subroutines on the DD, LRB, and USP registers. Currently, these complex operations are not implemented.

Applies to

7 taxonomy links