SlideShare a Scribd company logo
1 of 51
Presented by:
Engr Zeeshan Ahmed Lodro
Lecturer-Department of Electronics Engineering Technology
BBS University of Technology and Skill Development Khairpur Mirs
1
Lecture-04
2
Logical Group of Instructions
Instructions to perform AND operation
 Instruction type ANA R
 Instruction type ANI d8
Instructions to perform OR operation
 Instruction type OR A
 Instruction type ORI d8
Instructions to perform Exclusive OR operation
Instruction type XRA R
Instruction type XRI d8
3
 Instructions to complement accumulator
 Instructions to complement/set cy flag
 Instruction type CMC
 Instruction type STC
Instructions to perform compare operation
 Instruction type CMP R
 Instruction type CPI d8
Instructions to rotate accumulator
 Instruction type RLC
 Instruction type RAL
4
In operations likeAND , which need two
operands, 8085 imposes the restriction that
one of the operands must be in the
accumulator.The other operand can be one
of the following.
Contents of 8-bit register
Contents of memory location pointed by HL
register pair.
Eight bit immediate data.
5
 The AND operation performs bit wise AND of
the two operands. If X is a bot of accumulator,
andY is a bit of the other operand in the same
bit position.The and operation is performed
as per following.
6
 The AND instruction affects the following
flags:
 S,P and Z flags are updated based on the
result.
 Cy flag is reset to o;
 AC flag is set to 1.
7
 ANA is a mnemonic which stands for And
Accumulator and R stands for any of the 8085
registers.
 This instruction is used to AND contents of R
with accumulator.The result of AND
operation will be stored in accumulator.
8
 ANA E
 The result of execution is shown below
Summary:
ANA R( 1-byte; ANA E; 8 opcodes)
9
Register Before After
E 45H
A 33H 01H
F Any values Cy= 0, AC=1,
S=0,P=0
 ANI is a mnemonic that stands for And
Immediate with Accumulator and d8 stands
for any 8-bit data.This instruction is used to
AN 8-bit immediate data with the
accumulator,The result of ANDing will be
stored in the Accumulator,
 The S,P and Z flag are affected based on the
results.
10
 ANI F3H
 The result of execution is shown below
Summary:
ANI d8 ( 2-bytes; ANI F3H; 1 opcodes)
11
Register Before After
A 45H 41H
F Any values Cy= 0, AC=1,
S=0,P=1, Z=0
 How it resulted 41H in previous example?
12
 The OR operation performs bit-wiseOR of
the two operands.The OR operation is
performed as per following table.
13
 ORA is mnemonic that stands for OR
Accumulator and R stands for any of the 8085
registers.
 This instruction is used to OR contents of R
with the accumulator.The result of OR
operation will be stored in the Accumulator.
14
 ORA E
 The result of execution is shown below
Summary:
ORA R ( 1-byte; ORA E; 8 opcodes)
15
Register Before After
E 45H
A 33H 77H
F Any values Cy= 0, AC=0,
S=0,P=1, Z=0
 ORI is a mnemonic that stands for OR
Immediate with Accumulator and d8 stands
for any 8-bit data.
 This instruction is used to OR 8-bit
immediate data with the accumulator.
 The result of Oring will be stored in the
Accumulator.
16
 ORI F3H
 The result of execution is shown below
Summary:
ORI d8 ( 2-bytes; ORI F3H; 1 opcode)
17
Register Before After
A 45H F7H
F Any values Cy= 0, AC=0,
S=1,P=0, Z=0
 Following truth table is used to perform XOR
operation.
18
 XRA is a mnemonic that stands for eXclusive
OR accumulator and R stands for any of the
following registers or memory location
pointed by HL pair.
 This instruction is used to EX-OR contents of
R with the accumulator,The result of EX-OR
operation will be stored in the Accumulator,.
19
 XRA E
 The result of execution is shown below
Summary:
XRA R ( 1-byte; XRA E; 8 opcodes)
20
Register Before After
E 45H
A 33H 76H
F Any values Cy= 0, AC=0,
S=0,P=0, Z=0
 XRI is a mnemonic that stands for eXclusive
