I have an exam coming up, and I am completely stuck on this question (see below); even looking at the model answer did not help. I've tried reading our main text for the topic, but still have no idea how to do this. If anyone could provide a step-by-step walk through of the question, I would be very grateful.
"Assuming the first instruction of the MIPS snippet below is located at memory address 0x10001000. What is the value for else and exit in bne and j instruction?"
1 0x10001000: addi $s0, $0, 5 2 0x10001004: sub $s2, $0, $s1 3 0x10001008: beq $s0, $s2, else 4 0x1000100C: add $s0, $0, $0 5 0x10001010: add $t0, $s2, $s0 6 0x10001014: j exit 7 0x10001018: else: addi $s1, $s0, -1 8 0x1000101C: exit:
Model Answer:
Else: 0000000000000011 Exit: 00000000000000010000000111
I have included a link to an image of the original question as well. http://i.imgur.com/NgHpZXs.png