Microprocessor Architecture: Lecturer
Microprocessor Architecture: Lecturer
Department of
Computer Technical Engineering
Second Class
Microprocessor Architecture
المحاضره االولى
)(العملي
2019-2020
Lecturer
Registers
1. AX 1. SP 1. CS 1. IP
2. BX 2. BP 2. DS
3. CX 3. SI 3. ES
4. DX 4. DI 4. SS
General Purpose Registers
AX= 16 bits
0 7 8 15
Accumulator Register
BX= 16 bits
0 7 8 15
2. BX = BH + BL
Base Register
General Purpose Registers
CX= 16 bits
0 7 8 15
Counter Register
DX= 16 bits
0 7 8 15
4. DX = DH + DL
Data Register
Special Purpose Registers
SP= 16 bits
0 15
1. SP : Stack Pointer
BP= 16 bits
0 15
2. BP : Base Pointer
SI= 16 bits
0 15
3. SI : Source Index
DI= 16 bits
0 15
4. DI : Destination Index
Segment Registers
CS = 16 bits
0 15
1. CS : Code Segment
DS= 16 bits
0 15
2. DS : Data Segment
ES= 16 bits
0 15
3. ES : Extra Segment
SS= 16 bits
0 15
4. SS: Stack Segment
Instruction Pointer
IP = 16 bits
0 15
IP : Instruction Pointer
Accumulator Register
Base Register
Counter Register
Data Register
Code Segment
Instruction Pointer
Stack Segment
Stack Pointer
Base Pointer
Source Index
Destination Index
Data Segment
Extra Segment
MOV Instruction
• Copies the second operand (source) to the first operand (destination).
• The source operand can be an immediate value, general purpose register or
memory location.
• The destination register can be a general purpose register, or memory location.
• Both operands must be the same size, which can be a byte or a word.
Syntax:
MOV Destination, Source
Destination :-
1. Register
2. Memory location
Source :-
1. Register
2. Memory location
3. Immediate Value
EXAMPLE :-
MOV Register, Register
MOV Register, Memory Location
MOV Register, Immediate Value
MOV Memory Location, Register
MOV Memory Location, Memory Location
MOV Memory Location, Immediate Value
Register : AX, BX, CX, DX, AH, AL, BH, BL, CH, CL, DH, DL, DI, SI, BP, SP.
Memory Location : [3000H], [BX], [SI], etc….
Immediate Value : 5, -24, 3FH, 10001101b, etc….
EXAMPLE 1
Here is a short program that demonstrates the use of MOV instruction:
MOV AX, 0B800h
MOV DS, AX
Soluation :-
MOV CX, 2h
MOV BX, 5h
ADD CX, BX
MOV AL, 5h
MOV BL, 1h
ADD AL, BL
MOV DL, 3h
ADD DL, 5h
EXAMPLE 2
Write a program to find the summation of memory location 3000h with the content of register
DL and store the result in BH register.
Where DL= 4
Soluation :-
MOV DL, 4h
ADD DL, [3000H]
MOV BH, DL
Homework
1. Write a program to store number 5 in memory location 3000h,
then add its to the content of DX register and store the result in
BX register.
Where DX=EF1H
2. Write a program to find :-
[2500h]=BX+[3000H]+5
Where BX=10AH
Thank you for your
attention!