SlideShare a Scribd company logo
1 of 35
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

What's hot

8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer languageSanjeev Patel
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessorAMAN SRIVASTAVA
 
Memory organization (Computer architecture)
Memory organization (Computer architecture)Memory organization (Computer architecture)
Memory organization (Computer architecture)Sandesh Jonchhe
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086saurav kumar
 
Instruction cycle with interrupts
Instruction cycle with interruptsInstruction cycle with interrupts
Instruction cycle with interruptsShubham Jain
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGChapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGFrankie Jones
 
Register organization, stack
Register organization, stackRegister organization, stack
Register organization, stackAsif Iqbal
 
Register Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceRegister Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceTransweb Global Inc
 
Basic Computer Organization and Design
Basic Computer Organization and DesignBasic Computer Organization and Design
Basic Computer Organization and DesignKamal Acharya
 
Input output organization
Input output organizationInput output organization
Input output organizationabdulugc
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInteX Research Lab
 
INTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORINTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORGurudev joshi
 
8085 branching instruction
8085 branching instruction8085 branching instruction
8085 branching instructionprashant1271
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085saleForce
 

What's hot (20)

8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer language
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessor
 
Memory organization (Computer architecture)
Memory organization (Computer architecture)Memory organization (Computer architecture)
Memory organization (Computer architecture)
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
Instruction cycle with interrupts
Instruction cycle with interruptsInstruction cycle with interrupts
Instruction cycle with interrupts
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGChapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
 
Register organization, stack
Register organization, stackRegister organization, stack
Register organization, stack
 
Register Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceRegister Reference Instructions | Computer Science
Register Reference Instructions | Computer Science
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
 
Basic Computer Organization and Design
Basic Computer Organization and DesignBasic Computer Organization and Design
Basic Computer Organization and Design
 
Hardwired control
Hardwired controlHardwired control
Hardwired control
 
Input output organization
Input output organizationInput output organization
Input output organization
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer Architecture
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
 
Latches and flip flops
Latches and flip flopsLatches and flip flops
Latches and flip flops
 
INTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORINTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSOR
 
8085 branching instruction
8085 branching instruction8085 branching instruction
8085 branching instruction
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
 

Similar to Arithmetic and logical instructions

Logical instruction of 8085
Logical instruction of 8085Logical instruction of 8085
Logical instruction of 8085vishalgohel12195
 
Logical instruction of 8085
Logical instruction of 8085 Logical instruction of 8085
Logical instruction of 8085 Nemish Bhojani
 
Instructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIRInstructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIRTHEE CAVE
 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptssuserb448e2
 
itft-Instruction set-of-8085
itft-Instruction set-of-8085itft-Instruction set-of-8085
itft-Instruction set-of-8085Shifali Sharma
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction setJLoknathDora
 
Microprocessor Basics CH-3
Microprocessor Basics CH-3Microprocessor Basics CH-3
Microprocessor Basics CH-3Neelam Kapoor
 
Types of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessorTypes of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessorsamarthpawar9890
 
Mpmc i nstruction_ppt1.6_-_arthamatic_logic
Mpmc i nstruction_ppt1.6_-_arthamatic_logicMpmc i nstruction_ppt1.6_-_arthamatic_logic
Mpmc i nstruction_ppt1.6_-_arthamatic_logickalpana ravinder
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSSwapnil Mishra
 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Shubham Singh
 
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSORLOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSORRamaPrabha24
 
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORRamaPrabha24
 

Similar to Arithmetic and logical instructions (20)

Logical instruction of 8085
Logical instruction of 8085Logical instruction of 8085
Logical instruction of 8085
 
Logical instruction of 8085
Logical instruction of 8085 Logical instruction of 8085
Logical instruction of 8085
 
Instructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIRInstructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIR
 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).ppt
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
 
8085 instructions details
8085 instructions details8085 instructions details
8085 instructions details
 
8085 instructions
8085 instructions8085 instructions
8085 instructions
 
itft-Instruction set-of-8085
itft-Instruction set-of-8085itft-Instruction set-of-8085
itft-Instruction set-of-8085
 
8085 Instructions.pdf
8085 Instructions.pdf8085 Instructions.pdf
8085 Instructions.pdf
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Microprocessor Basics CH-3
Microprocessor Basics CH-3Microprocessor Basics CH-3
Microprocessor Basics CH-3
 
Types of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessorTypes of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessor
 
Mpmc i nstruction_ppt1.6_-_arthamatic_logic
Mpmc i nstruction_ppt1.6_-_arthamatic_logicMpmc i nstruction_ppt1.6_-_arthamatic_logic
Mpmc i nstruction_ppt1.6_-_arthamatic_logic
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
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
 
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSORLOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
 
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
8085 instructions
8085 instructions8085 instructions
8085 instructions
 

More from BIRLA VISHVAKARMA MAHAVIDYALAY (14)

VLAN ON PACKET TRACER
VLAN ON PACKET TRACERVLAN ON PACKET TRACER
VLAN ON PACKET TRACER
 
VLAN ON PACKET TRACER
VLAN ON PACKET TRACERVLAN ON PACKET TRACER
VLAN ON PACKET TRACER
 
VLAN on packet Tracer
VLAN on packet TracerVLAN on packet Tracer
VLAN on packet Tracer
 
Stepper motor interfacing
Stepper motor interfacingStepper motor interfacing
Stepper motor interfacing
 
E.com
E.comE.com
E.com
 
Fhss project
Fhss projectFhss project
Fhss project
 
Group 11
Group 11Group 11
Group 11
 
Me presentation
Me presentationMe presentation
Me presentation
 
Gujarat technological universit1
Gujarat technological universit1Gujarat technological universit1
Gujarat technological universit1
 
Cse presentation
Cse presentationCse presentation
Cse presentation
 
Group no 11
Group no 11Group no 11
Group no 11
 
Avs presentation
Avs presentationAvs presentation
Avs presentation
 
Automatic room light controller with bidirectional visitor counter
Automatic room light controller with bidirectional visitor counterAutomatic room light controller with bidirectional visitor counter
Automatic room light controller with bidirectional visitor counter
 
Automaticroomlightcontroller[1]
Automaticroomlightcontroller[1]Automaticroomlightcontroller[1]
Automaticroomlightcontroller[1]
 

Recently uploaded

VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 

Recently uploaded (20)

VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 

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.