User Tools


Differences

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

Link to this comparison view

Both sides previous revision Previous revision
weird_asm_code [2015/12/03 16:40]
queueram use custom mipsasm format
— (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.  It does this two more times. 
- 
-<code mipsasm>​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)</​code>​ 
- 
-===== 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! 
-<code mipsasm>#​ From LevelProc_8024BCD8 starting at 8024BD30: 
-  b     .L60 
-  nop    
-.L60: 
-  b     .L70 
-  lw    $v0, 0x24($sp) 
-  b     .L70 
-  nop    
-.L70: 
-  lw    $ra, 0x1c($sp)</​code>​