Re: STACK IMPLEMENTATION
- From: bastian42@xxxxxxxxx (42Bastian Schick)
- Date: Tue, 31 Jul 2007 09:48:24 GMT
On Mon, 30 Jul 2007 09:01:10 -0700, Tim Wescott <tim@xxxxxxxxxxxxxxxx>
wrote:
Tom Lucas wrote:
"Paul Burke" <paul@xxxxxxxxxx> wrote in message
news:5h62puF2s3seiU1@xxxxxxxxxxxxxxxxxxxxx
dk wrote:
I am trying to understand if i implement something like this in my
micro what would happen. My understanding is that i will lose the the
value of 'A'
CALL PUSH_A
.
.
.
CALL POP_A
PUSH_A : PUSH A
RET
POP_A: POP A
RET
Note that on some processors the call stack is separate from the data
stack (I believe this is the case on the PIC18 and the 6805, but I
haven't picked through either of them in detail). For these processors,
pushing a register onto the data stack then returning from a subroutine
wouldn't lose you your program counter, although it could certainly mess
up your data stack if you weren't planning on that behavior.
Just let me add, that many RISCs (PPC, ARM) do not push the return
address on the stack automatically, so calling will
not directly interfere with the stack (I do above things in my own
code a lot :-)
--
42Bastian
Do not email to bastian42@xxxxxxxxx, it's a spam-only account :-)
Use <same-name>@monlynx.de instead !
.
- Follow-Ups:
- Re: STACK IMPLEMENTATION
- From: Everett M. Greene
- Re: STACK IMPLEMENTATION
- References:
- STACK IMPLEMENTATION
- From: dk
- Re: STACK IMPLEMENTATION
- From: Paul Burke
- Re: STACK IMPLEMENTATION
- From: Tom Lucas
- Re: STACK IMPLEMENTATION
- From: Tim Wescott
- STACK IMPLEMENTATION
- Prev by Date: Re: Bluetooth - OK, wifi - no way?
- Next by Date: Re: Estimation techniques used in embedded porting projects
- Previous by thread: Re: STACK IMPLEMENTATION
- Next by thread: Re: STACK IMPLEMENTATION
- Index(es):
Relevant Pages
|