I'm using Atmel Studio 6.2 to write some assembly code for Atmega328p.
However, the call
instruction for subroutine doesn't work when I use simulator and step-by-step execute the program. It completely ignores the call
instruction and goes on to the next line.
In order to test the call
instruction I wrote a simple program, which looks as follows:
.include "m328pdef.inc"
ldi R16, 11
call hello_world
mov R1, R0
nop
hello_world:
mov R0, R16
ret
But even this doesn't work! It just goes on to execute mov R1, R0
.
What might be the reason? It's so annoying when call
doesn't work!