Skip to main content
Engineering LibreTexts

4.6: Exercises

  • Page ID
    27118
    1. Translate the following MIPS assembly language program into machine code.
      .text
      .globl main
      main:
          ori $t0, $zero, 15
          ori $t1, $zero, 3
          add $t1, $zero $t1
          sub $t2, $t0, $t1
          sra $t2, $t2, 2
          mult $t0, $t1
          mflo $a0
          ori $v0, $zero, 1
          syscall
          addi $v0, $zero, 10
          syscall
      
      .data
      result: .asciiz "15 * 3 is "
      
    2. Translate the following MIPS machine code into MIPS assembly language.
      0x2010000a
      0x34110005
      0x012ac022
      0x00184082
      0x030f9024
      
    • Was this article helpful?