MMIX LOGO

MMIX Instruction Set

Table of Content

Content

The POP Instruction

Name:

POP X,YZ

Specification:

If X > rL, then first replace X by rL + 1.

The register stack S[0],…,S[τ - 1] is changed as follows:

x ← S[τ - 1]mod256 (size of the callee's stack frame),
S[τ - 1] ← $(X - 1) (main return value),
rL ← min(x + X,rG),
$(rL - 1) ← $(rL - x - 2)
$(x + 1) ← $0,
$x ← S[τ - 1]
$0 ← S[τ - x - 1],
τ ← τ - x - 1
@ ← rJ + 4YZ

Timing:

Description:

The POP instruction undoes the effect of a previous PUSHJ Instruction. X indicates the number of return values in registers $0 to $(X-1), where $(X-1) contains the main return value. Initially, the size x of the callee's stack frame (the number of its local registers) is directly below $0 on the register stack. This value is replaced by the main return value. After that, the registers are renumbered such that the callee's local registers are again $0, $1, ... and the return values are in registers $X and following (where the $X here is from the previous PUSHJ instruction).

(Consider: You can see examples of the PUSHJ and POP instruction here)

See also:

PUSHJ and PUSHJ and POP examples

Please help to keep this site up to date! If you want to point out important material or projects that are not listed here, if you find errors or want to suggest improvements, please send email to email