0% found this document useful (0 votes)
78 views3 pages

Detailed Notes On Addressing Modes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views3 pages

Detailed Notes On Addressing Modes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Detailed Notes on Addressing Modes

Abstract
This document provides comprehensive notes on addressing modes, a fundamental concept
in computer architecture and assembly language programming. Addressing modes define
how the operand of an instruction is accessed or specified. Understanding these modes is
crucial for optimizing code and understanding how processors interpret instructions. This
document includes detailed explanations of various addressing modes, examples for each,
and important questions and answers that may be encountered in an exam setting.

Addressing Modes

1. Immediate Addressing Mode


In immediate addressing mode, the operand is specified explicitly in the instruction itself. This
means that the value to be used is directly provided.

Example:

MOV AL, 5h ; Move the immediate value 5h into register AL

2. Direct Addressing Mode


In direct addressing mode, the address of the operand is given explicitly in the instruction.
The processor accesses the memory location directly.

Example:

MOV AL, [1234h] ; Move the value at memory address 1234h into register AL

3. Indirect Addressing Mode


In indirect addressing mode, the address of the operand is specified by a register or a
memory location. The instruction points to a location that contains the actual address of the
operand.

Example:

MOV BX, 1234h ; Load address 1234h into register BX


MOV AL, [BX] ; Move the value at the address contained in BX into AL

4. Register Addressing Mode


In register addressing mode, the operand is located in a register. The instruction specifies
which register to use.

Example:
MOV AL, BL ; Move the value from register BL into register AL

5. Register Indirect Addressing Mode


In register indirect addressing mode, the address of the operand is held in a register. The
instruction uses the register to access the operand.

Example:

MOV BX, 1234h ; Load address 1234h into register BX


MOV AL, [BX] ; Move the value at the address in BX into AL

6. Base Addressing Mode


Base addressing mode uses a base register and an offset to calculate the effective address of
the operand. This is often used in conjunction with arrays.

Example:

MOV AX, [BX + SI] ; Move the value at the address calculated by BX + SI into AX

7. Indexed Addressing Mode


In indexed addressing mode, an index register is used along with a base address to access
an operand. This is useful for accessing elements in an array.

Example:

MOV AX, [SI + 5] ; Move the value at the address calculated by SI + 5 into AX

8. Relative Addressing Mode


Relative addressing mode calculates the effective address by adding a constant value to the
current instruction pointer (IP). This is commonly used for branch instructions.

Example:

JNZ LABEL ; Jump to LABEL if the zero flag is not set

Important Questions and Answers

1. What is the purpose of addressing modes?


• Addressing modes determine how the operand of an instruction is accessed,
allowing for flexibility in programming and optimization of code.

2. Explain immediate addressing mode with an example.


• In immediate addressing mode, the operand is specified directly in the
instruction. For example, MOV AL, 5h moves the immediate value 5h into the
register AL.

3. What is the difference between direct and indirect addressing modes?


• In direct addressing mode, the operand's address is explicitly given in the
instruction, while in indirect addressing mode, the address is stored in a register
or memory location.

4. How does indexed addressing mode work?


• Indexed addressing mode uses an index register along with a base address to
calculate the effective address of the operand, making it useful for accessing
array elements.

5. Provide an example of relative addressing mode.


• An example of relative addressing mode is the instruction JNZ LABEL, which
jumps to the specified label if the zero flag is not set, using the current
instruction pointer as a reference.

By understanding these addressing modes and their applications, students can enhance their
programming skills and prepare effectively for exams in computer architecture and assembly
language.

You might also like