6 .data # 4 bytes per int so 10 ints x 4 (10 x 4 = - space 40 .asciiz "\n" 7 myArray: 40) newline: .text 10 -globl main 11 12 main: 13 $te, 10 $t1, e $t2, e li # holds 10 for the Loop to run only 10 t...


in Assembly MIPS i have the code in the picture that reads in 10 integers into an array how would i reverse the array


For example input to array "1, 2, 3, 4, 5, 6, 7, 8, 9, 0"


reversed array "0,9,8,7,6,5,4,3,2,1"


6<br>.data<br># 4 bytes per int so 10 ints x 4 (10 x 4 =<br>- space 40<br>.asciiz

Extracted text: 6 .data # 4 bytes per int so 10 ints x 4 (10 x 4 = - space 40 .asciiz "\n" 7 myArray: 40) newline: .text 10 -globl main 11 12 main: 13 $te, 10 $t1, e $t2, e li # holds 10 for the Loop to run only 10 t imes # this register will hold the counter # this register will hold the Location of the array 14 15 li 16 li 17 18 19 WHILE: 20 bge $t1, $te BREAK 21 li $v®, 5 22 syscall $ve, myArray ($t2) $t2, $t2, 4 23 SW 24 addi 25 addi $t1, $t1, 1 26 WHILE 27 BREAK:

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here