OR immediate with Accumulator and d8
stands for 8-bit data.
 This instruction is used to Ex-OR 8-bit
immediate data with the accumulator.
 The result of EX-oring will be stored in
accumulator.
21
 XRI F3H
 The result of execution is shown below
Summary:
XRI d8 ( 2-bytes; XRI F3H; 1 opcode)
22
Register Before After
A 45H B6H
F Any values Cy= 0, AC=0,
S=1,P=0, Z=0
 The complement instruction in 8085 has the
mnemonic CMA that stands for CoMplement
the Accumulator.
 It performs 1s complement operation on the
contents of accumulator and the result is
stored back in the accumulator.
 Note that only accumulator contents can be
complemented but not others.
23
 CMA
 The result of execution is shown below
Summary:
CMA( 1-byte; CMA; 1 opcode)
24
Register Before After
A 45H BAH
 Intel 8085 provides instructions to
complement Cy flag, and set the CY flag to
the 1 state, but it does not have an instruction
to reset the Cy flag to 0.
 If it is desired to reset Cy flag to 0, the
method is to set 1 and then complement it.
25
 CMC stands for CoMplement the Carry flag.
 it performs complement operation on the Cy
flag and the result is stored back in the CY
flag.
26
 CMC
 The result of execution is shown below
Summary:
CMC( 1-byte; CMC; 1 opcode)
27
Register Before After
Cy 1 0
 STC stands for SeT the Carry flag.
 It sets the Cy flag to the 1 state.
 Immaterial of its earlier value.
28
 STC
 The result of execution is shown below
Summary:
STC( 1-byte; STC; 1 opcode)
29
Register Before After
Cy 1 1
Register Before After
Cy 0 1
 A compare instruction compares two
operands, and affects the status flags values
depending on the result of the comparison.
 In this operation, 8085 imposes the
restriction that one of the operands must be
in the accumulator and the other operand can
be of the following.
 Contents of 8-bit register
 Contents of memory location pointed by HL pair.
 Eight bit immediate data.
30
 The compare instruction actually computes the value of
the accumulator contents minus other operand.
 The original values of the operand are not changed.
 The result is stored in the register that is not accessible
to the programmer.
 Based on the results , all the flags are affected.
 It is very similar to comparing the heights of two
persons. After comparison heights remains unaltered
but we reach at some conclusions like.
 Both are of same height.
 Person 1 is taller
 Person 2 is shorter.
31
 CMP is a mnemonic that stands for CoMPare
accumulator and R stands for any of the
following registers.
 R=A,B,C,D,E,H,L,or M
 This instruction is used to compare contents
of the accumulator with R.The result of
compare operation will be stored in theTemp
register.Temp is an internal register that is
not accessible to the programmer.
32
 CMP E
 The result of execution is shown below
Summary:
Summary:
CMP R( 1-byte; CMP E; 8 opcodes)
33
Register Before After
A F5H
E 25H
Temp 45H D0H
F AnyValues Cy=0, AC=1, Z=0,
P=0, S=1
 Convert accumulator value F5 into binary
 Convert E register value 25 into binary
 Perform subtraction and convert result back into hex.
 1111 0101
 0010 0101
 1101 0000
 Cy=0 because carry not generated
 AC=1 because of assistance during BCD operations or
undefined behavior(no any solid reason) or AC=1 always
 Z=0 because result is not zero
 P=1 because result has even number of 1s
 S=1 because result is negative.There are two ways to
check in binary if the MSB is 1 result is negative and in hex
if left most digit is in range 8-F the result is negative.
34
 CMP E
 The result of execution is shown below
Summary:
Summary:
CMP R( 1-byte; CMP E; 8 opcodes)
35
Register Before After
A 50H
E 70H
Temp 45H E0H
F AnyValues Cy=1, AC=1, Z=0,
P=0, S=1
 Convert 50 into binary and also convert 70
into binary then subtract 70 from 50 and get
result E0
 0101 0000
 0111 0000
 1110 0000
 E0
36
 CMP E
 The result of execution is shown below
Summary:
Summary:
CMP R( 1-byte; CMP E; 8 opcodes)
37
Register Before After
A 50H
E 50H
Temp 45H ??
F AnyValues Cy=0, AC=1, Z=1,
P=1, S=0
 CMP E
 The result of execution is shown below
