Indirect/Indexed Addressing Mode

instruction-set

Solution

Not sure which architecture you're discussing so I'll just explain generically as best I can (based on experience wtih more concrete architectures, and investigative analysis of the stuff shown in the graphic you posted).

Immediate mode means use the immediate value, so something like `load r2, #800` would put the immediate value 800 into register 2.

Direct means direct memory access, so something like `load r2, 800` loads the value from memory address 800, and that value is 900.

Indirect means indirect memory access, so something like `load r2, (800)` loads the value from the memory address at memory address 800. The memory address at 800 is 900 and the value at 900 is 1000.

This one is a register/base-address combination like `load r2, (r1,#800)`. What that would do would be to add register 1 and the immediate value 800 (to get 1600) then grab the value from that memory location, giving 700.

Problem

When the instruction LOAD 800 is fed I understand how the other values are loaded into the accumulator but I don't know how you get the results for indexed and indirect addressing.

Original source