User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
weird_asm_code [2015/12/03 15:25]
queueram created
— (current)
Line 1: Line 1:
-====== 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: 
- 
-<code asm>​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)</​code>​