In: Computer Science
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
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