CONTENTS

Home
Electronics
Graphics
Java
Java Mobile
Android / iOS
Other Stuff
Music
Resume
Contact





naken_asm

More electronics projects on mikekohn.net here.

Posted: July 25, 2012
Updated: September 9, 2014

Introduction

Since I was adding new CPU support to naken430asm I decided to rename it to naken_asm. This is a raw, simple assembler. I have some include files for msp430 and Alexander Zhevak has made more complete include files available from: git clone git://github.com/zhevak/naken430-inc.git. Include files from Microchip for dsPIC work after being run through an included script and Atmel include files work directly from Atmel. As a side project, with help from Joe, we have been putting together a Java .class compiler called Java Grinder which produces output that can be compiled with naken_asm.

 
CPUasmdisasmsimcycle counterJava GrinderAuthor
65xxStableStableBetaYesYesJoe Davisson
680xBetaBeta No Michael Kohn
68HC08/CPU08BetaBeta Yes Michael Kohn
680x0/CPU32BetaBeta NoBetaMichael Kohn
8051/8052BetaBeta No Michael Kohn
ARMBetaBeta NoAlphaMichael Kohn
Atmel AVR8StableStableBetaYes Michael Kohn
dsPIC/PIC24StableStable YesYesMichael Kohn
MIPSBetaBeta No Michael Kohn
MSP430StableStableStableYesYesMichael Kohn
MSP430XBetaBeta No Michael Kohn
STM8BetaBeta Yes Michael Kohn
THUMBBetaBeta No Michael Kohn
TMS1000/TMS1100StableStable No Michael Kohn
TMS9900BetaBeta Yes Michael Kohn
Z80BetaBetaAlphaYes Michael Kohn

Stable here means I've been using it and proved it's working well. Beta means all the code is down but I haven't gotten a chance to write much code around it. If anyone else has been using one of these assemblers / disassemblers and finds it stable please let me know.

Download
naken_asm-2014-09-09.tar.gz (Source)
naken_asm-2014-09-09.zip (Windows Binary)
naken_asm-2014-09-09-macosx10.9-x86_64.tar.gz (MacOSX)

The source code is for compiling 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-2014-09-03.tar.gz (Source)
naken_asm-2014-07-05.tar.gz (Source)
naken_asm-2014-05-20.tar.gz (Source)
naken_asm-2014-04-12.tar.gz (Source)
naken_asm-2014-04-05.tar.gz (Source)

Chip Info

65xx - Support for 6502, 65c02, 6507, 6510, and any chip of this 8 bit family.

680x - Support for CPU's compatible with the 6800 instruction set.

68HC08/CPU08 - 68HC08 microcontroller instruction (CPU08). I did this specifically for the 68HC908GP32.

680x0/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.

ARM - Disassembler and assembler are mostly done for generic instructions. I made a small program to prove it working on the Raspberry Pi here.

dsPIC - Both disassembler and assembler are working. Proved it out with a Toy Car project.

MIPS - Farnell sent me a chipKIT UNO32 so I can add MIPS support to naken_asm. I have all the basic MIPS instructions assembling and disassembling. Just need to test it.

MSP430 - Full MSP430 and MSP430X support.

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.

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.

Z80 - I got all my info for this chip mostly from http://wikiti.brandonw.net/index.php?title=Z80_Instruction_Set and http://search.cpan.org/~pscust/Asm-Z80-Table-0.02/lib/Asm/Z80/Table.pm. There were a few weird things in here so I downloaded the datasheet from Zilog. There were just a couple extra instructions on these pages, not sure why. Anyway, the assembler/disassembler should be working.

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 :).

Documentation

I've been working on a README I'm going to start including with the download:
README

Samples

