title: what would be the encoding of a bnez MIPS instruction?
body: <p>What would be the encoding of this last instruction if the address of the Loop is 0x00012344?</p>
  
  <pre><code>Loop:
      addu $a0, $0, $t0
      ori $v0, $0, 4
      syscall
      addi $t0, $t0, -1
      bnez $t0, Loop
  </code></pre>
  
  <p>this last instruction is equivalent to: </p>
  
  <pre><code>bne $t0, $0, Loop
  </code></pre>
  
  <p>however, How would I write this in machine code?</p>
  
  <p>this is how for I got: </p>
  
  <pre><code>000101 01000 00000 iiiii iiiii iiiiii
  </code></pre>
  
  <p>I dont know what to but for the i's here. The address of Loop is 0x00012344 however that is a 17 bit binary number. I only have 16 bits </p>