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"

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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
.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:
Transcribed Image 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:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education