SlideShare une entreprise Scribd logo
1  sur  12
Télécharger pour lire hors ligne
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 1
Instruction Set of 8085 microprocessor
a) Data Transfer Group
b) Arithmetic Group
c) Logical Group
d) Branching/Loop Group
e) Stack and Machine Control Group
Notation used in Instruction and opcode
Notations Meaning
M Memory location pointed by HL register pair
R 8-bit register
RP 16-bit register pair
RS Source register
RD Destination register
Addr 16-bit address
X 8-bit data
c) Logical Group
1. ANA R 2. ANA M 3. ANI data 4. ORA R
5. ORA M 6. ORI data 7. XRA R 8. XRA M
9. XRI data 10. CMA 11. CMC 12. STC
13. CMP R 14. CMP M 15. CPI data 16. RLC
17. RRC 18. RAL 19. RAR
1. ANA R
Description - Logical AND content of register R with accumulator A and store
the result in accumulator A.
Operation - A AND R ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 2
Example - ANA E
Before Execution After Execution
R= E = 41H R= E = 41H
A = 35H A = 01H
E = 41H 0100 0001
A = 35H 0011 0101
0000 0001
2. ANA M
Description - Logical AND content of memory location M with accumulator A
and store the result in accumulator A.
Operation - A AND M ----> A OR A AND (HL) ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - ANA M
Before Execution After Execution
M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H
A = 35H A = 01H
Note: - AND operation is performed same as ANA R.
3. ANI data
Description - Logical AND immediate data with accumulator A and store the
result in accumulator A.
Operation - A AND data ----> A
No. of Bytes- 2
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - ANI 41H
Before Execution After Execution
data = 41H data = 41H
A = 35H A = 01H
Note: - AND operation is performed same as ANA R.
AND Operation
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 3
4. ORA R
Description - Logical OR content of register R with accumulator A and store the
result in accumulator A.
Operation - A OR R ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - ORA E
Before Execution After Execution
R= E = 41H R= E = 41H
A = 35H A = 75H
E = 41H 0100 0001
A = 35H 0011 0101
0111 0101
5. ORA M
Description - Logical OR content of memory location M with accumulator A
and store the result in accumulator A.
Operation - A OR M ----> A OR A OR (HL) ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - ORA M
Before Execution After Execution
M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H
A = 35H A = 75H
Note: - OR operation is performed same as ORA R.
OR Operation
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 4
6. ORI data
Description - Logical OR immediate data with accumulator A and store the
result in accumulator A.
Operation - A OR data ----> A
No. of Bytes- 2
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - ORI 41H
Before Execution After Execution
data = 41H data = 41H
A = 35H A = 75H
Note: - OR operation is performed same as ORA R.
7. XRA R
Description - Logical X-OR content of register R with accumulator A and store
the result in accumulator A.
Operation - A X-OR R ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - XRA E
Before Execution After Execution
R= E = 41H R= E = 41H
A = 35H A = 74H
E = 41H 0100 0001
A = 35H 0011 0101
0111 0100
X-OR Operation
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 5
8. XRA M
Description - Logical X-OR content of memory location M with accumulator A
and store the result in accumulator A.
Operation - A X-OR M ----> A OR A X-OR (HL) ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - XRA M
Before Execution After Execution
M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H
A = 35H A = 74H
Note: - X-OR operation is performed same as XRA R.
9. XRI data
Description - Logical X-OR immediate data with accumulator A and store the
result in accumulator A.
Operation - A X-OR data ----> A
No. of Bytes- 2
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - XRI 41H
Before Execution After Execution
data = 41H data = 41H
A = 35H A = 74H
Note: - X-OR operation is performed same as XRA R.
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 6
10. CMA
Description - Complement accumulator A and store the result in accumulator
A.
Operation - A̅ ----> A
No. of Bytes- 1
Flags - No flags are modified.
Example - CMA
Before Execution After Execution
A = 35H A = CA H
A = 35H = 0011 0101
A̅ = CA H = 1100 1010
11.CMC
Description - Complement the carry flag.
Operation - CY̅̅̅̅----> CY
No. of Bytes- 1
Flags - Only carry flag is complemented. No other flags are modified.
Example - CMC
Before Execution After Execution
(i) CY = Set CY = Reset
(ii) CY = Reset CY = Set
12.STC
Description - Set the carry flag.
Operation - CY = Set
No. of Bytes- 1
Flags - Only carry flag is complemented. No other flags are modified.
Example - STC
Before Execution After Execution
(i) CY = Set CY = Set
(ii) CY = Reset CY = Set
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 7
13.CMP R
Description - Compare content of register R with accumulator A. The contents
of register R and accumulator A are not altered.
Operation - A compare R----> Flag Register
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation and Z, CY
are used to indicate the result of comparison.
(i) A > R: CY is Reset and Zero flag is Reset.
(ii) A = R: Zero flag is set.
(iii) A < R: CY flag is set.
Example - CMP D
Before Execution After Execution
(i) A = 35H A > D
D = 25H
A = 35H = 0011 0101
D = 25H = 0010 0101
2’s complement of 25H -----> 1101 1011
A = 35H = 0011 0101
2’s complement of 25H -----> + 1101 1011
1 0001 0000
Carry is generated so CY = set, microprocessor complement this carry so CY = reset
and also zero flag is reset, which represent that the A is greater than D.
(ii) A = 35H A = D
D = 35H
A = 35H = 0011 0101
D = 35H = 0011 0101
2’s complement of 35H -----> 1100 1011
A = 35H = 0011 0101
2’s complement of 35H -----> + 1100 1011
1 0000 0000
Carry is generated so CY = set, microprocessor complement this carry so CY = reset
and zero flag is set, which represent that the A is equal to D.
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 8
(iii) A = 25H A < D
D = 35H
A = 25H = 0010 0101
D = 35H = 0011 0101
2’s complement of 35H -----> 1100 1011
A = 25H = 0010 0101
2’s complement of 35H -----> + 1100 1011
1111 0000
No carry generated so CY = reset, microprocessor complement this carry so CY = set,
which represent that the A is less than D.
14.CMP M
Description - Compare content of memory location M with accumulator A. The
contents of memory location M and accumulator A are not altered.
Operation - A compare M----> Flag Register
OR
A compare (HL)----> Flag Register
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation and Z, CY
are used to indicate the result of comparison.
(i) A > M: CY is Reset and Zero flag is Reset.
(ii) A = M: Zero flag is set.
(iii) A < M: CY flag is set.
Example - CMP M
Before Execution After Execution
A = 35H A > M
M = (HL) = (1000) = 25H
A = 35H = 0011 0101
M = (HL) = (1000) = 25H = 0010 0101
2’s complement of 25H -----> 1101 1011
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 9
A = 35H = 0011 0101
2’s complement of 25H -----> + 1101 1011
1 0001 0000
Carry is generated so CY = set, microprocessor complement this carry so CY = reset
and also zero flag is reset, which represent that the A is greater than M.
Note: - Other comparison examples (A=M & A<M) are same as CMP R.
15.CPI data
Description - Compare immediate data with accumulator A. The immediate
and accumulator A are not altered.
Operation - A compare data----> Flag Register
No. of Bytes- 2
Flags - S, Z and P are modified to reflect the result of operation and Z, CY
are used to indicate the result of comparison.
(i) A > data: CY is Reset and Zero flag is Reset.
(ii) A = data: Zero flag is set.
(iii) A < data: CY flag is set.
Example - CPI 25H
Before Execution After Execution
A = 35H A > data
data = 25H
A = 35H = 0011 0101
data = 25H = 0010 0101
2’s complement of 25H -----> 1101 1011
A = 35H = 0011 0101
2’s complement of 25H -----> + 1101 1011
1 0001 0000
Carry is generated so CY = set, microprocessor complement this carry so CY = reset
and also zero flag is reset, which represent that the A is greater than immediate
data.
Note: - Other comparison examples (A=data & A<data) are same as CMP R.
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 10
16. RLC
Description - Rotate accumulator A left by 1 bit.
Operation - Accumulator: Dn Dn+1 (n=0 to 6)
D7 D0
D7 CY
No. of Bytes- 1
Flags - Only carry flag is modified. No other flags are modified.
Example - RLC
Before Execution After Execution
A = 48H A = 90H
CY = 0
Value D7 D6 D5 D4 D3 D2 D1 D0
A = 48H 0 1 0 0 1 0 0 0
A = 91H 1 0 0 1 0 0 0 0
17. RRC
Description - Rotate accumulator A right by 1 bit.
Operation - Accumulator: Dn+1 Dn (n=0 to 6)
D0 D7
D0 CY
No. of Bytes- 1
Flags - Only carry flag is modified. No other flags are modified.
Example - RRC
D7 D6 D5 D4 D3 D2 D1 D0
D7 D6 D5 D4 D3 D2 D1 D0
CY
CY = 0
CY
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 11
Before Execution After Execution
A = 48H A = 24H
CY = 0
Value D7 D6 D5 D4 D3 D2 D1 D0
A = 48H 0 1 0 0 1 0 0 0
A = 24H 0 0 1 0 0 1 0 0
18. RAL
Description - Rotate accumulator A left through carry by 1 bit.
Operation - Accumulator: Dn Dn+1 (n=0 to 6)
D7 CY
CY D0
No. of Bytes- 1
Flags - Only carry flag is modified. No other flags are modified.
Example - RAL
Before Execution After Execution
A = 58H A = B1H
CY = 1 CY = 0
Value D7 D6 D5 D4 D3 D2 D1 D0
A = 58H 0 1 0 1 1 0 0 0
A = B1H 1 0 1 1 0 0 0 1
CY=1
New Value Previous Value
D7 D6 D5 D4 D3 D2 D1 D0
CY = 0
CY
CY = 0
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 12
19. RAR
Description - Rotate accumulator A right through carry by 1 bit.
Operation - Accumulator: Dn+1 Dn (n=0 to 6)
D0 CY
CY D7
No. of Bytes- 1
Flags - Only carry flag is modified. No other flags are modified.
Example - RAR
Before Execution After Execution
A = 59H A = 2C H
CY = 0 CY = 1
Value D7 D6 D5 D4 D3 D2 D1 D0
A = 59H 0 1 0 1 1 0 0 1
A = 2C H 0 0 1 0 1 1 0 0
CY=0
Previous Value New Value
D7 D6 D5 D4 D3 D2 D1 D0
CY
CY = 1

