naken_asm
Posted: July 25, 2012
Updated: January 12, 2023
Introduction
naken_asm is a lightweight assembler / disassembler with a focus on being
easy to compile (no dependencies) and easy to use. It was originally called
naken430asm, but since it has been expanded it to support many more CPUs it
has been renamed to naken_asm. Additionally, there is also a simulator for
some of the supported CPUs.
CPU |
asm |
disasm |
sim |
cycle counter |
Java Grinder |
Author |
1802 /04/05/06 (RCA) |
RC |
RC |
|
No |
No |
Michael Kohn |
4004 (Intel MCS-4) |
RC |
RC |
|
No |
No |
Michael Kohn |
6502 / 6510 |
Stable |
Stable |
Stable |
Yes |
Yes |
Joe Davisson |
65C816 |
Stable |
Alpha |
|
Yes |
Yes |
Joe Davisson |
6800 |
RC |
RC |
|
No |
No |
Michael Kohn |
6809 |
Stable |
Stable |
|
Yes |
Yes |
Michael Kohn |
68HC08 |
RC |
RC |
|
Yes |
No |
Michael Kohn |
68000 |
Stable |
Stable |
|
No |
Yes |
Michael Kohn |
8008 (Intel MCS-8) |
Stable |
Stable |
|
No |
No |
Michael Kohn |
8048 (MCS-48) |
RC |
RC |
|
No |
No |
Michael Kohn |
8051 / 8052 (MCS-51) |
Stable |
Stable |
|
No |
Yes |
Michael Kohn |
86000 |
RC |
RC |
|
No |
No |
Michael Kohn |
ARC |
Alpha |
Alpha |
|
No |
No |
Michael Kohn |
ARM |
RC |
RC |
|
No |
No |
Michael Kohn |
ARM64 |
Alpha |
Alpha |
|
No |
No |
Michael Kohn |
Atmel AVR8 |
Stable |
Stable |
Stable |
Yes |
Yes |
Michael Kohn |
Cell BE (IBM) |
Stable |
Stable |
|
No |
No |
Michael Kohn |
Copper (Amiga) |
RC |
RC |
|
Yes |
No |
Michael Kohn |
CP1610 |
RC |
RC |
|
No |
No |
Michael Kohn |
dsPIC |
Stable |
Stable |
|
Yes |
Yes |
Michael Kohn |
Emotion Engine (Sony) |
Stable |
Stable |
|
No |
Yes |
Michael Kohn |
Emotion Engine VU |
Stable |
Stable |
|
No |
No |
Michael Kohn |
Epiphany (Parallela) |
Stable |
Stable |
|
No |
Yes |
Michael Kohn |
Java |
Beta |
Beta |
|
No |
No |
Michael Kohn |
LC-3 |
RC |
RC |
RC |
No |
No |
Michael Kohn |
M8C (PSoC 1) |
RC |
RC |
|
No |
No |
Michael Kohn |
MIPS |
Stable |
Stable |
Stable |
No |
Yes |
Michael Kohn |
MSP430 |
Stable |
Stable |
Stable |
Yes |
Yes |
Michael Kohn |
MSP430X |
Stable |
Stable |
|
No |
Yes |
Michael Kohn |
Nintendo 64 RSP |
Stable |
Stable |
|
No |
No |
Michael Kohn |
PDP-8 |
Alpha |
Beta |
|
No |
No |
Lars Brinkhoff |
PDK13 |
RC |
RC |
|
No |
No |
Michael Kohn |
PDK14 |
RC |
RC |
|
No |
No |
Michael Kohn |
PDK15 |
RC |
RC |
|
No |
No |
Michael Kohn |
PIC14 |
RC |
RC |
|
No |
No |
Michael Kohn |
PIC24 |
Stable |
Stable |
|
Yes |
Yes |
Michael Kohn |
PIC32 (MIPS32) |
Stable |
Stable |
Stable |
No |
Yes |
Michael Kohn |
Propeller |
Stable |
Stable |
|
Yes |
Yes |
Michael Kohn |
Propeller 2 |
Stable |
Stable |
|
Yes |
No |
Michael Kohn |
PowerPC |
Stable |
Stable |
|
No |
No |
Michael Kohn |
RISC-V |
Stable |
Stable |
|
No |
No |
Michael Kohn |
SH-4 |
RC |
RC |
|
No |
No |
Michael Kohn |
STM8 |
Stable |
Stable |
RC |
Yes |
No |
Michael Kohn |
Super FX |
Beta |
Beta |
|
No |
No |
Michael Kohn |
SWEET16 |
RC |
RC |
|
No |
No |
Michael Kohn |
THUMB |
RC |
RC |
|
No |
No |
Michael Kohn |
TMS340 / TMS34010 |
RC |
RC |
|
No |
No |
Michael Kohn |
TMS1000 / TMS1100 |
Stable |
Stable |
|
No |
No |
Michael Kohn |
TMS9900 |
Stable |
Stable |
|
Yes |
Yes |
Michael Kohn |
SunPlus unSP |
RC |
RC |
|
No |
No |
Michael Kohn |
WebAssembly |
Beta |
Beta |
|
No |
No |
Michael Kohn |
Xtensa |
RC |
RC |
|
No |
No |
Michael Kohn |
Z80 |
Stable |
Stable |
Alpha |
Yes |
Yes |
Michael Kohn |
- Stable: The assembler has been used on a project.
- RC: The assembler has been tested against another assembler for accuracy.
- Beta: Code complete and should be good.
- Alpha: The assembler has been started but not complete.
If anyone else has been using one of these assemblers /
disassemblers and finds it stable please let me know so I can change
the status to stable.
Input / Output file formats:
- Intel HEX
- ELF
- Raw Binary
- SREC
- WDC
- Amiga
Download
naken_asm-2023-01-11.tar.gz (Source)
naken_asm-2023-01-11.zip (Windows Binary)
naken_asm-2023-01-11-macosx10.15-x86_64.tar.gz (MacOSX)
naken_asm-2023.01.11-1.el7.x86_64.rpm (CentOS Linux)
The source repository is really the best place to get naken_asm since
it will have all the latest bug fixes and features. It should compile
easily on Linux, BSD, or any other OS.
Just install gcc and type ./configure and then make.
Repository: git clone https://github.com/mikeakohn/naken_asm.git
Older
naken_asm-2022-10-29.tar.gz (Source)
naken_asm-2022-10-19.tar.gz (Source)
naken_asm-2022-04-16.tar.gz (Source)
naken_asm-2021-11-21.tar.gz (Source)
Documentation
The github repository has a docs directory with a list of all directives
and some specific information for certain CPUs:
README
I also started an MSP430 tutorial that might be useful:
MSP430 Tutorial. It's still a work
in progress though.
Include Files
include/
How To Help
- Use the assembler. Send me bug reports, suggestions, or just let me know you're using it.
- Spread the word. Link to this page.
- Create a package for a distribution (BSD/Linux etc).
- Development boards and other toys would be fun :).
Samples
launchpad_blink.asm - Make 2 LED's blink with the MSP430 Launchpad
CamelForth - Brad Rodriguez has an implementation of Forth assembled with naken_asm.
Sega Genesis Demo -
A demo of code written in Java, compiled with Java Grinder, and
assembled with naken_asm.
Apple IIgs Demo -
A demo Joe Davisson made of code written in Java, compiled with Java Grinder, and assembled with naken_asm.
Commodore 64 Demo -
A demo Joe Davisson made showing a Commodore 64 demo written in Java,
compiled with Java Grinder, and assembled with naken_asm.
TI99/4A Demo -
A demo of code written in Java, compiled with Java Grinder,
and assembled with naken_asm.
dsPIC Mandelbrots - Compute Mandelbrots
with the DSP module of the dsPIC
Epiphany Mandelbrot -
Compute Mandelbrots on a 16 core Epiphany on a Parallella board.
Playstation 3 Cell Mandelbrots -
Compute Mandelbrots on 6 Playstation 3 Cell cores.
Playstation 2 Demo - A demo written
in Java, compiled with Java Grinder, and assembled with naken_asm.
RISC-V - assembly on a HiFive1 board.
TRS80 Coco demo
- A demo written in Java using the 6809 support.
Intellivision Demo - A breakout
game written in Java and compiled for CP1610 / Intellivision with Java Grinder.
Intel 8008 - An iceFUN FPGA
with an 8008 core running an assembly program.
Nintendo 64 demo - A demo written
in Java, compiled with Java Grinder, and assembled with naken_asm.
Test Strategy
In order to give confidence that naken_asm isn't going to hinder anyone
else's development, I've been adding 3 different types of tests to the
build system. The unit and regression tests should be obvious what they
do. For the comparison tests,
I created a text file with every single instruction, assembled each instruction
one by one using someone else's assembler (usually the GNU gas assembler),
and used a bash script to compare the output of naken_asm with the output
of these assemblers.
All tests are in naken_asm's
tests/
directory.
Updates
October 29, 2022: Added support for Padauk PDK13, PDK14, PDK15. To
test it an asm file was created with all the instructions for each arch
and was assembled with Padauk's official IDE. It was then disassembled
with the fppa-pdk-tools open source package. There is support for PDK16
but fppa-pdk-tools didn't seem to want to decode the .pdk file that
the official IDE created, so there is no way to test it at the moment.
April 17, 2021: Added support for SunPlus unSP (used in some toys
and consoles like V.Smile and I believe some Leapfrog systems). There
are new tests that compare to the offical xasm16.exe assembler.
February 1, 2021: Added tests that compare the output of naken_asm
with other assemblers for 4004, 68HC08, and CP1610. I upgraded those to
RC and built a new release.
December 31, 2020: Added tests for Parallax Propeller 2 comparing the
output to another assembler.
December 17, 2020: Added Parallax Propeller 2 support. No tests written
yet so it's in a pretty unknown state.
November 29, 2020: I added Nintendo 64 RSP instructions. I used the
SGI Nintendo 64 RSP Programmer's guide (official PDF from SGI) to
add the instructions. To test I played around with 3 other assemblers
(bass, armips, and rspasm from the n64chain project) but ended up
using armips for different reasons.
Anyway, I tested naken_asm against the 3 assemblers and verified against
the PDF. I'm 99% sure I got this right, but if anyone has some information
please let me know.
May 17, 2020: I added TMS340 tests this weekend. Testing against the
gspa assembler. I also added some TMS34020 instructions. I wish I
had a board to test on :(.
May 10, 2020: I added TMS340 (TMS34010) this weekend. It was used
in Mortal Kombat so I thought it might be cool to have it. Just need
to do some testing to FINISH IT!
January 20, 2020: I added comparison tests for PSoC M8C (comparing
against Cypress's own assembler) and 8048 / MCS-48 (comparing against
asm48).
December 17, 2019: PSoC M8C was added. I haven't had a chance to try
it yet and there are currently no tests that compare the output with
other M8C assemblers.
November 2, 2019: Tests pass for Hitachi SH-4.
October 26, 2019: Added Hitachi SH-4. As of today, it's code complete
but hasn't been tested. Should work with the Sega Dreamcast hardware.
March 5, 2019: Added MCS-48 .. seems this was some Intel instruction
set used in things like 8048 in the Magnavox Odyssey 2.
Copyright 1997-2023 - Michael Kohn
|