Lecture 6 29th Jan 2024
Lecture 6 29th Jan 2024
Topic-III
T1. Barry B Brey, The Intel Microprocessors. Pearson, Eight Ed. 2009. Chapter 3, 4
Lecture 6
Types of Instructions
• Arithmetic Instructions
• Logical Instructions
1/31/2024 2
1
1/31/2024
Addressing Modes
1/31/2024 3
Addressing Modes
• Register Addressing
• Immediate Addressing
• Direct Addressing
• Register Indirect Addressing
• Base-plus-index Addressing
• Register Relative Addressing
• Base relative -plus-indexed Addressing
• Scaled Indexed Addressing
2
1/31/2024
MOV Instruction
1/31/2024 5
1/31/2024 6
3
1/31/2024
R ←M
M←R
R ←R
M← I
R ← I
1/31/2024 7
Addressing Modes
• Register Addressing
• Immediate Addressing
• Direct Addressing
• Register Indirect Addressing
• Base-plus-index Addressing
• Register Relative Addressing
• Base relative -plus-indexed Addressing
• Scaled Indexed Addressing
1/31/2024 8
4
1/31/2024
Addressing Modes
• Register Addressing
MOV AX, BX
• Immediate Addressing
MOV AX, 1420H
1/31/2024 9
Addressing Modes
• Direct Addressing
MOV AX, [2340H]
1/31/2024 10
5
1/31/2024
Addressing Modes
• Base-plus-index Addressing
MOV AX, [BX+SI]
1/31/2024 11
Addressing Modes
1/31/2024 12
6
1/31/2024
Addressing Modes
• 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.
7
1/31/2024
• The MOV BL, CL instruction does not affect the leftmost 8 bits of
register BX.
8
1/31/2024
W=0 (Data-byte)
W=1 (Data-word)
9
1/31/2024
W = 1 data is word.
W = 0 data is byte.
W (word/byte) in 80386 (32 bit processor)
W = 1 data is 32 bit.
W = 0 data is byte.
1/31/2024 19
1/31/2024 20
10
1/31/2024
MOD (2 bits)
22
11
1/31/2024
11
MOD
(R/M) 00 01 10 W=0 W=1
Registers
1/31/2024 24
12
1/31/2024
End of Lecture 6
1/31/2024 25
13