Empty program: Difference between revisions
→{{header|MIPS Assembly}}
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) |
||
Line 967:
=={{header|MIPS Assembly}}==
===Linux===
This just exits the program with exit code 0 (exit_success)
<lang mips>
Line 973 ⟶ 974:
syscall
</lang>
===Nintendo 64===
In addition to a proper cartridge header, [[wp:Cyclic_redundancy_check|CRCs]], and footer, you'll need to write a value of <tt>8</tt> to address <tt>0xBFC007FC</tt> so that the cartridge can boot correctly. (Nintendo 64 is big-endian, so the 8 is actually stored at <tt>0xBFC007FF</tt>, but every example I've seen stores the value as a <code>uint32</code> so that's what I'm going with.)
After that, just enter an infinite loop and you're done.
<lang mips>la $t0,0xBFC007FC
;N64 doesn't have load delay slots so we don't need a NOP here.
li $t1,8
sw $t1,0($t0)
halt:
nop ;not actually needed by real hardware, but Project 64 doesn't like infinite loops.
b halt
nop</lang>
=={{header|МК-61/52}}==
|