Click to go to ENCM 369 Winter 2008 HOME PAGE
This page is maintained by
Steve Norman
Last modified: Mon Apr 14 16:47:14 MDT 2008
Note: I will try to post the handouts every week, but most weeks I will not be posting solutions.
.text
.globl ff
ff: # prologue
addi $sp, $sp, -28 # allocate 7 words
sw $a2, 24($sp) # copy zz to stack
sw $ra, 20($sp)
sw $s3, 16($sp)
sw $s2, 12($sp)
sw $s1, 8($sp)
sw $s0, 4($sp)
add $s0, $zero, $a0 # copy xx to $s0 (forgot this in 2pm class!)
add $s1, $zero, $a1 # copy yy to $s1 (forgot this in 2pm class!)
Sorry for the confusion, and thanks to the student who asked me
about this at 2:55pm!
A return value of type double goes in $f0.
$f2 ... $f10 are like t-registers.
$f12 ... $f18 are like a-registers.
$f20 ... $30 are like s-registers.
(The handout is wrong about $f20.)