Professional Documents
Culture Documents
Introduction To Addressing Modes Example Addressing Modes For Accessing Data
Introduction To Addressing Modes Example Addressing Modes For Accessing Data
E.A. = <address in instruction> E.A. = Contents(PC) + sign ext (offset) E.A. = Contents(MEMORY[X]), where in LC-3, X is calculated as: Contents(PC) + sign ext (offset) E.A. = Contents(Base Register) + Contents(Index Register) E.A. = Contents(Base Register), AND increments the contents of the Base Register by SIZE of the operand
NO YES YES
ALL, via Base = 0 and Offset = small addr YES NO, too complex SOME SOME
YES YES
NO NO
AddrModes-2
Popularity: In ISAs that are not a RISC Load/Store ISA, this addressing mode is used for 50% of operand references
Popularity: (3rd) In ISAs that are not a RISC Load/Store ISA, this addressing mode is used for (9-20%) of operand references.
AddrModes-4
AddrModes-3
Popularity: (4th) In ISAs that are not a RISC Load/Store ISA, this addressing mode is used for (2-12%) of operand references.
Popularity: (2nd) In ISAs that are not a RISC Load/Store ISA, this addressing mode is used for (16-27%) of operand references.
AddrModes-6
AddrModes-5
Statistics for Alpha architecture with full optimization for SPEC CPU2000
Log2(displacement)
AddrModes-7
AddrModes-8
Assembly Time:
LD (PC-Relative)
AddrModes-11
AddrModes-12
2) SOLUTION: Create a memory pointer that is NEAR to the instruction; This memory pointer contains the address of ABC. LD R0, ABC_PTR ;R0 contains the address of ABC STR R3, R0, 0 ;R3 is stored into ABC near ABC_PTR .FILL ABC ; note, that there is no constraint of the ; distance between the ABC_PTR & ABC, ... far ; they just have to be in same source file ABC .BLKW 1 ; a scalar variable ... AddrModes-13
Popularity: (6th out of 6) In ISAs that are not a RISC Load/Store ISA, this addressing mode is used for (0.5-3%) of operand references.
AddrModes-14
NOTE: the memory indirect mode is not a solution for typical accesses to arrays or structures, so we must use the original solution.
AddrModes-15
AddrModes-17
AddrModes-18