Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use zero as the \"prearranged number\" that indicates the end of the program. Us

ID: 3652514 • Letter: U

Question

Use zero as the "prearranged number" that indicates the end of the program. Use ReadDec to read the number from the keyboard. And You may not use the .IF, .REPEAT, .WHILE, or other high-level directives in your programs.

Write a procedure named IsPrime that sets the Zero flag if the 32-bit integer passed in the EAX register is prime. A prime number is evenly divisible by only itself and 1. Optimize the program's loop to run as efficiently as possible. Write a test program that prompts the user for an integer, calls IsPrime, and displays a message indicating whether or not the value is prime. Continue prompting the user for integers and calling IsPrime until the user enters -1.

Please use comments ( ; on the program) to explain what you are doing, thank you.

Explanation / Answer

determine whether a user entered integer is a prime number Asked by: slamtart Hi experts.. I'm a recent graduate in the field of Computer Science, but am entirely unfamiliar with Assembly language, even though i have completed a course or two on it. The following was a question that was on my final exam for an assembly language course, of which I'm sure I completed goofed on. Can someone please provide the code based on the criteria given? Objectives Write a program using assemby language that sets the Zero flag if the 32-bit integer passed in the EAX register is prime. (A prime number is evenly divisible by only itself and 1). Optimize the program's loop to run as efficiently as possible. Your program should prompt the user for a number and then display a message indicating whether or not the number is prime. The program should then ask for another number from the user. Continue the loop in this fashion until the user enters a prearranged value such as -1. Input Data is input from the keyboard. User input is assumed to be valid (should be in decimal). Multiple inputs at one time are not allowed. Algorithm Upon your own design. Output Output is sent to screen. You must use the XLAT instruction to convert to ASCII. The first line of output contains your name and student number. Let's use John Smith as a name, and 123456789 as the student number.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote