# 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
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
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
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education