Skip to content
The Computer Science
TheCScience
  • Engineering Subjects
    • Human Values
    • Computer System Architecture
    • Microprocessor
    • Digital Communication
    • Internet of Things
  • NCERT Solutions
    • Class 12
    • Class 11
  • Solutions
    • HackerRank
      • C Solutions
      • C++ Solutions
      • Java Solutions
      • Python Solutions
      • Algorithms Solutions
      • Data Structures Solutions
    • HackerEarth Solutions
    • Leetcode Solutions
  • JEE 2027
The Computer Science
TheCScience

8085 Microprocessor Logical Instructions

YASH PAL, March 18, 2026April 25, 2026

8085 Microprocessor Logical Instructions – Logic instructions perform logic operations such as AND, OR, Exclusive-OR, NOT, rotate, and compare on the data of registers, memory locations, and immediate data. All logical instructions have one operand in the accumulator. The result is also stored in the accumulator.

Table of Contents

  • Logical Instructions of 8085 Microprocessor
    • ANDing Operations
    • ORing Operations
    • Ex-ORing Operations
    • Complement Operation
    • Compare Operations
    • Rotate Operations

Logical Instructions of 8085 Microprocessor

  1. ANDing Operations
  2. ORing Operations
  3. Ex-ORing Operations
  4. Complement Operation
  5. Compare Operations
  6. Rotate Operations

ANDing Operations

ANA RLogically AND the contents of the accumulator with the contents of register R.
OperationA ← A AND R
Length1 byte
Addressing modeRegister addressing mode
FlagsAll flags are affected with CY = 0 and AC = 1.
ANA MLogically AND the contents of the accumulator with the contents of the memory location pointed by register pair HL.
OperationA ← A AND [HL]
Length1 byte
Addressing modeIndirect addressing mode
FlagsAll flags are affected with CY = 0 and AC = 1.
ANI data (8 bit)Logically AND the 8-bit immediate data with the contents of the accumulator.
OperationA AND data
Length2 byte
Addressing modeImmediate addressing mode
FlagsAll flags are affected with CY = 0 and AC = 1.

ORing Operations

ORA RLogically OR the contents of the accumulator with the contents of register R.
OperationA ← A OR R
Length1 byte
Addressing modeRegister addressing mode
FlagsAll flags are affected according to the result with CY = 0 and AC = 1.
ORA MLogically OR the contents of the accumulator with the contents of the memory location pointed by register pair HL.
OperationA ← A OR [HL]
Length1 byte
Addressing modeIndirect addressing mode
FlagsAll flags are affected according to the result with CY = 0 and AC = 1.
ORI data (8-bit)Logically OR the contents of the accumulator with the immediate 8-bit data.
OperationA ← A OR data
Length2 byte
Addressing modeImmediate addressing mode
FlagsAll flags are affected according to the result with CY = 0 and AC = 1.

Ex-ORing Operations

XRA RLogically EX-OR the contents of register R with the accumulator contents. The result is stored in the accumulator.
OperationA ← A ExOR R
Length1 byte
Addressing modeRegister addressing mode
FlagsAll flags are affected according to the result with CY = 0 and AC = 1.
XRA MLogically EX-OR the contents of the memory location pointed by the HL register pair with the accumulator contents. The result is stored in the accumulator.
OperationA ← A ExOR [HL]
Length1 byte
Addressing modeIndirect addressing mode
FlagsAll flags are affected according to the result with CY = 0 and AC = 1.
XRI data (8-bit)Logically EX-OR the 8-bit immediate data with the accumulator contents and store the result in the accumulator.
OperationA ← A ExOR data
Length2 byte
Addressing modeImmediate addressing mode
FlagsAll flags are affected according to the result with CY = 0 and AC = 1.

Complement Operation

CMAComplement the contents of the accumulator.
OperationA ← A
Length1 byte
Addressing modeImplicit addressing mode
FlagsNo flag is affected.

Compare Operations

CMP RCompare (subtract) the contents of register R with the contents of the accumulator. The result of the subtraction operation is not stored.
OperationA – R
Length1 byte
Addressing modeRegister addressing mode
FlagsAll flags are affected according to the result. The result of the comparison can be obtained with the help of flags as follows:
A > R if CY = 0, Z = 0
A = R if CY = 0, Z = 1
A < R if CY = 1, Z = 0
CMP MCompare (subtract) the contents of the memory location pointed by register pair HL with the contents of the accumulator. The result is not stored.
OperationA – [HL]
Length1 byte
Addressing modeIndirect addressing mode
FlagsAll flags are affected according to the result. The result of the comparison can be obtained with the help of flags as follows:
A > M if CY = 0, Z = 0
A = M if CY = 0, Z = 1
A < M if CY = 1, Z = 0
CPI data (8 bit)Compare (subtract) the immediate data with the contents of the accumulator. The result is not stored.
OperationA – data
Length2 byte
Addressing modeImmediate addressing mode
FlagsAll flags are affected according to the result. The result of the comparison can be obtained with the help of flags as follows:
A > data if CY = 0, Z = 0
A = data if CY = 0, Z = 1
A < data if CY = 1, Z = 0

