Compile-time calculation: Difference between revisions
→{{header|MIPS Assembly}}
(→{{header|Wren}}: Added a clarification to the preamble.) |
Puppydrum64 (talk | contribs) |
||
Line 775:
{{Out}}
<pre>3628800</pre>
=={{header|MIPS Assembly}}==
While most assemblers support compile-time expressions, factorial is typically not one of them. However, you can multiply out the factorial manually. It's not feasible for larger factorials but it's better than nothing.
<lang mips>li t0,10*9*8*7*6*5*4*3*2 ;= 10! = 0x375F00
jal monitor ;display all registers to the screen
nop</lang>
{{out}}
<pre>t0:00375F00</pre>
=={{header|Nim}}==
|