Subject:
|
Re: signals / legOS internals
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Wed, 23 Jun 1999 00:57:13 GMT
|
Viewed:
|
1105 times
|
| |
| |
Kekoa Proudfoot <kekoa@pixel.Stanford.EDU> wrote:
> Lou Sortman <theball@bigfoot.com> wrote:
> > I was rolling along, planning this out, then it occurred to me that
> > local (to the function) variables are on the stack above the stack
> > pointer. That means that pushing anything on the stack asynchronously
> > is going to toast those variables. It makes me wonder why that doesn't
> > happen whenever OC1A happens.
>
> The stack pointer must always always always point at the bottom of the
> stack data area, i.e. to the last valid data item on the stack. As a
> consequence, push val (or mov.w val,@-r7) never overwrites data.
Reading this again, I should mention that pushing things on the stack
asynchronously is fine, as long as the stack pointer is always in the right
place, which is why it must always always always point to the location I
mentioned (and seemingly the location you also knew about).
Your misunderstanding is probably with regard to what a "push" operation
does. It moves the stack pointer down, not up -- down into free space.
There is no problem.
-Kekoa
|
|
Message has 1 Reply: | | Re: signals / legOS internals
|
| (...) I may have down and up reversed, since different machines grow the stack upward or downward, and I've worked with a few. I do have push and pop clear in my mind, though. So, yeah, down. So, by the "always" rule, nothing will ever be below the (...) (25 years ago, 23-Jun-99, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Re: signals / legOS internals
|
| (...) The stack pointer must always always always point at the bottom of the stack data area, i.e. to the last valid data item on the stack. As a consequence, push val (or mov.w val,@-r7) never overwrites data. When an interrupt occurs, the first (...) (25 years ago, 23-Jun-99, to lugnet.robotics.rcx.legos)
|
32 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|