Summary:
Summary:
CMP R( 1-byte; CMP E; 8 opcodes)
38
Register Before After
A F5H
E D5H
Temp 45H ??
F AnyValues Cy=0, AC=1, Z=0,
P=0, S=0
 CMP E
 The result of execution is shown below
Summary:
Summary:
CMP R( 1-byte; CMP E; 8 opcodes)
39
Register Before After
A 25H
E F5H
Temp 45H ??
F AnyValues Cy=1, AC=1, Z=0,
P=0, S=1
 CPI is a mnemonic that stand for Compare
Immediate with Accumulator and d8 stands
for any 8-bit data.
 This instruction is used to compare
accumulator with 8-bit immediate data.
 The result of the comparison is not accessible
to the programmer.
 All the flags are affected based on the results.
40
 CPI F5H
 The result of execution is shown below
Summary:
CPI d8( 2-bytes; CPI F5H; 1 opcode)
41
Register Before After
A 25H
Temp 45H 30H
F AnyValues Cy=1, AC=1, Z=0,
P=1, S=0
 Intel 8085 provides instructions to rotate the
accumulator contents from left to right.
 Rotate operation can be performed only on
accumulator.
42
 RLC stands for Rotate Left accumulator. It
rotates the accumulator contents to the left
by 1-bit position.
 Rotate left without involving cy in rotation
43
 It can be seen ,after rotate left operation, the bit
that moves out from the MS bit position goes to
vacancy created in the LS bit position.
 Also Cy flag gets a copy of the bit moved out
from the MS bit position.
 Notice that CY flag is not involved in the rotation
and it is only 8-bit rotation of accumulator
contents.
 Only Cy flag is affected by this instruction
execution.
44
 To check the value of MS bit of accumulator ,
perform rotate left and note the cy flag value
 To perform multiplication by 2, rotate
accumulator to left. It works correctly for
unsigned numbers as long as the MS bit of
accumulator before rotation is 0.
45
 Note that Accumulator’s MSB value before rotation was 0 so result
is doubled.
 Note that Accumulator’s MSB value before rotation was 1 so result is
not doubled.
46
Register Before After
A 24H 48H
Cy 1 0
Register Before After
A 84H 09H
Cy 0 1
 RAL stands for rotate accumulator left
involving Cy flag in rotation. It rotates the
accumulator contents to the left by 1-bit
position.
 Rotate left involving carry
47
 It can be seen that after rotate left operation,
the bit moves out from the MS bit position
and goes to the Cy flag and in the process
moves out earlier carry bit to the vacancy
created in the LS bit position.
 Notice that Cy flag is involved in the rotation
and it is 9 bit rotation of accumulator and Cy
contents.
 Only Cy flag is affected by this instruction
execution.
48
 To check the value of the MS bit of accumulator,
perform rotate left and note the Cy flag value.
 To perform the multiplication by 2, rotate the
accumulator to the left, it works correctly for
unsigned numbers as long as the MS bit of
accumulator and Cy flag are 0 before rotation.
For multiplication by 2^n perform rotate left n
times.
 To introduce a new bit value to the LS bit
position, put this bit value in the Cy flag and then
execute this instruction.
49
 Note that Accumulator is doubled.
 Note that Accumulator’s value is not doubled in this case because
MS bit of accumulator was a 1 before rotation.
50
Register Before After
A 24H 48H
Cy 0 0
Register Before After
A 84H 08H
Cy 0 1
51

More Related Content

What's hot

Microprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. KawareMicroprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. KawareProf. Swapnil V. Kaware
 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085shiji v r
 
Instruction set of 8085 microprocessor
Instruction set of 8085 microprocessorInstruction set of 8085 microprocessor
Instruction set of 8085 microprocessorRahul Sahu
 
microprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualmicroprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualAnkit Kumar
 
Unit iv microcontrollers final
Unit iv microcontrollers finalUnit iv microcontrollers final
Unit iv microcontrollers finalSARITHA REDDY
 
Microprocessor lab manual
Microprocessor lab manualMicroprocessor lab manual
Microprocessor lab manualDhaval Shukla
 
