Addressing Modes - Microprocessors
Addressing Modes - Microprocessors
MODES
Presented by: Mayank Rawal, Suyash Mehra,
Anushka Singhal, Om Aryan
Addressing modes are the different ways in which a source
operand is specified in an instruction and an opcode defines the
operation to perform.
MOV instruction is a common and flexible instruction. It provides a
basis for the explanation of data-addressing modes
Source is to the right and destination is to the left, next to the
opcode MOV.
An opcode, or operation code, tells the microprocessor which
operation to perform
Each statement in an assembly language program consists of four
parts or fields.
The MOV instruction shows the source, destination, and direction of data
flow.
The most common form of data addressing.
The microprocessor contains these 8-bit register names
used with register addressing: AH, AL, BH, BL, CH, CL, DH, and
DL.•16-bit register names: AX, BX, CX, DX, SP, BP, SI, and DI.
A register is the source of the operand
Data is stored in a register and a particular register refers to it
The effect of executing the MOV BX, CX instruction at the point just before the BX
register changes
Immediate Addressing Mode
Term immediate implies that data immediately follow the
hexadecimal opcode in the memory.
Immediate Addressing Mode
As with the MOV instruction illustrated in, the source data
overwrites the destination data
Immediate Addressing Mode
The letter H appends hexadecimal data.
If hexadecimal data begin with a letter, the assembler requires the
data start with a 0 – to represent a hexadecimal F2, 0F2H is used in
assembly language
An ASCII-coded character or characters maybe depicted in the
immediate form if the ASCII data are enclosed in apostrophes. – be
careful to use the apostrophe (’) for ASCII data and not the single
quotation mark (‘)
Binary data are represented if the binary number is followed by the
letter B – in some assemblers, the letter Y
Immediate Addressing Mode
Direct Addressing Mode
Direct addressing moves data between a memory location
and a register.
Two basic forms of direct data addressing:
a) Direct addressing
b) Displacement addressing
Address is formed by adding the displacement to the default
data segment (DS) address or an alternate segment address.
a. Direct Addressing
Direct addressing with a MOV instruction transfers data between a
memory location, located within the data segment, and the AL(8-
bit), AX (16-bit), or EAX (32-bit) register .
MOV AL, DATA loads AL from the data segment memory location
DATA (1234H).
DATA is a symbolic memory location, while 1234H is the actual
hexadecimal location
This instruction transfers a copy of contents of memory location 11234H into AL.
– the effective address is formed by adding 1234H (the offset address) and
10000H (the data segment address of 1000H times 10H) in a system operating in the
real mode.
Notice the difference between
b. Displacement Addressing
• Almost identical to direct addressing, except the instruction is 4
bytes wide instead of 3.
•In 80386 through Pentium 4, this instruction can be up to 7 bytes wide
if a 32-bit register and a 32-bit displacement are specified.
•This type of direct data addressing is much more flexible because
most instructions use it.
Register Indirect Addressing Mode
Figure shows how data are addressed by the MOV DX,[BX + DI]
instruction when themicroprocessor operates in the real mode.
t
The operation of theMOV AX, [BX+1000H]instructon,
whenBX=0100HandDS=0200H.
Address Generation =DS X 10H
[BX+offset]=02000+100+1000=3100Hand3101H
BASE RELATIVE PLUS INDEXING