SlideShare a Scribd company logo
W E L C O M E T O O U R
P R E S E N TAT I O N
Logical, Shift, and Rotate Instruction
CONTENT:
• Logical instruction(AND, OR, XOR, NOT) with example.
• Shift instruction
• Rotate instruction
• Converting ASCII code
LOGICAL INSTRUCTION:
Logical table of and, or, xor, and not gate:
a b a AND b a OR b a XOR b
0 0 0 0 0
0 1 0 1 1
1 0 0 1 1
1 1 1 1 0
a NOT a
0 1
1 0
LOGICAL AND:
1 0 1 0 1 0 1 0
1 1 1 1 0 0 0 0
00 0 001 0
0
1
1
0
0
1
0 1 1 0 1 1 1 0
1 0 1 1 0 0 1 1
11 1 111 1
0
1
1
0
1
1
ZF:
SF:
PF:
CF:
OF:
ZF:
SF:
PF:
CF:
OF:
LOGICAL OR:
1 0 1 0 1 0 1 0
1 1 0 1 0 0 0 1
11 0 111 1
0
1
0
0
0
1
0 1 1 0 1 0 1 0
1 0 1 1 0 0 1 1
00 0 100 0
0
0
0
0
1
1
ZF:
SF:
PF:
CF:
OF:
ZF:
SF:
PF:
CF:
OF:
LOGICAL XOR:
1 0 1 0 1 0 1 0
1 1 1 1 0 0 1 1
11 0 010 1
0
0
1
0
1
0
0 1 1 0 1 0 1 1
1 0 1 1 0 1 1 1
01 1 011 1
0
1
1
0
1
0
ZF:
SF:
PF:
CF:
OF:
ZF:
SF:
PF:
CF:
OF:
LOGICAL NOT:
1 0 1 0 1 0 1 0
11 1 000 1 0
1 1 0 0 1 1 1 0
11 0 000 0 1
0
0
1
0
1
0
0
0
0
1
ZF:
SF:
PF:
CF:
OF:
ZF:
SF:
PF:
CF:
OF:
AND, OR INSTRUCTION EXAMPLE:
Example-1: Clear the sign bit of AL while leaving the other bits unchanged
Solution: Use the AND instruction with 01111111b=7FH as the mask. Thus,
AND AL,7FH
Example-2: Set the most significant and least significant bits of AL while
preserving the other bits.
Solution: Use the QR instruction with 10000001b = 81h as the mask .Thus ,
OR AL , 81h
CONVERTING:
• Converting an ASCII Digit to a Number:
• Converting a Lowercase to a Uppercase:
• Clearing a register:
For example ,if the “5” key is pressed, AL gets 35h instead of 5.to get 5 in
AL ,we could do this..
SUB AL , 30h
SUB DL,20h
We already know two ways to clear a resister. For example, to clear AX we
could execute..
MOV AX,0 or SUB AX ,AX
SHIFT INSTRUCTION:
• SHL and
SAL
• SHR
• SAR
ROTATE INSTRUCTION:
• ROL
• ROR
• RCL
• RCR
SHIFT INSTRUCTION: SHL AND SAL
• The SHL (shift left ) instruction shifts the bits in the destination to the left.
• A 0 is shifted into the right most bit position and the msb is shifted into CF.
0 1 1 0 0 1 0 1
00100 1
0000 0
0
CF
CF
11 1-S
2-S1111
0
0
SHIFT INSTRUCTION: SHR
• The instruction SHR(shift right) performs right shift on the destination operand.
• A 0 is shifted into the msb position ,and the rightmost bit is shifted into CF.
0 1 1 0 0 1 0 1
00000
000 00 0
1 1 1 1
1 1 1
1-S
2-S
CF
CF
0
0
SHIFT INSTRUCTION: SAR
• The SAR instruction (shift arithmetic right) operates like SHR, with one
difference: the msb retains its original value.
0 1 1 0 0 1 0 1
00000
000 00 0
1 1 1 1
1 1 1
1-S
2-S
CF
CF
ROTATE INSTRUCTION: ROL
• The instruction ROL (rotate left )shifts bits to the left .The msb is shifted into
the rightmost bit . The CF also gets the bit shifted out of the msb .
0 1 1 0 0 1 0 1
000 1
1000
0 1111
11111
CF
CF
1-S
2-S
ROTATE INSTRUCTION: ROR
• The instruction ROR (rotate right ) works just like ROL , except that the bits are
rotate to the right .The rightmost bit is shifted into the msb , and also into The CF.
0 1 1 0 0 1 0 1
00000
000 01 0
1 1 1 1
1 1 1
1-S
2-S
CF
CF
ROTATE INSTRUCTION: RCL
0 1 1 0 0 1 0 1
000 0
1000
1111
0111
1
0
• The instruction RCL (Rotate through carry left ) shifts the bits of the
destination to the left. The msb is shifted
into the CF, and the previous value of CF is shifted into the rightmost bit.
1-S
2-S
ROTATE INSTRUCTION: RCR
0 1 1 0 0 1 0 1
0000
00 00
1 1 1
1 1 1
1-S
2-S
0
1
1
1
The instruction RCR( Rotate through carry right) works just like RCL,
except that the bits are rotated to the right.
CF
THANK YOU.

