Search code examples
memory-addressorganizationmodesetting

Finding the values in each Instruction based on addressing mode


Given the following memory values and a one-address machine with an accumulator, how would I find what values do the each of the following instructions load into the accumulator?

Memory Values:
     Word 20 contains 40.
     Word 30 contains 50.
     Word 40 contains 60.
     Word 50 contains 70.

Addressing Modes:
    a. LOAD IMMEDIATE 20
    b. LOAD DIRECT 20
    c. LOAD INDIRECT 20

I am very much confused on how I would determine what the values would be in each case/mode. Please show me step by step how I would find the values for each of the modes. For immediate, would the value be 40, since 20 contains 40? Thanks in advance.


Solution

  • for immediate,the value itself is loaded and not the address it contains i.e the value is 20.for direct, the address content is loaded.i.e word 20 contains 40 therefore 40 is loaded.For the indirect ,the content of the direct value is loaded.i.e the direct value for 20 is 40 and the content of 40 is 60.therefore 60 is loaded.I hope that helps.