Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need to fix this code to run and test prime numbers data Ask_Input: .asciiz Welcome to Prime Tester Enter a number between 0 and 100:

Need to fix this code to run and test prime numbers data Ask_Input: .asciiz "\Welcome to Prime Tester Enter a number between 0 and 100: " Number: .word 4 Prime: .asciiz "\Number is Prime " notPrime: .asciiz "\Number is not Prime " .text .globl main main: la $a0, Ask_Input li $v0,4 #op code to print the value in Ask_Input syscall li $v0,5 syscall move $t1,$v0 li $t2,2 divu $t1,$t2 mfhi $t7 mflo $t3 li $t4,3 beqz $t7,printnp bge $t4,$t3,printp loop: bge $t4,$t3,printp divu $t1,$t4 mfhi $t7 beqz $t7,printnp addi $t4,$t4,2 j loop exit: li $v0,10 syscall printp: la $a0, Prime li $v0,4 #op code to print the value in Ask_Input syscall j exit printnp: la $a0, notPrime li $v0,4 #op code to print the value in Ask_Input syscall j exit

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

Question in Chemical Engineering Please give Correct Answer 9 7 .

Answered: 1 week ago

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago