Question
Writing a program in assembly language in Motorola m68000 The program will prompt the user to enter four space separated numbers. These numbers may vary
Writing a program in assembly language in Motorola m68000
The program will prompt the user to enter four space separated numbers. These numbers may vary in length from a single digit to seven digits in length. Your program must verify that each of the input numbers are valid positive integers. If they are not valid positive integers your program should print the provided error message identifying the first incorrect input and quit. If there are an incorrect number of inputs your program should print the provided error message. If the numbers are all valid your program should add those numbers together and print the sum of those numbers with the provided output string. Extra spaces between any input or at the end should be ignored.
Use loop/branches
List of macros I/O: lineout, linein, cvta2, cvt2a, stripp, dump
Example 1:
Enter the four space separated numbers:
3 75 890 2
The sum is 970.
Example 2:
Enter the four space separated numbers:
5 apples 20words 342
The #2 input is not a number.
Example 3:
Enter the four space separated numbers:
3 4 5 2 3 4 5
There are not four inputs.
Example 4:
Enter the four space separated numbers:
3 apple
There are not four inputs.
Example 5:
Enter the four space separated numbers:
3 45 apple 23
The #3 input is not a number.
Example 6:
Enter the four space separated numbers:
3 4 5 2
The sum is 14.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started