SlideShare a Scribd company logo
ASSEMBLY LANGUAGE
COURCE CODE#CSC221
JUMPS
BY:
NADEEM AHMED
JUMP
 A jump is a instruction used to control the flow of
program.
Types of jumps:
1. Unconditional Jump
2. Conditional Jump
Unconditional Jump
 A jump without using any condition is known as
unconditional jump.
Or
Jump to label without any condition.
syntax:
JMP label_name
Example:
Label1:
mov dl,'a'
mov ah,02
int 21h
jmp Label1
Conditional Jump
 A jump with using condition is known as
conditional jump.
Or
Jump to label with condition.
syntax:
J<condition> label_name
(Let us discuss the CMP instruction before discussing the
conditional instructions.)
CMP Instruction
 Compares the destination operand to the source operand
Nondestructive subtraction of source from destination (destination
operand is not changed)
Syntax:
CMP destination, source
Note:
Cmp reg, reg Cmp dl,aI
Cmp reg, constant Cmp dl, 3
Cmp reg, [memory address] Cmp dl, [sI]
(1 of 3)
CMP Instruction
• Case 3: destination > source
mov al,6
mov bl,5
cmp al,bl
; ZF = 0, CF = 0
(2 of 3)
mov al,5
mov bl,5
cmp al,bl
; Zero flag set
Case 1: destination == source
mov al,4
mov bl,5
cmp al,bl
; Carry flag set
• Case 2: destination < source
The comparisons shown here are performed with “Unsigned"
integers.
CMP Instruction (3 of 3)
• Case 1: destination >source
mov al,5
Mov bl,-2
cmp al,bl
; Sign flag == Overflow flag
• Case 2 : destination < source
mov al,-1
Mov bl,5
cmp al,bl
; Sign flag != Overflow flag
The comparisons shown here are performed with "signed"
integers.
Conditional Jump For Unsigned Numbers
 Following are the conditional jump instructions used on
unsigned data used for logical operations −
Instruction Description Flags tested
JE/JZ Jump Equal or Jump Zero ZF
JNE/JNZ Jump not Equal or Jump Not Zero ZF
JA/JNBE Jump Above or Jump Not Below/Equal CF, ZF
JAE/JNB Jump Above/Equal or Jump Not Below CF
JB/JNAE Jump Below or Jump Not Above/Equal CF
JBE/JNA Jump Below/Equal or Jump Not Above AF, CF
Conditional Jump For Signed Numbers
 Following are the conditional jump instructions used on
unsigned data used for logical operations −
Instruction Description Flags tested
JE/JZ Jump Equal or Jump Zero ZF
JNE/JNZ Jump not Equal or Jump Not Zero ZF
JG/JNLE Jump Greater or Jump Not Less/Equal OF, SF, ZF
JGE/JNL Jump Greater/Equal or Jump Not Less OF, SF
JL/JNGE Jump Less or Jump Not Greater/Equal OF, SF
JLE/JNG Jump Less/Equal or Jump Not Greater OF, SF, ZF
Conditional Jump With Flags
 The following conditional jump instructions have special
uses and check the value of flags −
Instruction Description Flags tested
JC Jump If Carry CF
JNC Jump If No Carry CF
JO Jump If Overflow OF
JNO Jump If No Overflow OF
JP/JPE Jump Parity or Jump Parity Even PF
JNP/JPO Jump No Parity or Jump Parity Odd PF
JS Jump Sign (negative value) SF
JNS Jump No Sign (positive value) SF
Any Question?

More Related Content

What's hot

Stack organization
Stack organizationStack organization
Stack organizationchauhankapil
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing ModesMayank Garg
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly languageAhmed M. Abed
 
Program control instructions
Program control instructionsProgram control instructions
Program control instructionsDr. Girish GS
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer languageSanjeev Patel
 
Register transfer language & its micro operations
Register transfer language & its micro operationsRegister transfer language & its micro operations
Register transfer language & its micro operationsLakshya Sharma
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086saurav kumar
 
Flow control instructions
Flow control instructionsFlow control instructions
Flow control instructionsProdip Ghosh
 
Ll(1) Parser in Compilers
Ll(1) Parser in CompilersLl(1) Parser in Compilers
Ll(1) Parser in CompilersMahbubur Rahman
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set ArchitectureDilum Bandara
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086Mahalakshmiv11
 
Flag Registers (Assembly Language)
Flag Registers (Assembly Language)Flag Registers (Assembly Language)
Flag Registers (Assembly Language)Anwar Hasan Shuvo
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output OrganizationKamal Acharya
 

What's hot (20)

Assembly 8086
Assembly 8086Assembly 8086
Assembly 8086
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Stack organization
Stack organizationStack organization
Stack organization
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing Modes
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly language
 
Program control instructions
Program control instructionsProgram control instructions
Program control instructions
 
