Question

In: Computer Science

Example the Pep/9 system contains the following four hexadecimal values register A: 25B6 register X: AE20...

Example the Pep/9 system contains the following four hexadecimal values

register A: 25B6

register X: AE20

Mem[091D]: 0FF0

Mem[0A71]: 301D

If these are the values before each of the following instructions executes, indicate which of these values is changed when each statement is executed, and show the new value. If a register or a memory location shown above is unchanged by the instruction, don't show its contents; only show the item that changed and what the new 16-bit value of that item would be. Note: reset the contents of the registers and memory locations to the given values above before executing each of the following instructions (in other words, these instructions are independent of each other.

1. C1091D
2. D1091D
3. F90A71
4. 69091D
5. 990A71
6. 08

please explain

Solutions

Expert Solution

Greetings!!

Machine code represents the following instructions:

LDWA 0X091D,D

LDBA 0X091D,D

STBX 0X0A71,D

ADDX 0X091D,D

ORX 0X0A71,D

NEGA

Assumption:

For the purpose of execution the following memory addresses are considered.

0x0007 instead of 0x091D and is loaded with given value 0FF0

0x0009 instead of 0x0A71 and is loaded with given value 301D

Execution screenshot:

Register A and X are loaded with 25B6 and AE20

1. LDWA instruction load one word data from address 0007 to register A and it replaces the content of register A with 0FF0

2. LDBA instruction loads one byte of data from memory address 0007 into A by keeping the 0F in the register A itself. Now A contains 0F0F

3. STBX stores the lower byte of data in the X register to memory address 0009. ie 20 is stored at memory address 0009.

4. ADDX add the content of memory address 0007(0FF0) to its previous content AE20 and generate the answer as BE10.

5. ORX instruction does OR operation with BE10 and the content of address 0009 which is 201D and generate an answer BE1D

6. NEGA instruction negates the content of register A

Hope this helps


Related Solutions

Take the following program and translate it into PEP/9 assembly language: #include <iostream> using namespace std;...
Take the following program and translate it into PEP/9 assembly language: #include <iostream> using namespace std; int theArray[] = { 5, 11, -29, 45, 9, -1}; void sumPos(int ary[], int len, int &sum) {    sum = 0;    for (int i = 0; i < len; i++)            if (ary[i] > 0)                sum = sum + ary[i]; } int main() {    int total;    sumPos(theArray, 6, total);    for (int k=0; k < 6; k++)      cout...
Take the following program and translate it into PEP/9 assembly language: #include using namespace std; int...
Take the following program and translate it into PEP/9 assembly language: #include using namespace std; int fib(int n) { int temp; if (n <= 0) return 0; else if (n <= 2) return 1; else { temp = fib(n – 1); return temp + fib(n-2); } } int main() { int num; cout << "Which fibonacci number? "; cin >> num; cout << fib(num) << endl; return 0; } You must use equates to access the stack and follow the...
Take the following C++ program and translate it into Pep/9 assembly language #include using namespace std;...
Take the following C++ program and translate it into Pep/9 assembly language #include using namespace std; int age; char first, last; int main() {    cin >> age;    cin >> first >> last;    cout << "Your age " << age << endl;    cout << "Initials " << first << last << endl;    if (age >= 30)        cout << “Cannot trust\n”;    return 0; }
Take the following C++ program and translate it into PEP/9 assembly language #include <iostream> using namespace...
Take the following C++ program and translate it into PEP/9 assembly language #include <iostream> using namespace std; int num; char letter; int main() {    cin >> num;    cin >> letter;    cout << "You inputted " << num << endl;    cout << "Option " << letter << endl;    if (letter == '*')       cout << "Multiplied by 2 " << num*2 << endl;    return 0; }
Take the following program from C++ and translate it into Pep/9 assembly language: #include <iostream> using...
Take the following program from C++ and translate it into Pep/9 assembly language: #include <iostream> using namespace std; int theArray[] = { 5, 11, -29, 45, 9, -1}; void sumPos(int ary[], int len, int &sum) {    sum = 0;    for (int i = 0; i < len; i++)            if (ary[i] > 0)                sum = sum + ary[i]; } int main() {    int total;    sumPos(theArray, 6, total);    for (int k=0; k < 6; k++)...
Translate the following C++ program to Pep/9 assembly language. const char chConst = '+'; char ch1;...
Translate the following C++ program to Pep/9 assembly language. const char chConst = '+'; char ch1; char ch2; int main() { cin.get(ch1); cin.get(ch2);    cout << ch1 << chConst << ch2;    return 0; }
Convert the following binary values to hexadecimal and decimal (1 pt each) Write Hex Numbers as...
Convert the following binary values to hexadecimal and decimal (1 pt each) Write Hex Numbers as 0x##(ex 0x0A, 0xFF) Binary Hexadecimal Decimal 0001-1011 0x 0000-1000 0000-0100 0000-1001 0001-1111 1001-1001 0111-1010 1100-0010 1110-0101 1000-1010 0011-0100 0001-1001 0100-0011 1111-1111 1110-0111 0001-0010 0100-1000 0100-1110 1001-0001 0110-1100 Name: Convert the following hexadecimal values to binary and decimal Write binary numbers as 0000-0000 Hexadecimal Binary Decimal 0xf1 0xac 0x56 0x6c 0x32 0x30 0x05 0x28 0xf0 0x07 0x42 0xb9 0x6d 0x2f 0x71 0x0e 0x2d 0xfb 0xba...
Translate the following C program to PEP/9 assembly language. #include <stdio.h> Int main (){ int number;...
Translate the following C program to PEP/9 assembly language. #include <stdio.h> Int main (){ int number; Scanf (“%d”, & number); if (number % 2 ==0) { printf (“Even\n”); } else { printf(“Odd\n”); } Return 0; }
Suppose you have the following set of hexadecimal values: $20, $25, $40, $50, $12. Write a...
Suppose you have the following set of hexadecimal values: $20, $25, $40, $50, $12. Write a segment of program to find the minimum and maximum values of the set. Answer must be written in assembly.
give an example of a discrete random variable X whose values are integers and such that...
give an example of a discrete random variable X whose values are integers and such that E(X) = infinite. Prove that E(X) = infinite for your example. (hints: if you will be paid 2^k dollars for the kth head when you flip a fair coin., the expected value is infinite...) Or give other easy examples.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT