<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 24 Nov 2009 16:25:18 -0000
From   : dl.harper@... (David Harper)
Subject: Quine

Ian Stocks wrote:


> Nope, think of a stack of plates, the last one you pushed onto the pile
> will be the first one you pop off the pile. So the push and pop need to
> be nested.
>
> PHA
>   PHP
>     //do other code
>   PLP
> PLA

It is perhaps worth noting that if you really want to preserve both P and A 
it is better to do the push and pop (or pull) the other way round, ie:

PHP
  PHA
    //do other code
  PLA
PLP

Otherwise the final PLA could affect the P register (in particular the N and 
Z flags, though it will not make any difference to C).

David Harper
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>