Question: Write a Pep / 9 assembly language program that reads two integer values from the keyboard and prints the difference of the original input values,

Write a Pep/9 assembly language program that reads two integer values from the keyboard and prints the difference of the original input values, the difference doubled, the difference tripled, and the difference quadupled on separate lines. In other words, your program should produce exactly the same output as the following C program:
#include int num1; int num2; int diff; int calcVal; int main(){ printf ("?"); scanf("%d", &num1); printf ("?"); scanf("%d", &num2); diff = num1- num2; calcVal = diff + diff; printf("difference of inputs =%d
", diff); printf("*2=%d
", calcVal); calcVal += diff; printf("*3=%d
", calcVal); calcVal += diff; printf("*4=%d
", calcVal); return 0; }// end of main
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.
The input prompt symbols "?" and the output labels for each of the lines must be printed on the output, as well as the answers.
Adding a number to itself is the same as doubling the number; adding it again is the same as tripling the original number, etc.

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!