More Related Content

What's hot

Addressing Modes Of 8086
Addressing Modes Of 8086Addressing Modes Of 8086
Addressing Modes Of 8086
Ikhlas Rahman
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086
Mahalakshmiv11
 
8086 alp
8086 alp8086 alp
Stack and its usage in assembly language
Stack and its usage in assembly language Stack and its usage in assembly language
Stack and its usage in assembly language
Usman Bin Saad
 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
Poojith Chowdhary
 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Piyush Rochwani
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controllerTech_MX
 
chapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructionschapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructions
warda aziz
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
mahalakshmimalini
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing Modes
Mayank Garg
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer Architecture
Haris456
 
Flag Registers (Assembly Language)
Flag Registers (Assembly Language)Flag Registers (Assembly Language)
Flag Registers (Assembly Language)
Anwar Hasan Shuvo
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessor
AMAN SRIVASTAVA
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
warda aziz
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
Dilum Bandara
 
Computer instructions
Computer instructionsComputer instructions
Computer instructionsAnuj Modi
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
hello_priti
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly languageMir Majid
 
Unit 4 memory system
Unit 4   memory systemUnit 4   memory system
Unit 4 memory systemchidabdu
 
Assembly 8086
Assembly 8086Assembly 8086
Assembly 8086
Mustafa Salah
 

What's hot (20)

Addressing Modes Of 8086
Addressing Modes Of 8086Addressing Modes Of 8086
Addressing Modes Of 8086
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086
 
8086 alp
8086 alp8086 alp
8086 alp
 
Stack and its usage in assembly language
Stack and its usage in assembly language Stack and its usage in assembly language
Stack and its usage in assembly language
 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
 
chapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructionschapter 7 Logic, shift and rotate instructions
chapter 7 Logic, shift and rotate instructions
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing Modes
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer Architecture
 
Flag Registers (Assembly Language)
Flag Registers (Assembly Language)Flag Registers (Assembly Language)
Flag Registers (Assembly Language)
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessor
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
 
Computer instructions
Computer instructionsComputer instructions
Computer instructions
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly language
 
Unit 4 memory system
Unit 4   memory systemUnit 4   memory system
Unit 4 memory system
 
Assembly 8086
Assembly 8086Assembly 8086
Assembly 8086
 

Similar to Logical, Shift, and Rotate Instruction

Arithmetic and logical instructions set
Arithmetic and logical instructions setArithmetic and logical instructions set
Arithmetic and logical instructions set
Robert Almazan
 
Arithmetic instructions
Arithmetic instructionsArithmetic instructions
Arithmetic instructions
Robert Almazan
 
Chap3 8086 logical
Chap3 8086 logicalChap3 8086 logical
Chap3 8086 logical
HarshitParkar6677
 
Chapter3 8086inst logical 2
Chapter3 8086inst logical 2Chapter3 8086inst logical 2
Chapter3 8086inst logical 2
HarshitParkar6677
 
8086inst logical
8086inst logical8086inst logical
8086inst logical
HarshitParkar6677
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Bilal Amjad
 
Copy of 8086inst logical
Copy of 8086inst logicalCopy of 8086inst logical
Copy of 8086inst logical
HarshitParkar6677
 
Copy of 8086inst logical
Copy of 8086inst logicalCopy of 8086inst logical
Copy of 8086inst logical
HarshitParkar6677
 
