ADD Instruction Property 2
If an ADD instruction is executed, then only memory cell #dst is affected, since that is where the result of the opration is stored. All other memory cell values remain unchanged. More formally:
if the following are true:
- instruction #i is
add dst=d src1=s1 src2=s2
- the PC at time t = i
- not (other = d)
then value of cell other at time (t + 1) = value of cell other at time t
Let's take a look at the following computer:
Instructions
Memory Cells |
---|
Program Counter | Time |
---|---|
0 | 0 |
LW Computer Simulator
Notice that only memory cell #2 is changed. Memory cells #0 and #1 remain the same. In other words:
if the following are true:
- instruction #0 is
addi dst=2 src=1 imm=5
- the PC at time 0 = 0
- not (1 = 2)
then value of cell 1 at time (0 + 1) = value of cell 1 at time 0
Comments
Please log in to add comments