popsp


Pop from the stack (Pop Registers from Stack)

[Syntax]

-

popsp rh, rt

 

The following can be specified as rt and rh:

-

General-purpose registers r0 - r31

[Function]

Loads general-purpose register rt to rh from the stack in descending order (rt, rt - 1, rt - 2, ..., rh). After all the registers down to the specified register have been loaded, sp is updated (incremented).

Remark

The lower two bits of the address specified by sp are masked by 0.
If an exception is acknowledged before sp is updated, instruction execution is halted and exception handling is executed with the start address of this instruction used as the return address. The popsp instruction is then executed again (The sp value from before the exception handling is saved).

[Description]

-

The assembler generates one popsp machine instruction.

[Flag]

CY

---

OV

---

S

---

Z

---

SAT

---

[Caution]

-

If the relationship between the register numbers specified as rh and rt is rh > rt, the assembler outputs the following message.

E0551200 : Syntax error.

 

-

If a register that includes sp (r3) is specified as the restore register (rh = 3 to 31), the value read from the memory is not stored in sp (r3). This allows the POPSP instruction to be correctly re-executed after execution has been halted.