[ASM]Lab7
[ASM]Lab7[ASM]Lab7
[ASM]Lab7
Nora Youssef
 
Logic Micro Operation
Logic Micro OperationLogic Micro Operation
Logic Micro Operation
mahesh kumar prajapat
 
Microprocessor.pptx
Microprocessor.pptxMicroprocessor.pptx
Microprocessor.pptx
NishatNishu5
 
Logic, shift and rotate instruction
Logic, shift and rotate instructionLogic, shift and rotate instruction
Logic, shift and rotate instruction
kashif Shafqat
 
Logical instructions (and, or, xor, not, test)
Logical instructions (and, or, xor, not, test)Logical instructions (and, or, xor, not, test)
Logical instructions (and, or, xor, not, test)
Irfan Anjum
 
Logic microoperations
Logic microoperationsLogic microoperations
Logic microoperationsNitesh Singh
 
Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051
logesh waran
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
ihsanjamil
 
Assembly language-lab9
Assembly language-lab9Assembly language-lab9
Assembly language-lab9
AjEcuacion
 

Similar to Logical, Shift, and Rotate Instruction (20)

Arithmetic and logical instructions set
Arithmetic and logical instructions setArithmetic and logical instructions set
Arithmetic and logical instructions set
 
Arithmetic instructions
Arithmetic instructionsArithmetic instructions
Arithmetic instructions
 
Chap3 8086 logical
Chap3 8086 logicalChap3 8086 logical
Chap3 8086 logical
 
Chapter3 8086inst logical 2
Chapter3 8086inst logical 2Chapter3 8086inst logical 2
Chapter3 8086inst logical 2
 
8086inst logical
8086inst logical8086inst logical
8086inst logical
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
 
Copy of 8086inst logical
Copy of 8086inst logicalCopy of 8086inst logical
Copy of 8086inst logical
 
Copy of 8086inst logical
Copy of 8086inst logicalCopy of 8086inst logical
Copy of 8086inst logical
 
[ASM]Lab7
[ASM]Lab7[ASM]Lab7
[ASM]Lab7
 
Logic Micro Operation
Logic Micro OperationLogic Micro Operation
Logic Micro Operation
 
logical 8051
logical 8051logical 8051
logical 8051
 
Microprocessor.pptx
Microprocessor.pptxMicroprocessor.pptx
Microprocessor.pptx
 
Logic, shift and rotate instruction
Logic, shift and rotate instructionLogic, shift and rotate instruction
Logic, shift and rotate instruction
 
Logical instructions (and, or, xor, not, test)
Logical instructions (and, or, xor, not, test)Logical instructions (and, or, xor, not, test)
Logical instructions (and, or, xor, not, test)
 
Logic microoperations
Logic microoperationsLogic microoperations
Logic microoperations
 
Hemanth143
Hemanth143 Hemanth143
Hemanth143
 
Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051
 
Shift register
Shift registerShift register
Shift register
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
 
Assembly language-lab9
Assembly language-lab9Assembly language-lab9
Assembly language-lab9
 

More from Badrul Alam

E filling system (report)
E filling system (report)E filling system (report)
E filling system (report)
Badrul Alam
 
E file(final-defense)
E file(final-defense)E file(final-defense)
E file(final-defense)
Badrul Alam
 
E filling system (report)
E filling system (report)E filling system (report)
E filling system (report)
Badrul Alam
 
E file (title-defense)
E file (title-defense)E file (title-defense)
E file (title-defense)
Badrul Alam
 
E file(pre-defense)
E file(pre-defense)E file(pre-defense)
E file(pre-defense)
Badrul Alam
 
Albert einstein presentation
Albert einstein presentationAlbert einstein presentation
Albert einstein presentation
Badrul Alam
 
Fedora os presentation
Fedora os presentationFedora os presentation
Fedora os presentation
Badrul Alam
 
Security features of fedora
Security features of fedoraSecurity features of fedora
Security features of fedora
Badrul Alam
 
Factorial number in linux shell.
Factorial number in linux shell. Factorial number in linux shell.
Factorial number in linux shell.
Badrul Alam
 
Simulation of Queueing Systems(Single-Channel Queue).
Simulation of Queueing Systems(Single-Channel Queue).Simulation of Queueing Systems(Single-Channel Queue).
Simulation of Queueing Systems(Single-Channel Queue).
Badrul Alam
 
