0% found this document useful (0 votes)
56 views

6.4.4 Illustrative Program: Testing of The Carry Flag: Flowchart and

This document discusses testing the carry flag in assembly language programs. It provides an example problem of adding two hexadecimal numbers and displaying either 01H or the sum depending on whether the addition results in a carry. The problem is broken down into steps and represented with a flowchart. The flowchart is then translated into an assembly language program using jump instructions like JNC to change the sequence if there is no carry.

Uploaded by

Ameer Hamza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

6.4.4 Illustrative Program: Testing of The Carry Flag: Flowchart and

This document discusses testing the carry flag in assembly language programs. It provides an example problem of adding two hexadecimal numbers and displaying either 01H or the sum depending on whether the addition results in a carry. The problem is broken down into steps and represented with a flowchart. The flowchart is then translated into an assembly language program using jump instructions like JNC to change the sequence if there is no carry.

Uploaded by

Ameer Hamza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

INTRODUCTION TO 8085 INSTRUCTIONS 207

All the Jump instructions are listed here for an overview. The Zero and Carry flags
and related Jump instructions are used frequently. They are illustrated in the following ex-
amples.

6.4.4 illustrative Program: Testing of the Carry Flag


PROBLEM STATEMENT
Load the hexadecimal numbers 9BH and A7H in registers D and E, respectively, and add
the numbers. If the sum is greater than FFH, display 01H at output PORTO; otherwise,
display the sum.

PROBLEM ANALYSIS AND FLOWCHART


The problem can be divided into the following steps:
1. Load the numbers in the registers.
2. Add the numbers.
3. Check the sum.
Is the sum > FFH?

YES NO

4. Get ready to Go to Step 5


display 01 to display the sum

5. Display.
6. End.
FLOWCHART AND ASSEMBLY LANGUAGE PROGRAM
The six steps listed above can be converted into a flowchart and assembly language pro-
gram as shown in Figure 6.10.
Step 3 is a decision-making block. In a flowchart, the decision-making process is
represented by a diamond shape. It is important to understand how this block is translated
into the assembly language program. By examining the block carefully you will notice
the following:
1. The question is: Is there a Carry?
2. If the answer is no, change the sequence of the program. In the assembly language this
is equivalent to Jump On No Carry—JNC.

You might also like