MIPS Relocation Table: List Instructions

  • Thread starter Thread starter ElijahRockers
  • Start date Start date
  • Tags Tags
    Mips Table
Click For Summary
The discussion focuses on identifying which MIPS instructions contribute entries to the relocation table. Key points include that only certain instructions, such as those requiring absolute addresses, need entries, specifically lines 2 and 14 in the provided code. Other instructions, like line 9, are relational and do not require absolute values. Participants express their struggles with understanding the relocation table and seek guidance from instructors and TAs. Overall, clarification on the criteria for relocation entries is emphasized as a critical need for learners.
ElijahRockers
Gold Member
Messages
260
Reaction score
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.
 
Physics news on Phys.org
I went through that pdf already, actually, and just now again.

It has some examples in chapter 9 of what might constitute a relocation entry, but frankly I am not an experienced enough MIPS programmer to make heads or tails of WHY those are valid examples. Chapter 11 was also not much help - much of that document is intended to be used as a reference for experienced MIPS programmers, which I am definitely not. We are in week 3, and are very soon going to be starting into verilog, which I have much more experience with than MIPS.

It's obvious my answers in the above post are incorrect, but I wouldn't know how to change them.
 
Sorry I can't be of more help. I've done a small amount of MIPS programming, but I'm in no way an expert. The link I found was by doing a web search for mips "relocation table", which gave me a lot of hits. One of them might be more helpful than the one I gave.

If not, I suggest talking with your instructor during office hours. If you go to him, explain that you have done put in an effort by reading the text and searching on the web, to no avail.
 
Exactly what I Google searched for. I'm in lab right now, and I have talked to my TA about it. I think I am getting the idea.

lines 2 and lines 14 are the only ones that require an entry, since they need to be translated into a 32 bit absolute address. The other instructions, like that on line 9, don't require an absolute value, rather they are relational and specify a certain number of lines of code to jump to in the positive or negative direction.

This is my understanding of it after talking with the TA.

edit: Thanks for your help!
 
Last edited:

Similar threads

Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
10K
  • · Replies 4 ·
Replies
4
Views
10K
Replies
5
Views
17K
  • · Replies 4 ·
Replies
4
Views
21K
  • · Replies 1 ·
Replies
1
Views
7K