Errors while compiling avr asm program with avr-gas

Thread Starter

ankitbehera2670

Joined Apr 20, 2018
6
I am new to avr asm programming. I have written a small program in avr assembly. I am targetting the attiny2313 chip. Here is my code:
avr.s:
  1. .org 0x00
  2. jmp main
  3. add:
  4. ldi r16,1
  5. ldi r17,2
  6. add r16,r17
  7. ret
  8. main:
  9. call add
  10. nop
  11. rjmp main
But when I compile with avr-gas like this:
avr-as -mmcu=attiny2313 -o avr.o avr.s​
I get these error messages:
avr.s: Assembler messages:
avr.s:2: Error: illegal opcode asr for mcu attiny2313
avr.s:9: Error: illegal opcode jmp for mcu attiny2313​
But in the offical datasheet, avr does have JMP and CALL instruction so why do I get these error messages??
 
Top