in Assembly MIPS if i have the code below that loos 10 times to input an integer into an array how would i find the min value

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

if i have the code below that loos 10 times to input an integer into an array how would i find the min value

 

.data
7
maxText:
.asciiz "\nMaximum =
minText:
.asciiz "\nMinimum
# 4 bytes per int so 10 ints x 4 (10 x 4 = 40)
- space 40
.asciiz "\n"
9
myArray:
10
newline:
11
.text
12
-globl main
13
14
main:
15
li
$te, 10
# holds 10 for the Loop to run only 10 times
# this register will hold the counter
# this register will hold the Location of the array
16
17
li
$t1, e
18
li
$t2, e
19
20
21
WHILE:
22
bge
$t1, $t® BREAK
li
$ve, 5
23
24
syscall
$s0, myArray ($t2)
$t2, $t2, 4
$t1, $t1, 1
25
SW
26
addi
27
addi
28
j
WHILE
29
BREAK:
30
31
Transcribed Image Text:.data 7 maxText: .asciiz "\nMaximum = minText: .asciiz "\nMinimum # 4 bytes per int so 10 ints x 4 (10 x 4 = 40) - space 40 .asciiz "\n" 9 myArray: 10 newline: 11 .text 12 -globl main 13 14 main: 15 li $te, 10 # holds 10 for the Loop to run only 10 times # this register will hold the counter # this register will hold the Location of the array 16 17 li $t1, e 18 li $t2, e 19 20 21 WHILE: 22 bge $t1, $t® BREAK li $ve, 5 23 24 syscall $s0, myArray ($t2) $t2, $t2, 4 $t1, $t1, 1 25 SW 26 addi 27 addi 28 j WHILE 29 BREAK: 30 31
Expert Solution
Step 1

      .data

xyz:          .word          -8,16,-32,64,-128,256

minText:   .asciiz          "\nMinimum = "

msg_tot   .asciiz           "total: "

newline    .asciiz          "\n"

       .text

       .globl main

 

 

steps

Step by step

Solved in 3 steps

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