SlideShare a Scribd company logo
1 of 32
PRODIP GHOSH
īļFlow Control
Instructions
Flow Control Instructions
īļ Program using the different instruction :-
īƒ˜ Conditional and Unconditional Jump Instructions
īƒ˜Compare Instruction
īƒ˜Loop Instruction
Conditional Jump
īļSyntax:
ī‚„Jxxx destination_label
ī‚„Where xxx represents the condition
īļIf condition is true, the next instruction to be executed is the one at
destination_label.
īļIf condition is false, the instruction immediately following the jump is
done next.
Conditional Jump
īļThe destination_label must precede the jump instruction by no more
than 126 bytes.
īļTo implement a conditional jump, the CPU looks at the FLAG
register (set by last instruction executed by the processor).
īļJMP instructions themselves do not affect flags.
Unconditional Jump
īļSyntax:
ī‚„JMP destination_label
īļPurpose: To Transfer control to another part of the program.
īļExample:
ī‚„ MOV AX, 5
ī‚„ MOV BX, 2
ī‚„ JMP LABEL_SUB
ī‚„ ADD AX, BX ;this instruction will never execute
ī‚„ LABEL_SUB:
ī‚„ SUB AX, BX
Categories of Conditional Jump
īļSigned Jumps: This is used when a signed interpretation is being
given to result.
Symbol Description Condition for Jumps
JG/JNLE Jump if greater than
Jump if not less than or equal to
ZF = 0 and SF = OF
JGE/JNL Jump if greater than or equal to
Jump if not less than
SF = OF
JL/JNGE Jump if less than
Jump if not greater than or equal to
SF <> OF
JLE/JNG Jump if less than or equal to
Jump if not greater than
ZF = 1 and SF <> OF
Categories of Conditional Jump
īļUnsigned Jumps: This is used for an unsigned interpretation of result
Symbol Description Condition for Jumps
JA/JNBE Jump if above than
Jump if not below than or equal to
ZF = 0 and CF = 0
JAE/JNB Jump if above than or equal to
Jump if not below than
CF = 0
JB/JNAE Jump if below than
Jump if not above than or equal to
CF = 1
JBE/JNA Jump if below than or equal to
Jump if not above than
ZF = 1 and CF = 1
Categories of Conditional Jump
īļSingle-Flag Jumps: Which operate on settings of individual flags.
Compare Instruction
īļCMP (compare) instruction performs an implied subtraction of a
source operand from destination operand. Neither operand is
modified.
īƒ˜ CMP destination, source
īļCompare Instruction maintain three condition:
īƒ˜ Destination < Source
īƒ˜ Destination = Source
īƒ˜ Destination > Source
Examples
OUTPUT
High Level Language Structures
īļBranching Structure
īƒ˜ IF-THEN
īƒ˜ IF-THEN-ELSE
īƒ˜ CASE
IF-THEN
IF-THEN-ELSE
CASE
īļA case is a multiway branch structure that tests a register,
variable, or expression for particular values or range of
values. The general form is as follows:
īļCase Expression
ī‚„values_1: statements_1
ī‚„values_2: statements_2
â€Ļâ€Ļâ€Ļâ€Ļ..
ī‚„values_n: statements_n
ī‚„END_CASE
CASE Examples
High Level Language Structures
īļBranching with Compound Conditions
īƒ˜ AND CONDITIONS
īƒ˜ OR CONDITIONS
AND CONDITION
īƒ˜ An AND condition is true if and only if condition_1 and
condition_2 are both true.
īƒ˜ If any condition is false, then the whole thing is false.
AND CONDITION EXAMPLES
OR CONDITION
īƒ˜ If condition_1 OR condition_2 is true then an OR conditions is true.
īƒ˜ If both conditions are false, then the whole thing is false.
OR CONDITION EXAMPLES
High Level Language Structures
īļLooping Structures
īƒ˜FOR LOOP
īƒ˜WHILE LOOP
īƒ˜REPEAT LOOP
LOOPING STRUCTURES
īļFOR LOOP
ī‚„Executed at least once.
ī‚„ If CX contains 0, the loop instruction decrements CX (CX =
FFFFh)
ī‚„ To prevent this, use instruction JCXZ before the loop.
;initialize CX
JCXZ SKIP
TOP:
;body of the loop
LOOP TOP
SKIP:
Examples For Looping Structures
LOOPING STRUCTURES
īļWHILE LOOP
ī‚„ WHILE condition DO
ī‚„ ;statements
ī‚„ END_WHILE
īƒ˜ WHILE LOOP checks the terminating condition at the top of the
loop, so don’t forget to initialize variables.
EXAMPLES WHILE STRUCTURES
LOOPING STRUCTURES
īļREPEAT LOOP
īƒ˜ REPEAT
īƒ˜ ;statements
īƒ˜ UNTIL condition
īļFirst statements are executed, then the condition is checked.
īļIf true, the loop terminates; if false, control branches to the top of the
loop
Examples Repeat Structures
Flow control instructions
Flow control instructions