Contenu connexe

Tendances

ARM Architecture Instruction Set
ARM Architecture Instruction SetARM Architecture Instruction Set
ARM Architecture Instruction Set
Dwight Sabio
 

Tendances (20)

Addressing modes of 8085
Addressing modes of 8085Addressing modes of 8085
Addressing modes of 8085
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction Format
 
Latch and flip flop
Latch and flip flopLatch and flip flop
Latch and flip flop
 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085
 
PLOTTING UNITE STEP AND RAMP FUNCTION IN MATLAB
PLOTTING UNITE STEP AND RAMP  FUNCTION  IN  MATLAB PLOTTING UNITE STEP AND RAMP  FUNCTION  IN  MATLAB
PLOTTING UNITE STEP AND RAMP FUNCTION IN MATLAB
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessor
 
Microoperations
MicrooperationsMicrooperations
Microoperations
 
ARM Architecture Instruction Set
ARM Architecture Instruction SetARM Architecture Instruction Set
ARM Architecture Instruction Set
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessor
 
Logical and shift micro operations
Logical and shift micro operationsLogical and shift micro operations
Logical and shift micro operations
 
Msp430 assembly language instructions &amp;addressing modes
Msp430 assembly language instructions &amp;addressing modesMsp430 assembly language instructions &amp;addressing modes
Msp430 assembly language instructions &amp;addressing modes
 
Logical instruction of 8085
Logical instruction of 8085Logical instruction of 8085
Logical instruction of 8085
 
Lec 12-15 mips instruction set processor
Lec 12-15 mips instruction set processorLec 12-15 mips instruction set processor
Lec 12-15 mips instruction set processor
 
FPGA Coding Guidelines
FPGA Coding GuidelinesFPGA Coding Guidelines
FPGA Coding Guidelines
 
Stacks & subroutines 1
Stacks & subroutines 1Stacks & subroutines 1
Stacks & subroutines 1
 
Ch4
Ch4Ch4
Ch4
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Computer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notesComputer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notes
 

Similaire à 8085 logical instruction

8085 instruction set.pptx
8085 instruction set.pptx8085 instruction set.pptx
8085 instruction set.pptx
AchintKaur27
 
Instruction 4.pptx
Instruction 4.pptxInstruction 4.pptx
Instruction 4.pptx
HebaEng
 
Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051
Jay Patel
 

Similaire à 8085 logical instruction (20)

MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085
 
Microprocessor 11el01
Microprocessor 11el01Microprocessor 11el01
Microprocessor 11el01
 
Lecture 04 Logical Group of Instructions
Lecture 04 Logical Group of InstructionsLecture 04 Logical Group of Instructions
Lecture 04 Logical Group of Instructions
 
Instruction set 8085
Instruction set 8085Instruction set 8085
Instruction set 8085
 
Logical instruction of 8085
Logical instruction of 8085 Logical instruction of 8085
Logical instruction of 8085
 
Lecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of InstructionsLecture 03 Arithmetic Group of Instructions
Lecture 03 Arithmetic Group of Instructions
 
REGISTER TRANSFER AND MICROOPERATIONS2017-3-5.ppt
REGISTER  TRANSFER  AND  MICROOPERATIONS2017-3-5.pptREGISTER  TRANSFER  AND  MICROOPERATIONS2017-3-5.ppt
REGISTER TRANSFER AND MICROOPERATIONS2017-3-5.ppt
 
8085 instruction set.pptx
8085 instruction set.pptx8085 instruction set.pptx
8085 instruction set.pptx
 
5. 8085 instruction set ii
5. 8085 instruction set ii5. 8085 instruction set ii
5. 8085 instruction set ii
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085
 
module 5.1.pptx
module 5.1.pptxmodule 5.1.pptx
module 5.1.pptx
 
module 5.pptx
module 5.pptxmodule 5.pptx
module 5.pptx
 
Register transfer &amp; microoperations moris mano ch 04
Register transfer &amp; microoperations    moris mano ch 04Register transfer &amp; microoperations    moris mano ch 04
Register transfer &amp; microoperations moris mano ch 04
 
8085 instruction set (detailed)
8085 instruction set (detailed)8085 instruction set (detailed)
8085 instruction set (detailed)
 
Instruction 4.pptx
Instruction 4.pptxInstruction 4.pptx
Instruction 4.pptx
 
Mpi
MpiMpi
Mpi
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Dsp Datapath
Dsp DatapathDsp Datapath
Dsp Datapath
 
Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051Arithmetic & logical operations in 8051
Arithmetic & logical operations in 8051
 

Dernier

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 

Dernier (20)

data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 

