Can't compile *.s/*.asm files with avr-as

Guest #1552282
Hello,
i have a problem. If i want to compile an assembler file with avr-as and 
"m8def.inc" is included i can't compile because of these errors:


1
(...)
2
m8def.inc:139: Error: expected comma after "OCF1B"
3
m8def.inc:140: Error: expected comma after "OCF1A"
4
(...)
5
or
6
(...)
7
m8def.inc:449: Error: junk at end of line, first unrecognized character is`0'
8
m8def.inc:450: Error: expected comma after "INT1addr"
9
m8def.inc:450: Error: junk at end of line, first unrecognized character is`0'
10
(...)
11
and much more.

I guess it's because the "m8def.inc" file is written in AVR-Assembler 
and not GNU-Assembler.

Now my question is:
How can i fix m8def.inc or better ;) is there already a pre defined file 
like this for GNU-Assembler?

Thanks a lot :)
Guest #1552294
You can't mix Atmel's def.inc files with GNU gas.  They are written for 
a different kind of assembler.

Use #include <avr/io.h> to get the symbols for your processor.  They 
will sometimes differ from what you're used to if you've been using AVR 
assembler before, however.
Guest #1552491
If the whole file is written for Atmel assembler, you have to adapt not 
only the includes to GNU, but also the rest of the programm. avr-as will 
tell you, what ist doesn't like.

Oliver

Reply

A question of your own? This thread is over 16 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.