Instruction Set of 8085 Microprocessor

An instruction is a binary command used to execute an operation inside the microprocessor over a given data. A group of instructions that are supported by the 8085 microprocessor is known to be the instruction set of 8085 microprocessor.

Basically, 8085 is designed to have 5 functional categories of the instruction set. Here in this article, we will discuss each instruction set in detail.

Instruction set of 8085 microprocessor

We know that an instruction set is a group of instruction that executes the desired operation on the data specifically described by the microprocessor 8085.

The instruction set of 8085 microprocessor is classified as follows:

types of instruction set of 8085 microprocessor

Let us now move further to understand each instruction set separately.

Data Transfer Instruction

These instructions are used by the microprocessor in order to transfer the data from one location to another. More specifically, it helps in transferring the data from source operand to destination operand, without making any changes in the source data.

As the data present in the source is not modified. Thus it is more convenient to call it a data copy instruction. As while transferring the data from source to destination, the data present in the source is just copied to the destination also. Due to this no change in source data is noticed.

Basically, the instructions that come under this instruction set, are as follows:

instruction set of 8085 microprocessor - 01

This instruction helps to transfer the contents of register r2 into register r1. While the data in register r2 will remain the same.

instruction set of 8085 microprocessor - 02

This instruction transfers the data in register B to an accumulator.

instruction set of 8085 microprocessor - 03

This instruction specifies the transfer of data present in the memory to the register. However, the address of the memory location must be present in the HL register.

Example: MOV r, 1020H

instruction set of 8085 microprocessor - 04

This instruction specifies the immediate transfer of data to a memory location. And the address of this memory location is specified at the H-L registers.

Example: MOV M, 32H

instruction set of 8085 microprocessor - 05

In this instruction, the data is immediately transferred to the specified register.

Example: MVI r, 16H

instruction set of 8085 microprocessor - 07

It is load accumulator instruction. This instruction is used to copy the data present in the memory address specified as the operand of the instruction to the accumulator. More specifically, in this case, the data present in the 16-bit memory address is transferred to the accumulator.

Example: LDA 1000H

instruction set of 8085 microprocessor - 08

It is load accumulator indirect instruction. In this instruction, the register that acts as operand holds a memory location, where the actual data is present which is to be loaded at the accumulator.

Example: LDAX C/D

instruction set of 8085 microprocessor - 09

It stands for load H-L registers direct instruction. For this particular instruction, the data present in the address specified in the operand is copied to the L register. Also, the data present in the next memory location is loaded to the H register.

Example: LHLD 4500H

instruction set of 8085 microprocessor - 10

STA is stored accumulator direct instruction. Whenever this instruction is passed, then the data present in the accumulator is transferred to the memory address specified in the operand.

Example: STA 2032H

instruction set of 8085 microprocessor - 11

It is stored accumulator indirect instruction. The register present as the operand holds a memory address. So, the data of the accumulator is copied to that particular memory location.

Example: STAX D

instruction set of 8085 microprocessor - 12

This instruction is used to exchange the data present in two registers.

Example: We have XCHG H-L and D-E

So the contents of H and D while L and E are exchanged.instruction set of 8085 microprocessor - 13

This instruction transfers the data of HL pair into the stack pointer.

instruction set of 8085 microprocessor - 14

Like the SPHL, this instruction copies the data of H-L register into the stack pointer by placing the higher order bytes at H and lower order bytes at L.

instruction set of 8085 microprocessor - 15

In this instruction, the stack is loaded with the data present in the register given in the operand.

Firstly, the SP gets decremented and higher order bytes are copied to the stack. Further SP gets decremented in order to load the lower order register bytes.

Example: PUSH C

instruction set of 8085 microprocessor - 16

This instruction specifies the transfer of the data present at the top of the stack to the register given as the operand.

Example: POP D

instruction set of 8085 microprocessor - 17

In case of OUT instruction, the data at the accumulator is copied to the I/O port. At the operand an 8-bit port address is present.

Example: OUT 56 H

instruction set of 8085 microprocessor - 18

This instruction specifies the loading of data present at the I/O port to the accumulator. The operand holds the address of the port from where the data is to be copied.

Example: IN, 5B H

Arithmetic Instruction

This instruction set allows arithmetic operations to be performed over the data in memory and register inside the 8085 microprocessor.

