Combining AVR Studio 4 Assembler and GCC

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've recently developed some handy interrupt routines using assembly language in AVR Studio 4. I now want to combine these routines with some GCC programs that I developed using WinAVR (and Eclipse). I would like to combine these without having to translate my assembly code to GCC assembly.

Here're the questions:

- Has anyone successfully combined AVR Studio 4 assembly code and GCC? If so, how did you do it?

- If it's not reasonably easy, how much hassle is it to convert AVR Studio 4 assembly to GCC Assembly?

Thanks for any help!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avr-as requires slightly different syntax to the Atmel AvrAsm2. So you will have to make some changes.

Personally, I would select one dialect and always write in that dialect. Then just write a "sed" script to convert to the other flavour. Add a dependency rule to your Makefile and the whole process is transparent.

You may be able to do the conversion with regular conditional #define statements. You may prefer to use "awk" or some other program to do the conversion.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a distant memory that someone already posted an Atmel to avr-as converter here previously. Maybe I just dreamt it?

BTW if you #define register names rather than .def then it should work in both as they each have a pre-processor.

The avr-as manual is here by the way: http://sourceware.org/binutils/d...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
I have a distant memory that someone already posted an Atmel to avr-as converter here previously. Maybe I just dreamt it?

BTW if you #define register names rather than .def then it should work in both as they each have a pre-processor.

The avr-as manual is here by the way: http://sourceware.org/binutils/d...

Since I didn't find any such tutorial, I decided to create one. Thanks to all the forum folks who helped by answering key questions to get me on the track.

The tutorial is here:
https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=84753

Enjoy!