title: Assembler labels with limited jump range
body: <p>I am writing an assembler for a simple RISC processor which has a very small immiediate for jumps (7 bit signed). All jumps are calculated by:</p>
  
  <pre><code>PC = PC + IMMEDIATE + 1
  </code></pre>
  
  <p>where PC is the program counter which points to the next instruction. </p>
  
  <p>If you need to jump more than 64 lines ahead you need chained jumps as follows:</p>
  
  <pre><code>JMP, 0x3F
  
  //64 lines ahead
  
  JMP, 0x5;
  </code></pre>
  
  <p>This would effectively jump 70 lines ahead of the current instruction. </p>
  
  <p>My question comes in when we have labels:</p>
  
  <pre><code>JMP, label
  
  //more than 64 lines ahead
  
  label:
  </code></pre>
  
  <p>How would the assembler generate code for this? would you need two labels or would the assembler put in two jumps for you? If it puts in two jumps how does it know if an instruction is not 64 lines ahead?</p>