Programming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingProgramming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingAmitabh Shukla
 
Logical instruction of 8085
Logical instruction of 8085 Logical instruction of 8085
Logical instruction of 8085 Nemish Bhojani
 
Microprocessor lab
Microprocessor labMicroprocessor lab
Microprocessor labkpaulraj
 
Microprocessor and Microcontroller Lab Manual
Microprocessor and Microcontroller Lab ManualMicroprocessor and Microcontroller Lab Manual
Microprocessor and Microcontroller Lab ManualSanthosh Kumar
 
Microprocessor square wave
Microprocessor square waveMicroprocessor square wave
Microprocessor square waveFthi Arefayne
 
MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085Sumadeep Juvvalapalem
 
SAP II ARTICTURE ,SAP 2
SAP II ARTICTURE ,SAP 2SAP II ARTICTURE ,SAP 2
SAP II ARTICTURE ,SAP 2Apar Pramod
 

What's hot (19)

Microprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. KawareMicroprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. Kaware
 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085
 
Instruction set of 8085 microprocessor
Instruction set of 8085 microprocessorInstruction set of 8085 microprocessor
Instruction set of 8085 microprocessor
 
microprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualmicroprocessor Laboratory experiments manual
microprocessor Laboratory experiments manual
 
Unit iv microcontrollers final
Unit iv microcontrollers finalUnit iv microcontrollers final
Unit iv microcontrollers final
 
Microprocessor File
Microprocessor FileMicroprocessor File
Microprocessor File
 
Microprocessor lab manual
Microprocessor lab manualMicroprocessor lab manual
Microprocessor lab manual
 
MPMC LAB MANUAL EEE
MPMC LAB MANUAL EEEMPMC LAB MANUAL EEE
MPMC LAB MANUAL EEE
 
Programming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingProgramming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacing
 
Logical instruction of 8085
Logical instruction of 8085 Logical instruction of 8085
Logical instruction of 8085
 
Microprocessor lab
Microprocessor labMicroprocessor lab
Microprocessor lab
 
Instruction set
Instruction setInstruction set
Instruction set
 
8085 assembly language programming
8085 assembly language programming8085 assembly language programming
8085 assembly language programming
 
Microprocessor and Microcontroller Lab Manual
Microprocessor and Microcontroller Lab ManualMicroprocessor and Microcontroller Lab Manual
Microprocessor and Microcontroller Lab Manual
 
Microprocessor square wave
Microprocessor square waveMicroprocessor square wave
Microprocessor square wave
 
Introduction to 8085 by adi ppt
Introduction to 8085 by adi pptIntroduction to 8085 by adi ppt
Introduction to 8085 by adi ppt
 
MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085
 
SAP II ARTICTURE ,SAP 2
SAP II ARTICTURE ,SAP 2SAP II ARTICTURE ,SAP 2
SAP II ARTICTURE ,SAP 2
 
Micro task1
Micro task1Micro task1
Micro task1
 

Similar to Lecture 04 Logical Group of Instructions

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
 
12973 block diagram of 8085
12973 block diagram of 808512973 block diagram of 8085
12973 block diagram of 8085RAHULNOUGHTY
 
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Basil John
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :PJathin Kanumuri
 
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 setSaumitra Rukmangad
 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2Jathin Kanumuri
 
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORRamaPrabha24
 
12 chapter06 math_instructions_fa14
12 chapter06 math_instructions_fa1412 chapter06 math_instructions_fa14
12 chapter06 math_instructions_fa14John Todora
 
180410227 ae2406-lab-manual-doc
180410227 ae2406-lab-manual-doc180410227 ae2406-lab-manual-doc
180410227 ae2406-lab-manual-dochomeworkping10
 
Chapter 6 - Introduction to 8085 Instructions
Chapter 6 - Introduction to 8085 InstructionsChapter 6 - Introduction to 8085 Instructions
Chapter 6 - Introduction to 8085 Instructionscmkandemir
 
5th unit Microprocessor 8085
5th unit Microprocessor 80855th unit Microprocessor 8085
5th unit Microprocessor 8085Mani Afranzio
 

