Professional Documents
Culture Documents
Machine Code: Label Mnemonics Comments
Machine Code: Label Mnemonics Comments
PROBLEM ANALYSIS
One of the major drawbacks of the program in Example 6.2 is that the program reads
switch positions once and then stops. Therefore, if you want to turn on/off different ap-
pliances, you have to reset the system and start all over again. This is impractical in real-
life situations. However, the unconditional Jump instruction, in place of the HLT instruc-
tion, will allow the microcomputer to monitor the switch positions continuously.
PROGRAM
Memory Machine
Address Code Label Mnemonics Comments
2000 DB START: IN OOH ;Read input switches
2001 00
2002 D3 OUT 01H ;Turn on devices according to
2003 01 ; switch positions
2004 C3 JMP START ;Go back to beginning and
2005 00 • read the switches again
2006 20