Page 146 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 146
Introduction to Microprocessors
Notes
Fig.10.3: Generalized programming flowchart.
1. Planning stage: In this step setting up is done. It is most difficult step as initial setup depends
on the requirement of the following step.
2. Data are generally stored in memory or read from the input port. In this step the data is
brought into the microprocessor for operations.
3. All data manipulations are carried out in this step.
4. Storage of partial results in registers is done in this step.
5. The microprocessor does not know whether it has completed all the operations. Before it can
repeat the task, it needs to get ready for the next operations.
6. This is a decision-making step. It decides whether to change the sequence of execution and
repeat or to go to the next instruction.
7. This step involves either sending the result to an output port or storing in the memory.
Example: The following block of data is stored in the memory locations from 2050H to
2055H. Transfer the data to the location 4055H to 405AH in the reverse order.
Data (H): 22, B4, 1A, 27, 78, 99
Solution: The assembly language program for the above stated problem is as follows:
Memory Label Opcode Operands Remarks
21 START: LXI H, 2050H ; Index for data source
50
11 LXI D, 405AH ; Index for data
Contd. ...
140 LOVELY PROFESSIONAL UNIVERSITY