UNIT-2
8085 Instructions and
Microprocessors Assemble Language
Programming
8085 Instructions
• An instruction is a binary pattern designed inside a microprocessor
to perform a specific function.
• The entire group of instructions that a microprocessor supports is
called instruction set.
• An assembly language program is a set of instructions written in
the mnemonics of a given microprocessor.
• 8085 is an 8-bit device it can have up to 2 8 (256) instructions.
• However, the 8085 only uses 246 combinations that represent a
total of 74 instructions.
➢Most of the instructions have more than one format.
8085 Instructions
• Microprocessor instructions can be classified based on the
parameters such functionality, length and operand addressing.
Classification based on functionality (five different groups):
➢Data Transfer Operations
➢Arithmetic Operations
➢Logic Operations
➢Branch Operations
➢Machine Control Operations
8085 Instructions
1. Data transfer operations:
➢This group of instructions copies data from source to
destination.
➢The content of the source is not altered.
2. Arithmetic operations:
➢Instructions of this group perform operations like addition,
subtraction, increment & decrement.
➢One of the data used in arithmetic operation is stored in
accumulator and the result is also stored in accumulator.
8085 Instructions
3. Logical operations:
➢Logical operations include AND, OR, EXOR, NOT.
➢The operations like AND, OR and EXOR uses two operands, one
is stored in accumulator and other can be any register or
memory location. The result is stored in accumulator.
➢NOT operation requires single operand, which is stored in
accumulator.
8085 Instructions
4. Branching operations:
➢Instructions in this group can be used to transfer program
sequence from one memory location to another either
conditionally or unconditionally.
5. Machine control operations:
➢Instruction in this group control execution of other instructions
and control operations like interrupt, halt etc.
8085 Instructions
Classification based on length:
1. One-byte instructions:
➢Instruction having one byte in machine code.
2. Two-byte instructions:
➢Instruction having two byte in machine code.
3. Three-byte instructions:
➢Instruction having three byte in machine code.
8085 Instructions
➢Each instruction has two parts.
• The first part is the task or operation to be performed.
❖This part is called the “opcode” (operation code).
• The second part is the data to be operated on
❖Called the “operand”.
8085 Instructions
➢Examples of One Byte instructions
*the destination register C is shown first, followed by the source register.
8085 Instructions
➢Examples of Two Byte instructions
8085 Instructions
➢Examples of Three Byte instructions
*the 16-bit addresses are stored in memory locations in reversed order, the
low-order byte first, followed by the high-order byte..
8085 Instructions
➢Each instruction in many ways is similar to our everyday
conversation. E.g.:
1. Pass the butter (the request specifies the exact item).
• It is similar to the instruction for loading a specific data byte in a register.
2. Pass the bowl (mentions the bowl rather than its content).
• Similar to MOV C,A, where registers (bowls) are requested rather than data .
3. Let us eat (assumes that one knows what to eat).
• Similar to the instruction “Complement” which implicitly assumes that the
operand is the Accumulator.
8085 Instructions
➢Each instruction in many ways is similar to our everyday
conversation. E.g.:
4. I will have combination 17 on the menu (location of the item).
• Similar to transfer the data byte from the location 2050H.
5. I will have what Susie ordered (specified indirectly).
• Specifies memory location through the contents of a register pair.
➢These various ways of specifying data are called Addressing Modes.
Addressing Modes in Instructions
• The process of specifying the data to be operated on by the
instruction is called addressing.
• The various formats for specifying operands are called addressing
modes.
• The 8085 has the following five types of addressing:
1. Immediate addressing
2. Memory direct addressing
3. Register direct addressing
4. Indirect addressing
5. Implicit addressing
Addressing Modes in Instructions
Immediate Addressing:
• In this mode, the operand given in the instruction - a byte or word
– transfers to the destination register or memory location.
➢E.g.: MVI A, 9AH
• The operand is a part of the instruction.
• The operand is stored in the register mentioned in the instruction.
Addressing Modes in Instructions
Memory Direct Addressing:
• Memory direct addressing moves a byte or word between a
memory location and register.
• The memory location address is given in the instruction.
➢E.g. LDA 850FH: This instruction is used to load the content of memory
address 850FH in the accumulator.
Register Direct Addressing:
• Register direct addressing transfer a copy of a byte or word from
source register to destination register.
➢ E.g. MOV B,C : It copies the content of register C to register B.
Addressing Modes in Instructions
Indirect Addressing:
• Indirect addressing transfers a byte or word between a register and
a memory location.
➢E.g. MOV A, M: Here the data is in the memory location pointed to by the
contents of HL pair. The data is moved to the accumulator.
Implicit Addressing:
• In this addressing mode the data itself specifies the data to be
operated upon.
➢E.g. CMA: The instruction complements the content of the accumulator.
No specific data or operand is mentioned in the instruction.
Data Format
In an 8-bit microprocessor, data can be represented in one of four
formats:
➢ASCII
➢BCD
➢Signed Integer:
▪ the most significant bit D7, is used for sign. Therefore the largest positive
integer that can be processed by the 8085 at one time is 0111 1111 (7FH);
▪ the remaining Hex numbers, 80H to FFH, are considered negative
numbers.
▪ However, all negative numbers in this microprocessor are represented in
2’s complement format.
➢Unsigned Integer
Data Format
• It is important to recognize that the microprocessor deals with 0’s
and 1’s.
➢ It deals with values as strings of bits.
➢ It is the job of the user to add a meaning to these strings.
• Assume that after performing some operations the result in the
accumulator is 0100 0001 (41H).
Data Format
• There are four ways of reading this value:
➢It is an unsigned integer expressed in binary, the equivalent
decimal number would be 65.
➢It is a number expressed in BCD (Binary Coded Decimal) format.
That would make it, 41.
➢It is an ASCII representation of a letter. That would make it the
letter A.
➢It is a string of 0’s and 1’s where the 0 th and the 6 th bits are set
to 1 while all other bits are set to 0.
Overview of 8085 Instruction Set
• The following NOTATIONS are used:
Data Transfer (Copy) Instructions
• These instructions perform the following six operations:
Data Transfer (Copy) Instructions