120 likes | 256 Views
Introduction to Computer Organization and Assembly Language. Sheet 4. Unconditional Jumps – JMP Instruction. JMP destination_lable. Conditional Jumps – Signed Jumps. Conditional Jumps – Unsigned Jumps. Conditional Jumps – Single Flag Jumps. CMP Instruction. CMP destination, source
E N D
Introduction to Computer Organization and Assembly Language Sheet 4 By: Nora Alaqeel
Unconditional Jumps – JMP Instruction JMPdestination_lable
CMP Instruction CMPdestination, source Just like SUB but the destination does not change. Changes the Flags. Used with conditional jumps.
Example – IF, THEN, ELSE • Suppose AL and BL contain extended ASCII characters,Display the one that comes first in the character sequence
Example – AND condition Read a character, and if it’s an uppercase letter, Accept it
Example – OR Condition • Read a character. If it’s 'y' or 'Y', display it; otherwise, terminate the program.
LOOP Instruction LOOPdestination_Label • Display a row of 80 stars.
Example – While Loop Count number of characters entered and terminate if carriage return is entered.
Example – Repeat Loop Read characters until a blank is read terminate.