MMIX LOGO

MMIX Instruction Set

Table of Content

Content

PUT and GET

Name:
PUT X,$Z
PUT X,Z
GET $X,Z

Specification:
PUT: u(g[X]) ← u($Z)
GET: u($X) ← u(g[Z])

Timing:

Description:

GET transfers the value of a special register into a regular register. PUT goes the other way round, transferring the value from a regular register or a constant to a special register.

To indicate one of the special registers, use the predefined constants rA…rZ as well as rBB, rTT, rWW,rXX,rYY and rZZ.

The following registers are read only in user mode: rC, rL, rN, rO, rS, rI, rT, rTT, rK, rQ, rU and rV.

It is not possible to store a value in rG that is less than 32, or less than the current value of rL, or greater than 255.

It is not possible to store a value in rA that is greater than #3FFFF.

PUT:"put into special register" (the Y field must be zero.)

The special register identified by X is set to the contents of register $Z or to the unsigned byte Z itself, if permissible. Some changes are, however, impermissible:

rABits of rA that are always zero must remain zero;
rG | rLthe leading seven bytes of rG and rL must remain zero, and rL must not exceed rG;
rN | rO | rSthe special registers 9-11 (namely rN, rO, and rS) must not change;
rC | rI | rK | rQ | rT | rU | rV | rTTspecial registers 8 and 12-18 (namely rC, rI, rK, rQ, rT, rU, rV, and rTT) can be changed only if the privilege bit of rK is zero;
rQcertain bits of rQ (depending on available hardware) might not allow software to change them from 0 to 1. Moreover, any bits of rQ that have changed from 0 to 1 since the most recent GET x,rQ will remain 1 after PUT rQ,z.
rLThe PUT command will not increase rL; it sets rL to the minimum of the current value and the new value. (A program should say SETL $99,0 instead of PUT rL,100 when rL is known to be less than 100.)


Impermissible PUT commands cause an illegal instruction interrupt, or (in the case of rC, rI, rK, rQ, rT, rU, rV, and rTT) a privileged operation interrupt.
GET:"get from special register" (the Y field must be zero.)

Register $X is set to the contents of the special register identified by its code number Z, using the code numbers listed earlier. An illegal instruction interrupt occurs if Z ≥ 32. Every special register is readable; MMIX does not keep secrets from an inquisitive user. But of course only the operating system is allowed to change registers like rK and rQ (the interrupt mask and request registers). And not even the operating system is allowed to change rN (the serial number) or the stack pointers rO and rS.

See also:

List of Special Registers and STO.

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