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:

Behavior1F: # begin 80385114 (101E94)
  addiu $sp, $sp, -0x10
  lw    $t6, 0x80361164 # lui $t6, 0x8036/lw $t6, 0x1164($t6)
  lw    $t7, ($t6)
  srl   $t8, $t7, 0x10
  andi  $t9, $t8, 0xff
  andi  $t0, $t9, 0xff
  sw    $t0, 0xc($sp)
  lw    $t1, 0x80361164 # lui $t1, 0x8036/lw $t1, 0x1164($t1)
  lw    $t2, ($t1)
  srl   $t3, $t2, 8
  andi  $t4, $t3, 0xff
  andi  $t5, $t4, 0xff
  sw    $t5, 8($sp)
  lw    $t6, 0x80361164 # lui $t6, 0x8036/lw $t6, 0x1164($t6)
  lw    $t7, ($t6)
  andi  $t8, $t7, 0xff
  andi  $t9, $t8, 0xff
  sw    $t9, 4($sp)