

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















(b) Direct Memory Instruction A A Operand (a) Immediate Instruction Operand Registers (d) Register Instruction R R (c) Indirect Memory Instruction Registers (f) Displacement Memory Instruction R A Registers (e) Register Indirect Memory Instruction Top of Stack Register (g) Stack Implicit Instruction Operand Operand Operand Operand 4
◼ e.g. ADD 5
◼ The leftmost bit of the operand field is used as a sign bit
◼ No memory reference other than the instruction fetch is required to obtain the operand, thus saving one memory or cache cycle in the instruction cycle
◼ The size of the number is restricted to the size of the address field, which, in most instruction sets, is small compared with the word length
Address field contains the effective address of the operand Effective address (EA) = address field (A) Was common in earlier generations of computers Requires only one memory reference and no special calculation Limitation is that it provides only a limited address space
◼ Parentheses are to be interpreted as meaning contents of
◼ For a word length of N an address space of 2N^ is now available
◼ Instruction execution requires two memory references to fetch the operand ◼ One to get its address and a second to get its value
◼ EA = (... (A)... ) ◼ Disadvantage is that three or more memory references could be required to fetch an operand
Indirect Addressing Diagram Address
◼ The only difference is whether the address field refers to a memory location or a register
◼ Address space limitation of the address field is overcome by having that field refer to a word-length location containing an address ◼ Uses one less memory reference than indirect addressing
◼ The value contained in one address field (value = A) is used directly ◼ The other address field refers to a register whose contents are added to A to produce the effective address ◼ Most common uses: ◼ Relative addressing ◼ Base-register addressing ◼ Indexing
The implicitly referenced register is the program counter (PC) EA = A + (PC)
◼ A stack is a linear array of locations ◼ Sometimes referred to as a pushdown list or last-in-first-out queue ◼ A stack is a reserved block of locations ◼ Items are appended to the top of the stack so that the block is partially filled ◼ Associated with the stack is a pointer whose value is the address of the top of the stack ◼ The stack pointer is maintained in a register ◼ Thus references to stack locations in memory are in fact register indirect addresses