Page 145 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 145
Unit 10: Programming Techniques with Additional Instructions
The flowchart for these steps can be as follows: Notes
Figure 10.2: Flowchart of Task Repetitions.
No
Another type of loops include indexing along with the counter.
Indexing is defined as a pointer or reference to an object with sequential
numbers. Data bytes are stored in memory locations and those data bytes are
referred by their memory location.
These loops are executed in the following steps:
Step 1: Counter is setup by loading appropriate value in the register.
Step 2: An index or a memory pointer is required to locate where data bytes are stored.
Step 3: Data should be transferred from memory location to the microprocessor (ALU).
Step 4: Perform all data manipulation using ALU.
Step 5: The partial results should be temporarily stored in the register
Step 6: Decision making step, it decides whether the task is-completed or not indicated by a flag
check.
Step 7: The result should be stored or send to an output port.
These steps can be converted into a flowchart as shown in Fig. 10.2. It is a generalized flowchart
which can be used to solve many problems. Some steps or blocks can be expanded with additional
loops or some blocks may need to be interchanged in their positions.
Key points to remembers:
1. Computer is best in repeating tasks.
2. It is fast and accurate.
3. Loops are setup by using the looping technique along with counting and indexing.
4. The computer is a versatile and powerful tools.
5. setting of loops are capable in making the decision which are based on data conditions.
LOVELY PROFESSIONAL UNIVERSITY 139