Question: Write a Pep / 9 assembly language program that reads an integer value from the keyboard, and displays a table that shows the product when

Write a Pep/9 assembly language program that reads an integer value from the keyboard, and displays a table that shows the product when the input value is multiplied by successive powers of 2, between 2 and 32. In other words, your program should produce exactly the same output as the following C program:
#include #include int inpVal; int multipl; int product; int main(){ printf("?"); scanf("%d", &inpVal); multipl =2; product = inpVal *2; printf("%d *%d =%d
", inpVal, multipl, product); multipl *=2; product *=2; printf("%d *%d =%d
", inpVal, multipl, product); multipl *=2; product *=2; printf("%d *%d =%d
", inpVal, multipl, product); multipl *=2; product *=2; printf("%d *%d =%d
", inpVal, multipl, product); multipl *=2; product *=2; printf("%d *%d =%d
", inpVal, multipl, product); }// end of main
Example of Input and Output format requirements:
For this example, assume that the keyboard input given to the program is:
111
For this input data, the output report must look like this:
?111111*2=222111*4=444111*8=888111*16=1776111*32=3552
Notice the spaces around the * and = symbols. If you run the C program shown on this page with a C compiler, this is the exact output you will obtain (go ahead and try it). Your task is to write a Pep/9 Assembly Language program that does this.
Notes:
BE SURE TO RUN THE PROGRAM IN "Terminal" MODE IN Pep/9 AND NOT "Batch" MODE SO THAT IT WORKS AS AN INTERACTIVE PROGRAM.
All multiplication operations involve powers of 2 in this problem, so you can use the Pep/9 ASLr instruction to implement these operations (you DON'T need loops to complete this assignment).
Be sure to adhere to the format example EXACTLY. This means that there should be a space after the ? in the first line of the output, and that there are two spaces before the = when the multiplier is 2,4 or 8, but only one space before the = when the multiplier is 16 or 32(this causes the = symbols to be nicely aligned in the output). There will be a deduction for mis-formatted output

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 Programming Questions!