Texas Instruments MSC1210 User Manual

Page 304

Advertising
background image

8052 Instruction Set

E-20

POP

Pop Value from Stack

Syntax

POP register

Instructions

OpCode

Bytes

Cycles

Flags

POP direct

0xD0

2

2

None

POP pops the last value placed on the stack into the direct address specified. In
other words, POP will load direct with the value of the internal RAM address pointed
to by the current stack pointer. The stack pointer is then decremented by 1.

Note:

The address of direct must be an internal RAM or SFR address. You cannot
POP directly into R registers such as R0, R1, etc.. For example, to POP a
value off the stack into R0, POP the value into the accumulator and then
move the value of the accumulator into R0.

Note:

When POPping a value off the stack into the accumulator, code the instruc-
tion as POP ACC, not POP A. The latter is invalid and will result in an error
at assemble time.

See also: PUSH

PUSH

Push Value onto Stack

Syntax

PUSH register

Instructions

OpCode

Bytes

Cycles

Flags

PUSH direct

0xC0

2

2

None

PUSH pushes the value of the specified direct address onto the stack. PUSH
first increments the value of the stack pointer by 1, then takes the value stored
in direct and stores it in internal RAM at the location pointed to by the increm-
ented stack pointer.

Note:

The address of direct must be an internal RAM or SFR address. You cannot
PUSH directly from R registers such as R0, R1, etc. For example, to push
a value onto the stack from R0, move R0 into the accumulator, and then
PUSH the value of the accumulator onto the stack.

Note:

When PUSHing a value from the accumulator onto the stack into the, code
the instruction as PUSH ACC, not PUSH A. The latter is invalid and will result
in an error at assemble time.

See also: POP

Advertising