The Microprocessor: Assembly Language
The Microprocessor: Assembly Language
LECTURE:3
THE MICROPROCESSOR
DATA ADDRESSING
MODES
DATA ADDRESSING
MODES
MOV AX,BX
MOV= opcode
AX and BX = operand
different ways of specifying data are
called the data addressing modes
Register Addressing
Immediate Addressing
Direct Addressing
Register Indirect Addressing
Base plus Index Addressing
Register Relative Addressing
Base Relative Plus Index Addressing
Examples:
MOV
MOV
MOV
MOV
MOV
MOV
AL,BL
CH,CL
AX,CX
SP,BP
DS,AX
SI,DI
Examples:
MOV AX,2550H; move 2550H into AX
MOV CX,625 ; load decimal value 625 into CX
MOV BL,40H ; load 40H into BL
In case of data segment registers:
MOV AX,2550H
MOV DS,AX
In other words the following would produce an error:
MOV DS,0123H; illegal
EXAMPLES
MOV
MOV
MOV
MOV
MOV
MOV
AL,44
AX,44H
SI,0
CH,100
AL,A
AX,AB
EXAMPLES
MOV AL,NUMBER
MOV AX,COW
MOV HOME,AX
PROBLEM:
Find the physical address of the
memory location and its content
after execution of the following.
Assuming DS:1512H
Mov AL,99H
MOV [3518],AL
SOLUTION:
First AL is initialized to 99H
Then the content of AL are moved to logical
address DS:3518
Shifting Ds left and adding it to the offset
gives the physical address of 18638H (15120h
+ 3518H= 18638H). That means after the
execution of the 2nd instruction, the memory
location with address 18638H will contain the
value 99h
PROBLEM:
Find the physical address of the
memory location and its content
after execution of the following.
Assuming DS:1012H
Mov AL,64H
MOV [4318],AL