Convert the following code to MIPS then convert to Cprogram
Solution
0x20080000 = 00100000000010000000000000000000
 Here the first 6 bits are: 001000.
 And this means its ADDI instruction.
 And the pattern is: ADDI rt, rs, immediate
 So, the binary instruction is:
 001000 00000 01000 0000000000000000
 001000 is ADDI.
 00000 is $t0 is the target register.
 01000 is $zero is the source register.
 0000000000000000 is the immediate value.
 So, the instruction is: $t0 <- $zero + 0, i.e., $t0 <- 0
 And its C equivalent code is: var1 = 0;
0x0089502A = 00000000100010010101000000101010
 Here the first 6 bits are: 000000.
 And this means its a SPECIAL instruction.
 So, picking the last 6 bits, 101010 means its a SLT instruction.
 And the pattern is: SLT rd, rs, rt
 So, the binary instruction is:
 000000 00100 01001 01010 00000 101010
 000000 is SPECIAL.
 00100 is $a0 is the source register.
 01001 is $t1 is the target register.
 01010 is $t2 is the destination register.
 00000 is 0
 101010 is SLT (Set on Less Than)
 So, the instruction is: $t2 <- $a0 < $t1
 And its C equivalent code is:
 if(var2 < var3)
 var1 = 1;

