- #1
ElijahRockers
Gold Member
- 270
- 10
Homework Statement
List instructions that will contribute an entry to the relocation table.
1 funca:
2 la $t0 , n
3 lw $s0 , 0( $t0 )
4 addi $s2 , $zero , 1
5 sub $s1 , $s1 , $s1
6 loop:
7 sll $t0 , $s2 , 3 1
8 slt $t1 , $t0 , $z e ro
9 bne $t1 , $zero , skip
10 add $s1 , $s1 , $s2
11 skip:
12 addi $s2 , $s2 , 1
13 beq $s2 , $s0 , done
14 j loop
15 done:
16 addi $v0 , $s1 , 0
17 j r $ra
18
19 n: .word 11
The Attempt at a Solution
lines 1, 6, 11, 15, 19...
This is a shot in the dark. the summer class I am taking is sort of off-step between lab and lecture. I've tried google, and searching the book thoroughly but I'm still not exactly sure when the relocation table is considered having an entry contributed. I know that related addresses may not need to, but that absolute addresses would. I haven't seen any solid rules to go by yet though.
Thanks.