• Please review our updated Terms and Rules here

Really good open-source assembler

Chuck(G)

25k Member
Joined
Jan 11, 2007
Messages
44,541
Location
Pacific Northwest, USA
I'm looking for a good open-source assembler (the architecture is immaterial, as long as I can incorporate my own instructions). Note: this is not for x86 or any of the usual architectures.

I need a good macro facility, preferably also with function-type macros as well as a symbol table that tracks symbol properties. Symbolic character string manipulation as well as nested macro definitions are important. Scoped symbols are a plus.

GCC gas doesn't do it; neither do any of the usual suspects--NASM, VASM, GASM, TASM just don't have enough "meat" in the macro and symbol areas. Microsoft MASM or even the old S/360 macro assembler (as well as a host of old mainframe assemblers) would be fine, but they're not open-source (and probably would be murder to modify).

I've considered FASM; it's pretty close.

Any ideas/suggestions?
 
Last edited:
Hi! We are converting to SDCC and its assembler for the N8VEM project. TASM worked OK for a while but it is closed source and obsolete. SDCC is a C compiler and produces relocatable code and its assembler works well too. It supports a whole host of architectures so probably could be extended to whatever you want.

I don't know if it will be sufficient for you but it is worth a look for sure.

Good luck

Andrew Lynch
 
I'm looking for a good open-source assembler (the architecture is immaterial, as long as I can incorporate my own instructions). Note: this is not for x86 or any of the usual architectures.

I need a good macro facility, preferably also with function-type macros as well as a symbol table that tracks symbol properties. Symbolic character string manipulation as well as nested macro definitions are important. Scoped symbols are a plus.

GCC gas doesn't do it; neither do any of the usual suspects--NASM, VASM, GASM, TASM just don't have enough "meat" in the macro and symbol areas. Microsoft MASM or even the old S/360 macro assembler (as well as a host of old mainframe assemblers) would be fine, but they're not open-source (and probably would be murder to modify).

I've considered FASM; it's pretty close.

Any ideas/suggestions?

I have Vers. 2 of "MASM/ASM/LINKER" from about 1984.
 
Hi! We are converting to SDCC and its assembler for the N8VEM project. TASM worked OK for a while but it is closed source and obsolete. SDCC is a C compiler and produces relocatable code and its assembler works well too. It supports a whole host of architectures so probably could be extended to whatever you want.

I don't know if it will be sufficient for you but it is worth a look for sure.

Hi Andrew,

Thanks for the link. I think it's curious that the development team disabled AVR support. I wonder if the code generator doesn't work all that well with Harvard architectures?
 
You might want to take a look at http://www.z390.org/. Its an open source JAVA "clone" of the IBM zSeries assembler coupled with an emuloator and debugger. So it has ll the Macro stuff you want and is open source. How amenabale it is to the mods you want to make I don't know, but its different to anything else I have met,
 
I think I found what I'm looking for The AS Assembler.

The z390 assembler certainly is impressive. I can still remember the 360/40 grinding when assembling a DCB macro. I may keep it in my back pocket, but right now, AS looks pretty good. During the 80s, I remember running across a shareware S/360 emulator with assembler, but I don't know whatever became of the project.
 
D'oh! The link is

http://sdcc.sourceforge.net/

We are moving the home computer development entirely to SDCC and probably the SBC and the rest of the boards as well. Some builders used it for the SBC-188 (Sergey and John) and now SDCC taking the place by storm.

I would like to hear your assessment of SDCC regardless of whether you use it for your project. Being free/open source C compiler and assembler is a pretty potent combination. It specializes in the small memories of embedded computers which is also a lot like the N8VEM systems.

Thanks and have a nice day!

Andrew Lynch
 
I looked over the project. It's okay, but it's still C with an assembler. All C preprocessors are very weak in the world of macro language. If you want to see a real preprocessor, take a look at the one for PL/I (Chapter 9) that's what, about 45 years old?

One of the problems with C is that it assumes a certain programming model that may not be particularly well suited to the host architecture. For example, consider C implemented on an 8080 CPU (not Z80). Handling function-local variables is almost painful to look at. What do you do with a machine like the PDP 8 that doesn't even support a stack or 8 bit characters, not to mention the best way to use "micro" instructions?

An assembler with a beefy macro processor can solve a lot of ugly problems.

Do consider non-compiled languages. On limited systems, they can often be smaller and almost as fast as compiled-to-machine code versions.

Languages are tools; don't limit yourself to just a screwdriver and a hammer.
 
You have the source for it? That was what, version 2? Not the greatest. 5.x was okay, however.
I've had it in my posession since about 1987 or 1988. It's on a 360 floppy and I can't remember where, exactly, that I acquired it. However, a good guess would be when I was working for the Government inside the beltway. Shoot me a PM with an email address and I'll get it out to you tonight. P.S. It is Vers. 2.
 
I very much recommend the AS assembler. I used it in a recent project for the 6800, and also dabbled a bit with some other architectures.

At the start of my project, when I found the asl assembler, there was the "last stable" version and the current "beta" version. I chose the last stable version, v1.41r8, which according to the web page was released in 1999. The last "current version" was listed as 2006, but the download page called it beta, so I didn't want to mess with it at the time. I did run into a bug in the macro processing, but was able to work around it.

After the project was over, I decided to take a look at the current version, and it turns out this software is still being actively developed. Last version was in December, 2010. (Perhaps even more recent now.) He's abandoned the versioning scheme he had on the web page and just goes by beta build number. Anyway, now that I'm running the new version, the bug in the macro processing is fixed.

Gilbert
 
I'm going to convert some of my AVR assembly as a test for AS. I may need to make my own symbols file for the particular CPU I'm working with, though.
 
Back
Top