
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
MIPS Code below:-
new_ln: .asciiz "\n"
.text
main:
li $v0,4
la $a0,prompt
syscall #output prompt for user
li $v0,5
syscall #input the integer and save it to $s0
move $s0,$v0
li $t0,2 #check if the input is odd or even by
div $t0,$s0,$t0 #division by 2; save rem in St1
mfhi $t1
if: bnez $t1,else # if remainder is 0
li $v0,4 #print number is even
la $a0,label2
syscall
j endif
else: li $v0,4 #else print number is odd
la $a0,label1
syscall
li $v0,4 # print newline
la $a0,new_ln
syscall
endif: li $v0,10 #exit program
syscall
Note:- Please read this above MIPS code and now make some changes in this same above code and modify as the given instruction in the picture.

Transcribed Image Text:### Programming Exercise Instructions
**Task:**
1. Make this program keep asking the user for the input of integer values until the user types the integer 0 (zero).
2. When 0 is entered, the program should print "OK, it's done!" and finish the execution.
**Submission Requirements:**
- You need to submit your `.asm` file and screenshots of the execution window.
- Ensure the screenshots show at least 7 numbers entered before you type 0.
- Compile these documents into one `.pdf` file before submission.
### Detailed Graphical Explanation
Note: As there are no graphs or diagrams in the provided image, no additional details regarding them are necessary.
### Example Input and Output:
```plaintext
Enter an integer: 5
Enter an integer: 3
Enter an integer: -7
Enter an integer: 8
Enter an integer: 12
Enter an integer: -2
Enter an integer: 4
Enter an integer: 0
OK, it's done!
```
This prompt is designed to help you practice handling repetitive user input and conditional statements in assembly language. Make sure your program is robust and can handle various integer inputs as specified.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 4 images

Knowledge Booster
Similar questions
- modifying following code and write comments for each line of codes. #include <stdio.h>#include <stdlib.h>#include <stdbool.h>#include <string.h> #define MAX_PASSWORD_LENGTH 128#define MIN_PASSWORD_LENGTH 10#define ALLOW_PASSPHRASE true#define MIN_PHRASE_LENGTH 20#define OPTIONAL_TESTS_REQUIRED true#define MIN_OPTIONAL_TESTS_TO_PASS 4 bool isStrongPassword(char *password);void printTestResults(char *password, bool isPassphrase, int optionalTestsPassed); int main() { char passwords[][128] = { "password", "mypassword", "thisismypassword", "passssword", "This is my password phrase1", "Tinypw1", "Ireallydontlikehavingtomakeupnewpasswordsallthetime1", "Iloveyouxxxooo1", "Boom**********!", "IHATEPWORDS1!", "ihatepwords1!", "IHatePwords!", "IHatePwords", "my pass phrase does not need to pass tests", "short pass phrase", "x", "x1",…arrow_forwardShell Scripting: Write the output when the input is 40: echo -n "Enter any number:" read n if [ $n -eq 30 ] 11 [ $n -gt 50 ] then echo "1" else echo "2" fiarrow_forwardGiven the following code segment: for n in range(x, y, z): print(n) Which of the following values for x, y and z will cause a runtime error? O 1, 5, -1 O 3, 2, 1 O 1,0, 1 None of the abovearrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY