SlideShare a Scribd company logo
5
Most read
9
Most read
12
Most read
B.RAMA PRABHA
ASSISTANT PROFESSOR,
DEPARTMENT OF COMPUTER SCIENCE,
K.C.S.KASI NADAR COLLEGE OF ARTS & SCIENCE,
CHENNAI-21
LOGICAL OPERATIONS
A Microprocessor is a programmable logic chip.it
can perform all logic functions of the hard wired
logic through its instruction set.The 8085 instruction
set includes such logic function such as
AND,OR,EX-OR,COMPLEMENT.
2
LOGICAL OPERATIONS
The opcode of the logical functions are as follows.
 AND – AND (Logical AND with a content of Register)
 ANI – AND IMMEDIATE (Logical AND 8-bit data)
 ORA – OR (Logical OR with a content of Register)
 ORI – OR IMMEDIATE(Logical OR 8-bit data)
 XRA – X-OR(Logical X-OR with a content of Register)
 XRI – X-OR IMMEDIATE(Logical X-OR 8-bit data)
3
AND Logic Instructions
ANA(LOGICAL AND)
 This is a one byte instruction
 The contents of a register or any memory location are logically
ANDed with the contents stored in the accumulator register. The
resulting answer is saved in the accumulator.
Example : ANA B , ANA 2000H
4
The Opcode The Operands Description
ANA
R Logical AND the register with accumulator
M
Logical AND the contents pointed by the memory
address pointed by the HL pair (M) with the contents
of the accumulator
ANI (AND IMMEDIATE)
 This is a two byte instruction
 The ANI instruction works exactly like the ANA instruction but
performs logical AND of 8-bit immediate value with the contents of
the accumulator register..
Example : ANI 04H 5
The Opcode The Operands Description
ANI 8-bit immediate data Logically AND immediate data with accumulator
OR Logic Instructions
ORA(LOGICAL OR)
 This is a one byte instruction
 The contents of a register or any memory location are logically
ORed with the contents stored in the accumulator register. The
resulting answer is saved in the accumulator.
Example : ORA B ,ORA 7580H
6
The Opcode The Operands Description
ORA
R Logical OR the register with accumulator
M
Logical OR the contents of the memory location
pointed by the HL pair (M) with the contents of the
accumulator
OR Logic Instructions
ORI(LOGICAL OR WITH DATA)
 This is a two byte instruction
 The ORI instruction works exactly like the ORA instruction but
performs logical OR of 8-bit immediate value with the contents of
the accumulator register.
Example : ORI 44H 7
The Opcode The Operands Description
ORI 8-bit immediate data Logically OR immediate data with accumulator
XRA (LOGICALLY OR WITH REGISTER OR MEMORY LOCATION)
 This is a one byte instruction
 The contents of a register or any memory location are logically
XORed with the contents stored in the accumulator register. The
resulting answer is saved in the accumulator. If the operand
happens to be a memory location, then its address is mentioned by
the contents of the H-L pair.
Example : XRA B ,XRA 7580H
8
The Opcode The Operands Description
XRA
R Logical XOR the register with accumulator
M
Logical XOR the contents of the memory address
pointed by the HL pair (M) with the contents of the
accumulator
XRI(LOGICALLY OR WITH DATA)
 This is a two byte instruction
 The XRI instruction works exactly like the XRA instruction but
performs logical XOR of 8-bit immediate value with the contents of
the accumulator register
Example : XRI 44H
9
The Opcode The Operands Description
XRI 8-bit immediate data Logically XOR immediate data with accumulator
Rotate Instructions
RLC(ROTATE ACCUMULATOR LEFT)
 This is a ONE byte instruction
 The RLC instruction causes each binary bit in the accumulator register to be rotated by one
position to its left. The MSB value is shifted to the LSB as well as the Carry Flag in the
PSW. The other PSW bits, such as S, Z, P, or AC, are not affected by this
operation.Example : RLC
10
The Opcode The Operands Description
RLC None Rotate Accumulator Left
Rotate Instructions
RRC(ROTATE ACCUMULATOR RIGHT)
 This is a ONE byte instruction
 The RRC instruction causes each binary bit in the accumulator register to be rotated by one
position to its right. The LSB value is shifted to the MSB as well as the Carry Flag in the
PSW. The other PSW bits, such as S, Z, P, or AC, are not affected by this
operation.Example : RRC
11
The Opcode The Operands Description
RRC None Rotate Accumulator Right
Rotate Instructions
RAL(ROTATE ACCUMULATOR LEFT WITH CARRY)
 This is a ONE byte instruction
 The RAL instruction causes each binary bit in the accumulator register to be rotated by one
position to its left through the carry flag as well. The MSB value is shifted to the Carry
Flag, and the Carry Flag in the PSW is shifted to the LSB.Example : RAL
12
The Opcode The Operands Description
RAL None Rotate Accumulator Left including the Carry
Rotate Instructions
RAL(ROTATE ACCUMULATOR LEFT)
 This is a ONE byte instruction
 The RAL instruction causes each binary bit in the accumulator register to be rotated by one
position to its left through the carry flag as well. The MSB value is shifted to the Carry
Flag, and the Carry Flag in the PSW is shifted to the LSB.Example : RAL
13
The Opcode The Operands Description
RAL None Rotate Accumulator Left including the Carry
Complement Instructions
CMA(COMPLEMENT ACCUMULATOR)
 This is a ONE byte instruction
 The CMA instruction complements the Content of the accumulator. No flags are affected.
 Example : CMA
14
The Opcode The Operands Description
CMA None Complement Accumulator
Complement Instructions
CMC(COMPLEMENT CARRY FLAG)
 This is a ONE byte instruction
 The CMC instruction complements the Carry Flag bit. The other PSW bits, such as S, Z, P,
or AC, are not affected by this operation.
Example : CMC
15
The Opcode The Operands Description
CMC None Complement Carry Flag
Set Instruction
STC(SET CARRY FLAG)
 This is a ONE byte instruction
 The STC instruction sets the Carry Flag bit to 1. The other PSW bits, such as S, Z, P, or
AC, are not affected by this operation
Example : STC
16
The Opcode The Operands Description
STC None Set Carry Flag
“
17

More Related Content

PPTX
Key board interfacing with 8051
PPTX
Computer instruction
PPTX
Instruction set of 8085 microprocessor
PPTX
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
PPTX
8085 DATA TRANSFER INSTRUCTIONS
PPTX
Interrupts of microprocessor 8085
PPT
Logical instruction of 8085
Key board interfacing with 8051
Computer instruction
Instruction set of 8085 microprocessor
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
8085 DATA TRANSFER INSTRUCTIONS
Interrupts of microprocessor 8085
Logical instruction of 8085

What's hot (20)

PDF
Programmable Peripheral Interface 8255
PDF
8085 arithmetic instructions
PPTX
General register organization (computer organization)
PDF
Memory interfacing of microprocessor 8085
PPTX
Arithmetic and logical instructions
PPT
PPTX
Flags registers
PDF
8085 branching instruction
PPTX
Register organization, stack
PDF
Cache replacement policies,cache miss,writingtechniques
PPT
Programming with 8085
PPT
Interfacing 8255
PPTX
Programmable peripheral interface 8255
PPTX
8254 Programmable Interval Timer by vijay
PPT
carry look ahead adder
PPTX
Instruction Set of 8086 Microprocessor
PDF
JK flip flops
PPTX
Stack and subroutine
PPT
8085 microproceesor ppt
PPTX
Introduction to 8085 microprocessor
Programmable Peripheral Interface 8255
8085 arithmetic instructions
General register organization (computer organization)
Memory interfacing of microprocessor 8085
Arithmetic and logical instructions
Flags registers
8085 branching instruction
Register organization, stack
Cache replacement policies,cache miss,writingtechniques
Programming with 8085
Interfacing 8255
Programmable peripheral interface 8255
8254 Programmable Interval Timer by vijay
carry look ahead adder
Instruction Set of 8086 Microprocessor
JK flip flops
Stack and subroutine
8085 microproceesor ppt
Introduction to 8085 microprocessor
Ad

Similar to LOGICAL OPERATIONS IN 8085 MICROPROCESSOR (20)

PPT
Logical instruction of 8085
PPTX
Lecture 04 Logical Group of Instructions
PDF
itft-Instruction set-of-8085
PPTX
Chap3 8086 logical
PPTX
Chapter3 8086inst logical 2
PPTX
8086inst logical
POTX
8085 instructions
PPTX
instructions of 8085 Microprocessor
PPT
Unit 2 8085 instruction set ppt
PPT
8085-instruction-set.ppt
PPTX
Copy of 8086inst logical
PPT
Copy of 8086inst logical
PPT
8085 instruction-set
PPTX
Types of instruction in 8085 microprocessor
PPT
8085 instruction set
PDF
Unit 2 Instruction set.pdf
PPTX
Instruction set 8085
PPT
8085-instruction-set.ppt
PPT
8085-instruction-set.ppt
PPTX
kc.digital.pptx
Logical instruction of 8085
Lecture 04 Logical Group of Instructions
itft-Instruction set-of-8085
Chap3 8086 logical
Chapter3 8086inst logical 2
8086inst logical
8085 instructions
instructions of 8085 Microprocessor
Unit 2 8085 instruction set ppt
8085-instruction-set.ppt
Copy of 8086inst logical
Copy of 8086inst logical
8085 instruction-set
Types of instruction in 8085 microprocessor
8085 instruction set
Unit 2 Instruction set.pdf
Instruction set 8085
8085-instruction-set.ppt
8085-instruction-set.ppt
kc.digital.pptx
Ad

More from RamaPrabha24 (10)

PPTX
Dynamic debugging in 8085 microprocessor
PPTX
programming techniques
PPTX
instruction format and addressing modes
PPTX
instruction set and classificaion
PPTX
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
PPTX
PINDIAGRAM OF 8085 MICROPROCESSOR
PPT
memory classification
PPTX
Introduction to microprocessor
PPTX
Basic terms used in microprocessor
PPTX
Applets in Java
Dynamic debugging in 8085 microprocessor
programming techniques
instruction format and addressing modes
instruction set and classificaion
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
PINDIAGRAM OF 8085 MICROPROCESSOR
memory classification
Introduction to microprocessor
Basic terms used in microprocessor
Applets in Java

Recently uploaded (20)

PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
PPT on Performance Review to get promotions
PDF
Well-logging-methods_new................
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
OOP with Java - Java Introduction (Basics)
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Lecture Notes Electrical Wiring System Components
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Structs to JSON How Go Powers REST APIs.pdf
Lesson 3_Tessellation.pptx finite Mathematics
Embodied AI: Ushering in the Next Era of Intelligent Systems
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
bas. eng. economics group 4 presentation 1.pptx
PPT on Performance Review to get promotions
Well-logging-methods_new................
Foundation to blockchain - A guide to Blockchain Tech
UNIT 4 Total Quality Management .pptx
Internet of Things (IOT) - A guide to understanding
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
OOP with Java - Java Introduction (Basics)
Mechanical Engineering MATERIALS Selection
Lecture Notes Electrical Wiring System Components
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Arduino robotics embedded978-1-4302-3184-4.pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx

LOGICAL OPERATIONS IN 8085 MICROPROCESSOR

  • 1. B.RAMA PRABHA ASSISTANT PROFESSOR, DEPARTMENT OF COMPUTER SCIENCE, K.C.S.KASI NADAR COLLEGE OF ARTS & SCIENCE, CHENNAI-21
  • 2. LOGICAL OPERATIONS A Microprocessor is a programmable logic chip.it can perform all logic functions of the hard wired logic through its instruction set.The 8085 instruction set includes such logic function such as AND,OR,EX-OR,COMPLEMENT. 2
  • 3. LOGICAL OPERATIONS The opcode of the logical functions are as follows.  AND – AND (Logical AND with a content of Register)  ANI – AND IMMEDIATE (Logical AND 8-bit data)  ORA – OR (Logical OR with a content of Register)  ORI – OR IMMEDIATE(Logical OR 8-bit data)  XRA – X-OR(Logical X-OR with a content of Register)  XRI – X-OR IMMEDIATE(Logical X-OR 8-bit data) 3
  • 4. AND Logic Instructions ANA(LOGICAL AND)  This is a one byte instruction  The contents of a register or any memory location are logically ANDed with the contents stored in the accumulator register. The resulting answer is saved in the accumulator. Example : ANA B , ANA 2000H 4 The Opcode The Operands Description ANA R Logical AND the register with accumulator M Logical AND the contents pointed by the memory address pointed by the HL pair (M) with the contents of the accumulator
  • 5. ANI (AND IMMEDIATE)  This is a two byte instruction  The ANI instruction works exactly like the ANA instruction but performs logical AND of 8-bit immediate value with the contents of the accumulator register.. Example : ANI 04H 5 The Opcode The Operands Description ANI 8-bit immediate data Logically AND immediate data with accumulator
  • 6. OR Logic Instructions ORA(LOGICAL OR)  This is a one byte instruction  The contents of a register or any memory location are logically ORed with the contents stored in the accumulator register. The resulting answer is saved in the accumulator. Example : ORA B ,ORA 7580H 6 The Opcode The Operands Description ORA R Logical OR the register with accumulator M Logical OR the contents of the memory location pointed by the HL pair (M) with the contents of the accumulator
  • 7. OR Logic Instructions ORI(LOGICAL OR WITH DATA)  This is a two byte instruction  The ORI instruction works exactly like the ORA instruction but performs logical OR of 8-bit immediate value with the contents of the accumulator register. Example : ORI 44H 7 The Opcode The Operands Description ORI 8-bit immediate data Logically OR immediate data with accumulator
  • 8. XRA (LOGICALLY OR WITH REGISTER OR MEMORY LOCATION)  This is a one byte instruction  The contents of a register or any memory location are logically XORed with the contents stored in the accumulator register. The resulting answer is saved in the accumulator. If the operand happens to be a memory location, then its address is mentioned by the contents of the H-L pair. Example : XRA B ,XRA 7580H 8 The Opcode The Operands Description XRA R Logical XOR the register with accumulator M Logical XOR the contents of the memory address pointed by the HL pair (M) with the contents of the accumulator
  • 9. XRI(LOGICALLY OR WITH DATA)  This is a two byte instruction  The XRI instruction works exactly like the XRA instruction but performs logical XOR of 8-bit immediate value with the contents of the accumulator register Example : XRI 44H 9 The Opcode The Operands Description XRI 8-bit immediate data Logically XOR immediate data with accumulator
  • 10. Rotate Instructions RLC(ROTATE ACCUMULATOR LEFT)  This is a ONE byte instruction  The RLC instruction causes each binary bit in the accumulator register to be rotated by one position to its left. The MSB value is shifted to the LSB as well as the Carry Flag in the PSW. The other PSW bits, such as S, Z, P, or AC, are not affected by this operation.Example : RLC 10 The Opcode The Operands Description RLC None Rotate Accumulator Left
  • 11. Rotate Instructions RRC(ROTATE ACCUMULATOR RIGHT)  This is a ONE byte instruction  The RRC instruction causes each binary bit in the accumulator register to be rotated by one position to its right. The LSB value is shifted to the MSB as well as the Carry Flag in the PSW. The other PSW bits, such as S, Z, P, or AC, are not affected by this operation.Example : RRC 11 The Opcode The Operands Description RRC None Rotate Accumulator Right
  • 12. Rotate Instructions RAL(ROTATE ACCUMULATOR LEFT WITH CARRY)  This is a ONE byte instruction  The RAL instruction causes each binary bit in the accumulator register to be rotated by one position to its left through the carry flag as well. The MSB value is shifted to the Carry Flag, and the Carry Flag in the PSW is shifted to the LSB.Example : RAL 12 The Opcode The Operands Description RAL None Rotate Accumulator Left including the Carry
  • 13. Rotate Instructions RAL(ROTATE ACCUMULATOR LEFT)  This is a ONE byte instruction  The RAL instruction causes each binary bit in the accumulator register to be rotated by one position to its left through the carry flag as well. The MSB value is shifted to the Carry Flag, and the Carry Flag in the PSW is shifted to the LSB.Example : RAL 13 The Opcode The Operands Description RAL None Rotate Accumulator Left including the Carry
  • 14. Complement Instructions CMA(COMPLEMENT ACCUMULATOR)  This is a ONE byte instruction  The CMA instruction complements the Content of the accumulator. No flags are affected.  Example : CMA 14 The Opcode The Operands Description CMA None Complement Accumulator
  • 15. Complement Instructions CMC(COMPLEMENT CARRY FLAG)  This is a ONE byte instruction  The CMC instruction complements the Carry Flag bit. The other PSW bits, such as S, Z, P, or AC, are not affected by this operation. Example : CMC 15 The Opcode The Operands Description CMC None Complement Carry Flag
  • 16. Set Instruction STC(SET CARRY FLAG)  This is a ONE byte instruction  The STC instruction sets the Carry Flag bit to 1. The other PSW bits, such as S, Z, P, or AC, are not affected by this operation Example : STC 16 The Opcode The Operands Description STC None Set Carry Flag