? A two-word instruction is stored in the symbol W.
? The address of the symbol is stored in W+1 and it is named as Y
.
? W+2
is the address of the next instruction. PC is used to fetch the address of next instruction which is to be executed.
? The operands used by the instruction are addressed by a symbol Z
.
? The value specified by the operand is stored in the index register which is named as X
.
Now, to get the operands used for the execution, need to determine the symbol Z
which is shown below with the addressing modes:
In Direct addressing mode, address field of the instruction directly gives the address of the operand. Therefore Y directly gives the address of Z.
Therefore Z=Y
is the direct addressing mode of instruction to calculate the Z.
In Indirect addressing mode, the address filed of the instruction gives the address in which the effective address is stored in the memory.
Here, the effective address is stored in M[Y]
and it gives the address of operands executed by the instruction.
Z = M[Y]
In Relative addressing mode, the address filed of the instruction is added to the contents of the PC. Here PC indicates the address of next instruction which is Y (i.e. W+1). It will give the address of operands executed by the instruction.
Z = W + Y
In Indexed addressing mode, the value specified by the index register is added to the address specified by the instruction. It will give the address of operands executed by the instruction.
Z = X + Y
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…