Longest Common Sub-sequence (LCS)
Longest Common Sub-sequence (LCS)Longest Common Sub-sequence (LCS)
Longest Common Sub-sequence (LCS)
Badrul Alam
 
Equivalence and minimization of DFA
Equivalence and minimization of DFAEquivalence and minimization of DFA
Equivalence and minimization of DFA
Badrul Alam
 
Loop(for, while, do while) condition Presentation
Loop(for, while, do while) condition PresentationLoop(for, while, do while) condition Presentation
Loop(for, while, do while) condition Presentation
Badrul Alam
 
Error Detection and Correction presentation
Error Detection and Correction presentation Error Detection and Correction presentation
Error Detection and Correction presentation
Badrul Alam
 
Networking assignment
Networking assignmentNetworking assignment
Networking assignment
Badrul Alam
 
Schema relationship to E-R diagram
Schema relationship to E-R diagramSchema relationship to E-R diagram
Schema relationship to E-R diagram
Badrul Alam
 
Automatic light control Using LDR
Automatic light control Using LDRAutomatic light control Using LDR
Automatic light control Using LDR
Badrul Alam
 
Pipeline processing and generation of computer.
Pipeline processing and generation of computer.Pipeline processing and generation of computer.
Pipeline processing and generation of computer.
Badrul Alam
 

More from Badrul Alam (18)

E filling system (report)
E filling system (report)E filling system (report)
E filling system (report)
 
E file(final-defense)
E file(final-defense)E file(final-defense)
E file(final-defense)
 
E filling system (report)
E filling system (report)E filling system (report)
E filling system (report)
 
E file (title-defense)
E file (title-defense)E file (title-defense)
E file (title-defense)
 
E file(pre-defense)
E file(pre-defense)E file(pre-defense)
E file(pre-defense)
 
Albert einstein presentation
Albert einstein presentationAlbert einstein presentation
Albert einstein presentation
 
Fedora os presentation
Fedora os presentationFedora os presentation
Fedora os presentation
 
Security features of fedora
Security features of fedoraSecurity features of fedora
Security features of fedora
 
Factorial number in linux shell.
Factorial number in linux shell. Factorial number in linux shell.
Factorial number in linux shell.
 
Simulation of Queueing Systems(Single-Channel Queue).
Simulation of Queueing Systems(Single-Channel Queue).Simulation of Queueing Systems(Single-Channel Queue).
Simulation of Queueing Systems(Single-Channel Queue).
 
Longest Common Sub-sequence (LCS)
Longest Common Sub-sequence (LCS)Longest Common Sub-sequence (LCS)
Longest Common Sub-sequence (LCS)
 
Equivalence and minimization of DFA
Equivalence and minimization of DFAEquivalence and minimization of DFA
Equivalence and minimization of DFA
 
Loop(for, while, do while) condition Presentation
Loop(for, while, do while) condition PresentationLoop(for, while, do while) condition Presentation
Loop(for, while, do while) condition Presentation
 
Error Detection and Correction presentation
Error Detection and Correction presentation Error Detection and Correction presentation
Error Detection and Correction presentation
 
Networking assignment
Networking assignmentNetworking assignment
Networking assignment
 
Schema relationship to E-R diagram
Schema relationship to E-R diagramSchema relationship to E-R diagram
Schema relationship to E-R diagram
 
Automatic light control Using LDR
Automatic light control Using LDRAutomatic light control Using LDR
Automatic light control Using LDR
 
Pipeline processing and generation of computer.
Pipeline processing and generation of computer.Pipeline processing and generation of computer.
Pipeline processing and generation of computer.
 

Recently uploaded

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 

Recently uploaded (20)

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 

