Special variables: Difference between revisions
m
→{{header|MIPS Assembly}}
Drkameleon (talk | contribs) (Added Arturo implementation) |
Puppydrum64 (talk | contribs) |
||
Line 1,286:
infolists; /* give the names of all available lists */
[labels, values, functions, macros, arrays, myoptions, props, aliases, rules, gradefs, dependencies, let_rule_packages, structures]</lang>
=={{header|MIPS Assembly}}==
The register <code>$0</code> or <code>$zero</code> always has a value of zero and cannot be changed. Any attempts to load a nonzero value into this register will have no effect. This makes it useful as a "garbage bin" of sorts.
When multiplying two registers, the product is always stored in the <code>$HI</code> and <code>$LO</code> registers. Their contents can be read into your standard registers with the commands <code>mfhi $reg</code> and <code>mflo $reg</code>.
<lang mips>
li $t0,0x4500
li $t1,0xFFFF
multu $t0,$t1 ;unsigned multiplication of $t0 and $t1
mfhi $t0 ;load the top 32 bits of the product into $t0
mflo $t1 ;load the bottom 32 bits of the product into $t1</lang>
Division is a similar story, except <code>$HI</code> holds the remainder and <code>$LO</code> holds the quotient.
When using <code>JAL functionName</code> to call a function, the <code>$ra</code> register holds the return address.
=={{header|ML/I}}==
|