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
Convert the following into Pep/9 assembly language:
#include <iostream>
using namespace std;
int num
int main() {
cin >> num;
num = num % 16;
cout << "num=" << num << endl;
return 0;
}
Hint for the %16 part:
0 % 16 = 0
1 % 16 = 1
2 % 16 = 2
...
14 % 16 = 14
15 % 16 = 15
16 % 16 = 0
17 % 16 = 1
...
30 % 16 = 14
31 % 16 = 15
32 % 16 = 0
...
Convert all the results to binary. What do they all have in common?
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
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
- Course : Compiler Construction Book Name : Compilers Principles Techniques and Tools Second Edition by alfred V.aho monica s.lam Ravi sethi Jeffrey D.Ullman Please solve from the book (Pg#378) Exercise 6.3.1 : Determine the types and relative addresses for the identifiers in the following sequence of declarations: float x; record { float x; float y; } p; record { int tag; float x; float y; } q;arrow_forwardConvert the following C++ programs into Pep/9 assembly #include <iostream> using namespace std; int minimum (int i1, int i2){if (i1 < i2)return i1;elsereturn i2;}int main (){int n, m;cin >> n >> m;cout << "Minimum: " << minimum (n, m) << endl;return 0;} Submit: Pep/9 source code along with screen capture showing it running in the Pep simulatorarrow_forwardTranslate the following C program into NASM. #include <stdio.h> int ary[] = {12, 40, -2, 89, 35, -7, 6}; int main() { int sum = 0; int highest = 0; for (int x = 0; x < 7; x++) { if (highest < ary[x]) highest = ary[x]; sum += ary[x]; } printf("Sum is %d\n", sum); printf("Highest value is %d\n", highest); } Use indexing (the [ebx+esi] or [ebx+edi] form). You can have several “dw” values on the same line. Use the “loop” command.arrow_forward
- translate the following C++ program into Pep/9 Assembly. #include<iostream> using namespace std; void showNext(int age){ int nextYr; nextYr = age + 1; cout << "Age:" << age<< endl; cout << "Age next year: " << nextYr << endl;}int main() { int myAge; cout << "Enter age: "; cin >> myAge; showNext (myAge); return 0;}arrow_forwardConvert the following C++ programs into Pep/9 assembly #include <iostream> using namespace std; void minimum (int i1, int i2){ if (i1 < i2) cout << i1 << " is less than " << i2 << endl; else if (i1 > i2) cout << i2 << " is less than " << i1 << endl; else cout << i1 << " equals " << i2 << endl;}int main (){ int n, m; cout << "Enter two integers: "; cin >> n >> m; minimum (n, m); return 0;} Submit: Pep/9 source code along with screen capture showing it running in the Pep simulatorarrow_forwardComplete 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_forward
- Convert this C++ program into Java program #include <iostream> using namespace std; int main() { int a=8, b=10, *c=&a, *d=&b; (*c)++; (*d)--; cout<<a<<" "<<b; return 0; }arrow_forwardConvert the following C++ program into Pep/9 Assembly. #include <iostream>using namespace std;void SetEqualGreater (int &num1, int &num2){ if (num1 < num2) num1 = num2; else num2 = num1;}int main() { int x, y; // Using Local Variables cin >> x >> y; SetEqualGreater(x, y); cout << "x = y = " << x << endl; return 0;} Submit: Source file along with screen captures showing the program running in the Pep/8 simulator.arrow_forward
arrow_back_ios
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