Java Reference
In-Depth Information
+
3
+
3
1
b
+
*
1
2
2
c
e
f
d
1
1
1
1
Figure 13.10: Expression Tree for (a-b) + ((c+d)+(e*f)) with
Register Needs.
lw
$10, c
# Load c into register 10
lw
$11, d
# Load d into register 11
add
$10, $10, $11
# Compute c + d into register 10
lw
$11, e
# Load e into register 11
lw
$12, f
# Load f into register 12
mul
$11, $11, $12
# Compute e * f into register 11
add
$10, $10, $11
# Compute (c + d) + (e * f) into reg 10
lw
$11, a
# Load a into register 11
lw
$12, b
# Load b into register 12
sub
$11, $11, $12
# Compute a - b into register 11
add
$10, $11, $10
# Compute (a-b)+((c+d)+(e*f)) into reg 10
Figure 13.11: MIPS code for (a-b) + ((c+d)+(e*f))
 
Search WWH ::




Custom Search