Write a Pep/9 assembly language program that reads an integer value from the keyboard, and displays a table that shows the quotient when the input value is divided 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 int inpVal; int divis; int quotient; int main() { printf("? "); scanf("%d", &inpVal); divis = 2; quotient = inpVal / divis; printf("%d / %d = %d\n", inpVal, divis, quotient); divis *= 2; quotient /= 2; printf("%d / %d = %d\n", inpVal, divis, quotient); divis *= 2; quotient /= 2; printf("%d / %d = %d\n", inpVal, divis, quotient); divis *= 2; quotient /= 2; printf("%d / %d = %d\n", inpVal, divis, quotient); divis *= 2; quotient /= 2; printf("%d / %d = %d\n", inpVal, divis, quotient); } // end of main Example of Input and Output format requirements: For this example, assume that the keyboard input given to the program is: 8209 For this input data, the output report must look like this: ? 8209 8209 / 2 = 4104 8209 / 4 = 2052 8209 / 8 = 1026 8209 / 16 = 513 8209 / 32 = 256 **************************** IMP I need in this below example in Assembly Language format please don't answer in other ways***************************************

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

Write a Pep/9 assembly language program that reads an integer value from the keyboard, and displays a table that shows the quotient when the input value is divided 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 <stdio.h> int inpVal; int divis; int quotient; int main() { printf("? "); scanf("%d", &inpVal); divis = 2; quotient = inpVal / divis; printf("%d / %d = %d\n", inpVal, divis, quotient); divis *= 2; quotient /= 2; printf("%d / %d = %d\n", inpVal, divis, quotient); divis *= 2; quotient /= 2; printf("%d / %d = %d\n", inpVal, divis, quotient); divis *= 2; quotient /= 2; printf("%d / %d = %d\n", inpVal, divis, quotient); divis *= 2; quotient /= 2; printf("%d / %d = %d\n", inpVal, divis, quotient); } // end of main

Example of Input and Output format requirements:

For this example, assume that the keyboard input given to the program is:

8209

For this input data, the output report must look like this:

? 8209

8209 / 2 = 4104

8209 / 4 = 2052

8209 / 8 = 1026

8209 / 16 = 513

8209 / 32 = 256

**************************** IMP I need in this below example in Assembly Language format please don't answer in other ways********************************************

gure
High-Order Language
#include <stdio.h>
char ch;
int j;
int main() {
scanf ("&c %d", &ch, &j);
j += 5;
ch++;
printf("%c\n%d\n", ch, j);
return 0;
}
Assembly Language
0000
120006
BR
main
0003 00
ch:
.BLOCK 1
;global variable #1c
0004
0000
j:
.BLOCK 2
global variable #2d
0006 D1FC15 main:
LDBA
charIn,d
;scanf ("&c %d", &ch, &j)
0009
F10003
STBA
ch,d
000c 310004
DECI
j,d
;j += 5
000F
C10004
LDWA
j,d
0012
600005
ADDA
5,i
0015
E10004
STWA
j,d
0018
D10003
LDBA
ch, d
;ch++
001B
600001
ADDA
1,i
001E
F10003
STBA
ch,d
0021 D10003
LDBA
ch,d
:printf ("$c\n&d\n", ch, j)
0024 F1FC16
STBA
charOut,d
0027 DO000A
LDBA
'\n',i
002A F1FC16
STBA
charOut,d
002D
390004
DECO
j,d
0030 DO000A
LDBA
'\n',i
0033
F1FC16
STBA
charOut,d
0036 00
STOP
0037
.END
Input
M 419
Output
424
Transcribed Image Text:gure High-Order Language #include <stdio.h> char ch; int j; int main() { scanf ("&c %d", &ch, &j); j += 5; ch++; printf("%c\n%d\n", ch, j); return 0; } Assembly Language 0000 120006 BR main 0003 00 ch: .BLOCK 1 ;global variable #1c 0004 0000 j: .BLOCK 2 global variable #2d 0006 D1FC15 main: LDBA charIn,d ;scanf ("&c %d", &ch, &j) 0009 F10003 STBA ch,d 000c 310004 DECI j,d ;j += 5 000F C10004 LDWA j,d 0012 600005 ADDA 5,i 0015 E10004 STWA j,d 0018 D10003 LDBA ch, d ;ch++ 001B 600001 ADDA 1,i 001E F10003 STBA ch,d 0021 D10003 LDBA ch,d :printf ("$c\n&d\n", ch, j) 0024 F1FC16 STBA charOut,d 0027 DO000A LDBA '\n',i 002A F1FC16 STBA charOut,d 002D 390004 DECO j,d 0030 DO000A LDBA '\n',i 0033 F1FC16 STBA charOut,d 0036 00 STOP 0037 .END Input M 419 Output 424
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education