Skip to content

Motorola Fast Floating Point (MFFP) Ghidra extension

License

Notifications You must be signed in to change notification settings

nicodex/ghidra_motorolaffp

Repository files navigation

Motorola Fast Floating Point (MFFP) Ghidra extension

The MotorolaFFP Ghidra extension adds a new built-in data type. It also provides a plug-in to convert scalar operands to equates.

This format is used in the MC68343 Floating Point Firmware, which is included in the Commodore Amiga ROM Operating Systems from the very beginning and part of the mathffp.library.

NOTE: The Amiga ROM Kernel Reference Manual documents the exponent to be stored as two's complement value in excess-64 format. If you handle the encoded exponent as an unsigned value, the bias is 65.

Binary format:
31 23 15 7
MMMMMMMM MMMMMMMM MMMMMMMM SEEEEEEE
  • 24-bit significand (MSB stored, 23-bit fraction like IEEE 754 binary32)
  • 1-bit sign (1 = negative)
  • 7-bit exponent with a bias of 65
  • Largest negative encoded value 0xFFFFFFFF (-9.2233714E+18)
  • Smallest negative encoded value 0x80000080 (-2.7105054E-20)
  • Smallest positive encoded value 0x80000100 (+2.7105058E-20)
  • Largest positive encoded value 0xFFFFFF7F (+9.2233714E+18)
  • Zero value 0x00000000 (conversion to IEEE 754 binary32: significand MSB ignored)
  • Neither negative zero, nor quiet/signaling NaN, nor Infinity, nor subnormal values

Install

To install an official pre-built extension release:

Ghidra / File / Install Extensions...

Usage

Read the extension help file.

Build

To create the build for other Ghidra versions:

Install Ghidra:
  • Download and extract the target version of Ghidra
Install build tools:
Download and extract the source:

Download from GitHub

$ unzip ghidra_motorolaffp-main
$ cd ghidra_motorolaffp-main

NOTE: Instead of downloading the compressed source, you may instead want to clone the GitHub repository:

$ git clone https://github.com/nicodex/ghidra_motorolaffp.git
$ cd ghidra_motorolaffp
Build the extension:
$ gradle -PGHIDRA_INSTALL_DIR=<GHIDRA_DIR>

(where <GHIDRA_DIR> is the absolute path to the Ghidra installation).

The compressed build will be located at dist/.

Develop

To develop the extension itself, it is highly recommended to use Eclipse.

Install build and development tools:
Import the extension project into Eclipse:
  • File -> Import...
  • General | Existing Projects into Workspace
  • Select root directory to be your downloaded or cloned source repository
  • Click Finish
Link the project to the Ghidra installation:
  • GhidraDev -> Link Ghidra...

GhidraDev / Link Ghidra...

Launch the project with the Ghidra run configuration:
  • Run -> Run As -> Ghidra

Run / Run As / Ghidra

Export the project to an installable extension module:
  • GhidraDev -> Ghidra

Run / Export / Ghidra Module Extension...

The compressed build will be located at dist/.

Legal

Like Ghidra, this software is released under the Apache License, Version 2.0 ("Apache 2.0").

For details read the license file.