Homework Answers: Machine Instructions

 

Show the machine instruction (in binary and hex) for each of the following assembler instructions.

  1.      sll   $t6, $s6, 21
         000000 00000 10110 01110 10101 000000
         00 16 75 40
        
  2.      add   $t4, $t1, $v0
         000000 01001 00010 01100 00000 100000
         01 22 60 20
  3.      addi  $s0, $v0, 45
         001000 00010 10000 0000 0000 0010 1101
         20 50 00 2D
        
  4.      sub   $t4, $t1, $t4
         000000 01001 01100 01100 00000 100010
         01 2C 60 22
  5.      bgtz  $t1, one
         000111 01001 00000 0000 0000 0000 0110  # branch down 7 instrs
         1D 20 00 06
  6.      bltz  $t1, two
         000001 01001 00000 0000 0000 0000 0111  # branch down 8 instrs
         05 20 00 07
  7.      sra   $t5, $t5, 21
         000000 00000 01101 01101 11111 000011
         00 0D 6F C3
        
  8.      xor   $t6, $t2, $t1
         000000 01010 01001 01110 00000 100110
         01 49 70 26
  9.      addi  $t2, $t2, -39
         001000 01010 01010 1111 1111 1101 1001
         21 4A FF D9
  10.      ori   $t5, $t3, 0xa4
         001101 01011 01101 0000000010100100
         35 6D 00 A4
  11.      beq   $s1, $s2, read
         000100 10001 10010 1111 1111 1111 0001  # branch up 14 instrs
         12 32 FF F1

Email Me | Office Hours | My Home Page | Department Home | MCC Home Page

© Copyright Emmi Schatz 2021