Question: Problem Statement Write an assembly language program that requests input for a positive number greater than zero; then extracts and prints the digits in the

Problem Statement Write an assembly language program that requests input for a positive number greater than zero; then extracts and prints the digits in the number from right to left with one digit in each line. The table below provides sample input and corresponding output. input expected output 12345 5 4 3 2 1 654321 1 2 3 4 5 6 -1 invalid input abc! invalid input 0 invalid input 6390 0 9 3 6 The digits can be extracted using repeated integer division in a loop with the divisor=10 until the quotient becomes zero. The reminder in each round will be the rightmost digit. For example, integer division quotient reminder 12345 10 1234 5 1234 10 123 4 123 10 12 3 12 10 1 2 1 10 0 1 Your program must define and use the following procedures: Procedure Main: This is the main procedure of the program which makes the correct sequence of calls to other procedures below. Procedure read_input: Shows appropriate message and reads the number into the EAX register. Procedure print_error: Shows appropriate error message when invalid input is given. Procedure find_digits: performs the task of extracting the digits from left to right one by one and printing the result to the screen one digit in each line with appropriate messages. Note: appropriate message means informative message of your choice! Submission Submit your program on Moodle. Use HW4XXXXX.asm as file name, where XXXXX is your student ID. Grading Table Points Style (naming=1, comments=1, spacing=1, indentation=1, and correct naming of submission file=1) 5 Procedure Main with correct call sequences = 1 and data definition =1 2 Procedure read_input (procedure definition = 1, display of messages=1, read integers into EAX =1, return = 1, check valid input=1) 5 Procedure print_error (procedure definition = 1, message =1, return=1) 3 Procedure find_digits (procedure definition = 1, showing message(s)=1, one digit in each line = 1, correct loop=2, correct division and reminder=2, correct sequence right to left = 2 return =1) 10 Total 25 Code of ethics It is essential that each student solve all programming assignments, lab tests and exams individually unless instructed otherwise, e.g., for group projects. Copying, plagiarism, collusion, switching, and falsification are violations of the university academic regulations. Students involved in such acts will be severely penalized. The department has adopted a firm policy on this issue. A zero mark will be assigned the first time a student is caught involved in copying and his/her name will be added to a watch list maintained by the Head of Department. Further repeated involvements in copying will cause the student to get an F grade in that course. This is in line with the university academic regulations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!