POPM

Restoring multiple registers from the stack

POPM

POP Multiple registers


[Syntax]

POPM dest-dest2

 

[Operation]

signed char i;

for ( i = register_num(dest); i <= register_num(dest2); i++ ) {

tmp = *SP;

SP = SP + 4;

register(i) = tmp;

}

 

[Function]

-

This instruction restores values from the stack to the block of registers in the range specified by dest and dest2.

-

The range is specified by first and last register numbers. Note that the condition (first register number < last register number) must be satisfied.

-

R0 cannot be specified.

-

The stack pointer in use is specified by the U bit in the PSW.

-

Registers are restored from the stack from R1 to R15.

 

[Instruction Format]

Syntax

Processng Size

Operand

Code Size

(Byte)

dest

dest2

POPM dest-dest2

L

Rd

(Rd=R1~R14)

Rd2

(Rd2=R2~R15)

2

[Flag Change]

-

This instruction does not affect the states of flags.

 

[Description Example]

POPM R1-R3

POPM R4-R8