Instruction Set and Assembly Language Programming 167
accumulator. Only IN and OUT instructions deal with the input or output ports, addressed by the second
byte of the instruction. Note that in 8085 port addresses are 8-bit, while memory addresses are 16-bit.
The last three instruction types have 3-byte format. The second and third bytes in these cases contain
either the target address, LSB followed by MSB, or 16-bit data. 8085 offers only one instruction, LXI, to
load 16-bit data to a register pair, indicated in bits 4 and 5 of the rst byte of the instruction, as shown in
Figure 6.11 (l). Observe the similarity of this eld (bits 4 and 5) with the format shown in Figure 6.11 (d),
as the register pairs are also identical in both cases.
Figure 6.11 (k) shows the format for eight conditional jump and eight conditional call instructions.
Note that in both cases 16-bit address is speci ed by second and third bytes of the instruction. The
conditions are speci ed through bits 3 – 5 of the rst byte of the instruction, identical with one byte
conditional return instruction shown in Figure 6.11 (f).
Instructions that do not demand any operand (CALL or JMP) or have implicit addressing mode (like
LDA or STA) but need the help of 16-bit target address, are placed in the group shown in Figure 6.11 (j).
In this case, instruction LHLD or SHLD, respectively, loads or stores register pair HL to or from the
indicated memory address.
6.6.2 Discussions
At present, we do not have either the need or the scope for a detailed discussion on all instructions of
8085. However, we point out certain interesting facts related with these instructions after this explana-
tion of all instruction formats adopted by 8085, presented in Section 6.6.1.
At a rst glance at Table 6.5 , the reader might conclude that 8085 offers more instructions for program
branching than data transfer (29 vs 10). However, if we pick up the MOV instruction from data transfer
group, then we nd that this instruction offers 63 variations. The format of this move instruction is
MOV destination register, source register.
We already know from Chapter 5 (Figure 5.15) that 8085 offers seven general purpose 8-bit registers,
namely A, B, C, D, E, H and L. Each one of these seven registers might be a source or a destination. More-
over, any memory location addressed by the HL register pair might also be a source or destination for the
MOV instruction. All these resulted in 63 variations of MOV instruction. Of course, instructions like MOV
A, A are also included within this set of 63 instructions, which are of no use (except to kill time of the pro-
cessor in the same way as the NOP instruction). However, this scheme had made the data transfer within the
processor (or its outside) more ef cient, as all MOV instructions are single byte instructions consuming one
machine cycle for its execution. Only the memory oriented MOV instructions demand two machine cycles.
On the other side, inclusion of so many conditional CALL and conditional return instructions in the
instruction set of 8085 seems to be counter-productive. A study on the usage of these instructions might
have indicated that they are used in a very limited manner within any program body. This might be the
reason of excluding these conditional CALL and conditional return instructions from the instruction set
of 8086 ( Table 6.6 ) – the successor of 8085. If we compare instruction sets of 8085 and 8051 ( Table 6.7 ),
then we may also observe the identical trend.
The above discussions clarify one of the main design considerations for the instruction set of any pro-
cessor. In general, there is always an upper limit of the number of instructions (opcodes or machine codes)
for any processor. For example, being an 8-bit processor, 8085 had an upper limit of 256 instructions as it
used only the rst byte of all instructions as the opcode. The second and third bytes of all 2-byte and 3-byte
instructions of 8085 contained either data (8-bit or 16-bit) or address (16-bit). To make the instruction set
M06_GHOS1557_01_SE_C06.indd 167M06_GHOS1557_01_SE_C06.indd 167 4/29/11 5:09 PM4/29/11 5:09 PM