60 likes | 146 Views
Problem 1 - Add $9 to the value stored in memory (address = $2) and put the result into $5. $5 = $9 + M[$2]. First, get the value stored in memory (address = $2) and put it into $5. 5 2 X 0. X. $2. 0. 1. $5. X X 1. X. M[$2]. 0. X. 0 1.
E N D
Problem 1 - Add $9 to the value stored in memory (address = $2) and put the result into $5. $5 = $9 + M[$2]
First, get the value stored in memory (address = $2) and put it into $5. 5 2 X 0 X $2 0 1 $5 X X 1 X M[$2] 0 X 0 1
Second, add the value stored in $9 to $5, and put the result in $5. 5 5 9 0 $5 0 1 $5 $9 X X 0 0 (arith.) 1 0 0 1
Problem 2 - Add $5 to 82 and stored the result in memory (address in $9). M[$9] = $5 + 82
Add $5 to 82 (temporary result in $1) 1 5 X 1 82 $5 0 1 $1 X X 0 0 (arith.) 1 0 0 1
Write $1 to M[$9] (temporary result in $1) X 9 1 0 X $9 1 0 $1 $1 X X 0 X 0 X 1 1