Upload
mohamad-hasan-nofal
View
217
Download
0
Embed Size (px)
Citation preview
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 1/16
3/24/2008 prepared by :Maher A l-omari١
8085 instructions
Chapter 6
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 2/16
3/24/2008 prepared by :Maher A l-omari٢
Data transfer instructions
sec 6.1 was covered in chapter 2
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 3/16
3/24/2008 prepared by :Maher A l-omari٣
Addressing modes
Immediate addressing : MVI C,32
Register addressing : MOV H,B.
direct addressing : STA 2065. Indirect addressing : MOV M,B.
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 4/16
3/24/2008 prepared by :Maher A l-omari٤
Arithmetic Operations
Section 6.2 from text
They perform arithmetic operations on data
in registers and memory.
They affect the flags (Register F)
CYPACZS
D0
D1
D2
D3
D4
D5
D6
D7
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 5/16
3/24/2008 prepared by :Maher A l-omari٥
ADD r (Add register).
Section 6.2 from text
(A)(A) ← (A) + (r)(A) + (r)
CY=P=AC=Z =S =(A) = 7D 0 0 0 1 0
[All flags are affected][All flags are affected]
R is
A,B,C,D,E,H,L
ADD C
+ 5AH5AH
C23H23H
A7DH7DH
A
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 6/16
3/24/2008 prepared by :Maher A l-omari٦
ADD M (Add memory contents).
Section 6.2 from text
(A)(A) ← (A) + (M)(A) + (M)
CY=P=AC=Z =S =(A) = 48 0 0 0 1 0
[All flags are affected][All flags are affected]
M is contents of
memory location
pointed at by H,L
ADD M
+ 36H36H
M12H12H
A48H48H
A
CAH2060
36H2061
2061H2061H
HL
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 7/16
3/24/2008 prepared by :Maher A l-omari٧
ADI , data (Add immediate).
Section 6.2 from text
(A)(A) ← (A) + data(A) + data
CY=P=AC=Z =S =(A) = 00 0 1 1 1 1
[All flags are affected][All flags are affected]
Any 8-bit number
ADI 88
+ 88H88H88H78H78H
A00H00H
A
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 8/16
3/24/2008 prepared by :Maher A l-omari٨
Subtractions complement ’ 2
Section 6.2 from text
CY=P=AC=Z =S =(A) = C9 1 0 0 1 1
[All flags are affected][All flags are affected]
-5AH5AHC
23H23H
A23H23H
A
A6HA6H
C’+
C9HC9H11
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 9/16
3/24/2008 prepared by :Maher A l-omari٩
SUB r (subtract register).
Section 6.2 from text
(A)(A) ← (A)(A) -- (r)(r)
CY=P=AC=Z =S =(A) = C9 1 0 0 1 1
[All flags are affected][All flags are affected]
R is
A,B,C,D,E,H,L
SUB C
- 5AH5AH
C23H23H
A
C9HC9H
A
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 10/16
3/24/2008 prepared by :Maher A l-omari١٠
SUB M (subtract memory contents).
Section 6.2 from text
(A)(A) ← (A)(A) -- (M)(M)
CY=P=AC=Z =S =(A) = 48 0 0 0 1 1
[All flags are affected][All flags are affected]
M is contents of
memory location
pointed at by H,L
SUB M
- CAHCAH
M
12H12H
A
48H48H
A
CAH2060
36H2061
2060H2060H
HL
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 11/16
3/24/2008 prepared by :Maher A l-omari١١
SUI , data (subtract immediate).
Section 6.2 from text
(A)(A) ← (A)(A) -- datadata
CY=P=AC=Z =S =(A) = F0 1 0 1 1 1
[All flags are affected][All flags are affected]
Any 8-bit number
SUI ,88
- 88H88H88H78H78H
A
F0HF0H
A
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 12/16
3/24/2008 prepared by :Maher A l-omari١٢
INR R (Increment register).
Section 6.2 from text
(R)(R) ← (R) + 1(R) + 1
CY=P=AC=Z =S =(A) = NC 0 1 1 1 NC
[All flags are affected except[All flags are affected except
the carry flag]the carry flag]
INR E
+ 1H1H1HFFHFFH
E
00H00H
E
R is
A,B,C,D,E,H,L
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 13/16
3/24/2008 prepared by :Maher A l-omari١٣
INR M (Increment memory).
Section 6.2 from text
(M)(M) ← (M) + 1(M) + 1
CY=P=AC=Z =S =(A) = NC 1 0 1 0 NC
[All flags are affected except[All flags are affected except
the carry flag]the carry flag]
INR M
+ 1H1H1HCFH
M
D0HD0H
M
M is contents of
memory location
pointed at by H,L
CFH2060
36H2061
2060H2060H
HL
D0H
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 14/16
3/24/2008 prepared by :Maher A l-omari١٤
DCR M (decrement memory).
Section 6.2 from text
(M)(M) ← (M)(M) -- 11
CY=P=AC=Z =S =(A) = NC 1 0 1 1 NC
[All flags are affected except[All flags are affected except
the carry flag]the carry flag]
DCR M
- 1H1H1HCFH
M
CEHCEH
M
M is contents of
memory location
pointed at by H,L
CFH2060
36H2061
2060H2060H
HL
CEH
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 15/16
3/24/2008 prepared by :Maher A l-omari١٥
INX Rp (Increment register pair).
Section 6.2 from text
((RpRp)) ← ((RpRp) + 1) + 1
CY=P=AC=Z =S =
[All flags are NOT affected[All flags are NOT affected
INX H
+ 1H1H1H20FF
HL
21002100
HL
Rp is contents of
regiter pair
H,B,D,SP
8/7/2019 CCE404 Chapter 6-0
http://slidepdf.com/reader/full/cce404-chapter-6-0 16/16
3/24/2008 prepared by :Maher A l-omari١٦
DCX Rp (Decrement register pair).
Section 6.2 from text
((RpRp)) ← ((RpRp)) -- 11
CY=P=AC=Z =S =
[All flags are NOT affected[All flags are NOT affected
DCX sp
- 1H1H1H2000
SP
1FFF1FFF
SP
Rp is contents of
regiter pair
H,B,D,SP