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.
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:
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.
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: 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-2021 - Michael Kohn