1 / 26

CONTROL FLOW INSTRUCTIONS AND PROGRAM STRUCTURES

CONTROL FLOW INSTRUCTIONS AND PROGRAM STRUCTURES. Topic of lecture. 1. Flag-Control Instructions 2. Compare Instructions 3. Control Flow and Jump Instructions 4. Subroutines and Subroutine-Handling Instructions 5. The Loop and the Loop-Handling Instructions. Flag-Control Instructions.

Download Presentation

CONTROL FLOW INSTRUCTIONS AND PROGRAM STRUCTURES

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CONTROLFLOW INSTRUCTIONS ANDPROGRAM STRUCTURES

  2. Topic of lecture 1. Flag-Control Instructions 2. Compare Instructions 3. Control Flow and Jump Instructions 4. Subroutines and Subroutine-Handling Instructions 5. The Loop and the Loop-Handling Instructions

  3. Flag-Control Instructions • The flag-control instructions, when executed, directly affect the state of the flags. These instructions include: • LAHF (Load AH from flags) • SAHF (Store AH into flags)

  4. Compare Instruction

  5. Control Flow and Jump Instructions • Unconditional jump instruction. • Conditional jump instruction. • Branching structure – IF-THEN. • Loop program structure – REPEAT-UNTIL and WHILE-DO. • Applications using the loop and branch software structures.

  6. Unconditional jump

  7. Conditional jump

  8. Unconditional jump instruction

  9. Conditional jump instruction

  10. Subroutines and Subroutine-Handling Instructions • A subroutine is a special program that can be called for execution from any point in a program. • A subroutine is also known as a procedure. • A return instruction must be included at the end of the subroutine to initiate the return sequence to the main program environment. • CALL and RET instructions • PUSH and POP instructions

  11. Subroutines and Subroutine-Handling Instructions

  12. The Loop and the Loop-HandlingInstructions

More Related