(Solved) : Start Program Mipsarrayprograms Change 1 Array 10 Integers Instead 5 Integers Values Use C Q42778694 . . .

Start with the program in MIPSArrayprogram.s Change it so that (1) it has an array of 10 integers instead of 5 integers - theinclude macros.asm .data array: .word 9, 8, 3, 0, 3 .text la $so, array # loop to modify array by multiplying each item bydone: # loop to print each item of array addi $s1, $0,0 # i = 0 addi $t2, $0, 5 # $t2 = 5 loop2: # i<5? # if not then end sltStart with the program in MIPSArrayprogram.s Change it so that (1) it has an array of 10 integers instead of 5 integers – the values to use are up to you (you can choose your own) (2) it uses a loop to change every third number of the array (starting from the first number) in the following way – the number is doubled and 10 is added. E.g. example if the array is 0, 6, 10, 3, 8, 17, 11, 9,8,2 then after the loop is complete the array will be 10, 6, 10, 16, 8, 17, 32, 9, 8, 14 Attach your modified code file as the answer to this question. Upload Choose a File include “macros.asm” .data array: .word 9, 8, 3, 0, 3 .text la $so, array # loop to modify array by multiplying each item by 8 addi $s1, $0,0 # i = 0 addi $t2, $0,5 # $t2 = 5 loop1: #i < 5? # if not then done # $te – i * 4 (byte offset) # address of array[i] slt $to, $s1, $t2 beq $te, $e, done sll $t0, $s1, 2 add $te, $50 lw $t1, 0($t0) sli $t1, $t1, 3 sw $t1, 0($t0) addi $31, $s1, 1 loop1 # $t1 = array[i] # $t1 = array[i] * 8 # array[i] = array[i] * 8 # i = i + 1 # repeat done: done: # loop to print each item of array addi $s1, $0,0 # i = 0 addi $t2, $0, 5 # $t2 = 5 loop2: # i<5? # if not then end slt $t0,$s1, $t2 beq $t0, $0, end sll $t0, $51, 2 add $t0, $t0, $50 # $t0 = i * 4 (byte offset) # address of array[i] lw $t1, 0($t0) # $t1 = array[i] print_int($t1) print_str(” “) addi $51, $51, 1 # i = i + 1 j loop2 # repeat end: done Show transcribed image text Start with the program in MIPSArrayprogram.s Change it so that (1) it has an array of 10 integers instead of 5 integers – the values to use are up to you (you can choose your own) (2) it uses a loop to change every third number of the array (starting from the first number) in the following way – the number is doubled and 10 is added. E.g. example if the array is 0, 6, 10, 3, 8, 17, 11, 9,8,2 then after the loop is complete the array will be 10, 6, 10, 16, 8, 17, 32, 9, 8, 14 Attach your modified code file as the answer to this question. Upload Choose a File
include “macros.asm” .data array: .word 9, 8, 3, 0, 3 .text la $so, array # loop to modify array by multiplying each item by 8 addi $s1, $0,0 # i = 0 addi $t2, $0,5 # $t2 = 5 loop1: #i

Expert Answer


Answer to Start with the program in MIPSArrayprogram.s Change it so that (1) it has an array of 10 integers instead of 5 integers …

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us