1 / 6

Understanding Conditional Branching in Computer Programming

This chapter delves into the program control group, focusing on conditional branching in computer programming. It covers essential instructions such as True (T), False (F), and various condition checks including High, Low, Equal, and Not Equal. The text explains how to properly utilize conditions like Carry Clear, Overflow Set, plus or minus checks, and comparisons between signed and unsigned integers. Special emphasis is placed on branch instructions like BHI, BLS, BNE, and BEQ, providing a comprehensive guide for implementing effective conditional logic in programming.

veata
Télécharger la présentation

Understanding Conditional Branching in Computer Programming

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. Chapter 3

  2. Program Control Group • T True None • F False None • HI High C+Z=0 • LS Lower or Same C+Z=1 • CC Carry Clear C=0 • CS Carry Set C=1 • NE Not Equal Z=0 • EQ Equal Z=1 • VC Overflow Clear V=0 • VS Overflow Set V=1 • PL Plus N=0 • MI Minus N=1 • GE Greater than or Equal N xor V=0 • LT Less than N xor V=1 • GT Greater Than Z+(N xor V)=0 • LE Lower Than or Equal Z+(N xor V)=0

  3. Conditional Branch • BHI Branch if High • BLS Branch if Lower or Same • BCC Branch if Carry Clear • BCS Branch if Carry Set • BNE Branch if Not Equal • BEQ Branch if Equal • BVC Branch if Overflow Clear • BVS Branch if Overflow Set • BPL Branch if Plus • BMI Branch if Minus • BGE Branch if Greater than or Equal • BLT Branch if Less than • BGT Branch if Greater Than • BLE Branch if Lower Than or Equal

  4. Signed and Unsigned Comparison • If both the values are signed • BGE Branch if Greater than or Equal • BLT Branch if Less than • BGT Branch if Greater Than • BLE Branch if Lower Than or Equal • BNE Branch if Not Equal • BEQ Branch if Equal

  5. Signed and Unsigned Comparison • If both the numbers are unsigned for comparison • BHI Branch if High • BLS Branch if Lower or Same • BCC Branch if Carry Clear • BCS Branch if Carry Set • BNE Branch if Not Equal • BEQ Branch if Equal

  6. Decrement and Branch Condition • BHI Branch if High • BLS Branch if Lower or Same • BCC Branch if Carry Clear • BCS Branch if Carry Set • BNE Branch if Not Equal • BEQ Branch if Equal • BVC Branch if Overflow Clear • BVS Branch if Overflow Set • BPL Branch if Plus • BMI Branch if Minus • BGE Branch if Greater than or Equal • BLT Branch if Less than • BGT Branch if Greater Than • BLE Branch if Lower Than or Equal

More Related