Download presentation

Presentation is loading. Please wait.

Published byZain Levett Modified over 2 years ago

1
Solution to Problem 2.19.4 Recitation #1 (Week 2) ECEN350 Prof. Choi

4
a)f(a,b,c)=func(func(a,b),c) f: addi $sp,$sp,–8 sw $ra,4($sp) sw $s0,0($sp) move $s0,$a2 jal func #v0=func($a0,$a1)=func(a,b) move $a0,$v0# $a0= func(a,b) move $a1,$s0# $a1=c jal func# v0=func($a0,$a1)=func($v0,c)=func(func(a,b),c) lw $ra,4($sp) lw $s0,0($sp) addi $sp,$sp,8 jr $ra

5
b) f(a,b,c)=func(a,b)+func(b,c) f: addi $sp,$sp,–12 sw $ra,8($sp) sw $s1,4($sp) sw $s0,0($sp) move $s0,$a1 move $s1,$a2 jal func# $v0=func($a0,$a1)=func(a,b) move $a0,$s0# $a0=b move $a1,$s1#$a1=c move $s0,$v0# $s0=$v0=func(a,b) jal func;#$v0=func($a0,$a1)=func(b,c) add $v0,$v0,$s0#$v0=func(a,b)+func(b,c) lw $ra,8($sp) lw $s1,4($sp) lw $s0,0($sp) addi $sp,$sp,12 jr ra

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Perspective view ppt on ipad Ppt on indian history in hindi Ppt on bond length of water Ppt on communication in india Ppt on financial ratio analysis Ppt on special education in india Ppt on cross-sectional study definition Ppt on polynomials in maths sign Ppt on game theory youtube Ppt on air pollution for class 7