beautypg.com

Popmhi – Zilog Z16F2810 User Manual

Page 154

background image

POPMHI Instruction

UM018809-0611

138

ZNEO

®

CPU Core

User Manual

POPMHI

Definition

POP Multiple

Syntax

POPMLO mask

POPMHI mask

Operation

Description

Execution of the POPMLO or POPMHI instruction loads multiple 32-bit values from the stack to
the registers indicated by the 8-bit immediate mask operand. Each bit in the mask represents an
ALU register in the range R0–R7 or R8–R15, respectively, for POPMLO or POPMHI. Values are
popped to registers in numerical order to maintain symmetry with the PUSHM instructions.

The ZNEO CPU assembler allows mask bits for this instruction to be enumerated in a list delim-
ited by angle brackets. The list can be in any order.

For example, the following statements pop the values of R0, R5, R6, R7, and R13 in numerical
order:

POPMLO

POPMHI

The assembler implements a combined POPM mnemonic that generates appropriate POPMLO
and POPMHI opcodes based on a single assembly language statement.

For example, the following statement produces the same object code as the previous two-line
example:

POPM

POPMLO:

for n=0 to 7

if mask[n]=1

SP)

Rn

SP

SP + 4

endif

endfor

POPMHI:

for n=8 to 15

if mask[n–8]=1

(SP)

Rn

SP

SP + 4

endif

endfor

This manual is related to the following products: