Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. What would be the output of the following MIPS code? .globl main main: addu $s7, $0, $ra add $s3, $0, $0 addi $s4,

 

1. What would be the output of the following MIPS code? .globl main main: addu $s7, $0, $ra add $s3, $0, $0 addi $s4, $0, 1 add $s5, $0, $0 la $s6, save .data .align .globl 2 save %23 the next line creates an array of 10 words that can be referred to as "save" #23 the array is initialized to the 10 values after .word % so the first array entry is a 0 and the last entry is a 2 save: .word 0, 0, 0, 0, 0, 0, 0, 6, 3, 2 .text Loop: add $t8, $s3, $s3 add $t8, $t8, $t8 add $t8, $t8, $s6 lw $t9, 0 ($t8) bne $t9, $s5, Exit add $s3, $s3, $s4 j Loop Exit: .data .globl messagel messagel: .asciiz " The value of i is: .text li $v0, 4 la $a0, messagel syscall. li $v0, 1 add $a0, $0, $s3 syscall addu $ra, $0, $s7 jr $ra add $0, $0, $0 "

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Architecture A Quantitative Approach

Authors: John L. Hennessy, David A. Patterson

4th edition

123704901, 978-0123704900

More Books

Students also viewed these Computer Network questions