Page 1 of 1

hardenning stuff with assembler

Posted: Sun Oct 05, 2008 9:08 am
by Diego J
Hi people.
I need to make a project completely in assembler for the Uni.

As an extra for the project, students can opt to make an interface with USB, and only for that we can use C.

I have successfully maked (with a lot of research) a C project with some assembler functions. But this is far away from being an assembler project.
With assembler functions i cant use constants like PORTB and the others.
I cant include m32def.inc because i use avr-gcc and not avrasm.

If i use AVR-ASM i can make an entire project in assembler, but then i cant add C files like the ones for avrusb.

Any idea of how can i make a basic mix between both languages?

My needs for the mixedproject are like this:

main.asm (or .S) for the core (reset interrupt, device initialization, etc.)
usb.c and usb.h for making use of avrusb.
i2cmem.asm to comunicate with an i2c external memory.

And also i would need to be able to use predefined constants in assembler.

I would really apreciate any help.

Cheers,
Diego.

Posted: Tue Oct 07, 2008 3:28 am
by Grendel
avr-gcc allows mixing assembler and C modules quite nicely -- including usage of I/O macros (via #include <avr/io.h>). Just take a look at some of the AVR-USB projects.

Posted: Sun Oct 12, 2008 6:33 pm
by JohanKrava
You can use any language you wish or all of them in a single project! You need a compiler for each of your languages and then just link your compiled (obj) files together. I work this way. Ask Google for details.