Similar to Lecture 04 Logical Group of Instructions (20)

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
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
Blockdiagramof8085.ppt
Blockdiagramof8085.pptBlockdiagramof8085.ppt
Blockdiagramof8085.ppt
 
12973 block diagram of 8085
12973 block diagram of 808512973 block diagram of 8085
12973 block diagram of 8085
 
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)
 
Uc 2(vii)
Uc 2(vii)Uc 2(vii)
Uc 2(vii)
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :P
 
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
 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2
 
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
 
12 chapter06 math_instructions_fa14
12 chapter06 math_instructions_fa1412 chapter06 math_instructions_fa14
12 chapter06 math_instructions_fa14
 
180410227 ae2406-lab-manual-doc
180410227 ae2406-lab-manual-doc180410227 ae2406-lab-manual-doc
180410227 ae2406-lab-manual-doc
 
8085 micro processor
8085 micro processor8085 micro processor
8085 micro processor
 
Chapter 6 - Introduction to 8085 Instructions
Chapter 6 - Introduction to 8085 InstructionsChapter 6 - Introduction to 8085 Instructions
Chapter 6 - Introduction to 8085 Instructions
 
Dsp Datapath
Dsp DatapathDsp Datapath
Dsp Datapath
 
8085-paper-presentation.ppt
8085-paper-presentation.ppt8085-paper-presentation.ppt
8085-paper-presentation.ppt
 
Emb day2 8051
Emb day2 8051Emb day2 8051
Emb day2 8051
 
5th unit Microprocessor 8085
5th unit Microprocessor 80855th unit Microprocessor 8085
5th unit Microprocessor 8085
 
Architecture of 8085
Architecture of  8085Architecture of  8085
Architecture of 8085
 

More from Zeeshan Ahmed

Lecture 05 NOP and Stack Group of Instructions
Lecture 05 NOP and Stack Group of InstructionsLecture 05 NOP and Stack Group of Instructions
Lecture 05 NOP and Stack Group of InstructionsZeeshan Ahmed
 
Lecture 0 History of Microprocessors and Microcontrollers
Lecture 0 History of Microprocessors and Microcontrollers Lecture 0 History of Microprocessors and Microcontrollers
Lecture 0 History of Microprocessors and Microcontrollers Zeeshan Ahmed
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab ManualDigital Signal Processing Lab Manual
Digital Signal Processing Lab ManualZeeshan Ahmed
 
Power Electronics Lab Manual Spring 2017
Power Electronics Lab Manual Spring 2017Power Electronics Lab Manual Spring 2017
Power Electronics Lab Manual Spring 2017Zeeshan Ahmed
 
Tera Hertz Electromagnetic Waves
Tera Hertz Electromagnetic WavesTera Hertz Electromagnetic Waves
Tera Hertz Electromagnetic WavesZeeshan Ahmed
 
Industrial Electronics Lab Manual
Industrial Electronics Lab Manual Industrial Electronics Lab Manual
Industrial Electronics Lab Manual Zeeshan Ahmed
 
Signed numbers in 8051
Signed numbers in 8051Signed numbers in 8051
Signed numbers in 8051Zeeshan Ahmed
 

More from Zeeshan Ahmed (12)

Lecture 05 NOP and Stack Group of Instructions
Lecture 05 NOP and Stack Group of InstructionsLecture 05 NOP and Stack Group of Instructions
Lecture 05 NOP and Stack Group of Instructions
 
Lecture 0 History of Microprocessors and Microcontrollers
Lecture 0 History of Microprocessors and Microcontrollers Lecture 0 History of Microprocessors and Microcontrollers
Lecture 0 History of Microprocessors and Microcontrollers
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab ManualDigital Signal Processing Lab Manual
Digital Signal Processing Lab Manual
 
Power Electronics Lab Manual Spring 2017
Power Electronics Lab Manual Spring 2017Power Electronics Lab Manual Spring 2017
Power Electronics Lab Manual Spring 2017
 
Tera Hertz Electromagnetic Waves
Tera Hertz Electromagnetic WavesTera Hertz Electromagnetic Waves
Tera Hertz Electromagnetic Waves
 
Industrial Electronics Lab Manual
Industrial Electronics Lab Manual Industrial Electronics Lab Manual
Industrial Electronics Lab Manual
 