More Related Content

What's hot

8086 instruction set
8086 instruction set8086 instruction set
8086 instruction setSazzad Hossain
 
Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programmingKartik Sharma
 
Chapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registersChapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registerswarda aziz
 
8086 String Instructions.pdf
8086 String Instructions.pdf8086 String Instructions.pdf
8086 String Instructions.pdfA. S. M. Badrudduza
 
Special of 80386 registers
Special of 80386 registersSpecial of 80386 registers
Special of 80386 registersTanmoy Mazumder
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086Akhila Rahul
 
Jumps in Assembly Language.
Jumps in Assembly Language.Jumps in Assembly Language.
Jumps in Assembly Language.NA000000
 
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
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formatsMazin Alwaaly
 
Unit 3 sp assembler
Unit 3 sp assemblerUnit 3 sp assembler
Unit 3 sp assemblerDeepmala Sharma
 
Computer instructions
Computer instructionsComputer instructions
Computer instructionsAnuj Modi
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086Mahalakshmiv11
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 80869840596838
 
flag register of 8086
flag register of 8086flag register of 8086
flag register of 8086asrithak
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...Bilal Amjad
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorAshita Agrawal
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Bilal Amjad
 
PAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 MicroporcessorPAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 MicroporcessorKanchanPatil34
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction FormatDhrumil Panchal
 

What's hot (20)

8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 
Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programming
 
Chapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registersChapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registers
 
8086 String Instructions.pdf
8086 String Instructions.pdf8086 String Instructions.pdf
8086 String Instructions.pdf
 
Special of 80386 registers
Special of 80386 registersSpecial of 80386 registers
Special of 80386 registers
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Jumps in Assembly Language.
Jumps in Assembly Language.Jumps in Assembly Language.
Jumps in Assembly Language.
 
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 ...
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formats
 
Unit 3 sp assembler
Unit 3 sp assemblerUnit 3 sp assembler
Unit 3 sp assembler
 
Computer instructions
Computer instructionsComputer instructions
Computer instructions
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
flag register of 8086
flag register of 8086flag register of 8086
flag register of 8086
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
PAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 MicroporcessorPAI Unit 3 Paging in 80386 Microporcessor
PAI Unit 3 Paging in 80386 Microporcessor
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction Format
 

Viewers also liked

Flow control in computer
Flow control in computerFlow control in computer
Flow control in computerrud_d_rcks
 
ARM Programlama
ARM ProgramlamaARM Programlama
ARM ProgramlamaIsmail Iltar
 
Arm modes
Arm modesArm modes
Arm modesabhi165
 
Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Chinmayee samal
 
Logic, shift and rotate instruction
Logic, shift and rotate instructionLogic, shift and rotate instruction
Logic, shift and rotate instructionkashif Shafqat
 
Control Flow Analysis
Control Flow AnalysisControl Flow Analysis
Control Flow AnalysisEdgar Barbosa
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructionsihsanjamil
 

Viewers also liked (9)

Flow control in computer
Flow control in computerFlow control in computer
Flow control in computer
 
Flag control
Flag controlFlag control
Flag control
 
ARM Programlama
ARM ProgramlamaARM Programlama
ARM Programlama
 
Arm modes
Arm modesArm modes
Arm modes
 
Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085
 
Flow of Control
Flow of ControlFlow of Control
Flow of Control
 
Logic, shift and rotate instruction
Logic, shift and rotate instructionLogic, shift and rotate instruction
Logic, shift and rotate instruction
 
Control Flow Analysis
Control Flow AnalysisControl Flow Analysis
Control Flow Analysis
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
 

Similar to Flow control instructions

Decision Making Statement in C ppt
Decision Making Statement in C pptDecision Making Statement in C ppt
Decision Making Statement in C pptMANJUTRIPATHI7
 
2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.ppt2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.pptManojKhadilkar1
 
Diploma ii cfpc u-3 handling input output and control statements
Diploma ii  cfpc u-3 handling input output and control statementsDiploma ii  cfpc u-3 handling input output and control statements
Diploma ii cfpc u-3 handling input output and control statementsRai University
 
