0% found this document useful (0 votes)
89 views16 pages

CCE404 Chapter 6-0

This document summarizes arithmetic instructions for the 8085 microprocessor, including: 1) Addition instructions like ADD that add registers or memory to registers and affect the flag register. 2) Subtraction instructions like SUB and SUI that subtract from registers. 3) Increment instructions like INR that increment registers or memory by 1. All the instructions described affect the flag register after performing operations on registers or memory.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views16 pages

CCE404 Chapter 6-0

This document summarizes arithmetic instructions for the 8085 microprocessor, including: 1) Addition instructions like ADD that add registers or memory to registers and affect the flag register. 2) Subtraction instructions like SUB and SUI that subtract from registers. 3) Increment instructions like INR that increment registers or memory by 1. All the instructions described affect the flag register after performing operations on registers or memory.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

8085 instructions

Chapter 6

١ 3/24/2008 prepared by :Maher A l-omari


Data transfer instructions

z sec 6.1 was covered in chapter 2

٢ 3/24/2008 prepared by :Maher A l-omari


Addressing modes

z Immediate addressing : MVI C,32


z Register addressing : MOV H,B.
z direct addressing : STA 2065.
z Indirect addressing : MOV M,B.

٣ 3/24/2008 prepared by :Maher A l-omari


Arithmetic Operations

z They perform arithmetic operations on data


in registers and memory.
z They affect the flags (Register F)

D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY

٤ Section 6.2 from text 3/24/2008 prepared by :Maher A l-omari


R is
A,B,C,D,E,H,L

ADD r (Add register).

(A) ← (A) + (r)

ADD C

A C A
23H
23H + 5AH
5AH 7DH
7DH

(A) = 7D S= 0 Z= 0 AC= 0 P= 1 CY= 0


[All flags are affected]
٥ Section 6.2 from text 3/24/2008 prepared by :Maher A l-omari
M is contents of
memory location
pointed at by H,L

ADD M (Add memory contents).


2060
CAH
(A) ← (A) + (M)
HL
2061 36H
ADD M 2061H
2061H

A M A
12H
12H + 36H
36H 48H
48H

(A) = 48 S= 0 Z= 0 AC= 0 P= 1 CY= 0


[All flags are affected]
٦ Section 6.2 from text 3/24/2008 prepared by :Maher A l-omari
Any 8-bit number

ADI , data (Add immediate).

(A) ← (A) + data


ADI 88

A A
78H
78H + 88H
88H 00H
00H

(A) = 00 S= 0 Z= 1 AC= 1 P= 1 CY= 1


[All flags are affected]
٧ Section 6.2 from text 3/24/2008 prepared by :Maher A l-omari
2’s complement Subtraction

A A
23H
23H 23H
23H

- C + C’
5AH
5AH A6H
A6H

11 C9H
C9H

(A) = C9 S= 1 Z= 0 AC= 0 P= 1 CY= 1


[All flags are affected]
٨ Section 6.2 from text 3/24/2008 prepared by :Maher A l-omari
R is
A,B,C,D,E,H,L

SUB r (subtract register).

(A) ← (A) - (r)

SUB C

A C A
23H
23H - 5AH
5AH C9H
C9H

(A) = C9 S= 1 Z= 0 AC= 0 P= 1 CY= 1


[All flags are affected]
٩ Section 6.2 from text 3/24/2008 prepared by :Maher A l-omari
M is contents of
memory location
pointed at by H,L

SUB M (subtract memory contents).

2060
CAH
(A) ← (A) - (M)
HL
2061 36H
SUB M 2060H
2060H

A M A
12H
12H - CAH
CAH 48H
48H

(A) = 48 S= 0 Z= 0 AC= 0 P= 1 CY= 1


[All flags are affected]
١٠ Section 6.2 from text 3/24/2008 prepared by :Maher A l-omari
Any 8-bit number

SUI , data (subtract immediate).

(A) ← (A) - data


SUI ,88

A A
78H
78H - 88H
88H F0H
F0H

(A) = F0 S= 1 Z= 0 AC= 1 P= 1 CY= 1


[All flags are affected]
١١ Section 6.2 from text 3/24/2008 prepared by :Maher A l-omari
R is
A,B,C,D,E,H,L

INR R (Increment register).

(R) ← (R) + 1
INR E

E E
FFH
FFH + 1H
1H 00H
00H

(A) = NC S= 0 Z= 1 AC= 1 P= 1 CY= NC


[All flags are affected except
١٢ Section 6.2 from text 3/24/2008 the carry flag]
prepared by :Maher A l-omari
M is contents of
memory location
pointed at by H,L

INR M (Increment memory).


2060
CFH
D0H
(M) ← (M) + 1
HL
2061 36H
INR M 2060H
2060H

M M
CFH + 1H
1H D0H
D0H

(A) = NC S= 1 Z= 0 AC= 1 P= 0 CY= NC


[All flags are affected except
١٣ Section 6.2 from text 3/24/2008 the carry flag]
prepared by :Maher A l-omari
M is contents of
memory location
pointed at by H,L

DCR M (decrement memory).


2060
CFH
CEH
(M) ← (M) - 1
HL
2061 36H
DCR M 2060H
2060H

M M
CFH - 1H
1H CEH
CEH

(A) = NC S= 1 Z= 0 AC= 1 P= 1 CY= NC


[All flags are affected except
١٤ Section 6.2 from text 3/24/2008 the carry flag]
prepared by :Maher A l-omari
Rp is contents of
regiter pair
H,B,D,SP

INX Rp (Increment register pair).

(Rp) ← (Rp) + 1
INX H

HL HL

20FF + 1H
1H 2100
2100

S= Z= AC= P= CY=
[All flags are NOT affected
١٥ Section 6.2 from text 3/24/2008 prepared by :Maher A l-omari
Rp is contents of
regiter pair
H,B,D,SP

DCX Rp (Decrement register pair).

(Rp) ← (Rp) - 1
DCX sp

SP SP

2000 - 1H
1H 1FFF
1FFF

S= Z= AC= P= CY=
[All flags are NOT affected
١٦ Section 6.2 from text 3/24/2008 prepared by :Maher A l-omari

You might also like