Sei sulla pagina 1di 5

Instruction-set Architectures – Addressing Modes

Students:
Hassler Isaac
Jorge Zapata
Juan Camilo Vergara
Gabriel Gómez Suarez

PROFESSOR: EDUARDO ZUREK, PH.D.

UNIVERSIDAD DEL NORTE


SISTEMS ENGINEERING (COMPUTER SCIENCES) DPT.
COMPUTER STRUCTURE I
Barranquilla-Colombia
2017
Instruction-set Architectures (ISA)

Introduction
An Instruction-set architecture (ISA) is an abstraction of the computer resources that is used for
programmers and compiler’s developers to write code for computational solutions. There are many
kinds of ISA, being the most important categories RISC (with ARM as the most architecture for
smartphones) and CISC (with x86 for commercial computers). In all cases, there are some basic
Addressing modes for data localization and jump directing.

Objective General:
Describe each one of the addressing modes available for different ISA. Using simulators for ARM
and x86, write and implement examples for each addressing mode and explain your program.
Addressing Modes
• Different types of addresses involve tradeoffs between instruction length, addressing flexibility
and complexity of address calculation. Common Addressing Modes:

— Immediate

— Direct

— Indirect

— Register

— Relative addressing

— Displacement.

— Implied (Stack, and a few others).

Immediate: The effective address is the location of an operand of the instruction, since the
operand is the data to be accessed. Immediate instructions use their operand to hold the data
needed to complete the instruction.

Advantages:

 The advantage of immediate addressing is that all data is retrieved with the completion of
the operand fetch.

Disadvantages:

 A disadvantage is that the value retrieved is hard coded and non-changeable since
modification of code once the code is running is consider improper and in many systems
impossible. Another disadvantage is the size of the data allowed in the operand. A CPU may
be able to fetch 16 or 32 bit data values when reading from memory, but an immediate
operand may be restricted to 8 bits or some other value smaller than the full register size.

Direct: This address indicates the starting location of the data to be accessed. Some systems have
different opcodes if the address in the operand can be retrieved with a single read rather that
requiring several reads of the operand field. This may be referred to as a zero page or near address.

Advantages:

 A primary advantage of this addressing mode is use of a quick, direct path to the data of
interest.

Disadvantages:

 A disadvantage is that the address is permanently coded in the instruction.


Indirect: The address is stored in a register (register indirect) or memory location (memory indirect)
specified by the operand - essentially a pointer.

Advantages:

 The advantage of this is the ability to change the memory pointed during program
execution. It is very useful when processing arrays of data. Register Indirect is also useful in
multi-tasking systems because the 'pointer' can be adjusted for the block of memory the
code is loaded into.

Disadvantages:

 Several fetches are required to arrive at the data of interest.


 In the case of register indirect, CPU registers acting as pointers are not available for other
tasks. I.E. you want a CPU with many registers.

Register: All effective addresses (both source and destination) are registers named in the
operand. The effective address(es) is/are the named registers involved in the action. Actions
between registers are the fastest to accomplise and are highly favored in RISC architectures.

Relative addressing: The address is found by adding the operand treated as a signed offset to the
program counter. In most cases, relative addressing is used with commands that modify the
program counter, such as conditinal branch statements, so the effective address, once calculated,
is stored back in the program counter.

Advantages:

 A major advantage of relative addressing is found in relation to multitasking systems. Since


any branches are relative to the current instruction pointer, the code can be loaded
anywhere in main memory and it self-corrects for the address offsets.

Disadvantages:

 The primary disadvantage of relative addressing is that the operand is seldom large enough
to represent the full address range, thus limiting the branching distance or requiring a
different branch technique for branching of a different magnitude.

Displacement: The address is a combination of address stored in a named register (or registers)
and a hard coded offset value. Displacement is always a positive value. The displacement value is an
offset that is almost always a value much smaller that a legal address in possible address range of
the system (often between 256 and 4K). However, the indirect register may be capable of holding
any value in the full address range.

Implied: The effective address is implied by (is part of) the opcode itself. Implied instructions
usually consist of only the instruction opcode. The registers and/or memory involved is known by
the cpu and will be accessed automatically. Examples might be an instruction that increments the
counter register by a predefined value or sets or tests a CPU condition register.
Referencias Bibliograficas:
http://faculty.cs.niu.edu/~berezin/463/notes/addrmode.html

http://aturing.umcs.maine.edu/~meadow/courses/cos335/COA11.pdf

https://www.cs.sfu.ca/CourseCentral/250/ggbaker/notes/250notes-24.pdf