Re: STACK IMPLEMENTATION



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 !
.



Relevant Pages

  • Re: Is it wise to push all-in early in a tournament?
    ... The best times to make a push play ... But why call when you can push and take down a nice pot when your opponent ... But remember that if this "big bet" is a significant portion of your stack, ... I consider it my goal in any tournament to do the latter as much as ...
    (rec.gambling.poker)
  • Re: Is it wise to push all-in early in a tournament?
    ... whether or not the rest of the table is splashing chips around. ... I may push more than I want to and you may be more conservative than ... Do I want to play this opponent after the flop? ... push at anytime and I may not want to risk my stack on a suckout when I ...
    (rec.gambling.poker)
  • Virtual machine: assembly instructions
    ... push; Push the address of the first variable onto the stack ... itof: convert integer to float ... If top+1 of int stack is less than top; push true else push false ...
    (comp.programming)
  • Re: Building Unification Table - tranforming prolog like notation into lisp notation
    ... |> problem comes from tranlating prolog notation into lisp notation. ... ;; Here is a quickly done stack based solution for the problem Slobodan ... (defstruct composite-term str indices) ... (push (cons (composite-term-str item) ...
    (comp.lang.lisp)
  • Re: Free word order
    ... > Frontwardness of language: Going S O V. ... I agree that SVO is a bit mixed-up for me as a native speaker of a SOV ... In a SOV language by analogy, the arguments are pushed to the stack ... no idea so push it ...
    (sci.lang)