beautypg.com

Add add to stack pointer (word) – Zilog Z80380 User Manual

Page 59

background image

5-25

Z380

U

SER

'

S

M

ANUAL

Z

ILOG

DC-8297-03

ADD

ADD TO STACK POINTER (WORD)

ADD SP,src src = IM

Operation:

if (XM) then begin

SP(31-0)

SP(31-0) + src(31-0)

end

else begin

SP(15-0)

SP(15-0) + src(15-0)

end

The source operand is added to the SP register and the sum is stored in the SP register. This
has the effect of allocating or allocating space on the stack. Two’s complement addition is
performed.

Flags:

S: Unaffected
Z: Unaffected
H: Set if there is a carry from bit 11 of the result; cleared otherwise
V: Unaffected
N: Cleared
C: Set if there is a carry from the most significant bit of the result; cleared otherwise

Addressing

Execute

Mode

Syntax

Instruction Format

Time

Note

IM:

ADD SP,nn

11101101 10000010 -n(low)- -n(high)

2

I, X