Input-Buffering
Input-BufferingInput-Buffering
Input-Buffering
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer language
 
Register transfer language & its micro operations
Register transfer language & its micro operationsRegister transfer language & its micro operations
Register transfer language & its micro operations
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
Flow control instructions
Flow control instructionsFlow control instructions
Flow control instructions
 
Unit 4-booth algorithm
Unit 4-booth algorithmUnit 4-booth algorithm
Unit 4-booth algorithm
 
Ll(1) Parser in Compilers
Ll(1) Parser in CompilersLl(1) Parser in Compilers
Ll(1) Parser in Compilers
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
 
ADDRESSING MODES
ADDRESSING MODESADDRESSING MODES
ADDRESSING MODES
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086
 
Flag Registers (Assembly Language)
Flag Registers (Assembly Language)Flag Registers (Assembly Language)
Flag Registers (Assembly Language)
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output Organization
 

Similar to Jumps in Assembly Language.

Chap3 program flow control instructions
Chap3 program flow control instructionsChap3 program flow control instructions
Chap3 program flow control instructionsHarshitParkar6677
 
Chapter3 program flow control instructions
Chapter3 program flow control instructionsChapter3 program flow control instructions
Chapter3 program flow control instructionsHarshitParkar6677
 
Jump&Loop instruction
Jump&Loop instructionJump&Loop instruction
Jump&Loop instructionjosnapv
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...Bilal Amjad
 
Loops Basics
Loops BasicsLoops Basics
Loops BasicsMushiii
 

Similar to Jumps in Assembly Language. (12)

Al2ed chapter8
Al2ed chapter8Al2ed chapter8
Al2ed chapter8
 
Chap3 program flow control instructions
Chap3 program flow control instructionsChap3 program flow control instructions
Chap3 program flow control instructions
 
Chapter3 program flow control instructions
Chapter3 program flow control instructionsChapter3 program flow control instructions
Chapter3 program flow control instructions
 
Flag control
Flag controlFlag control
Flag control
 
Jump&Loop instruction
Jump&Loop instructionJump&Loop instruction
Jump&Loop instruction
 
Branching
BranchingBranching
Branching
 
Chapter2c
Chapter2cChapter2c
Chapter2c
 
microcontroller.ppt
microcontroller.pptmicrocontroller.ppt
microcontroller.ppt
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
 
Chapt 06
Chapt 06Chapt 06
Chapt 06
 
Chapt 06
Chapt 06Chapt 06
Chapt 06
 
Loops Basics
Loops BasicsLoops Basics
Loops Basics
 

More from NA000000

JAVA Naming Conventions By NADEEM AHMED FROM DEPALPUR
JAVA Naming Conventions By NADEEM AHMED FROM DEPALPURJAVA Naming Conventions By NADEEM AHMED FROM DEPALPUR
JAVA Naming Conventions By NADEEM AHMED FROM DEPALPURNA000000
 
Line Of Code(LOC) In Software Engineering By NADEEM AHMED FROM DEPALPUR
Line Of Code(LOC) In Software Engineering By NADEEM AHMED FROM DEPALPURLine Of Code(LOC) In Software Engineering By NADEEM AHMED FROM DEPALPUR
Line Of Code(LOC) In Software Engineering By NADEEM AHMED FROM DEPALPURNA000000
 
Critical Path Method In Software Engineering By NADEEM AHMED
Critical Path Method In Software Engineering By NADEEM AHMED Critical Path Method In Software Engineering By NADEEM AHMED
Critical Path Method In Software Engineering By NADEEM AHMED NA000000
 
COCOMO Modal In Software Engineering By NADEEM AHMED
COCOMO Modal In Software Engineering By NADEEM AHMED COCOMO Modal In Software Engineering By NADEEM AHMED
COCOMO Modal In Software Engineering By NADEEM AHMED NA000000
 
LEGACY SYSTEM In Software Engineering By NADEEM AHMED
LEGACY SYSTEM In Software Engineering By NADEEM AHMED LEGACY SYSTEM In Software Engineering By NADEEM AHMED
LEGACY SYSTEM In Software Engineering By NADEEM AHMED NA000000
 
Modal Driven Architecture In Software Engineering By NADEEM AHMED
Modal Driven Architecture In Software Engineering By NADEEM AHMED Modal Driven Architecture In Software Engineering By NADEEM AHMED
Modal Driven Architecture In Software Engineering By NADEEM AHMED NA000000
 
Software Testing By NADEEM AHMED FROM DEPALPUR
Software Testing By NADEEM AHMED FROM DEPALPURSoftware Testing By NADEEM AHMED FROM DEPALPUR
Software Testing By NADEEM AHMED FROM DEPALPURNA000000
 
