[A83] Re: Explaining the stack for registers


[Prev][Next][Index][Thread]

[A83] Re: Explaining the stack for registers




First, "if you push af and then pop bc" the contents will be in BC, not AF.
The reason for this is when you push a register, the values in it are put on
the stack, not the name. So if you push af then the value of A and the flags
byte are on the stack. You can then pop whatever you want. If you pop bc
then the 2 bytes on the stack from the push af will be put in BC. (B will
have what was in A, and C will have what was in F).

There is no limit to how many times a register can be pushed, except on the
TI-83 Plus (and I think 83) the stack is only 400 bytes. After that you will
corrupt RAM. The TI-OS uses a few bytes, but you have like 100 pushes or
more you could do before you overflowed the stack.


Michael Vincent
Detached Solutions - www.detacheds.com
Radical Software - www.radicalsoft.org

----- Original Message -----
From: "TypeR unknown" <typerfuture@hotmail.com>
To: <assembly-83@lists.ticalc.org>
Sent: Thursday, August 16, 2001 10:00 AM
Subject: [A83] Explaining the stack for registers


>
> After reading the FAQ in AsmGuru there is a question about the stack with
> registers. It says that (if I remember correctly) "if you push af and then
> pop bc, the contents of bc will be in af"
>
> WHY ???
>
> I see no logic in that, and unfortunatly it isn't explained in AsmGuru
> either, so here I am :)
>
> Also I would like to know how many times a register can be pushed.
>
>
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>





References: