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:
But when I compile with avr-gas like this:
avr.s:
- .org 0x00
- jmp main
- add:
- ldi r16,1
- ldi r17,2
- add r16,r17
- ret
- main:
- call add
- nop
- rjmp main
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??avr.s:2: Error: illegal opcode asr for mcu attiny2313
avr.s:9: Error: illegal opcode jmp for mcu attiny2313