launchpad_blink.asm - Make 2 LED's blink with the MSP430 Launchpad
spi.asm - Write 16 bits out of SPI to a MCP4921 DAC
ds1305_rtc.asm - Read time from a DS1305 real time clock chip using MSP430.
ds18b20.asm - Read temperature from a DS18B20 temperature sensor using MSP430.
guitar_proc.asm - Example of taking input on the A/D, changing the sound sample, and throwing it out a DAC.
clock_thermometer.asm - Talking alarm clock thermometer.
msp430_sirc.asm - Reading SIRC data from a Sony remote control.
uart.asm - UART example for msp430g2553.
Bluetooth Thermometer - Bluetooth module hooked up to an msp430g2553.
Syma S107 No Fly Zone - IR Jammer for Syma S107 Helicopters.
Brushless Motor - Example of spinning a brushless motor with an MSP430.
LCD - Olimex MSP430-4619LCD.
Walking Robot - Vinod's 2 servo walking robot using the TI Launchpad.
Math Routines - Joe Davisson made some math funcions for the MSP430.
Balsa Wood Airplane - Created an IR remote control receiver using an Atmel ATtiny85.
PAPER-ROM - Stored some data on a disk of paper and read it back with IR sensors and an ATtiny2313.
Jimmy Jose's sample MSP430 programs
CamelForth - Brad Rodriguez has an impl ementation of Forth assembling with naken_asm.
dsPIC Mandelbrots - Compute Mandelbrots with the DSP module of the dsPIC
Java Grinder 64 Demo - A little demo Joe Davisson made showing a Commodore 64 demo written in Java, compiled with Java Grinder, and assembled with naken_asm.

News

September 9, 2014: I've been adding different types of scripted tests to naken_asm that I can run every time I do a build. Found a few bugs and posted a new release.

March 22, 2014: I added symbols information from ELF to naken_asm so bprint and wprint for example can use the symbol names instead of just numbers. I also added a simulator for avr8 to assist in the avr8 Java Compiler for Java Grinder.

March 16, 2014: I added some code so that naken_util can now execute MSP430 code from the command line without entering the simulator. The purpose for this was to help automate testing of Java Grinder. Now if Joe or I make a change to some critical code, make tests will compile some Java programs, grind them into MSP430, and then execute them with naken_util and test that R15 is the expected value. There are a bunch of tests like this that I've been wanting to add to naken_asm too, but I have so little time.

February 22, 2014: I've been cleaning up some code today. Trying to make some of the older naken430asm code that I moved here easier to read. I've also started changing my spacing system from the x=1 format to the more common x = 1. I fixed a bug that made $ for hex in 65xx stop working and added a .set directive. Now from anywhere in the code .set can be used to set a variable in the address list (same list as labels are put in) except this number can change as many times as the user wants.

Also, I've currently been working on a project called Java Grinder (with Joe Davisson again doing the 65xx part) which uses this assembler.

November 29, 2013: I introduced a bug into the September 18, 2013 release that made naken_asm not deal with single ascii characters inside of '' correctly. This is fixed in the November 29, 2013 version. I removed any versions of naken_asm with that problem from my website.

November 28, 2013: Made some major improvements to ARM. Doing some comparing between GNU's as and naken_asm to make sure it's okay. Eventually I'm planning on making some auto-test of all the instructions like I did with dsPIC. Also, naken_prog can now program LPC chips. I can read the flash back and see that it came back the same way I wrote it so it appears it's working. I also fixed a bug in writing out symbols in ELF output.

November 07, 2013: I fixed a bug in the cycle counter in MSP430 and finished my clean-up of the ARM code. Over the next couple weeks I'm going to do some QA on it to make sure everything is working okay. I also added naken_prog which is currently able to read info and flash from LCP1114 ARM chips (and probably some others). Tomorrow I plan to make it so I can write to the flash of a chip.

October 30, 2013: I started on a major cleanup / rewrite of the ARM code a couple weeks ago. Hopefully in the next couple weeks I'll have a chance to finish it up. If not it's my Thanksgiving project.

July 28, 2013: Major rewrite of dsPIC assembler / disassembler is done. I added a script for converting Microchip's include files to naken_asm style. Working on my first big dsPIC project so I can mark this as stable.

July 21, 2013: Posted the latest. I deleted almost all of the dsPIC assembler and started over. I've been checking every type of instruction against the Microchip assembler and everything is looking really good. I have a couple things to polish up and a little more testing to do. Also, I have 6 DSP instructions that I haven't added yet. Should be done in a couple days I hope. Also, thanks to Ene Alexandru for reporting a segfault in the disassembler for msp430x and sending me a fix. That's included in this release too.



Copyright 1997-2014 - Michael Kohn