Rotate Operations

RLC rotate operation
Figure 1: RLC operation
RLCRotate the accumulator left without carry
OperationAs shown in the above image
Length1 byte
Addressing modeImplicit addressing mode
FlagsOnly the CY flag is affected according to the most significant bit (D7).
RAL rotate operation
Figure 2: RAL Operation
RALRotate the accumulator left with carry
OperationAs shown in the above image
Length1 byte
Addressing modeImplicit addressing mode
FlagsOnly the CY flag is affected according to the most significant bit (D7).
RRC rotate operation
Figure 3: RRC Operation
RRCRotate the accumulator right without carry
OperationAs shown in the above image
Length1 byte
Addressing modeImplicit addressing mode
FlagsOnly the CY flag is affected according to the most significant bit (D0).
RAR rotate operation
Figure 4: RAR Operation
RRCRotate the accumulator right with carry
OperationAs shown in the above image
Length1 byte
Addressing modeImplicit addressing mode
FlagsOnly the CY flag is affected according to the least significant bit (D0).

Note: The rotate instructions are primarily used in arithmetic multiply and divide operations and for serial data transfer.


Microprocessor Subject Tutorials & Notes | Beginners Guide
engineering subjects Microprocessor microprocessor

Post navigation

Previous post
Next post

Introduction to Microprocessor
Generations of Computer
Microprocessor Types
Types of Computer Systems
Types of Programming Languages
Basic Computer Structure
Interfacing Logic Devices
Number System in Computer
Number System Arithmetic – Addition & Subtraction

Microprocessor as CPU
8085 Microprocessor Architecture
Pin Configuration of 8085 Microprocessor
Demultiplexing of Address and Data Bus in 8085 Microprocessor
Basic Operations of the 8085 Microprocessor
Memory Organization in 8085 Microprocessor

Microprocessor memory structure
Memory Interfacing with 8085 Microprocessor
Memory address decoding in a microprocessor
Input/Output Interfacing in Microprocessor

8085 Microprocessor Programming Model
8085 Assembly Language Programming
8085 Microprocessor Instructions
Microprocessor Programming Steps
Flowchart Design of a Program
8085 Microprocessor Data Transfer Instructions
8085 Microprocessor Arithmetic Instructions
8085 Microprocessor Logical Instructions
8085 Microprocessor Branch Instructions
8085 Microprocessor Machine-Processor Control Instructions
Basic Structure of an Assembly Language Program
Programming Techniques for Repeated Tasks
Debugging of a Microprocessor Program

8085 Microprocessor Timing Operations
Timing Diagram of 8085 Microprocessor
Time Delay in Microprocessor
Stack in 8085 Microprocessor
Subroutine in 8085 Microprocessor
MACRO in Microprocessor

Interrupts in 8085 Microprocessor
Digital to Analog Converter (DAC) in Microprocessor
Analog to Digital Converter (ADC) in Microprocessor

Programmable Peripheral Interface
8255 (PPI) Programmable Peripheral Interface
Programmable Interval Timer (PIT) 8253/8254
Programmable Interrupt Controller (PIC) 8259
Direct Memory Access (DMA) Controller 8257

8086 Microprocessor Architecture, Instructions, and Pin Diagram
Addressing Modes of the 8086 Microprocessor
Instruction Set of 8086 Microprocessor
8088 Microprocessor Architecture with Pin Diagram
Difference between 8085, 8086, and 8088 Microprocessors
80186 Microprocessor Architecture
80286 Microprocessor Architecture & Features
80386 Microprocessor Architecture & Features
80486 Microprocessor Architecture & Features
80586 (Pentium) Microprocessor Architecture & Features

8051 Microcontroller Architecture
8051 Microcontroller Memory Organization
8051 Microcontroller Pin Configuration & Programming Model
8051 Microcontroller Timers and Counters
Serial Communication in 8051 Microcontroller
Interrupts of the 8051 Microcontroller
Addressing Modes of the 8051 Microcontroller
Intel MMX Architecture
Dual Core Processor

LED & Multiplexed Display Interfacing with Microprocessor
Liquid Crystal Display (LCD) Pin Configuration & Interfacing
Matrix Keyboard Interfacing with Microprocessor
8279 Keyboard/Display Controller
Programmable Communication Interface (USART) 8251
Serial Communication Standards in Microprocessor
Computer System Standard Buses

TheCScience

At TheCScience.com, our mission is to make quality education accessible to everyone. We provide in-depth, easy-to-understand articles covering Secondary, Senior Secondary, and Graduation-level subjects.

Our content is designed to simplify complex concepts through clear explanations, diagrams, and structured learning—helping students build strong fundamentals and succeed academically without financial barriers.

Pages

About US

Contact US

Privacy Policy

DMCA

Our Tools

Hosting - get 20% off

Engineering Subjects

Internet of Things

Human Values

Digital Communication

Computer System Architecture

Microprocessor

Programming Tutorials

Data Structure and Algorithm

C

Java

NCERT

Class 12th

©2026 TheCScience | WordPress Theme by SuperbThemes