Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

.data str1: .asciiz How many even numbers would you like to add together? str2: .asciiz The sum of the numbers is .text main:

.data str1: .asciiz "How many even numbers would you like to add together? " str2: .asciiz "The sum of the numbers is " .text main: li $v0, 4 #print str1 la $a0, str1 syscall li $v0, 5 #Input how many even numbers want to be taken syscall add $t7, $0, $v0 bgt $t7, $0, loop j main loop: beq $t7, $0, done li $v0, 5 syscall move $t0,$v0 div $t0,$2 mfhi $t0 beq $t0,0,evenNumber j skip evenNumber: add $t6,$t6,$v0 addi $s0,$s0,1 skip: j loop done: li $v0, 4 #print str2 la $a0, str2 syscall move $a0,$t6 li $v0,1 syscall exit: li $v0, 10 syscall

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

8. Explain the contact hypothesis.

Answered: 1 week ago

Question

7. Identify four antecedents that influence intercultural contact.

Answered: 1 week ago