Re: A86: PUSH and POP


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

Re: A86: PUSH and POP



On Wed, 10 Sep 1997 Steve86Asm@aol.com wrote:

> You write:
> 
> > Could someone please explain the use of push and pop to me?  sorry to
> >  bother ya'll but i am a newbie to ASM
> >  
<snip>
> and doing 16 bit ld's (because there are no opcodes to do it):
> push hl
> pop de        ;same as ld de,hl   , if that opcode existed.

In a case like this, it's better to do two 8-bit loads (which take 4 
t-states each) rather than push/pop (which take 21 t-states total).

(Incidentally, there's also "ex de,hl" which is only 4 t-states.)

Another point that should be mentioned is that the stack grows in reverse.
When a value is pushed the stack pointer is decremented, and vice versa.

--------
Dan Eble (mailto:eble@cis.ohio-state.edu)
         (http://www.cis.ohio-state.edu/~eble)


References: