Posted: July 25, 2012
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.
Stable here means I've been using it and proved it's working well. Beta means all the code is written but I haven't gotten a chance to use it myself. Most of the beta assemblers still have tests run against them that compare against other assemblers. If anyone else has been using one of these assemblers / disassemblers and finds it stable please let me know.
Input / Output file formats:
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
The github repository has a docs directory with a list of all directives
and some specific information for certain CPUs:
How To Help
launchpad_blink.asm - Make 2 LED's blink with the MSP430 Launchpad
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.
1802 - Support for RCA 1802 / 1804 / 1805 / 1806 compatible chips.
6502 - Support for 6502, 65c02, 6507, 6510, and any chip of this 8 bit family.
68000/CPU32 - My target for this minimum 68000 for Amiga programming or Sega Genesis or such.
8051/8052 - Support for 8051 and 8052 8 bit family chips (also known as MCS-51). I tested some code on an Atmel AT89S52 and on a Wixel.
ARM - Disassembler and assembler are mostly done for generic instructions. I used it to make Easy Match work on a Raspberry Pi.
STM8 - Added support for STM8. Valentin Dudouyt has created a tool to flash the STM8 Disovery board with Linux: https://github.com/vdudouyt/stm8flash.
TMS1000/TMS1100 - An old TI 4 bit CPU that's used in the Speak & Spell, Speak & Math, some old calculators, and others.
Xtensa - Tensilica's Xtensa core used in the ESP32 and ESP8266.
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: I added PSoC M8C. 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.
February 3, 2019: Added Tensilica's Xtensa instruction set. This is the CPU used in the ESP32 and ESP8266 cheap WiFi modules. So far there are tests against the output of GNU's assembler and everything matches except slli (which looks like a bug in GNU's assembler) plus a bunch of instructions (data cache instructions) that aren't supported by GNU's assembler aren't tested. There is a complete list of instructions tested in the tests/comparison directory under xtensa_template.txt. Also, big endian mode isn't tested yet.
January 5, 2019: Added Java. It can't output class files, so not sure how useful it is at this moment, but I have my reasons for wanting it.. :).
December 25, 2018: Added Amiga's copper co-processor and some developer documentation to help with others wanting to add support for their own CPU.
July 8, 2018: I added (the start) of a linker to naken_asm. Currently it just works with MIPS (Playstation 2). I was using it to link some pieces of ps2dev to try getting sound working. It pretty much just handles functions and doesn't support global variables. Hoping to have it work with global variables and some other CPUs sometime.
June 1, 2018: Since it seems there is a new Intellivision console I decided to add CP1610.
May 12, 2018: Added support for SWEET16 (for Apple II programmers).
April 22, 2018: Added support for RCA 1802.
October 21, 2017: Added a Playstation 3 example using 6 SPU cores to the SIMD Mandelbrots page.
October 15, 2017: Added a Playstation 3 example using AltiVec to the SIMD Mandelbrots page.
October 7, 2017: Added FPU instructions to PowerPC.
September 8, 2017: Altivec support is in.
September 7, 2017: Just an update as to where the assembler stands right now. There have been a few bug fixes lately (I'll probably roll up a new tarball in the next few days) around macros (there was a limit of like 10 parameters, it's now 254) and some bugs in the 6502 simulator that were filed on github. My current work has been adding samples for Playstation 2. In the samples directory I've added code to display a triangle, draw an image, do some texture mapping. Next will probably be the vector units. I also started adding code to the PowerPC base for Altivec. I'm hoping to have some sample code for the Playstation 3 using that and the Cell BE soon. On my list is also to add NEON to the ARM assembler and THUMB-2 to the THUMB assembler. I started working on ARC (a core found in Intel's Curie chip in the Arduino 101 and the Intel ME chip found on Intel motherboards) but that chip is very tedious... maybe I'm missing a better way to implement it.
June 16, 2017: Didn't realize that Parallax Propeller instructions all had condition codes. In the documentation the "cond" field always had 1111 instead of something like CCCC so I figured all these instructions could only be "if_always". I added conditions to the assembler.
May 29, 2017: I added a Mandelbrot generator the Epiphany / Parallella board in the samples directory. I created a Epiphany Mandelbrot page for more info on that. I also added an LC-3 assembler. Hoping I have time to do FPGA work with it.
I've been eyeballing Axis's Etrax (CRIS?) CPU and the ARC CPU (the one that comes with the Intel Curie and on Intel motherboards) as possible future assemblers. If anyone has any requests send me an email.
April 6, 2017: I added automated testing for THUMB comparing the output to GNU's assembler.
March 24, 2017: I added a Playstation 2 include file and a small Playstation 2 program written in assembly. I posted a picture along with a small explanation on a Playstation 2 page.
Copyright 1997-2020 - Michael Kohn