SlideShare a Scribd company logo
Birla Vishwakarma Mahavidyalaya
ET Department
Arithmetic Instructions and
Logical Instructions
Under the Guidance :
Prof. Bhargav Goradiya,
H.O.D. ,ET department,BVM
Name E. No.
Vatsal Bodiwala 140083112002
Ashit Patel 140083112010
Jigar Sindha 140083112017
Vipul Thakor 140083112019
Rohit Vadgama 140083112020
 Addition
 Subtract
 Increment
 Decrement
 Any 8-bit number, or the contents of register,
or the contents of memory location can be
added to the contents of accumulator.
 The result (sum) is stored in the accumulator.
 No two other 8-bit registers can be added
directly.
 If the operand is memory location, its address
is specified by H-L pair.
Opcode Operand Description
ADD R
M
Add content of register or memory to
accumulator
Example: ADD B or ADD M
Example: ADC B or ADC M
Opcode Operand Description
ADC R
M
Add register or memory to
accumulator with
carry
Opcode Operand Description
ADI 8-Bit Data Add immediate to accumulator
Opcode Operand Description
ACI 8-Bit data The 8-bit data and the Carry Flag
(CY) are added to the
contents of accumulator.
Example: ADI 45 H
Example: ACI 45 H
Opcode Operand Description
DAD Register pair Add register pair to H-L pair
 The 16-bit contents of the register pair are
added to the contents of H-L pair.
 The result is stored in H-L pair.
 If the result is larger than 16 bits, then CY is
set.
 Example: DAD B
 Any 8-bit number, or the contents of register, or the
contents of memory location can be subtracted from the
contents of accumulator.
 The result is stored in the accumulator.
 Subtraction is performed in 2’s complement form.
 If the result is negative, it is stored in 2’s complement
form.
 No two other 8-bit registers can be subtracted directly.
 If the operand is memory location, its address is
specified by H-L pair.
Opcode Operand Description
SUB R
M
The contents of the register or
memory location are subtracted from
the contents of the accumulator.
Example: SUB B or SUB M
Opcode Operand Description
SBB R
M
The contents of the register or
memory location and Borrow Flag are
subtracted from the contents of the
accumulator.
Example: SBB B or SBB M
Opcode Operand Description
SUI 8-bit data The 8-bit data is subtracted from the
contents of the accumulator.
Example: SUI 5 H
Opcode Operand Description
SBI 8-bit data The 8-bit data and the Borrow Flag is
subtracted from the contents of the
accumulator.
Example: SBI 5 H
 The 8-bit contents of a register or a memory
location can be incremented or decremented by 1.
 The 16-bit contents of a register pair can be
incremented or decremented by 1.
 Increment or decrement can be performed on any
register or a memory location.
 If the operand is a memory location, its address is
specified by the contents of H-L pair.
Opcode Operand Description
INR R
M
The contents of register or memory
location are
incremented by 1.
Example: INR B or INR M
Opcode Operand Description
INX R The contents of register pair are
incremented by 1.
Example: INX H
Opcode Operand Description
DCR R
M
The contents of register or memory
location are
decremented by 1.
Example: DCR B or DCR M
Opcode Operand Description
DCX R The contents of register pair are
decremented by 1.
Example: DCX H
 These instructions perform various logical operations
with the content of accumulator.
 The logical operations are:
AND
OR
XOR
Rotate
Compare
Complement
 Any 8-bit data, or the contents of register, or
memory location can logically have
AND operation
OR operation
XOR operation
with the contents of accumulator.
 The result is stored in accumulator.
Opcode Operand Description
ANA R
M
Logical AND register or memory with
accumulator
 The contents of the accumulator are logically ANDed with the
contents of register or memory.
 The result is placed in the accumulator.
 If the operand is a memory location, its address is specified by
the contents of H-L pair.
 S, Z, P are modified to reflect the result of the operation.
 CY is reset and AC is set.
 Example: ANA B or ANA M.
Opcode Operand Description
ANI 8-bit data Logical AND immediate with
accumulator
 The contents of the accumulator are logically ANDed
with the 8-bit data.
 The result is placed in the accumulator.
 S, Z, P are modified to reflect the result.
 CY is reset, AC is set.
Example: ANI 86H.
Opcode Operand Description
ORA R
M
Logical OR register or memory with
accumulator
 The contents of the accumulator are logically ORed