8085 logical instruction

  • 1. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 1 Instruction Set of 8085 microprocessor a) Data Transfer Group b) Arithmetic Group c) Logical Group d) Branching/Loop Group e) Stack and Machine Control Group Notation used in Instruction and opcode Notations Meaning M Memory location pointed by HL register pair R 8-bit register RP 16-bit register pair RS Source register RD Destination register Addr 16-bit address X 8-bit data c) Logical Group 1. ANA R 2. ANA M 3. ANI data 4. ORA R 5. ORA M 6. ORI data 7. XRA R 8. XRA M 9. XRI data 10. CMA 11. CMC 12. STC 13. CMP R 14. CMP M 15. CPI data 16. RLC 17. RRC 18. RAL 19. RAR 1. ANA R Description - Logical AND content of register R with accumulator A and store the result in accumulator A. Operation - A AND R ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set.
  • 2. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 2 Example - ANA E Before Execution After Execution R= E = 41H R= E = 41H A = 35H A = 01H E = 41H 0100 0001 A = 35H 0011 0101 0000 0001 2. ANA M Description - Logical AND content of memory location M with accumulator A and store the result in accumulator A. Operation - A AND M ----> A OR A AND (HL) ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - ANA M Before Execution After Execution M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H A = 35H A = 01H Note: - AND operation is performed same as ANA R. 3. ANI data Description - Logical AND immediate data with accumulator A and store the result in accumulator A. Operation - A AND data ----> A No. of Bytes- 2 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - ANI 41H Before Execution After Execution data = 41H data = 41H A = 35H A = 01H Note: - AND operation is performed same as ANA R. AND Operation
  • 3. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 3 4. ORA R Description - Logical OR content of register R with accumulator A and store the result in accumulator A. Operation - A OR R ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - ORA E Before Execution After Execution R= E = 41H R= E = 41H A = 35H A = 75H E = 41H 0100 0001 A = 35H 0011 0101 0111 0101 5. ORA M Description - Logical OR content of memory location M with accumulator A and store the result in accumulator A. Operation - A OR M ----> A OR A OR (HL) ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - ORA M Before Execution After Execution M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H A = 35H A = 75H Note: - OR operation is performed same as ORA R. OR Operation
  • 4. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 4 6. ORI data Description - Logical OR immediate data with accumulator A and store the result in accumulator A. Operation - A OR data ----> A No. of Bytes- 2 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - ORI 41H Before Execution After Execution data = 41H data = 41H A = 35H A = 75H Note: - OR operation is performed same as ORA R. 7. XRA R Description - Logical X-OR content of register R with accumulator A and store the result in accumulator A. Operation - A X-OR R ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - XRA E Before Execution After Execution R= E = 41H R= E = 41H A = 35H A = 74H E = 41H 0100 0001 A = 35H 0011 0101 0111 0100 X-OR Operation
  • 5. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 5 8. XRA M Description - Logical X-OR content of memory location M with accumulator A and store the result in accumulator A. Operation - A X-OR M ----> A OR A X-OR (HL) ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - XRA M Before Execution After Execution M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H A = 35H A = 74H Note: - X-OR operation is performed same as XRA R. 9. XRI data Description - Logical X-OR immediate data with accumulator A and store the result in accumulator A. Operation - A X-OR data ----> A No. of Bytes- 2 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - XRI 41H Before Execution After Execution data = 41H data = 41H A = 35H A = 74H Note: - X-OR operation is performed same as XRA R.
  • 6. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 6 10. CMA Description - Complement accumulator A and store the result in accumulator A. Operation - A̅ ----> A No. of Bytes- 1 Flags - No flags are modified. Example - CMA Before Execution After Execution A = 35H A = CA H A = 35H = 0011 0101 A̅ = CA H = 1100 1010 11.CMC Description - Complement the carry flag. Operation - CY̅̅̅̅----> CY No. of Bytes- 1 Flags - Only carry flag is complemented. No other flags are modified. Example - CMC Before Execution After Execution (i) CY = Set CY = Reset (ii) CY = Reset CY = Set 12.STC Description - Set the carry flag. Operation - CY = Set No. of Bytes- 1 Flags - Only carry flag is complemented. No other flags are modified. Example - STC Before Execution After Execution (i) CY = Set CY = Set (ii) CY = Reset CY = Set
  • 7. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 7 13.CMP R Description - Compare content of register R with accumulator A. The contents of register R and accumulator A are not altered. Operation - A compare R----> Flag Register No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation and Z, CY are used to indicate the result of comparison. (i) A > R: CY is Reset and Zero flag is Reset. (ii) A = R: Zero flag is set. (iii) A < R: CY flag is set. Example - CMP D Before Execution After Execution (i) A = 35H A > D D = 25H A = 35H = 0011 0101 D = 25H = 0010 0101 2’s complement of 25H -----> 1101 1011 A = 35H = 0011 0101 2’s complement of 25H -----> + 1101 1011 1 0001 0000 Carry is generated so CY = set, microprocessor complement this carry so CY = reset and also zero flag is reset, which represent that the A is greater than D. (ii) A = 35H A = D D = 35H A = 35H = 0011 0101 D = 35H = 0011 0101 2’s complement of 35H -----> 1100 1011 A = 35H = 0011 0101 2’s complement of 35H -----> + 1100 1011 1 0000 0000 Carry is generated so CY = set, microprocessor complement this carry so CY = reset and zero flag is set, which represent that the A is equal to D.
  • 8. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 8 (iii) A = 25H A < D D = 35H A = 25H = 0010 0101 D = 35H = 0011 0101 2’s complement of 35H -----> 1100 1011 A = 25H = 0010 0101 2’s complement of 35H -----> + 1100 1011 1111 0000 No carry generated so CY = reset, microprocessor complement this carry so CY = set, which represent that the A is less than D. 14.CMP M Description - Compare content of memory location M with accumulator A. The contents of memory location M and accumulator A are not altered. Operation - A compare M----> Flag Register OR A compare (HL)----> Flag Register No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation and Z, CY are used to indicate the result of comparison. (i) A > M: CY is Reset and Zero flag is Reset. (ii) A = M: Zero flag is set. (iii) A < M: CY flag is set. Example - CMP M Before Execution After Execution A = 35H A > M M = (HL) = (1000) = 25H A = 35H = 0011 0101 M = (HL) = (1000) = 25H = 0010 0101 2’s complement of 25H -----> 1101 1011
  • 9. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 9 A = 35H = 0011 0101 2’s complement of 25H -----> + 1101 1011 1 0001 0000 Carry is generated so CY = set, microprocessor complement this carry so CY = reset and also zero flag is reset, which represent that the A is greater than M. Note: - Other comparison examples (A=M & A<M) are same as CMP R. 15.CPI data Description - Compare immediate data with accumulator A. The immediate and accumulator A are not altered. Operation - A compare data----> Flag Register No. of Bytes- 2 Flags - S, Z and P are modified to reflect the result of operation and Z, CY are used to indicate the result of comparison. (i) A > data: CY is Reset and Zero flag is Reset. (ii) A = data: Zero flag is set. (iii) A < data: CY flag is set. Example - CPI 25H Before Execution After Execution A = 35H A > data data = 25H A = 35H = 0011 0101 data = 25H = 0010 0101 2’s complement of 25H -----> 1101 1011 A = 35H = 0011 0101 2’s complement of 25H -----> + 1101 1011 1 0001 0000 Carry is generated so CY = set, microprocessor complement this carry so CY = reset and also zero flag is reset, which represent that the A is greater than immediate data. Note: - Other comparison examples (A=data & A<data) are same as CMP R.
  • 10. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 10 16. RLC Description - Rotate accumulator A left by 1 bit. Operation - Accumulator: Dn Dn+1 (n=0 to 6) D7 D0 D7 CY No. of Bytes- 1 Flags - Only carry flag is modified. No other flags are modified. Example - RLC Before Execution After Execution A = 48H A = 90H CY = 0 Value D7 D6 D5 D4 D3 D2 D1 D0 A = 48H 0 1 0 0 1 0 0 0 A = 91H 1 0 0 1 0 0 0 0 17. RRC Description - Rotate accumulator A right by 1 bit. Operation - Accumulator: Dn+1 Dn (n=0 to 6) D0 D7 D0 CY No. of Bytes- 1 Flags - Only carry flag is modified. No other flags are modified. Example - RRC D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 CY CY = 0 CY
  • 11. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 11 Before Execution After Execution A = 48H A = 24H CY = 0 Value D7 D6 D5 D4 D3 D2 D1 D0 A = 48H 0 1 0 0 1 0 0 0 A = 24H 0 0 1 0 0 1 0 0 18. RAL Description - Rotate accumulator A left through carry by 1 bit. Operation - Accumulator: Dn Dn+1 (n=0 to 6) D7 CY CY D0 No. of Bytes- 1 Flags - Only carry flag is modified. No other flags are modified. Example - RAL Before Execution After Execution A = 58H A = B1H CY = 1 CY = 0 Value D7 D6 D5 D4 D3 D2 D1 D0 A = 58H 0 1 0 1 1 0 0 0 A = B1H 1 0 1 1 0 0 0 1 CY=1 New Value Previous Value D7 D6 D5 D4 D3 D2 D1 D0 CY = 0 CY CY = 0
  • 12. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 12 19. RAR Description - Rotate accumulator A right through carry by 1 bit. Operation - Accumulator: Dn+1 Dn (n=0 to 6) D0 CY CY D7 No. of Bytes- 1 Flags - Only carry flag is modified. No other flags are modified. Example - RAR Before Execution After Execution A = 59H A = 2C H CY = 0 CY = 1 Value D7 D6 D5 D4 D3 D2 D1 D0 A = 59H 0 1 0 1 1 0 0 1 A = 2C H 0 0 1 0 1 1 0 0 CY=0 Previous Value New Value D7 D6 D5 D4 D3 D2 D1 D0 CY CY = 1