The arithmetic instruction set is given as follows:

instruction set of 8085 microprocessor - 19

This instruction specifies that the data present in the register is to be added with the data present in the accumulator and the result is to be stored in the accumulator itself.

Example: ADD B

instruction set of 8085 microprocessor - 20

This instruction is used to add the data of the memory address specified at the operand with the data present at the accumulator. And the result of the addition is stored in the accumulator.

Example: ADD 52H

instruction set of 8085 microprocessor - 21

In this particular instruction, the 8-bit data present as the operand is immediately added with the data at the accumulator and the result is stored at the accumulator.

Example: ADI 16H

instruction set of 8085 microprocessor - 22

This instruction adds the 8-bit data at the operand and carry flag with the data present at the accumulator. After each addition, the flag reflects the outcome of the addition.

Example: ACI 35H

instruction set of 8085 microprocessor - 23

In this instruction, the data at the register is added with the data present at the accumulator along with the carry bit and outcome is reflected at the accumulator.

Example: ADC B

instruction set of 8085 microprocessor - 24

This instruction is used to add the data present at the memory location whose address is specified in the operand given and the carry bit along with the data present in the accumulator. The result of the addition is stored in the accumulator.

Example: AMC 45H

instruction set of 8085 microprocessor - 25

This instruction subtracts the data present at the register given at the operand from the data in the accumulator, further the result is stored at the accumulator.

Example: SUB D

instruction set of 8085 microprocessor - 26

In this instruction, the data present at the memory location whose address is given by the H-L register is subtracted from the data at the accumulator.

Example: SUB 256H

instruction set of 8085 microprocessor - 27

This instruction is used to immediately subtract the data given as operand in the instruction from the data present at the accumulator. After each subtraction, the flag is modified so as to show the outcome of subtraction.

Example: SUI 55H

instruction set of 8085 microprocessor - 28

This instruction subtracts the 8-bit data given as the operand and the borrow bit from the data present at the accumulator, and resultantly store the output achieved in the accumulator.

Example: SBI 21H

instruction set of 8085 microprocessor - 29

By the use of this instruction, the data at the register and the borrow bit is subtracted from the data at the accumulator.

Example: SBB B

instruction set of 8085 microprocessor - 30

This instruction specifies the subtraction of data present at the memory location, whose address is present at the H-L register and the borrow bit from the data at the accumulator.

Example: SBB 1600H

instruction set of 8085 microprocessor - 31

This instruction increments the data by 1 which is present at the register given at the operand. The result of which is stored at the same register.

Example: INX D

instruction set of 8085 microprocessor - 32

This instruction decrements the data present at the register by 1 and stores the result at the same register.

Example: DCX D

instruction set of 8085 microprocessor - 33

Sometimes in an instruction, the operand holds a memory location. The address of this memory location is present at the H-L pair. So, the data present at that particular location is decremented by 1.

Example: DCR 42H

instruction set of 8085 microprocessor - 34

It stands for decimal adjust accumulator. This instruction causes to break the 8-bit binary number into two 4-bit binary coded decimal digits.

Logical Instruction

These instructions are used to perform logical or Boolean operations over the data present in either register or memory. The logical instructions modify the flag bits according to the operation performed.

The logical instruction set is as follows:instruction set of 8085 microprocessor - 35

This instruction is used to compare the data at the accumulator with the data present at the register or memory which is given as operand. According to the result obtained by the comparison, the flags are set. While the data being compared remains unchanged.

Suppose,

  • If the data present at the accumulator is smaller than that of register or memory, then carry flag is set.
  • If the data in the accumulator is equal to the data in the register or memory, then it sets the zero flag.
  • However, if the data in the accumulator is greater than the data present in the memory or register, then both carry and zero flags are reset.

instruction set of 8085 microprocessor - 36

This instruction is used to compare the 8-bit data given as operand in the instruction with the data present in the accumulator. The comparison result is shown by the flags.

instruction set of 8085 microprocessor - 37

This instruction performs the AND operation of the data present in the accumulator to the data present in the register or memory. After the AND operation, S, P, Z are changed to show the result of the comparison. AC is set and CY is reset.

Example: ANA  Dinstruction set of 8085 microprocessor - 38

This instruction is used to perform AND operation of the immediate 8-bit data given as operand with the data present in the accumulator.

