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

Flow control instructions
Flow control instructionsFlow control instructions
Flow control instructionsProdip Ghosh
 
Timing and control
Timing and controlTiming and control
Timing and controlchauhankapil
 
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
 
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
 
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
 
Control Unit Design
Control Unit DesignControl Unit Design
Control Unit DesignVinit Raut
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer languageSanjeev Patel
 
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 instructionswarda aziz
 
Solution manual of assembly language programming and organization of the ibm ...
Solution manual of assembly language programming and organization of the ibm ...Solution manual of assembly language programming and organization of the ibm ...
Solution manual of assembly language programming and organization of the ibm ...Tayeen Ahmed
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazardAJAL A J
 
Computer instructions
Computer instructionsComputer instructions
Computer instructionsAnuj Modi
 
Register Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceRegister Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceTransweb Global Inc
 
Interfacing With High Level Programming Language
Interfacing With High Level Programming Language Interfacing With High Level Programming Language
Interfacing With High Level Programming Language .AIR UNIVERSITY ISLAMABAD
 

What's hot (20)

Basic Computer Organization and Design
Basic  Computer  Organization  and  DesignBasic  Computer  Organization  and  Design
Basic Computer Organization and Design
 
Flow control instructions
Flow control instructionsFlow control instructions
Flow control instructions
 
8086 alp
8086 alp8086 alp
8086 alp
 
Timing and control
Timing and controlTiming and control
Timing and control
 
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
 
Assembly Language
Assembly LanguageAssembly Language
Assembly Language
 
Assignment on alp
Assignment on alpAssignment on alp
Assignment on alp
 
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,...
 
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 ...
 
Control Unit Design
Control Unit DesignControl Unit Design
Control Unit Design
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer language
 
06. thumb instructions
06. thumb instructions06. thumb instructions
06. thumb instructions
 
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
 
Memory Hierarchy
Memory HierarchyMemory Hierarchy
Memory Hierarchy
 
Solution manual of assembly language programming and organization of the ibm ...
Solution manual of assembly language programming and organization of the ibm ...Solution manual of assembly language programming and organization of the ibm ...
Solution manual of assembly language programming and organization of the ibm ...
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazard
 
Computer instructions
Computer instructionsComputer instructions
Computer instructions
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Register Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceRegister Reference Instructions | Computer Science
Register Reference Instructions | Computer Science
 
Interfacing With High Level Programming Language
Interfacing With High Level Programming Language Interfacing With High Level Programming Language
Interfacing With High Level Programming Language
 

Similar to CSC221 JUMP INSTRUCTIONS

Similar to CSC221 JUMP INSTRUCTIONS (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
 
Program control instructions
Program control instructionsProgram control instructions
Program control instructions
 
Jump&Loop instruction
Jump&Loop instructionJump&Loop instruction
Jump&Loop instruction
 
Branching
BranchingBranching
Branching
 
Chapter2c
Chapter2cChapter2c
Chapter2c
 
microcontroller.ppt
microcontroller.pptmicrocontroller.ppt
microcontroller.ppt
 
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

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 

Recently uploaded (20)

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 

CSC221 JUMP INSTRUCTIONS

  • 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