Logical, Shift, and Rotate Instruction

  • 1. W E L C O M E T O O U R P R E S E N TAT I O N
  • 2. Logical, Shift, and Rotate Instruction
  • 3. CONTENT: • Logical instruction(AND, OR, XOR, NOT) with example. • Shift instruction • Rotate instruction • Converting ASCII code
  • 4. LOGICAL INSTRUCTION: Logical table of and, or, xor, and not gate: a b a AND b a OR b a XOR b 0 0 0 0 0 0 1 0 1 1 1 0 0 1 1 1 1 1 1 0 a NOT a 0 1 1 0
  • 5. LOGICAL AND: 1 0 1 0 1 0 1 0 1 1 1 1 0 0 0 0 00 0 001 0 0 1 1 0 0 1 0 1 1 0 1 1 1 0 1 0 1 1 0 0 1 1 11 1 111 1 0 1 1 0 1 1 ZF: SF: PF: CF: OF: ZF: SF: PF: CF: OF:
  • 6. LOGICAL OR: 1 0 1 0 1 0 1 0 1 1 0 1 0 0 0 1 11 0 111 1 0 1 0 0 0 1 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 00 0 100 0 0 0 0 0 1 1 ZF: SF: PF: CF: OF: ZF: SF: PF: CF: OF:
  • 7. LOGICAL XOR: 1 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 11 0 010 1 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 1 01 1 011 1 0 1 1 0 1 0 ZF: SF: PF: CF: OF: ZF: SF: PF: CF: OF:
  • 8. LOGICAL NOT: 1 0 1 0 1 0 1 0 11 1 000 1 0 1 1 0 0 1 1 1 0 11 0 000 0 1 0 0 1 0 1 0 0 0 0 1 ZF: SF: PF: CF: OF: ZF: SF: PF: CF: OF:
  • 9. AND, OR INSTRUCTION EXAMPLE: Example-1: Clear the sign bit of AL while leaving the other bits unchanged Solution: Use the AND instruction with 01111111b=7FH as the mask. Thus, AND AL,7FH Example-2: Set the most significant and least significant bits of AL while preserving the other bits. Solution: Use the QR instruction with 10000001b = 81h as the mask .Thus , OR AL , 81h
  • 10. CONVERTING: • Converting an ASCII Digit to a Number: • Converting a Lowercase to a Uppercase: • Clearing a register: For example ,if the “5” key is pressed, AL gets 35h instead of 5.to get 5 in AL ,we could do this.. SUB AL , 30h SUB DL,20h We already know two ways to clear a resister. For example, to clear AX we could execute.. MOV AX,0 or SUB AX ,AX
  • 11. SHIFT INSTRUCTION: • SHL and SAL • SHR • SAR ROTATE INSTRUCTION: • ROL • ROR • RCL • RCR
  • 12. SHIFT INSTRUCTION: SHL AND SAL • The SHL (shift left ) instruction shifts the bits in the destination to the left. • A 0 is shifted into the right most bit position and the msb is shifted into CF. 0 1 1 0 0 1 0 1 00100 1 0000 0 0 CF CF 11 1-S 2-S1111 0 0
  • 13. SHIFT INSTRUCTION: SHR • The instruction SHR(shift right) performs right shift on the destination operand. • A 0 is shifted into the msb position ,and the rightmost bit is shifted into CF. 0 1 1 0 0 1 0 1 00000 000 00 0 1 1 1 1 1 1 1 1-S 2-S CF CF 0 0
  • 14. SHIFT INSTRUCTION: SAR • The SAR instruction (shift arithmetic right) operates like SHR, with one difference: the msb retains its original value. 0 1 1 0 0 1 0 1 00000 000 00 0 1 1 1 1 1 1 1 1-S 2-S CF CF
  • 15. ROTATE INSTRUCTION: ROL • The instruction ROL (rotate left )shifts bits to the left .The msb is shifted into the rightmost bit . The CF also gets the bit shifted out of the msb . 0 1 1 0 0 1 0 1 000 1 1000 0 1111 11111 CF CF 1-S 2-S
  • 16. ROTATE INSTRUCTION: ROR • The instruction ROR (rotate right ) works just like ROL , except that the bits are rotate to the right .The rightmost bit is shifted into the msb , and also into The CF. 0 1 1 0 0 1 0 1 00000 000 01 0 1 1 1 1 1 1 1 1-S 2-S CF CF
  • 17. ROTATE INSTRUCTION: RCL 0 1 1 0 0 1 0 1 000 0 1000 1111 0111 1 0 • The instruction RCL (Rotate through carry left ) shifts the bits of the destination to the left. The msb is shifted into the CF, and the previous value of CF is shifted into the rightmost bit. 1-S 2-S
  • 18. ROTATE INSTRUCTION: RCR 0 1 1 0 0 1 0 1 0000 00 00 1 1 1 1 1 1 1-S 2-S 0 1 1 1 The instruction RCR( Rotate through carry right) works just like RCL, except that the bits are rotated to the right. CF