Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

INTRODUCTION TO 8085 INSTRUCTIONS 205

For example, to instruct the microprocessor to go to the memory location 2000H,


the mnemonics and the machine code entered will be as follows:

Machine Code Mnemonics


C3 .1MP 2000H
00
20
Note the sequence of the machine code. The 16-bit memory address of the jump lo-
cation is entered in the reverse order, the low-order byte (OOH) first, followed by the high-
order byte (20H). The 8085 is designed for such a reverse sequence. The jump location
can also be specified using a label. While writing a program, you may not know the ex-
act memory location to which a program sequence should be directed. In that case, the
memory address can be specified with a label (or a name). This is particularly useful and
necessary for an assembler. However, you should not specify both a label and its 16-bit
address in a Jump instruction. Furthermore, you cannot use the same label for different
memory locations. The next illustrative program shows the use of the Jump instruction.

6.4.2 Illustrative Program: Unconditional Jump to Set Up


a Continuous Loop
PROBLEM STATEMENT
Modify the program in Example 6.2 to read the switch positions continuously and turn on
the appliances accordingly.

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

You might also like