





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!






Page 1 From 9
Addressing modes are an aspect of the instruction set architecture in most central processing unit (CPU) designs. The various addressing modes that are defined in a given instruction set architecture define how machine language instructions in that architecture identify the operand(s) of each instruction. An addressing mode specifies how to calculate the effective memory address of an operand by using information held in registers and/or constants contained within a machine instruction or elsewhere. Addressing Modes Applications Immediate Addressing Mode To initialize registers to a constant value Direct Addressing Mode and Register Direct Addressing Mode To access static data To implement variables Indirect Addressing Mode and Register Indirect Addressing Mode To implement pointers because pointers are memory locations that store the address of another variable To pass array as a parameter because array name is the base address and pointer is needed to point the address Relative Addressing Mode For program relocation at run time i.e. for position independent code To change the normal sequence of execution of instructions For branch type instructions since it directly updates the program counter Index Addressing Mode For array implementation or array addressing For records implementation Base Register Addressing Mode For writing relocatable code i.e. for relocation of program in memory even at run time For handling recursive procedures
Page 2 From 9
In this mode, the operand is specified in the instruction itself. An immediate mode instruction has an operand field rather than the address field. Examples -
In this mode, effective address of operand is present in instruction itself. o Single memory reference to access data. o No additional calculations to find the effective address of the operand. Example-
In this, the address field of instruction gives the address where the effective address is stored in memory. This slows down the execution, as this includes multiple memory lookups to find the operand. Example-
Page 4 From 9
It is interesting to note-
In this the contents of the indexed register is added to the Address part of the instruction, to obtain the effective address of operand. EA = A + (R), In this the address field holds two values, A(which is the base value) and R(that holds the displacement), or vice versa.
In this addressing mode, Effective address of the operand is obtained by adding the content of program counter with the address part of the instruction. EA = A + (PC), where EA is effective address and PC is program counter. The operand is A cells away from the current cell (the one pointed to by PC)
This can be defined as EA = A + (R), where A is displacement and R holds pointer to base address.
A= main memory address R=displacement from that address EA = A + content(R) A lenght comparibly large than base register addressing
index register, that is R displacement register, are used in iterative task so need to increment and decrement to address arrays or memory automatically done part of same instruction cycle EA = A + content(R) R = R + 1
Page 5 From 9
indirect addressing + indexing EA = content of A + content of R
EA = contents of (A + content (R))
In this mode, operand is at the top of the stack. For example: ADD, this instruction will POP top two items from the stack, add them, and will then PUSH the result to the top of the stack. Example - ADD
Page 7 From 9 ADD Rd, 1000
Page 8 From 9 Q 2 )