title: mips number of clock cycles, How to find it
body: <p><em>How many clock cycles does these fours instructions take?</em></p>
  
  <pre><code>#Macro Instructions
  li  $t0, 32         #  1 or 2 cycles ?
                      #      
                      # Based on MIPS Assembly Language Programming by Robert Britton :
                      #
                      #                lui $at, Upper 16-bits of value 
                      #                ori Rd, $at, Lower 16-bits of value
                      #                ***OR***
                      #                ori Rt, $0, value
                      #
                      #
                      #  But when I run it on Mars4_3 it showed the assembler 
                      #  converted it to addiu, $8, $0, 0x00000020
  
  
  div $t2, $t2, $t0   #  41 cycles?          
                      #                bne Rt, $0,
                      #                break $0
                      #                ok: div Rs, Rt
                      #                mflo Rd
  
  #Integer Instruction
  
  lw  $t2, 0($t1)     #  1  cycles?
  sw  $t2, 0($t3)     #  1  cycles?
  </code></pre>
  
  <hr>
  
  <p>I used <a href="http://sourceforge.net/projects/spimsimulator/files/" rel="nofollow">QtSpim</a> and <a href="http://courses.missouristate.edu/kenvollmar/mars/" rel="nofollow">Mars4_3</a> but haven't seen an option to measure clock cycle.I'm wondering if you know, please help me out.</p>