60 likes | 179 Vues
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.
E N D
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
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
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
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
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