with the contents of the register or memory.
 The result is placed in the accumulator.
 If the operand is a memory location, its address is
specified by the contents of H-L pair.
 S, Z, P are modified to reflect the result.
 CY and AC are reset.
Example: ORA B or ORA M.
Opcode Operand Description
ORI 8-bit data Logical OR immediate with
accumulator
The contents of the accumulator are logically ORed
with the 8-bit data.
 The result is placed in the accumulator.
 S, Z, P are modified to reflect the result.
 CY and AC are reset.
Example: ORI 86H.
Opcode Operand Description
XRA R
M
Logical XOR register or memory with
accumulator
The contents of the accumulator are XORed with the
contents of the register or memory.
The result is placed in the accumulator.
If the operand is a memory location, its address is
specified by the contents of H-L pair.
S, Z, P are modified to reflect the result of the
operation.
CY and AC are reset.
Example: XRA B or XRA M.
Opcode Operand Description
XRI 8-bit data XOR immediate with accumulator
The contents of the accumulator are XORed with the
8-bit data.
 The result is placed in the accumulator.
 S, Z, P are modified to reflect the result.
CY and AC are reset.
 Example: XRI 86H.
 Any 8-bit data, or the contents of register, or
memory location can be compares for:
Equality
Greater Than
Less Than
with the contents of accumulator.
 The result is reflected in status flags.
 The contents of the operand (register or
memory) are compared with the contents of
the accumulator.
 Both contents are preserved .
 The result of the comparison is shown by
setting the flags of the PSW as follows:
Opcode Operand Description
CMP R
M
Compare register or memory with
accumulator
 if (A) < (reg/mem): carry flag is set
 if (A) = (reg/mem): zero flag is set
 if (A) > (reg/mem): carry and zero flags are
reset.
Example: CMP B or CMP M
Opcode Operand Description
CMP R
M
Compare register or memory with
accumulator
 The 8-bit data is compared with the
contents of accumulator.
 The result of the comparison is shown by
setting the flags of the PSW as follows:
Opcode Operand Description
CPI 8-bit dat Compare immediate with accumulator
 if (A) < data: carry flag is set
 if (A) = data: zero flag is set
 if (A) > data: carry and zero flags are reset.
Example: CPI 89H
Opcode Operand Description
CPI 8-bit dat Compare immediate with accumulator
 Each bit in the accumulator can be shifted
either left or right to the next position.
Opcode Operand Description
RLC None Rotate accumulator left
Each binary bit of the accumulator is rotated left by one
position.
 Bit D7 is placed in the position of D0 as well
as in the Carry flag.
 CY is modified according to bit D7.
 S, Z, P, AC are not affected.
Example: RLC.
Opcode Operand Description
RRC None Rotate accumulator right
Each binary bit of the accumulator is rotated right by one position.
Bit D0 is placed in the position of D7 as well as in the Carry flag.
CY is modified according to bit D0.
S, Z, P, AC are not affected.
Example: RRC.
Opcode Operand Description
RAL None Rotate accumulator left through carry
Each binary bit of the accumulator is rotated left by one position
through the Carry flag.
 Bit D7 is placed in the Carry flag, and the Carry flag is placed in
the least significant position D0.
CY is modified according to bit D7.
 S, Z, P, AC are not affected.
Example: RAL.
Opcode Operand Description
RAR None Rotate accumulator right through
carry
Each binary bit of the accumulator is rotated right by one position
through the Carry flag.
 Bit D0 is placed in the Carry flag, and the Carry flag is placed in
the most significant position D7.
CY is modified according to bit D0.
S, Z, P, AC are not affected.
Example: RAR.
 The contents of accumulator can be
complemented.
 Each 0 is replaced by 1 and each 1 is replaced
by 0.
Opcode Operand Description
CMA None Complement accumulator
 The contents of the accumulator are complemented.
 No flags are affected.
Example: CMA.
Opcode Operand Description
CMC None Complement carry
 The Carry flag is complemented.
 No other flags are affected.
 Example: CMC.
Opcode Operand Description
STC None Set carry
The Carry flag is set to 1.
 No other flags are affected.
 Example: STC.
Arithmetic and logical instructions

More Related Content

