Chapter 2: 12E (page 167)
Assume that registers \(s0 and \)s1 hold the values 0x80000000 and 0xD0000000, respectively.
1. What is the value of \(t0 for the following assembly code?
add \)t0,\(s0,\)s1
2. Is the result in \(t0 the desired result, or has there been an overflow?
3. For the contents of registers \)s0 and \(s1 as specified above, what is the value of \)t0 for the following assembly code?
sub \(t0,\)s0,\(s1
4. Is the result in \)t0 the desired result, or has there been an overflow?
5. For the contents of registers \(s0 and \)s1 as specified above, What is the value of \(t0 for the following assembly code?
add \)t0,\(s0,\)s1
add \(t0,\)t0,\(s0
6. Is the result in \)t0 the desired result, or has there been an overflow?
Short Answer
The results of each instruction:
- The value of $t0=50000000
- Yes, it has overflow.
- The value of $t0=B0000000
- No, there is no overflow.
- The value of $t0=D0000000
- Yes, there is an overflow