Modes of addressing memory (immediate, direct, indirect and indexed)
1.2.4 Types of Programming Language
Practise exam questionsTypes of Programming Language — Note 4 of 5
Candidates need an understanding of addressing, which should be integrated with assembly language. Candidates should have experience of using immediate, direct, indirect and indexed addressing in the writing, reading and tracing of programs written in assembly language.
The addressing mode tells the processor how to interpret the operand of an instruction: as the actual value to use, or as an address where the value (or another address) can be found.
The operand IS the value to be used, e.g. ADD #5 adds the number 5.
The operand is the ADDRESS of the memory location holding the value, e.g. ADD 5 adds the value stored at address 5. LMC uses direct addressing.
The operand is the address of a location that holds ANOTHER address, where the value is found. Useful for accessing more memory locations than the operand can address directly.
The address used is the operand PLUS the contents of the index register. Useful for stepping through arrays: increment the index register to move to the next element.
LDA 10 with: immediate loads 10; direct loads 20; indirect loads 35. If the index register holds 10, indexed LDA 10 uses address 20 and loads 35.Ready to test yourself?
Practise 1.2.4 questions