User Tools


This is an old revision of the document!


Weird ASM Code

Throughout the SM64 ROM there is a lot of weird assembly code. The purpose of this page is to document all the ASM weirdness.

Kill it Again

In case the first ANDI didn't work, the compiler inserts a second one. It does this two more times.

Behavior1F: # begin 80385114 (101E94)
  addiu $sp, $sp, -0x10
  lw    $t6, 0x80361164
  lw    $t7, ($t6)
  srl   $t8, $t7, 0x10
  andi  $t9, $t8, 0xff
  andi  $t0, $t9, 0xff
  sw    $t0, 0xc($sp)

Branch Branch Branch

All the branch delay slots weren't enough, so the compiler inserted 3 back-to-back branches, including one that can't even be reached!

# From LevelProc_8024BCD8 starting at 8024BD30:
  b     .L60
  nop   
.L60:
  b     .L70
  lw    $v0, 0x24($sp)
  b     .L70
  nop   
.L70:
  lw    $ra, 0x1c($sp)