Example: ANI 65H

instruction set of 8085 microprocessor - 39

This instruction executes OR operation, of the data in the accumulator with the data present in the register or memory location.

Example: ORA B

instruction set of 8085 microprocessor - 40

Here, 8-bit data given as operand is logically ORed with the data in the accumulator. The outcome of which is saved in the accumulator.

Example: ORI 26H

instruction set of 8085 microprocessor - 41

This instruction performs XOR operation with data at the accumulator and the data at the register or memory. In this case, CY and AC are reset.

instruction set of 8085 microprocessor - 42

This instruction performs XOR operation of the 8-bit data given as operand and the data at the accumulator. And stores the result at the accumulator.

instruction set of 8085 microprocessor - 43

This instruction holds significance when there exists a need to rotate the bits present in the accumulator. Basically, for an 8-bit value, each bit is rotated or shifted left by one position. Also, the rotation of last bit of the sequence i.e., D7, sets the CY flag.

instruction set of 8085 microprocessor - 44

This instruction rotates the bit to the right by one position. In this case, D0, sets the CY flag.

instruction set of 8085 microprocessor - 45

This instruction rotates the bits to the left by one of the data present in the accumulator through the carry flag.

Here, D7 is shifted to carry the flag and the bit in the carry flag is shifted to D0.

instruction set of 8085 microprocessor - 46

This instruction is used to rotate the bits of the data present in the accumulator to the right through the carry flag.

In this case, D0 is shifted to carry the flag and carry bit is shifted to D7 position.

instruction set of 8085 microprocessor - 47

This instruction sets the carry flag to 1, without affecting any other flags.

instruction set of 8085 microprocessor - 48

This instruction is used to generate the complement of data at the accumulator. The complement function does not affect any of the flags.

instruction set of 8085 microprocessor - 49

This instruction complements the data present at the carry flag. Thus any other flag is not affected by this instruction.

Branching Instruction

These instructions are used in order to switch or transfer the control of the microprocessor from one position to another. More specifically we can say, it changes the general sequential flow.

The branching instruction set is given below:

instruction set of 8085 microprocessor - 50

This instruction is used to transfer the present program sequence to that memory location whose 16-bit address is specified in operand of the instruction.

Example: JMP 2020H

instruction set of 8085 microprocessor - 51

This instruction comes under conditional branching instruction, in which the present program sequence is transferred to that particular location whose address is provided at the operand. But this transferring depends on the given PSX flag.

Example: JZ 1600Hinstruction set of 8085 microprocessor - 52

This instruction moves the control of recent program sequence to the memory address given at the operand. But before transferring, the PC gets decremented.

Example: CALL 3400H

instruction set of 8085 microprocessor - 53

This instruction causes unconditional return of the sub-routine to the actual program.

instruction set of 8085 microprocessor - 54

This instruction is used to transfer the sequence from the main program to the interrupt service routine. Basically, the transfer is performed over one of the 8 bits which are specified in the operand.

Control Instruction

As the name itself is suggesting that these instructions are used to control the operations of the microprocessor. The control instructions are as follows:

instruction set of 8085 microprocessor - 55

It stands for no operation. Whenever the microprocessor fetches this instruction, then it is decoded but not executed.

instruction set of 8085 microprocessor - 56

It is used to disable the interrupts generated in the microprocessor. Resetting of interrupt enable flip-flop is performed. This leads to disabling of all the interrupts except TRAP.

instruction set of 8085 microprocessor - 57

This instruction is used to enable the interrupt. This time the interrupt enable pin is set which leads to enabling of the interrupts in the system.

instruction set of 8085 microprocessor - 58

Whenever HLT is decoded by the microprocessor, then it halts any other program and continuously executes the current program which is under operation. To get out of the halt state either an interrupt or reset is required.

instruction set of 8085 microprocessor - 59

SIM stands for set interrupt mask. This instruction is used to implement the programming of hardware interrupts 7.5, 6.5 and 5.5 and serial output.

instruction set of 8085 microprocessor - 60

RIM stands for read interrupt mask. This instruction is used to put the desired data at the accumulator according to the interrupt and serial input.

This is all about the instruction set of 8085 Microprocessor.

1 thought on “Instruction Set of 8085 Microprocessor”

Leave a Comment

Your email address will not be published. Required fields are marked *