Subject:
|
Re: signals / legOS internals
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Wed, 23 Jun 1999 02:15:33 GMT
|
Viewed:
|
1100 times
|
| |
| |
Lou Sortman wrote:
>
> When you define a bunch of local variables (more than fit in available
> registers), where are they? Unless you happen to know the answer, I may
> have to do some more experimenting.
>
> Admittedly, it has been awhile, but the last time I was heavy into
> assembler, it was under Unix, where in one direction (counting from SP),
> you had any passed arguments and return addresses for previously called
> (and not yet returned) functions. In the other direction, that was
> where you put your local variables. So that you could call further
> functions, the stub would adjust the SP at the beginning of the function
> and restore it before returning.
I may have answered my own question here. Since the SP is adjusted
before anything is actually done with the local variables, the rule
about it always pointing to the last valid datum is not violated even if
local variables are placed after the return address.
|
|
Message has 1 Reply: | | Re: signals / legOS internals
|
| (...) Yes, that is correct. As for passing parameters to a function, they are simply pushed onto the stack before the function call. Therefore, the H8 stack usually looks something like e.g. this: function param sp+10 function param sp+8 return (...) (25 years ago, 23-Jun-99, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Re: signals / legOS internals
|
| (...) When you define a bunch of local variables (more than fit in available registers), where are they? Unless you happen to know the answer, I may have to do some more experimenting. Admittedly, it has been awhile, but the last time I was heavy (...) (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
|
|
|
|