beautypg.com

Popd (pop pointer direct) – Echelon Neuron User Manual

Page 110

background image

POPD (Pop Pointer Direct)

The POPD instruction pops the two bytes from TOS and NEXT on the data stack

into the specified pointer register. The POPD instruction uses the pointer direct

addressing mode. The pointer-register expression must be in the range 0 to 3.
Because the data stack grows towards higher addresses, NEXT holds the most-

significant byte (MSB) and TOS holds the least-significant byte (LSB) of the 16-

bit value to be popped.
The POPD instruction applies to Series 3100, 5000, and 6000 devices.

Syntax:
The POPD instruction requires one operand to specify the pointer register:

POPD [0]

POPD [1]

POPD [2]

POPD [3]

Table 39 describes the attributes of the POPD instruction.

Table 39. POPD Instruction

Instruction

Hexadecimal

Opcode

Instruction

Size (Bytes)

CPU Cycles

Required

Affect on

Carry Flag

POPD [0]

F0

1

6

None

POPD [1]

F1

1

6

None

POPD [2]

F2

1

6

None

POPD [3]

F3

1

6

None


Example:
The following example preserves the P1 and P2 pointer registers by pushing

them onto the stack before performing operations that could affect these

registers, then popping them from the stack.

P1 EQU 1

P2 EQU 2

; Preserve P1, P2.

pushd [P1]

pushd [P2]

...

popd [P1]

popd [P2]

ret ; return to caller

100

Neuron Assembly Language Instruction Statements