MMIX Local and Global Register Use

Table of Content


Author: Martin Ruckert


Having 256-32 global Registers, the only way to put these registers to work is using all of them as global and having a maximum of 32 local registers. When using a standard tool chain (gcc, binutils, clib) the compiler will restrict itself to the use of only 32 registers, because it is not known in advance how many global registers are used by other modules. The physically available local registers are used completely through the register stack.

It would be nice, if one could enable the temporary use of more than the 32 local registers in selected procedures, e.g. a 128 point FFT. The following proposal would allow such use:


Remove the restriction rL <= rG.

The current rules state that registers less than rL are local, registers greater or equal to rG are global, and all others are marginal. The additional rule rL<=rG is actually not needed. Dropping this rule would allow setting rL using a PUT instruction (which is currently not allowed) to a value higher than rG. Then the registers in the range rG to rL would be local registers shadowing the corresponding global registers. The concept of shadowing is consistent with the concept of local registers as local variables.

A function that temporarily needs more than 32 registers could safely GET the current value form rL, PUT any desired values in rL and restore rL later without changing values in global registers of the same name.


mail comments to

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