assembly - When to use which registers? -
$t (temporaries) caller saved if needed. subroutines can use w/out saving. not preserved across procedure calls.
$s (saved values) callee saved. subroutine using 1 of these must save original , restore before exiting. preserved across procedure calls.
when use registers? far guess, when working subroutines, use $s registers, and, otherwise $t registers.
when use $f registers?
use $txx
as possible. use $sxx
program state needs preserved across calls. (a common bug , difficult find bug accidentally expecting $txx
register have unchanged state across call.)
the $fxx
registers floating point use only. not use them else - way lies madness.
Comments
Post a Comment