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

Program control instructions
Program control instructionsProgram control instructions
Program control instructionsDr. Girish GS
 
Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructionsRavi Anand
 
8086 instructions
8086 instructions8086 instructions
8086 instructionsRavi Anand
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programmingKartik Sharma
 
Multiplication & division instructions microprocessor 8086
Multiplication & division instructions microprocessor 8086Multiplication & division instructions microprocessor 8086
Multiplication & division instructions microprocessor 8086University of Gujrat, Pakistan
 
Stack organization
Stack organizationStack organization
Stack organizationchauhankapil
 
Flags
FlagsFlags
FlagsCME
 
Register organization, stack
Register organization, stackRegister organization, stack
Register organization, stackAsif Iqbal
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086Mahalakshmiv11
 
Branching instructions in 8086 microprocessor
Branching instructions in 8086 microprocessorBranching instructions in 8086 microprocessor
Branching instructions in 8086 microprocessorRabin BK
 
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
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer ArchitectureHaris456
 
Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programmingKartik Sharma
 
Stack in 8085 microprocessor
Stack in 8085 microprocessorStack in 8085 microprocessor
Stack in 8085 microprocessorhepzijustin
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output OrganizationKamal Acharya
 
Register Transfer Language,Bus and Memory Transfer
Register Transfer Language,Bus and Memory TransferRegister Transfer Language,Bus and Memory Transfer
Register Transfer Language,Bus and Memory Transferlavanya marichamy
 

What's hot (20)

Program control instructions
Program control instructionsProgram control instructions
Program control instructions
 
Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructions
 
Assembly 8086
Assembly 8086Assembly 8086
Assembly 8086
 
8086 instructions
8086 instructions8086 instructions
8086 instructions
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programming
 
Multiplication & division instructions microprocessor 8086
Multiplication & division instructions microprocessor 8086Multiplication & division instructions microprocessor 8086
Multiplication & division instructions microprocessor 8086
 
Stack organization
Stack organizationStack organization
Stack organization
 
Flags
FlagsFlags
Flags
 
Register organization, stack
Register organization, stackRegister organization, stack
Register organization, stack
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086
 
Branching instructions in 8086 microprocessor
Branching instructions in 8086 microprocessorBranching instructions in 8086 microprocessor
Branching instructions in 8086 microprocessor
 
Instruction set
Instruction setInstruction set
Instruction set
 
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 ...
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer Architecture
 
ADDRESSING MODES
ADDRESSING MODESADDRESSING MODES
ADDRESSING MODES
 
Instruction formats-in-8086
Instruction formats-in-8086Instruction formats-in-8086
Instruction formats-in-8086
 
Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programming
 
Stack in 8085 microprocessor
Stack in 8085 microprocessorStack in 8085 microprocessor
Stack in 8085 microprocessor
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output Organization
 
Register Transfer Language,Bus and Memory Transfer
Register Transfer Language,Bus and Memory TransferRegister Transfer Language,Bus and Memory Transfer
Register Transfer Language,Bus and Memory Transfer
 

Viewers also liked

Flow control in computer
Flow control in computerFlow control in computer
Flow control in computerrud_d_rcks
 
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

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
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
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 

Recently uploaded (20)

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
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...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 

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