PPT
Logical instruction of 8085
PPTX
Programming the basic computer
PPT
Assembly Language Programming Of 8085
PPT
Types of instructions
PPT
Instruction set-of-8085
PPT
Instruction codes and computer registers
PPT
8085-microprocessor
PPTX
Datapath Design of Computer Architecture
Logical instruction of 8085
Programming the basic computer
Assembly Language Programming Of 8085
Types of instructions
Instruction set-of-8085
Instruction codes and computer registers
8085-microprocessor
Datapath Design of Computer Architecture

What's hot (20)

PPTX
Addressing Modes of 8085 Microprocessor
PPTX
8255 PPI
PPTX
Instruction set of 8085 microprocessor
PDF
8259 Programmable Interrupt Controller
PPTX
Instruction Set Architecture
PPTX
Instruction codes
PPTX
3.programmable interrupt controller 8259
PPTX
General register organization (computer organization)
PPTX
Associative Memory in Computer architecture
PPTX
8085 addressing modes
PPTX
Types of Addressing modes- COA
PPTX
Assembly language
PPTX
8254 Programmable Interval Timer by vijay
PPTX
flag register of 8086
PPT
Registers
PPT
Computer Organization and Architecture.
PPTX
PDF
Computer organization memory
PPT
Interfacing 8255
PPT
Memory & I/O interfacing
Addressing Modes of 8085 Microprocessor
8255 PPI
Instruction set of 8085 microprocessor
8259 Programmable Interrupt Controller
Instruction Set Architecture
Instruction codes
3.programmable interrupt controller 8259
General register organization (computer organization)
Associative Memory in Computer architecture
8085 addressing modes
Types of Addressing modes- COA
Assembly language
8254 Programmable Interval Timer by vijay
flag register of 8086
Registers
Computer Organization and Architecture.
Computer organization memory
Interfacing 8255
Memory & I/O interfacing
Ad

Similar to Arithmetic and logical instructions (20)

PDF
itft-Instruction set-of-8085
PPT
Logical instruction of 8085
PDF
8085 Instructions.pdf
PPT
8085 instruction set
PPTX
Types of instruction in 8085 microprocessor
PPTX
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
PPT
instruction-set-of-8085 (1).ppt
PPT
Instruction set of 8085
PDF
4CS3-MPI-Unit-2.pdf microprocessor and interface
POTX
8085 instructions
PPTX
Instruction set 8085
PPT
Chapter 3 instruction set-of-8085
PDF
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
PDF
8085 instructions
PPTX
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
PPTX
Lecture 04 Logical Group of Instructions
PPT
instruction_set_8051_microcontroller.ppt
PDF
Chapter 6 - Introduction to 8085 Instructions
itft-Instruction set-of-8085
Logical instruction of 8085
8085 Instructions.pdf
8085 instruction set
Types of instruction in 8085 microprocessor
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
instruction-set-of-8085 (1).ppt
Instruction set of 8085
4CS3-MPI-Unit-2.pdf microprocessor and interface
8085 instructions
Instruction set 8085
Chapter 3 instruction set-of-8085
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
8085 instructions
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
Lecture 04 Logical Group of Instructions
instruction_set_8051_microcontroller.ppt
Chapter 6 - Introduction to 8085 Instructions
Ad

More from BIRLA VISHVAKARMA MAHAVIDYALAY (14)

PDF
VLAN ON PACKET TRACER
PDF
VLAN ON PACKET TRACER
PDF
VLAN on packet Tracer
PPTX
Stepper motor interfacing
PPTX
DOCX
Gujarat technological universit1
PPTX
PPTX
DOCX
Automatic room light controller with bidirectional visitor counter
PPT
Automaticroomlightcontroller[1]
VLAN ON PACKET TRACER
VLAN ON PACKET TRACER
VLAN on packet Tracer
Stepper motor interfacing
Gujarat technological universit1
Automatic room light controller with bidirectional visitor counter
Automaticroomlightcontroller[1]

Recently uploaded (20)

PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Sustainable Sites - Green Building Construction
PDF
Digital Logic Computer Design lecture notes
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Welding lecture in detail for understanding
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Geodesy 1.pptx...............................................
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Internet of Things (IOT) - A guide to understanding
Sustainable Sites - Green Building Construction
Digital Logic Computer Design lecture notes
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Arduino robotics embedded978-1-4302-3184-4.pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
bas. eng. economics group 4 presentation 1.pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CH1 Production IntroductoryConcepts.pptx
Welding lecture in detail for understanding
Foundation to blockchain - A guide to Blockchain Tech
Structs to JSON How Go Powers REST APIs.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
UNIT 4 Total Quality Management .pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Geodesy 1.pptx...............................................