Mca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statementsMca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statementsRai University
 
handling input output and control statements
 handling input output and control statements handling input output and control statements
handling input output and control statementsRai University
 
Decision making and looping - c programming by YEASIN NEWAJ
Decision making and looping -  c programming by YEASIN NEWAJDecision making and looping -  c programming by YEASIN NEWAJ
Decision making and looping - c programming by YEASIN NEWAJYeasinNewaj
 
Btech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statementsBtech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statementsRai University
 
Control statements anil
Control statements anilControl statements anil
Control statements anilAnil Dutt
 
Bsc cs pic u-3 handling input output and control statements
Bsc cs  pic u-3 handling input output and control statementsBsc cs  pic u-3 handling input output and control statements
Bsc cs pic u-3 handling input output and control statementsRai University
 
Control statements
Control statementsControl statements
Control statementsCutyChhaya
 
Constructs (Programming Methodology)
Constructs (Programming Methodology)Constructs (Programming Methodology)
Constructs (Programming Methodology)Jyoti Bhardwaj
 
Programming Fundamentals in C++ structures
Programming Fundamentals in  C++ structuresProgramming Fundamentals in  C++ structures
Programming Fundamentals in C++ structuresayshasafdarwaada
 

Similar to Flow control instructions (20)

Al2ed chapter8
Al2ed chapter8Al2ed chapter8
Al2ed chapter8
 
Decision Making Statement in C ppt
Decision Making Statement in C pptDecision Making Statement in C ppt
Decision Making Statement in C ppt
 
DECISION MAKING.pptx
DECISION MAKING.pptxDECISION MAKING.pptx
DECISION MAKING.pptx
 
2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.ppt2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.ppt
 
Branching
BranchingBranching
Branching
 
Control Statement programming
Control Statement programmingControl Statement programming
Control Statement programming
 
Diploma ii cfpc u-3 handling input output and control statements
Diploma ii  cfpc u-3 handling input output and control statementsDiploma ii  cfpc u-3 handling input output and control statements
Diploma ii cfpc u-3 handling input output and control statements
 
Mca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statementsMca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statements
 
handling input output and control statements
 handling input output and control statements handling input output and control statements
handling input output and control statements
 
C++ chapter 4
C++ chapter 4C++ chapter 4
C++ chapter 4
 
6.pptx
6.pptx6.pptx
6.pptx
 
Decision making and looping - c programming by YEASIN NEWAJ
Decision making and looping -  c programming by YEASIN NEWAJDecision making and looping -  c programming by YEASIN NEWAJ
Decision making and looping - c programming by YEASIN NEWAJ
 
Btech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statementsBtech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statements
 
Control statements anil
Control statements anilControl statements anil
Control statements anil
 
Bsc cs pic u-3 handling input output and control statements
Bsc cs  pic u-3 handling input output and control statementsBsc cs  pic u-3 handling input output and control statements
Bsc cs pic u-3 handling input output and control statements
 
Control statements
Control statementsControl statements
Control statements
 
Constructs (Programming Methodology)
Constructs (Programming Methodology)Constructs (Programming Methodology)
Constructs (Programming Methodology)
 
Control statements in java
Control statements in javaControl statements in java
Control statements in java
 
Programming Fundamentals in C++ structures
Programming Fundamentals in  C++ structuresProgramming Fundamentals in  C++ structures
Programming Fundamentals in C++ structures
 
Comp ppt (1)
Comp ppt (1)Comp ppt (1)
Comp ppt (1)
 

Recently uploaded

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Call Us â‰Ŋ 8377877756 â‰ŧ Call Girls In Shastri Nagar (Delhi)
Call Us â‰Ŋ 8377877756 â‰ŧ Call Girls In Shastri Nagar (Delhi)Call Us â‰Ŋ 8377877756 â‰ŧ Call Girls In Shastri Nagar (Delhi)
Call Us â‰Ŋ 8377877756 â‰ŧ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 

Recently uploaded (20)

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
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
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
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Call Us â‰Ŋ 8377877756 â‰ŧ Call Girls In Shastri Nagar (Delhi)
Call Us â‰Ŋ 8377877756 â‰ŧ Call Girls In Shastri Nagar (Delhi)Call Us â‰Ŋ 8377877756 â‰ŧ Call Girls In Shastri Nagar (Delhi)
Call Us â‰Ŋ 8377877756 â‰ŧ Call Girls In Shastri Nagar (Delhi)
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 

