#!/usr/bin/env bash
#
# AVRA Build and Release helper script
# source this in the root directory of avra and then invoke one of the
# functions to create a release. This is very hackish, but makes life easier.

Hi Jim, I am working on my Master's thesis which requires me to include some atmel assembler command-line tool in my software bundle. Therefore, I need something opensource. Otherwise, on Windows I would just copy the avrasm2.exe from the Atmel Studio installation directory, but I suppose that the licence does not allow me to distribute with my software.

Hi all, Atmel Studio includes both avrasm and gcc toolchain, probably for serving different syntaxes. As far as I am concerned, there are 2 - GCC syntax and Atmel syntax. What I would need is an opensource assembler for the Atmel syntax, which, Avra is. Or does anybody know how to convert the file in atmel assembly to the gcc syntax??? There should be different macro declarations and something like that...

On the whole the mnemonics are about 95% similar between Asm2 and avr-as so the only things that need "fixing" are the directives. Unless you are doing something particularly "exotic" (like Asm2 macros) then it's almost a one for one change. To do it you just need to read the two manuals side-by-side:

OTOH I guess AVRA is a possibility but as other have noted it's not going to include any AVR models released in the last 5 years.

TBH it's no clear to me why you would need to "distribute" a copy of the assembler anyway. Whatever software is used can you not tell the user of your .asm "oh and you need to use XYZ V123" and leave them to install it?

And to answer the original question, I took on, as an exercise, to build AVRA on Lunix.

Yes, the instructions on the page linked to are weird, and if you don't know anything about "Autotools" it's not easy to figure out what is actually needed to be done.

First a note: Since the latest AVRA sources are quite old now, they do not play all that well with Autotools. There are a few small fixes that needs to be made. In the src/ subfolder directory, create these files (e.g. as empty): NEWS. , README. , AUTHORS. ChangeLog. .

Now, still in the src/ subfolder, issue these commands in order. Some will produce warnings, but there should be no errors:

$ aclocal
$ autoconf
$ automake -a
$ ./configure
$ make

You should end up with an executable avra in the src/ folder:

$ ./avra
AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010)
Copyright (C) 1998-2010. Check out README file for more info
AVRA is an open source assembler for Atmel AVR microcontroller family
It can be used as a replacement of 'AVRASM32.EXE' the original assembler
shipped with AVR Studio. We do not guarantee full compatibility for avra.
AVRA comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of avra under the terms
of the GNU General Public License.
For more information about these matters, see the files named COPYING.
usage: avra [-f][O|M|I|G] output file type
[-o <filename>] output file name
[-l <filename>] generate list file
[-m <mapfile>] generate map file
.
.
.

Since I do not want to actually instyall AVRA I didn't do the last step, but it probably should work OK:

$ make install

That's it!

For Windows, I wonder what is hard to understand with the instruction given:

download then OpenWatcom C/C++ Toolchain for windows and create a new project and add the C and H files to it and compile.

No, I haven't tried it (yet ;-), but it sounds pretty straight forward.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here.

No guarantees, but if we don't report problems they won't get much of a chance to be fixed! Details/discussions at link given just above.

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

1. Download Watcom and install it (I went with the defaults all the way, you might want to select to install to e.g. "C:\Program Files (x86)\WATCOM" rather than the default "C:\WATCOM" ...)

2. Creaet a new project in Watcom (I created C:\Users\JohnDoe\Documents\WatcomProjects\AVRA.wpj, as a Win32 Character-mode Executable.)

3. Download the source file package (I downloaded avra-1.3.0.tar.bz2)

4. I unpacked the tarball to a subfolder to where I place the Watcom project file: C:\Users\JohnDoe\Documents\WatcomProjects\avra-1.3.0\

5. In Watcom I added all .c files and all .h files (Sources menu, New Source. Then browse to where the unpacked sources are, select *.c and Add all, select *.h and Add all. Then close the dialogue.)

6. I then did a build (Actions menu, Make all.)

I got a Windows executable that can run from a command line:

C:\Users\JohnDoe\Documents\WatcomProjects>avra
AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010)
Copyright (C) 1998-2010. Check out README file for more info
AVRA is an open source assembler for Atmel AVR microcontroller family
It can be used as a replacement of 'AVRASM32.EXE' the original assembler
shipped with AVR Studio. We do not guarantee full compatibility for avra.
AVRA comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of avra under the terms
of the GNU General Public License.
For more information about these matters, see the files named COPYING.
usage: avra [-f][O|M|I|G] output file type
[-o <filename>] output file name
[-l <filename>] generate list file
[-m <mapfile>] generate map file
.
.
.

No other tests done.

But it sure went smoothly on Windows! (-:

I'm sure it could b built with any other standards-compliant compiler with little changes to the sources. E.g. MS Visual C++ (which does C files just fine), GCC (possibly packed as a plugin to an IDE of your liking, e.g. Ecclipse, NetBeans, CodeBlocks...). But Watcom worked just fine. (-:

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here.

No guarantees, but if we don't report problems they won't get much of a chance to be fixed! Details/discussions at link given just above.

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]