Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
translate into Pep/9 assembly language code:
#include <iostream>
using namespace std;
const numLoops = 10;
int main(){
int x = 0;
do {
cout << x << endl;
++x;
} while (x < numLoops);
return 0;
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 3 images
Knowledge Booster
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.Similar questions
- Convert the following into Pep/9 Assembler: #include using namespace std; int square(int n){ int i; int sq; sq = 0; for (i = 0; i < n; i++){ sq = sq + n; } return sq; } int main (){ int num; cout << "Enter a number: "; cin >> num; cout << num << " squared = " << square(num) << endl; return 0; }arrow_forwardConvert the following into Pep/9 Assembler: #include <iostream>using namespace std;int square(int n){ int i; int sq; sq = 0; for (i = 0; i < n; i++){ sq = sq + n; } return sq;}int main (){ int num; cout << "Enter a number: "; cin >> num; cout << num << " squared = " << square(num) << endl; return 0;} Submit: Source file along with screen captures showing the program running in the Pep simulator.arrow_forwardConvert the following program into pep/9 assembly language #include <iostream>using namespace std;int total;int main(){ int num1;int num2;cin >> num1 >> num2; total = num1 + num2;cout << "Sum = " << total << endl; return 0;}arrow_forward
- Complete the following C++ programs into Pep/9 assembly language: 1) int main(){int cop; int driver; cop = 0; driver = 40; while (cop <= driver) { cop += 25; driver += 20; } cout << cop; return 0;}arrow_forwardExample: The Problem Input File Using C programming language write a program that simulates a variant of the Tiny Machine Architecture. In this implementation memory (RAM) is split into Instruction Memory (IM) and Data Memory (DM). Your code must implement the basic instruction set architecture (ISA) of the Tiny Machine Architecture: //IN 5 //OUT 7 //STORE O //IN 5 //OUT 7 //STORE 1 //LOAD O //SUB 1 55 67 30 55 67 1 LOAD 2- ADD 3> STORE 4> SUB 5> IN 6> OUT 7> END 8> JMP 9> SKIPZ 31 10 41 30 //STORE O 67 //OUT 7 11 /LOAD 1 //OUT 7 //END 67 70 Output Specifications Each piece of the architecture must be accurately represented in your code (Instruction Register, Program Counter, Memory Address Registers, Instruction Memory, Data Memory, Memory Data Registers, and Accumulator). Data Memory will be represented by an integer array. Your Program Counter will begin pointing to the first instruction of the program. Your simulator should provide output according to the input file. Along with…arrow_forwardTranslate the following C++ program to Pep/9 assembly language. Code should also be commented. #include <iostream>using namespace std;int Lesser(int x, int y) { int least; if (x < y) least = x; else least = y; return least;}int main(){ int num1; int num2; cout << "Enter two integers: "; cin >> num1 >> num2 cout << "Lesser: " << Lesser(num1, num2); << endl; return 0;}arrow_forward
- translate a c++ program into pep/9 assembly language #include <iostream> using namespace std; int myAge;void ShowVal(int age){ cout << "Age:" << age << endl;} int main() {cout << "Enter age: ";cin >> myAge;ShowVal(myAge);return 0;}arrow_forwardConvert the following C++ programs into Pep/9 assembly #include <iostream> using namespace std; void times(int& prod, int mpr, int mcand) { prod = 0; while (mpr != 0) { if (mpr % 2 == 1) prod = prod + mcand; mpr /= 2; mcand *= 2; } } int main(){ int product, n, m; cout << "Enter two numbers: "; cin >> n >> m; times(product, n, m); cout << "Product: " << product << endl; return 0; } Submit: Pep/9 source code along with screen capture showing it running in the Pep simulatorarrow_forwardConvert the following C++ program to pep9/Assembly language BR Main format not machine language #include <iostream>using namespace std; int times(int mpr, int mcand){int prod = 0;while (mpr != 0){if (mpr % 2 == 1)prod = prod + mcand;mpr /= 2;mcand *= 2;} return prod;} int main(){ int n, m; cout << "Enter two numbers: ";cin >> n >> m; cout << "Product: " << times(n, m) << endl; return 0;}arrow_forward
- Write the report of this course that is the explanation of the algorithm in this program #include<iostream> // include necessary libraries #include<stack> // include necessary libraries #include<locale> // include necessary libraries #include <climits> // include necessary libraries using namespace std; int preced(char ch) { // defining precedence function if(ch == '+' || ch == '-') { // if condition return 1;}else if(ch == '*' || ch == '/') {return 2;}else {return 0;}} string inToPost(string infix ) { // defining push function stack<char> stk;stk.push('#'); string postfix = ""; string::iterator it; for(it = infix.begin(); it!=infix.end(); it++) { // for loop if(isalnum(char(*it))) // if condition postfix += *it;else if(*it == '(') // if condition stk.push('(');else if(*it == ')') { // if condition while(stk.top() != '#' && stk.top() != '(') {postfix += stk.top(); stk.pop(); // pop element }stk.pop(); }else {if(preced(*it) >…arrow_forwardPlease help c++languagearrow_forward15. Translate the following C program to Pep/9 assembly language. #include int main() { int numitms, j, data, sum; scanf("%d", &numItms); sum = 0; for (j = 1; j <= numitms; j++) { scanf("%d", &data); sum += data; } printf ("Sum: %d\n", sum); return 0; } Sample Input 48-376 Sample Output Sum: 18arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education