Flow control instructions

  • 1.
  • 4. Flow Control Instructions īļ Program using the different instruction :- īƒ˜ Conditional and Unconditional Jump Instructions īƒ˜Compare Instruction īƒ˜Loop Instruction
  • 5. Conditional Jump īļSyntax: ī‚„Jxxx destination_label ī‚„Where xxx represents the condition īļIf condition is true, the next instruction to be executed is the one at destination_label. īļIf condition is false, the instruction immediately following the jump is done next.
  • 6. Conditional Jump īļThe destination_label must precede the jump instruction by no more than 126 bytes. īļTo implement a conditional jump, the CPU looks at the FLAG register (set by last instruction executed by the processor). īļJMP instructions themselves do not affect flags.
  • 7. Unconditional Jump īļSyntax: ī‚„JMP destination_label īļPurpose: To Transfer control to another part of the program. īļExample: ī‚„ MOV AX, 5 ī‚„ MOV BX, 2 ī‚„ JMP LABEL_SUB ī‚„ ADD AX, BX ;this instruction will never execute ī‚„ LABEL_SUB: ī‚„ SUB AX, BX
  • 8. Categories of Conditional Jump īļSigned Jumps: This is used when a signed interpretation is being given to result. Symbol Description Condition for Jumps JG/JNLE Jump if greater than Jump if not less than or equal to ZF = 0 and SF = OF JGE/JNL Jump if greater than or equal to Jump if not less than SF = OF JL/JNGE Jump if less than Jump if not greater than or equal to SF <> OF JLE/JNG Jump if less than or equal to Jump if not greater than ZF = 1 and SF <> OF
  • 9. Categories of Conditional Jump īļUnsigned Jumps: This is used for an unsigned interpretation of result Symbol Description Condition for Jumps JA/JNBE Jump if above than Jump if not below than or equal to ZF = 0 and CF = 0 JAE/JNB Jump if above than or equal to Jump if not below than CF = 0 JB/JNAE Jump if below than Jump if not above than or equal to CF = 1 JBE/JNA Jump if below than or equal to Jump if not above than ZF = 1 and CF = 1
  • 10. Categories of Conditional Jump īļSingle-Flag Jumps: Which operate on settings of individual flags.
  • 11. Compare Instruction īļCMP (compare) instruction performs an implied subtraction of a source operand from destination operand. Neither operand is modified. īƒ˜ CMP destination, source īļCompare Instruction maintain three condition: īƒ˜ Destination < Source īƒ˜ Destination = Source īƒ˜ Destination > Source
  • 14. High Level Language Structures īļBranching Structure īƒ˜ IF-THEN īƒ˜ IF-THEN-ELSE īƒ˜ CASE
  • 17. CASE īļA case is a multiway branch structure that tests a register, variable, or expression for particular values or range of values. The general form is as follows: īļCase Expression ī‚„values_1: statements_1 ī‚„values_2: statements_2 â€Ļâ€Ļâ€Ļâ€Ļ.. ī‚„values_n: statements_n ī‚„END_CASE
  • 19. High Level Language Structures īļBranching with Compound Conditions īƒ˜ AND CONDITIONS īƒ˜ OR CONDITIONS
  • 20. AND CONDITION īƒ˜ An AND condition is true if and only if condition_1 and condition_2 are both true. īƒ˜ If any condition is false, then the whole thing is false.
  • 22. OR CONDITION īƒ˜ If condition_1 OR condition_2 is true then an OR conditions is true. īƒ˜ If both conditions are false, then the whole thing is false.
  • 24. High Level Language Structures īļLooping Structures īƒ˜FOR LOOP īƒ˜WHILE LOOP īƒ˜REPEAT LOOP
  • 25. LOOPING STRUCTURES īļFOR LOOP ī‚„Executed at least once. ī‚„ If CX contains 0, the loop instruction decrements CX (CX = FFFFh) ī‚„ To prevent this, use instruction JCXZ before the loop. ;initialize CX JCXZ SKIP TOP: ;body of the loop LOOP TOP SKIP:
  • 26. Examples For Looping Structures
  • 27. LOOPING STRUCTURES īļWHILE LOOP ī‚„ WHILE condition DO ī‚„ ;statements ī‚„ END_WHILE īƒ˜ WHILE LOOP checks the terminating condition at the top of the loop, so don’t forget to initialize variables.
  • 29. LOOPING STRUCTURES īļREPEAT LOOP īƒ˜ REPEAT īƒ˜ ;statements īƒ˜ UNTIL condition īļFirst statements are executed, then the condition is checked. īļIf true, the loop terminates; if false, control branches to the top of the loop