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.
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
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 compatible chips.
6502 - Support for 6502, 65c02, 6507, 6510, and any chip of this 8 bit family.
65C816 - Support for the 16 bit version of the 6502. Example of this working here: Apple IIgs Java
68HC08/CPU08 - 68HC08 microcontroller instruction (CPU08). I did this specifically for the 68HC908GP32.
68000/CPU32 - My target for this minimum 68000 for Amiga programming or Sega Genesis or such. I may add Amiga executable support for input and output.
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.
Emotion Engine - This is the CPU (based on MIPS) in the Playstation 2. There is support for the two vector units as well.
IBM Cell - This is for the 8 core SPU vector units in the Playstation 3.
STM8 - Added support for STM8. Valentin Dudouyt has created a tool to flash the STM8 Disovery board with Linux: https://github.com/vdudouyt/stm8flash.
Super FX - This is a chip that was originally used as a co-processor in some Super Nintendo games.
TMS1000/TMS1100 - An old TI 4 bit CPU that's used in the Speak & Spell, Speak & Math, some old calculators, and others.
TMS9900 - One of the first 16 bit CPUs. From the looks of it it seems to be the grandfather of the MSP430. I didn't use TMS9900 standard syntax for hex, but I can change it if I get requests.
I've been working on a README I'm going to start including with the
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-2018 - Michael Kohn