Given the following state of memory of Pep8 machine 0003 12
Given the following state of memory of Pep/8 machine
0003 12
0004 A8
0005 DF
0006 01
What is the content of the register A after the execution of the following instruction (for Pep/8 machine)? Show all your work!
a)C1 0004
b) C0 0003
71 0005
Solution
a) Every Assembly Instruction will contain 4 or 8 bits of op-code and remaing bits represents operand problably an address.
Incase of Pep/8 Instruction set, C1 represents \"Load into A from Address\". So \"C1 0004\" says that Load content of memory location 0004 into Register A.
From the given set of memory locations, the memory location 0004 contains the data A8.
So, The After the Execution of the assembly instrcution \"C1 0004\", The Register A will contain A8.
b) Given Instruction: C0 0003
71 0005
The op-code C0 represents \"Load into A Immediate\", which means load the value 3 into Register A.
In the Simlar way of Decoding the memory instruction, the op-code 71 represents \"Add contents of Address to A\".
So given instrction is 71 0005 which means add the data presnt in memory location 0005 to Register A.
Therefore from the given memory locations, 0005 contains the data DF.
Adding DF to the content of Register A (3) which results in DF + 3 = E2 . So E2 will be the conent of Register A.
