Subroutine within ATMEGA16 (by Jorge Jacome)
Hi all
There is a file written in Assembler attached to this, then I hope my explanation is clear with the problem that I have.
I am using Studio 4 for ATMEL microcontrollers for a Mega16 chip running the simulator step by step , I can see the arrow is executing the first subroutine call Dly jumping to the label Dly and stay in that loop ( it is a delay subroutine ) until reach the command ret.
My surprise is instead of returning to the instruction lsr Acc and executing the rest of commands , then calling the same subroutine for the second time;it jumps to ldi Acc, 0x87 inmediately after the label Loop:
I already used all the options available, or the ones I Know without succesful.
Any help ?