Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

implement mips code to get the sum, max, and min of the digit list and to print out the results (sum, max, and min) -

implement mips code to get the sum, max, and min of the digit list and to print out the results (sum, max, and min) - The output should be 3 numbers (sum, max, and min) like "35, 12, 4" Check out the sample.asm code and then implement hw2.asm (I am just providing "sample.asm" to help you. You don\'t have to use it.)

hw:

.data

digit: .word 10, 12, 23, 28, 7, 39, 10, 11, 23, 12, 3, 4, 5, 1

length: .word 14 # the length of the digit list

.text

main:

# HERE, implement mips code

# to get the sum, max, and min of the digit list above

# and to print the results (sum, max, and min) .end

sample:

.data

digit:

.word 10, 12, 23, 28

str: .asciiz " "

.text

main:

la $s1, digit

lw $t0, 0($s1)

lw $t1, 4($s1)

lw $t2, 8($s1)

lw $t3, 12($s1)

addi $t4, $t0, 5

sw $t4, 20($s1)

lw $t0, 20($s1)

li $v0, 1

add $a0, $t0, $t1

syscall

li $v0, 4

la $a0, str

syscall

li $v0, 1

sub $a0, $t2, $t3

syscall

.end

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

Step: 3

blur-text-image

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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago