title: MIPS labels storage location
body: <p>In MIPS, while using a jump instruction, we use a label.</p>
  
  <pre><code>again: nop
      $j again
  </code></pre>
  
  <p>So when we reach the jump instruction, we use the label <code>again</code> to show where to go and the value of the actual address there is used. I wanted to know where the label <em>again</em> is stored. Meaning, say <code>nop</code> is stored at 0x00400000, and the jump instruction is at 0x00400004. Where, then is <code>again</code> kept, how does MIPS know <code>again</code> is pointing to 0x00400000? Is it stored in the Dynamic Data area of the memory map? <a href="https://i.stack.imgur.com/cqWcS.png" rel="nofollow noreferrer">This is the memory map I've been provided for MIPS</a></p>
  
  <p>I've also included the question which caused this confusion below, for reference.</p>
  
  <p>Give the object code in hexadecimal for the following branch (be, bne) and jump (j) instructions.</p>
  
  <pre><code>... # some other instructions
  again:  add ... # there is an instruction here and meaning is insignificant
      add ... # likewise for the other similar cases
      beq    $t0, $t1, next
      bne  $t0, $t1, again
      add ...
      add ...
      add ...
  next:   j   again
  </code></pre>
  
  <p>Assume that the label again is located at memory location 0x10 01 00 20. If you think that you do not have enough information to generate the code explain.</p>