The question is detailed and given as follows:
A two-word instruction to perform the load operation is stored in memory at an address 200 as represented in the memory map given below. The address field of the instruction is stored at address 201. The mode field specifies an addressing mode. R1 is the general-purpose register, which has the value of 400. Base register contains the value 100.

Determine the effective address and the operand to be loaded for the following address modes:
(i) Direct
(ii) Immediate
(iii) Indirect
(iv) Relative
(v) Base register Addressing
(vi) Register indirect address
The answer is given below.
ADVERTISEMENT
Direct Addressing Mode
The address field contains 500 (stored at location 201).
The effective address (EA) = 500.
The operand at memory location 500 is 1100 (as seen in the memory map).
Effective Address: 500
Operand Loaded: 1100
Immediate Addressing Mode
The address field itself is used as the operand.
The operand is 500 (value stored at address 201).
Effective Address: Not applicable
Operand Loaded: 500
Indirect Addressing Mode
The address field contains 500 (stored at 201), which acts as a pointer.
The memory at location 500 contains 1100, which is the effective address.
The operand at location 1100 is 1700.
Effective Address: 1100
Operand Loaded: 1700
Relative Addressing Mode
The address field (500) is interpreted relative to the instruction location (200).
Effective Address = PC (Program Counter) + Address Field
EA = 200 + 500 = 700
The operand at memory location 700 is not explicitly provided in the memory map.
Effective Address: 700
Operand Loaded: Unknown (not given in the memory map)
Base Register Addressing Mode
The effective address is calculated using the Base Register value.
EA = Base Register + Address Field
EA = 100 + 500 = 600
The operand at memory location 600 is 1200.
Effective Address: 600
Operand Loaded: 1200
Register Indirect Addressing Mode
The value in register R1 is used as the effective address.
R1 = 400.
The operand at memory location 400 is 1000.
Effective Address: 400
Operand Loaded: 1000
Kommentare