title: Assembly Address: Label vs Absolute Address
body: <p>I am writing simple SMIPS assembly tests to be run on HDL-defined processors.</p>
  
  <p>For instance I have the following code that should generate an overflow exception:</p>
  
  <pre><code>main:
  
          #Test Overflow Exception
  
          addi $2, $0, 0xffffffff
          addi $3, $2, 0x1  
  </code></pre>
  
  <p>I know that if the processor is doing the right thing, it should redirect to the handler which is placed at address <code>0xdeadbeef</code>. I know only to add labels for jumps as in adding the following code to the above:</p>
  
  <pre><code>overflowHandler: 
          addiu $5 $0, 1
          bne   $0, $5, pass
  </code></pre>
  
  <p>Is there a way to make the overflowHandler code start at the correct 0xdeadbeef address? 
  Does main start at address 0 ?</p>
  
  <p><strong>EDIT  : (I have control over jump address from processor described in HDL)</strong></p>
  
  <p>Since I have control over processor jump address from the description of processor design in Bluespec , I can change that to be divisible by 4 and jump to a closer more convenient location. So my question is: does the address start counting from address 0x0 at the beginning of main?? 
  What is the best solution? : change the address jump, or the label to correspond to it?</p>
  
  <p>Thanks in advance,</p>