Programming The 8085
Programming The 8085
Emergency Alarm
To
Conveyor
Belts
S,
S4 Input
53 Port Data 8085
Bus MPU
S2
Do
S
So
EN
+ Input
Ena
ble
Input Output
Port Port
F2H F3H
DO,
EN EN
Input Enable Output Enable Solid-State Relays
FIGURE 6.12
Input/Output Ports to Control Manufacturing Processes
PROBLEM ANALYSIS
To perform the tasks specified in the problem, the
microprocessor needs to
1. read the switch positions.
2. check whether switches S7 and Si from the ports F1H
and F2H are on.
3. turn on the emergency signal if both switches are on,
and turn off all the conveyer
belts.
4. turn on the conveyer belts according to the switch
positions So through S4 at input port
F1H if both switches, S7 and Sic, are not on
simultaneously.
5. continue checking the switch positions.
FLOWCHART AND PROGRAM
The five steps listed above can be translated into a
flowchart and an assembly language
program as shown in Figure 6.13.
6.5.3 Documentation
A program is similar to a circuit diagram. Its purpose is to
communicate to others what
the program does and how it does it. Appropriate comments
are critical for conveying the
logic behind a program. The program as a whole should be
self-documented.