Lab 9
4. First non-zero address: [0x10010000] Contents: 0x61
5. Line 10 (this will depend on whether you type in all the commented lines or not).
6. 00400000, which is the starting address of the text segment. The instruction is la $t2, chararray.
7. It is [0x00400000], i.e. the first line of code from the program.
N.B. Ensure you reload the code at this stage!!!!
9. [0x10010000] is the value in $t2 after the two lines of pseudo-instructions have been executed.
10. $t0 contains 0x00000061. 11. No $t0 is not zero. Next instruction is "bne $t0, 'a', nota"
12. 'a': 0x61 ; $t0 contains 0x00000061.
13. $t2: [0x10010000]
14. $t2 holds the address of the current character in the string that is being checked
for whether it is an 'a' or not.
15. nextCh specifies lb $t0, ($t2)
16. $t2 is now [0x10010001], this is one more than last time, i.e. we have gone to the
next letter in the string.
17. beqz $t0, strEnd
18. 'a' is 0x61 in Hex. $t0 is now 0x62.
19. $t2 now contains [0x10010002].
20. Yes as $t0 is equal to zero.
|