Skip to main content

FV-1 Disassembler

Project description

disfv1

Disassembler for Spin Semi FV-1

Copyright (C) 2019-2021 Nathan Fraser

A simple disassembler for the Spin Semiconductor FV-1 DSP. This disassembler will convert a FV-1 binary program file into strict FV-1 assembler statements, suitable for use with asfv1 and the Spin IDE.

Requirements

  • Python > 2.6

Installation

Make sure your system has a python interpreter (preferably python3), then install from the Python Package Index using the pip command:

$ pip3 install disfv1

or

$ pip install disfv1

For system-specific installation instructions see System Specific Installation below.

Usage

$ disfv1 input.bin output.asm

$ disfv1 -h
usage: disfv1 [-h] [-v] [-q] [-r] [-s] [-p {0,1,2,3,4,5,6,7}] infile [outfile]

Disassemble a single FV-1 DSP program.

positional arguments:
  infile                binary program file
  outfile               assembly program output file

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         print version
  -q, --quiet           suppress warnings
  -r, --relative        use relative skip targets
  -s, --suppressraw     convert invalid/raw statements into nop
  -p {0,1,2,3,4,5,6,7}  program number

Overview

disfv1 is based on information in the FV-1 datasheet and AN0001 "Basics of the LFOs in the FV-1". It disassembles FV-1 machine code into strict assembler compatible with asfv1.

  • This disassembler converts a single 128 instruction DSP program binary and outputs a corresponding assembly representation.

  • Skip offsets are automatically replaced with labels. To suppress labels and instead get the offset, use command line option -r (--relative).

  • By default, the source is assumed to be a single program. To offset into a bank file, use the command line option -p (--program) to choose an alternate program.

  • Invalid instructions are disassembled as 'raw' instructions, to replace them with 'nop' use command line option -s (--suppressraw).

Example

$ disfv1 example.bin
info: Reading input from example.bin
info: Read 9 instructions.
	skp	RUN,addr03             	; flags:0x10 offset:0x02
	ldax	POT0                   	; reg:0x10
	wrax	REG0,0.0               	; reg:0x20 k:0x0000
addr03:	ldax	ADCL                   	; reg:0x14
	mulx	REG0                   	; reg:0x20
	wra	0,0.0                  	; del:0x0000 k:0x000
	rda	9830,0.5               	; del:0x2666 k:0x100
	rda	19660,0.5              	; del:0x4ccc k:0x100
	wrax	DACL,0.0               	; reg:0x16 k:0x0000

System Specific Installation

The preferred method for installation is to use your system's packaged pip3 command to fetch and install disfv1 from PyPi and set it up to work with a python3 interpreter.

Linux with apt (Debian, Ubuntu)

$ sudo apt install python3-venv python3-pip
$ pip3 install disfv1

Linux with yum (Fedora 21)

$ sudo yum install python3 python3-wheel
$ pip3 install disfv1

Linux with dnf (Fedora 22)

$ sudo dnf install python3 python3-wheel
$ pip3 install disfv1

rch Linux

$ sudo pacman -S python-pip
$ pip install disfv1

MacOS

Download a copy of the "Latest Python 3 Release" for Mac OS from python.org. Install the package, then open a terminal and run:

$ pip3 install disfv1

Windows

Download a copy of the "Latest Python 3 Release" for Windows from python.org. Install the package, then open a command prompt and run:

C:\> pip3 install disfv1

For more detailed information, please refer to the Python package installation documentation and installing pip with packaging managers at packaging.python.org.

Install from Source

If you would prefer to not use pip, or if your system is provided with and older version of Python (eg MacOS), disfv1 can be installed using the included setup.py script. Fetch a copy of the latest source package, unpack it and then run the installer as root:

$ sudo python ./setup.py install

Alternatively, the main source file can be run directly with a python interpreter without the need to install any files:

$ python ./disfv1.py infile.asm outfile.bin

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

disfv1-1.0.6.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

disfv1-1.0.6-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file disfv1-1.0.6.tar.gz.

File metadata

  • Download URL: disfv1-1.0.6.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for disfv1-1.0.6.tar.gz
Algorithm Hash digest
SHA256 f8d4f80108565dfd596405d80ecea10023208185113a3e5ccb746879fc9486f9
MD5 af78446b80b6e8aae12c04ed27335c1a
BLAKE2b-256 23039a4f319e233b10ad2f47506c5dc9db722000c96d29a26db218e75994debe

See more details on using hashes here.

File details

Details for the file disfv1-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: disfv1-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for disfv1-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 715669fe0e579af4c9ddfea1519029d4ee2b623b868ed8cd4d43ba6cf3db9787
MD5 522a4824c6458e9ca3e37e994582034a
BLAKE2b-256 1a1b27a0b1c5f88a902ea14ad3197ac3f156e0e207c24096b5fedbbb69a3abb3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page