Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

call, ret

call, ret

2005-02-22 by Eric

Hi all, Now here is a tricky problem, sorry to hog your time.

I have a call statement near the start of the program I comment out just before I download it to the
micro, but when I wish to step through the program with the simulator, I un-comment it.

The main program calls a function then that calls a second function which calls a third function, (but as
I step through it) a "RET"urn in the third function should send it back to were the second function left
off, But instead sends the studio program right back to the very first statement at the beginning of the
program.


 From Eric

Re: [AVR-Chat] call, ret

2005-02-22 by Dave VanHorn

At 08:56 AM 2/22/2005, Eric wrote:

>Hi all, Now here is a tricky problem, sorry to hog your time.
>
>I have a call statement near the start of the program I comment out just 
>before I download it to the
>micro, but when I wish to step through the program with the simulator, I 
>un-comment it.
>
>The main program calls a function then that calls a second function which 
>calls a third function, (but as
>I step through it) a "RET"urn in the third function should send it back to 
>were the second function left
>off, But instead sends the studio program right back to the very first 
>statement at the beginning of the
>program.

And your stack pointer is set to where?

Re: [AVR-Chat] call, ret

2005-02-22 by Eric

Goodone Dave

How can I plead ignorant on this one, I did read about this problem in the theory books come to think of
it, in fact this is someone else's program a "16 character by two line LCD" maybe I should start fresh
with my own program and call up the LCD as I need to.


From Eric
Show quoted textHide quoted text
----- Original Message -----
From: "Dave VanHorn" <dvanhorn@dvanhorn.org>
To: <AVR-Chat@yahoogroups.com>; <AVR-Chat@yahoogroups.com>
Sent: Wednesday, February 23, 2005 3:29 AM
Subject: Re: [AVR-Chat] call, ret



At 08:56 AM 2/22/2005, Eric wrote:

>Hi all, Now here is a tricky problem, sorry to hog your time.
>
>I have a call statement near the start of the program I comment out just
>before I download it to the
>micro, but when I wish to step through the program with the simulator, I
>un-comment it.
>
>The main program calls a function then that calls a second function which
>calls a third function, (but as
>I step through it) a "RET"urn in the third function should send it back to
>were the second function left
>off, But instead sends the studio program right back to the very first
>statement at the beginning of the
 program.

And your stack pointer is set to where?





Yahoo! Groups Links

Re: [AVR-Chat] call, ret

2005-02-22 by Dave VanHorn

At 09:51 AM 2/22/2005, Eric wrote:

>Goodone Dave
>
>How can I plead ignorant on this one, I did read about this problem in the 
>theory books come to think of
>it, in fact this is someone else's program a "16 character by two line 
>LCD" maybe I should start fresh
>with my own program and call up the LCD as I need to.

VBG!

It's just part of the things you have to do at the start of the program, to 
set up the machine.
These chips are so flexible and powerful, that a good init routine is a 
significant piece of code in any non-trivial project.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.