Write an assembly language program that repeatedly prompts the user to enter signed decimal integer numbers....

60.1K

Verified Solution

Question

Programming

Write an assembly language program that repeatedly prompts theuser to enter signed decimal integer numbers. The program should berun from the command prompt, output a text prompt to the screen,and then wait for the user to type in a number followed by theEnter key. (The legitimate range of user input values is any signedinteger that can be represented in 32 bits.) After each number isentered, the program should determine and display the followinginformation about the number: whether it is positive or negative;whether or not it is evenly divisible by 16; and whether or not itcan be represented in 16 bits (in other words, is it in the range-32768 x +32767). For example, if the user entered the number +5,the output generated by the program should look similar tothis:
+5 is a positive number.
+5 is not evenly divisible by 16.
+5 can be represented in 16 bits.
On the other hand, if the user entered -32816, the output wouldlook like this:
-32816 is a negative number.
-32816 is evenly divisible by 16.
-32816 cannot be represented in 16 bits.
After determining and displaying the above information, the programshould prompt the user to enter another number. This process shouldcontinue until the user enters the value 0 (which is neitherpositive nor negative). At that point, execution should terminateand return to the command prompt.
Assemble, link, and test your program. Make sure to test it foreach of the eight possible input cases (permutations of positivevs. negative, divisible by 16 vs. not divisible by 16, and fits in16 bits vs. does not fit in 16 bits), as well as the ninthpossibility (the special case of 0, which exits the program). Whenyou are sure it is working, run it from the command prompt andcapture a screen shot(s) of a test run that illustrates all ninepossibilities and the corresponding outputs.

Answer & Explanation Solved by verified expert
3.9 Ratings (485 Votes)
Required Assembly code is given belowLC0string dLC1string d is apositive numbernLC2string d is anegative numbernLC3string d isevenly divisible by 16nLC4string d isnot evenly divisible by 16nLC5string d canbe represented in 16 bitsnLC6string dcannot be represented in 16    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students