Software Inspection By NADEEM AHMED FROM DEPALPUR
Software Inspection By NADEEM AHMED FROM DEPALPURSoftware Inspection By NADEEM AHMED FROM DEPALPUR
Software Inspection By NADEEM AHMED FROM DEPALPURNA000000
 
Cleanroom Software Engineering By NADEEM AHMED FROM DEPALPUR
Cleanroom Software Engineering By NADEEM AHMED FROM DEPALPURCleanroom Software Engineering By NADEEM AHMED FROM DEPALPUR
Cleanroom Software Engineering By NADEEM AHMED FROM DEPALPURNA000000
 
UML Diagrams By NADEEM AHMED FROM DEPALPUR
UML Diagrams By NADEEM AHMED FROM DEPALPURUML Diagrams By NADEEM AHMED FROM DEPALPUR
UML Diagrams By NADEEM AHMED FROM DEPALPURNA000000
 
Biometrics
BiometricsBiometrics
BiometricsNA000000
 
Computer Networks By NADEEM AHMED
Computer Networks By NADEEM AHMED Computer Networks By NADEEM AHMED
Computer Networks By NADEEM AHMED NA000000
 
Cloud computing by NADEEM AHMED
Cloud computing by NADEEM AHMEDCloud computing by NADEEM AHMED
Cloud computing by NADEEM AHMEDNA000000
 
Iot proposal by nadeem ahmed
Iot proposal by nadeem ahmedIot proposal by nadeem ahmed
Iot proposal by nadeem ahmedNA000000
 
Assignment#1
Assignment#1Assignment#1
Assignment#1NA000000
 
Project proposal oop
Project proposal oopProject proposal oop
Project proposal oopNA000000
 

More from NA000000 (17)

JAVA Naming Conventions By NADEEM AHMED FROM DEPALPUR
JAVA Naming Conventions By NADEEM AHMED FROM DEPALPURJAVA Naming Conventions By NADEEM AHMED FROM DEPALPUR
JAVA Naming Conventions By NADEEM AHMED FROM DEPALPUR
 
Line Of Code(LOC) In Software Engineering By NADEEM AHMED FROM DEPALPUR
Line Of Code(LOC) In Software Engineering By NADEEM AHMED FROM DEPALPURLine Of Code(LOC) In Software Engineering By NADEEM AHMED FROM DEPALPUR
Line Of Code(LOC) In Software Engineering By NADEEM AHMED FROM DEPALPUR
 
Critical Path Method In Software Engineering By NADEEM AHMED
Critical Path Method In Software Engineering By NADEEM AHMED Critical Path Method In Software Engineering By NADEEM AHMED
Critical Path Method In Software Engineering By NADEEM AHMED
 
COCOMO Modal In Software Engineering By NADEEM AHMED
COCOMO Modal In Software Engineering By NADEEM AHMED COCOMO Modal In Software Engineering By NADEEM AHMED
COCOMO Modal In Software Engineering By NADEEM AHMED
 
LEGACY SYSTEM In Software Engineering By NADEEM AHMED
LEGACY SYSTEM In Software Engineering By NADEEM AHMED LEGACY SYSTEM In Software Engineering By NADEEM AHMED
LEGACY SYSTEM In Software Engineering By NADEEM AHMED
 
Modal Driven Architecture In Software Engineering By NADEEM AHMED
Modal Driven Architecture In Software Engineering By NADEEM AHMED Modal Driven Architecture In Software Engineering By NADEEM AHMED
Modal Driven Architecture In Software Engineering By NADEEM AHMED
 
Software Testing By NADEEM AHMED FROM DEPALPUR
Software Testing By NADEEM AHMED FROM DEPALPURSoftware Testing By NADEEM AHMED FROM DEPALPUR
Software Testing By NADEEM AHMED FROM DEPALPUR
 
Software Inspection By NADEEM AHMED FROM DEPALPUR
Software Inspection By NADEEM AHMED FROM DEPALPURSoftware Inspection By NADEEM AHMED FROM DEPALPUR
Software Inspection By NADEEM AHMED FROM DEPALPUR
 
Cleanroom Software Engineering By NADEEM AHMED FROM DEPALPUR
Cleanroom Software Engineering By NADEEM AHMED FROM DEPALPURCleanroom Software Engineering By NADEEM AHMED FROM DEPALPUR
Cleanroom Software Engineering By NADEEM AHMED FROM DEPALPUR
 
UML Diagrams By NADEEM AHMED FROM DEPALPUR
UML Diagrams By NADEEM AHMED FROM DEPALPURUML Diagrams By NADEEM AHMED FROM DEPALPUR
UML Diagrams By NADEEM AHMED FROM DEPALPUR
 
Biometrics
BiometricsBiometrics
Biometrics
 
Computer Networks By NADEEM AHMED
Computer Networks By NADEEM AHMED Computer Networks By NADEEM AHMED
Computer Networks By NADEEM AHMED
 