Arithmetic and logical instructions

  • 1. Birla Vishwakarma Mahavidyalaya ET Department Arithmetic Instructions and Logical Instructions Under the Guidance : Prof. Bhargav Goradiya, H.O.D. ,ET department,BVM
  • 2. Name E. No. Vatsal Bodiwala 140083112002 Ashit Patel 140083112010 Jigar Sindha 140083112017 Vipul Thakor 140083112019 Rohit Vadgama 140083112020
  • 3.  Addition  Subtract  Increment  Decrement
  • 4.  Any 8-bit number, or the contents of register, or the contents of memory location can be added to the contents of accumulator.  The result (sum) is stored in the accumulator.  No two other 8-bit registers can be added directly.  If the operand is memory location, its address is specified by H-L pair.
  • 5. Opcode Operand Description ADD R M Add content of register or memory to accumulator Example: ADD B or ADD M Example: ADC B or ADC M Opcode Operand Description ADC R M Add register or memory to accumulator with carry
  • 6. Opcode Operand Description ADI 8-Bit Data Add immediate to accumulator Opcode Operand Description ACI 8-Bit data The 8-bit data and the Carry Flag (CY) are added to the contents of accumulator. Example: ADI 45 H Example: ACI 45 H
  • 7. Opcode Operand Description DAD Register pair Add register pair to H-L pair  The 16-bit contents of the register pair are added to the contents of H-L pair.  The result is stored in H-L pair.  If the result is larger than 16 bits, then CY is set.  Example: DAD B
  • 8.  Any 8-bit number, or the contents of register, or the contents of memory location can be subtracted from the contents of accumulator.  The result is stored in the accumulator.  Subtraction is performed in 2’s complement form.  If the result is negative, it is stored in 2’s complement form.  No two other 8-bit registers can be subtracted directly.  If the operand is memory location, its address is specified by H-L pair.
  • 9. Opcode Operand Description SUB R M The contents of the register or memory location are subtracted from the contents of the accumulator. Example: SUB B or SUB M Opcode Operand Description SBB R M The contents of the register or memory location and Borrow Flag are subtracted from the contents of the accumulator. Example: SBB B or SBB M
  • 10. Opcode Operand Description SUI 8-bit data The 8-bit data is subtracted from the contents of the accumulator. Example: SUI 5 H Opcode Operand Description SBI 8-bit data The 8-bit data and the Borrow Flag is subtracted from the contents of the accumulator. Example: SBI 5 H
  • 11.  The 8-bit contents of a register or a memory location can be incremented or decremented by 1.  The 16-bit contents of a register pair can be incremented or decremented by 1.  Increment or decrement can be performed on any register or a memory location.  If the operand is a memory location, its address is specified by the contents of H-L pair.
  • 12. Opcode Operand Description INR R M The contents of register or memory location are incremented by 1. Example: INR B or INR M Opcode Operand Description INX R The contents of register pair are incremented by 1. Example: INX H
  • 13. Opcode Operand Description DCR R M The contents of register or memory location are decremented by 1. Example: DCR B or DCR M Opcode Operand Description DCX R The contents of register pair are decremented by 1. Example: DCX H
  • 14.  These instructions perform various logical operations with the content of accumulator.  The logical operations are: AND OR XOR Rotate Compare Complement
  • 15.  Any 8-bit data, or the contents of register, or memory location can logically have AND operation OR operation XOR operation with the contents of accumulator.  The result is stored in accumulator.
  • 16. Opcode Operand Description ANA R M Logical AND register or memory with accumulator  The contents of the accumulator are logically ANDed with the contents of register or memory.  The result is placed in the accumulator.  If the operand is a memory location, its address is specified by the contents of H-L pair.  S, Z, P are modified to reflect the result of the operation.  CY is reset and AC is set.  Example: ANA B or ANA M.
  • 17. Opcode Operand Description ANI 8-bit data Logical AND immediate with accumulator  The contents of the accumulator are logically ANDed with the 8-bit data.  The result is placed in the accumulator.  S, Z, P are modified to reflect the result.  CY is reset, AC is set. Example: ANI 86H.
  • 18. Opcode Operand Description ORA R M Logical OR register or memory with accumulator  The contents of the accumulator are logically ORed with the contents of the register or memory.  The result is placed in the accumulator.  If the operand is a memory location, its address is specified by the contents of H-L pair.  S, Z, P are modified to reflect the result.  CY and AC are reset. Example: ORA B or ORA M.
  • 19. Opcode Operand Description ORI 8-bit data Logical OR immediate with accumulator The contents of the accumulator are logically ORed with the 8-bit data.  The result is placed in the accumulator.  S, Z, P are modified to reflect the result.  CY and AC are reset. Example: ORI 86H.
  • 20. Opcode Operand Description XRA R M Logical XOR register or memory with accumulator The contents of the accumulator are XORed with the contents of the register or memory. The result is placed in the accumulator. If the operand is a memory location, its address is specified by the contents of H-L pair. S, Z, P are modified to reflect the result of the operation. CY and AC are reset. Example: XRA B or XRA M.
  • 21. Opcode Operand Description XRI 8-bit data XOR immediate with accumulator The contents of the accumulator are XORed with the 8-bit data.  The result is placed in the accumulator.  S, Z, P are modified to reflect the result. CY and AC are reset.  Example: XRI 86H.
  • 22.  Any 8-bit data, or the contents of register, or memory location can be compares for: Equality Greater Than Less Than with the contents of accumulator.  The result is reflected in status flags.
  • 23.  The contents of the operand (register or memory) are compared with the contents of the accumulator.  Both contents are preserved .  The result of the comparison is shown by setting the flags of the PSW as follows: Opcode Operand Description CMP R M Compare register or memory with accumulator
  • 24.  if (A) < (reg/mem): carry flag is set  if (A) = (reg/mem): zero flag is set  if (A) > (reg/mem): carry and zero flags are reset. Example: CMP B or CMP M Opcode Operand Description CMP R M Compare register or memory with accumulator
  • 25.  The 8-bit data is compared with the contents of accumulator.  The result of the comparison is shown by setting the flags of the PSW as follows: Opcode Operand Description CPI 8-bit dat Compare immediate with accumulator
  • 26.  if (A) < data: carry flag is set  if (A) = data: zero flag is set  if (A) > data: carry and zero flags are reset. Example: CPI 89H Opcode Operand Description CPI 8-bit dat Compare immediate with accumulator
  • 27.  Each bit in the accumulator can be shifted either left or right to the next position. Opcode Operand Description RLC None Rotate accumulator left Each binary bit of the accumulator is rotated left by one position.
  • 28.  Bit D7 is placed in the position of D0 as well as in the Carry flag.  CY is modified according to bit D7.  S, Z, P, AC are not affected. Example: RLC.
  • 29. Opcode Operand Description RRC None Rotate accumulator right Each binary bit of the accumulator is rotated right by one position. Bit D0 is placed in the position of D7 as well as in the Carry flag. CY is modified according to bit D0. S, Z, P, AC are not affected. Example: RRC.
  • 30. Opcode Operand Description RAL None Rotate accumulator left through carry Each binary bit of the accumulator is rotated left by one position through the Carry flag.  Bit D7 is placed in the Carry flag, and the Carry flag is placed in the least significant position D0. CY is modified according to bit D7.  S, Z, P, AC are not affected. Example: RAL.
  • 31. Opcode Operand Description RAR None Rotate accumulator right through carry Each binary bit of the accumulator is rotated right by one position through the Carry flag.  Bit D0 is placed in the Carry flag, and the Carry flag is placed in the most significant position D7. CY is modified according to bit D0. S, Z, P, AC are not affected. Example: RAR.
  • 32.  The contents of accumulator can be complemented.  Each 0 is replaced by 1 and each 1 is replaced by 0.
  • 33. Opcode Operand Description CMA None Complement accumulator  The contents of the accumulator are complemented.  No flags are affected. Example: CMA. Opcode Operand Description CMC None Complement carry  The Carry flag is complemented.  No other flags are affected.  Example: CMC.
  • 34. Opcode Operand Description STC None Set carry The Carry flag is set to 1.  No other flags are affected.  Example: STC.