48 Laws of Power
48 Laws of Power 48 Laws of Power
48 Laws of Power
 
Synchronous Motor
Synchronous MotorSynchronous Motor
Synchronous Motor
 
networking topology
networking topologynetworking topology
networking topology
 
Audio amplifier
Audio amplifier Audio amplifier
Audio amplifier
 
Signed numbers in 8051
Signed numbers in 8051Signed numbers in 8051
Signed numbers in 8051
 
Bio—chip ] sensor
Bio—chip ] sensorBio—chip ] sensor
Bio—chip ] sensor
 

Recently uploaded

Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
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
 
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
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
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
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
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
 

Recently uploaded (20)

Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
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
 
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...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
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
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
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
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.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
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
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
 

Lecture 04 Logical Group of Instructions

  • 1. Presented by: Engr Zeeshan Ahmed Lodro Lecturer-Department of Electronics Engineering Technology BBS University of Technology and Skill Development Khairpur Mirs 1 Lecture-04
  • 2. 2 Logical Group of Instructions
  • 3. Instructions to perform AND operation  Instruction type ANA R  Instruction type ANI d8 Instructions to perform OR operation  Instruction type OR A  Instruction type ORI d8 Instructions to perform Exclusive OR operation Instruction type XRA R Instruction type XRI d8 3
  • 4.  Instructions to complement accumulator  Instructions to complement/set cy flag  Instruction type CMC  Instruction type STC Instructions to perform compare operation  Instruction type CMP R  Instruction type CPI d8 Instructions to rotate accumulator  Instruction type RLC  Instruction type RAL 4
  • 5. In operations likeAND , which need two operands, 8085 imposes the restriction that one of the operands must be in the accumulator.The other operand can be one of the following. Contents of 8-bit register Contents of memory location pointed by HL register pair. Eight bit immediate data. 5
  • 6.  The AND operation performs bit wise AND of the two operands. If X is a bot of accumulator, andY is a bit of the other operand in the same bit position.The and operation is performed as per following. 6
  • 7.  The AND instruction affects the following flags:  S,P and Z flags are updated based on the result.  Cy flag is reset to o;  AC flag is set to 1. 7
  • 8.  ANA is a mnemonic which stands for And Accumulator and R stands for any of the 8085 registers.  This instruction is used to AND contents of R with accumulator.The result of AND operation will be stored in accumulator. 8
  • 9.  ANA E  The result of execution is shown below Summary: ANA R( 1-byte; ANA E; 8 opcodes) 9 Register Before After E 45H A 33H 01H F Any values Cy= 0, AC=1, S=0,P=0
  • 10.  ANI is a mnemonic that stands for And Immediate with Accumulator and d8 stands for any 8-bit data.This instruction is used to AN 8-bit immediate data with the accumulator,The result of ANDing will be stored in the Accumulator,  The S,P and Z flag are affected based on the results. 10
  • 11.  ANI F3H  The result of execution is shown below Summary: ANI d8 ( 2-bytes; ANI F3H; 1 opcodes) 11 Register Before After A 45H 41H F Any values Cy= 0, AC=1, S=0,P=1, Z=0
  • 12.  How it resulted 41H in previous example? 12
  • 13.  The OR operation performs bit-wiseOR of the two operands.The OR operation is performed as per following table. 13
  • 14.  ORA is mnemonic that stands for OR Accumulator and R stands for any of the 8085 registers.  This instruction is used to OR contents of R with the accumulator.The result of OR operation will be stored in the Accumulator. 14
  • 15.  ORA E  The result of execution is shown below Summary: ORA R ( 1-byte; ORA E; 8 opcodes) 15 Register Before After E 45H A 33H 77H F Any values Cy= 0, AC=0, S=0,P=1, Z=0
  • 16.  ORI is a mnemonic that stands for OR Immediate with Accumulator and d8 stands for any 8-bit data.  This instruction is used to OR 8-bit immediate data with the accumulator.  The result of Oring will be stored in the Accumulator. 16
  • 17.  ORI F3H  The result of execution is shown below Summary: ORI d8 ( 2-bytes; ORI F3H; 1 opcode) 17 Register Before After A 45H F7H F Any values Cy= 0, AC=0, S=1,P=0, Z=0
  • 18.  Following truth table is used to perform XOR operation. 18
  • 19.  XRA is a mnemonic that stands for eXclusive OR accumulator and R stands for any of the following registers or memory location pointed by HL pair.  This instruction is used to EX-OR contents of R with the accumulator,The result of EX-OR operation will be stored in the Accumulator,. 19
  • 20.  XRA E  The result of execution is shown below Summary: XRA R ( 1-byte; XRA E; 8 opcodes) 20 Register Before After E 45H A 33H 76H F Any values Cy= 0, AC=0, S=0,P=0, Z=0
  • 21.  XRI is a mnemonic that stands for eXclusive OR immediate with Accumulator and d8 stands for 8-bit data.  This instruction is used to Ex-OR 8-bit immediate data with the accumulator.  The result of EX-oring will be stored in accumulator. 21
  • 22.  XRI F3H  The result of execution is shown below Summary: XRI d8 ( 2-bytes; XRI F3H; 1 opcode) 22 Register Before After A 45H B6H F Any values Cy= 0, AC=0, S=1,P=0, Z=0
  • 23.  The complement instruction in 8085 has the mnemonic CMA that stands for CoMplement the Accumulator.  It performs 1s complement operation on the contents of accumulator and the result is stored back in the accumulator.  Note that only accumulator contents can be complemented but not others. 23
  • 24.  CMA  The result of execution is shown below Summary: CMA( 1-byte; CMA; 1 opcode) 24 Register Before After A 45H BAH
  • 25.  Intel 8085 provides instructions to complement Cy flag, and set the CY flag to the 1 state, but it does not have an instruction to reset the Cy flag to 0.  If it is desired to reset Cy flag to 0, the method is to set 1 and then complement it. 25
  • 26.  CMC stands for CoMplement the Carry flag.  it performs complement operation on the Cy flag and the result is stored back in the CY flag. 26
  • 27.  CMC  The result of execution is shown below Summary: CMC( 1-byte; CMC; 1 opcode) 27 Register Before After Cy 1 0
  • 28.  STC stands for SeT the Carry flag.  It sets the Cy flag to the 1 state.  Immaterial of its earlier value. 28
  • 29.  STC  The result of execution is shown below Summary: STC( 1-byte; STC; 1 opcode) 29 Register Before After Cy 1 1 Register Before After Cy 0 1
  • 30.  A compare instruction compares two operands, and affects the status flags values depending on the result of the comparison.  In this operation, 8085 imposes the restriction that one of the operands must be in the accumulator and the other operand can be of the following.  Contents of 8-bit register  Contents of memory location pointed by HL pair.  Eight bit immediate data. 30
  • 31.  The compare instruction actually computes the value of the accumulator contents minus other operand.  The original values of the operand are not changed.  The result is stored in the register that is not accessible to the programmer.  Based on the results , all the flags are affected.  It is very similar to comparing the heights of two persons. After comparison heights remains unaltered but we reach at some conclusions like.  Both are of same height.  Person 1 is taller  Person 2 is shorter. 31
  • 32.  CMP is a mnemonic that stands for CoMPare accumulator and R stands for any of the following registers.  R=A,B,C,D,E,H,L,or M  This instruction is used to compare contents of the accumulator with R.The result of compare operation will be stored in theTemp register.Temp is an internal register that is not accessible to the programmer. 32
  • 33.  CMP E  The result of execution is shown below Summary: Summary: CMP R( 1-byte; CMP E; 8 opcodes) 33 Register Before After A F5H E 25H Temp 45H D0H F AnyValues Cy=0, AC=1, Z=0, P=0, S=1
  • 34.  Convert accumulator value F5 into binary  Convert E register value 25 into binary  Perform subtraction and convert result back into hex.  1111 0101  0010 0101  1101 0000  Cy=0 because carry not generated  AC=1 because of assistance during BCD operations or undefined behavior(no any solid reason) or AC=1 always  Z=0 because result is not zero  P=1 because result has even number of 1s  S=1 because result is negative.There are two ways to check in binary if the MSB is 1 result is negative and in hex if left most digit is in range 8-F the result is negative. 34
  • 35.  CMP E  The result of execution is shown below Summary: Summary: CMP R( 1-byte; CMP E; 8 opcodes) 35 Register Before After A 50H E 70H Temp 45H E0H F AnyValues Cy=1, AC=1, Z=0, P=0, S=1
  • 36.  Convert 50 into binary and also convert 70 into binary then subtract 70 from 50 and get result E0  0101 0000  0111 0000  1110 0000  E0 36
  • 37.  CMP E  The result of execution is shown below Summary: Summary: CMP R( 1-byte; CMP E; 8 opcodes) 37 Register Before After A 50H E 50H Temp 45H ?? F AnyValues Cy=0, AC=1, Z=1, P=1, S=0
  • 38.  CMP E  The result of execution is shown below Summary: Summary: CMP R( 1-byte; CMP E; 8 opcodes) 38 Register Before After A F5H E D5H Temp 45H ?? F AnyValues Cy=0, AC=1, Z=0, P=0, S=0
  • 39.  CMP E  The result of execution is shown below Summary: Summary: CMP R( 1-byte; CMP E; 8 opcodes) 39 Register Before After A 25H E F5H Temp 45H ?? F AnyValues Cy=1, AC=1, Z=0, P=0, S=1
  • 40.  CPI is a mnemonic that stand for Compare Immediate with Accumulator and d8 stands for any 8-bit data.  This instruction is used to compare accumulator with 8-bit immediate data.  The result of the comparison is not accessible to the programmer.  All the flags are affected based on the results. 40
  • 41.  CPI F5H  The result of execution is shown below Summary: CPI d8( 2-bytes; CPI F5H; 1 opcode) 41 Register Before After A 25H Temp 45H 30H F AnyValues Cy=1, AC=1, Z=0, P=1, S=0
  • 42.  Intel 8085 provides instructions to rotate the accumulator contents from left to right.  Rotate operation can be performed only on accumulator. 42
  • 43.  RLC stands for Rotate Left accumulator. It rotates the accumulator contents to the left by 1-bit position.  Rotate left without involving cy in rotation 43
  • 44.  It can be seen ,after rotate left operation, the bit that moves out from the MS bit position goes to vacancy created in the LS bit position.  Also Cy flag gets a copy of the bit moved out from the MS bit position.  Notice that CY flag is not involved in the rotation and it is only 8-bit rotation of accumulator contents.  Only Cy flag is affected by this instruction execution. 44
  • 45.  To check the value of MS bit of accumulator , perform rotate left and note the cy flag value  To perform multiplication by 2, rotate accumulator to left. It works correctly for unsigned numbers as long as the MS bit of accumulator before rotation is 0. 45
  • 46.  Note that Accumulator’s MSB value before rotation was 0 so result is doubled.  Note that Accumulator’s MSB value before rotation was 1 so result is not doubled. 46 Register Before After A 24H 48H Cy 1 0 Register Before After A 84H 09H Cy 0 1
  • 47.  RAL stands for rotate accumulator left involving Cy flag in rotation. It rotates the accumulator contents to the left by 1-bit position.  Rotate left involving carry 47
  • 48.  It can be seen that after rotate left operation, the bit moves out from the MS bit position and goes to the Cy flag and in the process moves out earlier carry bit to the vacancy created in the LS bit position.  Notice that Cy flag is involved in the rotation and it is 9 bit rotation of accumulator and Cy contents.  Only Cy flag is affected by this instruction execution. 48
  • 49.  To check the value of the MS bit of accumulator, perform rotate left and note the Cy flag value.  To perform the multiplication by 2, rotate the accumulator to the left, it works correctly for unsigned numbers as long as the MS bit of accumulator and Cy flag are 0 before rotation. For multiplication by 2^n perform rotate left n times.  To introduce a new bit value to the LS bit position, put this bit value in the Cy flag and then execute this instruction. 49
  • 50.  Note that Accumulator is doubled.  Note that Accumulator’s value is not doubled in this case because MS bit of accumulator was a 1 before rotation. 50 Register Before After A 24H 48H Cy 0 0 Register Before After A 84H 08H Cy 0 1
  • 51. 51