Cloud computing by NADEEM AHMED
Cloud computing by NADEEM AHMEDCloud computing by NADEEM AHMED
Cloud computing by NADEEM AHMED
 
Iot proposal by nadeem ahmed
Iot proposal by nadeem ahmedIot proposal by nadeem ahmed
Iot proposal by nadeem ahmed
 
Biomatric
BiomatricBiomatric
Biomatric
 
Assignment#1
Assignment#1Assignment#1
Assignment#1
 
Project proposal oop
Project proposal oopProject proposal oop
Project proposal oop
 

Recently uploaded

Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportAvinash Rai
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxCapitolTechU
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...Nguyen Thanh Tu Collection
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chipsGeoBlogs
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleCeline George
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptSourabh Kumar
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersPedroFerreira53928
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxbennyroshan06
 
Advances in production technology of Grapes.pdf
Advances in production technology of Grapes.pdfAdvances in production technology of Grapes.pdf
Advances in production technology of Grapes.pdfDr. M. Kumaresan Hort.
 
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringBasic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringDenish Jangid
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
 
Forest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDFForest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDFVivekanand Anglo Vedic Academy
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfPo-Chuan Chen
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPCeline George
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptxmansk2
 

Recently uploaded (20)

Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Advances in production technology of Grapes.pdf
Advances in production technology of Grapes.pdfAdvances in production technology of Grapes.pdf
Advances in production technology of Grapes.pdf
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringBasic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Forest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDFForest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDF
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 

Jumps in Assembly Language.

  • 2. JUMP  A jump is a instruction used to control the flow of program. Types of jumps: 1. Unconditional Jump 2. Conditional Jump
  • 3. Unconditional Jump  A jump without using any condition is known as unconditional jump. Or Jump to label without any condition. syntax: JMP label_name Example: Label1: mov dl,'a' mov ah,02 int 21h jmp Label1
  • 4. Conditional Jump  A jump with using condition is known as conditional jump. Or Jump to label with condition. syntax: J<condition> label_name (Let us discuss the CMP instruction before discussing the conditional instructions.)
  • 5. CMP Instruction  Compares the destination operand to the source operand Nondestructive subtraction of source from destination (destination operand is not changed) Syntax: CMP destination, source Note: Cmp reg, reg Cmp dl,aI Cmp reg, constant Cmp dl, 3 Cmp reg, [memory address] Cmp dl, [sI] (1 of 3)
  • 6. CMP Instruction • Case 3: destination > source mov al,6 mov bl,5 cmp al,bl ; ZF = 0, CF = 0 (2 of 3) mov al,5 mov bl,5 cmp al,bl ; Zero flag set Case 1: destination == source mov al,4 mov bl,5 cmp al,bl ; Carry flag set • Case 2: destination < source The comparisons shown here are performed with “Unsigned" integers.
  • 7. CMP Instruction (3 of 3) • Case 1: destination >source mov al,5 Mov bl,-2 cmp al,bl ; Sign flag == Overflow flag • Case 2 : destination < source mov al,-1 Mov bl,5 cmp al,bl ; Sign flag != Overflow flag The comparisons shown here are performed with "signed" integers.
  • 8. Conditional Jump For Unsigned Numbers  Following are the conditional jump instructions used on unsigned data used for logical operations − Instruction Description Flags tested JE/JZ Jump Equal or Jump Zero ZF JNE/JNZ Jump not Equal or Jump Not Zero ZF JA/JNBE Jump Above or Jump Not Below/Equal CF, ZF JAE/JNB Jump Above/Equal or Jump Not Below CF JB/JNAE Jump Below or Jump Not Above/Equal CF JBE/JNA Jump Below/Equal or Jump Not Above AF, CF
  • 9. Conditional Jump For Signed Numbers  Following are the conditional jump instructions used on unsigned data used for logical operations − Instruction Description Flags tested JE/JZ Jump Equal or Jump Zero ZF JNE/JNZ Jump not Equal or Jump Not Zero ZF JG/JNLE Jump Greater or Jump Not Less/Equal OF, SF, ZF JGE/JNL Jump Greater/Equal or Jump Not Less OF, SF JL/JNGE Jump Less or Jump Not Greater/Equal OF, SF JLE/JNG Jump Less/Equal or Jump Not Greater OF, SF, ZF
  • 10. Conditional Jump With Flags  The following conditional jump instructions have special uses and check the value of flags − Instruction Description Flags tested JC Jump If Carry CF JNC Jump If No Carry CF JO Jump If Overflow OF JNO Jump If No Overflow OF JP/JPE Jump Parity or Jump Parity Even PF JNP/JPO Jump No Parity or Jump Parity Odd PF JS Jump Sign (negative value) SF JNS Jump No Sign (positive value) SF