# Program to print 0 if integer input is even; 1 if input is odd prompt1: prompt 2: prompt 3: label: num: new ln: main: .data .asciiz "This program prints a zero if the input is even" asciiz "and a 1 if the input is odd.n" asciiz "Enter an integer: " .asciiz "Your result is " .word .asciiz "n" .text li la syscall $v0,4 $a0, promptl li la syscall li $v0,4 $a0, prompt2 li la syscall $v0,4 $a0, prompt 3 $v0,5 syscall move $50, $v0 $10,2 $t0,$s0,$t0 li div mfhi $t1 $v0,4 $a0, label li la syscall li $v0,1 move $a0,$t1 syscall $v0,4 $a0, new_ln li la syscall li $v0,10 syscall #output prompt1 for user #output prompt2 for user #output prompt 3 for user #input the integer and save it to $80 #check if input is odd or even by #division by 2; saving rem in $t1 #print the output label #print result-remainder #print newline #exit program Example Modify the MIPS program in Example as following: 1. Take two integer values from user input instead of using given numbers. The
# Program to print 0 if integer input is even; 1 if input is odd prompt1: prompt 2: prompt 3: label: num: new ln: main: .data .asciiz "This program prints a zero if the input is even" asciiz "and a 1 if the input is odd.n" asciiz "Enter an integer: " .asciiz "Your result is " .word .asciiz "n" .text li la syscall $v0,4 $a0, promptl li la syscall li $v0,4 $a0, prompt2 li la syscall $v0,4 $a0, prompt 3 $v0,5 syscall move $50, $v0 $10,2 $t0,$s0,$t0 li div mfhi $t1 $v0,4 $a0, label li la syscall li $v0,1 move $a0,$t1 syscall $v0,4 $a0, new_ln li la syscall li $v0,10 syscall #output prompt1 for user #output prompt2 for user #output prompt 3 for user #input the integer and save it to $80 #check if input is odd or even by #division by 2; saving rem in $t1 #print the output label #print result-remainder #print newline #exit program Example Modify the MIPS program in Example as following: 1. Take two integer values from user input instead of using given numbers. The
Chapter5: Looping
Section: Chapter Questions
Problem 8RQ
Related questions
Question
100%
Please help me to solve this problem. Thank you in advance =)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage