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

1) Translate the following C program to Pep/9 assembly language. Please attach screenshot of Pep/9 simulator...
1) Translate the following C program to Pep/9 assembly language. Please attach screenshot of Pep/9 simulator running the program. #include <stdio.h.> 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); return0; }
The code must work on PEP/9, it shouldn't be too complicated and long Take the following...
The code must work on PEP/9, it shouldn't be too complicated and long 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...
Convert the following pep/9 machine language program into an assembly code. Determine the output of this...
Convert the following pep/9 machine language program into an assembly code. Determine the output of this program if the input is ‘tab’. The left column is the memory address of the first byte on the line: 0000 D1FC15 0003 F1001F 0006 D1FC15 0009 F10020 000C D1FC15 000F F10021 0012 D10020 0015 F1FC16 0018 D1001F 001B F1FC16 001E 00
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT