Instruction Set of 8085 Microprocessor & Its Classification

The first commercially successful microprocessor is the 8085 microprocessor by Intel. This microprocessor was mainly developed to eliminate the drawbacks of 8080 architecture. 8085 microprocessor is an 8-bit microprocessor because at a time it works on 8-bits and the technology used to design this processor is N-MOS technology. As compared to other microprocessors, this microprocessor is very popular because it has some unique characteristics like it is an 8-bit device, designed with a single NMOS IC including 6200 transistors. In this processor, a total of 80 instructions and246 operational codes are present. It includes an internal CLK generator and works on a CLK cycle including 50% duty cycle.  This article discusses an overview of the instruction set of 8085 microprocessor, types with examples.


What is Instruction Set in 8085 Microprocessor?

A binary command that is used to perform a function in the microprocessor over provided data is known as instruction. A set of instructions is known as an instruction set that decides the microprocessor function. Every instruction includes two parts like Opcode & the Operand where Opcode is used to specify the function to be executed & operand gives the data to be functioned on.

8085 Microprocessor
8085 Microprocessor

Classification of Instruction Set of 8085

The instruction set of 8085 microprocessor is classified into five types which include the following.

Classification of Instruction Set of 8085 Microprocessor
Classification of Instruction Set of 8085 Microprocessor
  • Data Transfer Instruction
  • Arithmetic Instruction
  • Logical Instruction
  • Branching Instruction
  • Control Instruction

Data Transfer Instruction

An instruction that is used to transfer the data from one register to another is known as data transfer instruction. So, the data transfer can be done from source to destination without changing the source contents. Data transfer mainly occurs from one register to another register, from memory location to register, register to memory, and between an I/O device & accumulator. Following are the list of Data Transfer Instruction

Mov r, M

This data transfer instruction is used to transfer data present within the memory (M) to the register (r). But, the memory location address must be there within the HL register.

Example: MOV r, 1020H

Mov M, Data

This type of instruction specifies the data transfer immediately to a location of memory. This memory location address can be specified at the H-L registers.

Example: MOV M, 28H

MVI r, Data (Move Immediate)

In this type of instruction, the transmission of data can be done immediately toward the particular register.

Example: MVI r, 32H

Instruction

Op-
code
Opr Bytes Machine-
cycles
T-
states

Detail

MVI

MVI

Reg., Data
Mem., Data
2
2
2
3
7
10

Move immediate 8 bit

LDA address (Load Accumulator)

LDA is a load accumulator instruction that is mainly used for copying the data available in the address of memory indicated as the instruction’s operand to the accumulator. Particularly, in this case, the available data in the 16-bit address memory is transferred toward the accumulator.

Example: LDA 500H

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

LDA

LDA

16-bit address 3 4 3A 13

Load accumulator direct

LDAX (LoaD Accumulator by eXtended Register Pair)

It is a load accumulator from an address in the register pair. In this type of data transfer instruction, the register holds the address of the data that needs to be loaded to the accumulator.

Example: LDAX C/D

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex code T-
states

Detail

LDAX LDAX B/D reg. Pair 1 2 1A 7 Load accumulator indirect

LHLD (Load H & L Registers Direct)

LHLD instruction is a direct load instruction, where it loads the H-L register with the data from the memory. In this type of instruction, the data which is available in the address specified is copied to the L register first and then the available data within the next memory location will be loaded in the H register.

Example: LHLD 2500H

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

LHLD LHLD 16 bit address 3 5  

2A

16 Load H and L registers direct

STA Address (Store Accumulator Contents in Memory)

STA stands for stored accumulator direct instruction. Once this instruction is accepted, then the available data within the accumulator can be transferred to the address of memory indicated within the operand.

Example: STA 2030H

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

STA STA 16 bit 3 4  

32

13 Store Accumulator Direct

In the above example data stored in the accumulator will be stored to  memory location 2030. LSB followed by MSB will be stored in the memory location.

STAX Register (Store Accumulator by Extended Register)

It is a stored accumulator indirect instruction. In this instruction, the register is available as the operand that holds a memory address. Thus, the accumulator data can be copied to that specific memory location.

Example: STAX D

Instruction

Op-
code
Opr Bytes Machine-
cycles
Hes Code T-
states

Detail

STAX STAX B/D reg. pair 1 2  

12

7 Store Accumulator Indirect

XCHG (Exchange)

This type of data transfer instruction can be used to exchange the data available within two registers.

Example: XCHG H-L & D-E. In this, the contents of H & D and L & E are exchanged.

Instruction

Op-
code

Opr  Bytes Machine-
cycles
Hex Code T-
states

Detail

XCHG XCHG None 1 1 EB 4 Exchange H and L with D and E

SPHL (Stack Pointer HL Register)

In this data transfer instruction, the data of H &L can be moved to the stack pointer.

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

SPHL SPHL None 1 1  

 

F9

6 (in 8085),
5(in 8080)
Copy H and L registers to the Stack pointer(SP)

PCHL (Program Counter with HL Data)

Similar to SPHL instruction, this PCHL instruction simply copies the H-L register’s data into the SP by loading the high order bytes at H & low order bytes at L.

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

PCHL PCHL None 1 1 E9 6 Load program counter with HL contents

PUSH

In this type of instruction, the stack can be loaded with the available data within the register provided in the operand. Initially, the stack pointer gets decreased & high order bytes are copied to the stack. Further stack pointer gets decreased to load the low order register bytes.

Example: PUSH D

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

PUSH PUSH Reg. pair 1 3 D5 12 Push register pair into the stack

POP

This instruction indicates the data transfer from the top of the stack to the register provided as the operand.

Example: POP C

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

POP POP Reg. pair 1 3  

D1

10 POP OFF Stack to register pair

OUT

In this type of data transfer instruction, the data available at the accumulator can be copied toward the I/O port. An 8-bit port address at the operand is present.

Example: OUT 36 H

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

OUT OUT 8-bit port address 2 3  

D3

10 Output Data from Accumulator to a port with 8 bit address

IN

This type of instruction is used to load the data available at the I/O port to the accumulator. The operand simply holds the port address from where the data can be copied.

Example: IN, 6B H

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

IN IN 8-bit port address 2 3  

DB

10 Input data to accumulator from a port with 8-bit address

Arithmetic Instruction of 8085

The arithmetic instructions perform different operations like addition, subtraction, increment & decrement on the data within memory & register in the 8085 microprocessor.

ADD r

This arithmetic instruction adds the data which is available in the register to the data available within the accumulator & the final result will be stored in the accumulator.

Example: ADD C

ADD M

This type of instruction is mainly used to add the date in the memory address data denoted at the operand to the data available at the accumulator. So the addition result will be stored within the accumulator.

Example: ADD 28H

ADI Data (Add Immediate)

In this instruction, the 8-bit data is specified as an operand is added immediately to the data available at the accumulator & the result is stored at the accumulator.

Example: ADI 24 H

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

ADI ADI 8-bit, data 2 2  

C6

7 Add immediate to accumulator

ACI Data (Add with Carry Immediate)

This type of instruction simply adds the 8-bit data available at the operand & carries the flag by the data available at the accumulator. After every addition, the flag reproduces the output of the addition.

Example: ACI 35H

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

ACI
Instruction
ACI 8 bit data 2 2  

CE

7 Add immediately to Accumulator with Carry.

ADC r (Add with Carry)

In this type of instruction, the data present at the register can be added to the data available at the accumulator with the carry bit & output is simply reflected at the accumulator.

Example: ADC D

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

ADC ADC Reg., Mem. 1,1 1,2 8A 4,7 Add register to accumulator with carry

AMC M 

This type of instruction is mainly used to add the available data at the location of memory whose address is denoted within the operand specified & the carry bit with the data available within the accumulator. So the output of addition can be stored within the accumulator.

Example: AMC 25H

SUB r

This type of instruction is used to subtract the available data at the register given at the operand from the data present in the accumulator. The final result will be stored at the accumulator.

Example: SUB C

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

SUB SUB Reg. , Mem. 1,1 1,2  

91

4,7 Subtract register or memory from Accumulator

SUB M

This instruction is used to subtract the available data at the location of memory whose address is provided by the H-L register from the data present at the accumulator.

Example: SUB 128H

SUI Data (Subtract Immediate from Accumulator)

This type of instruction is mainly used to instantly subtract the data available as operand within the instruction from the available data at the accumulator. After every subtraction, the flag can be changed to show the result of subtraction.

Example: SUI 35H

Instruction

Op-
code

Operand Bytes Machine-
cycles
Hex Code T-
states

Detail

SUI SUI 8 bit data 2 2  

D6

7 Subtract immediate from the accumulator

SBI Data (Subtract with Borrow Immediate from Accumulator)

This type of instruction helps subtract the 8-bit data provided as the operand & the borrow bit from the available data at the accumulator, and the result will be stored within the accumulator.

Example: SBI 24H

Instruction

Op-
code
Operand Bytes Machine-
cycles
Hex Code T-
states

Detail

SBI SBI 8 bit data 2 2  

DE

7 Subtract immediate with borrow

SBB r

This instruction is used to subtract the data present at the register & the borrow bit from the data present at the accumulator.

Example: SBB C

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

SBB SBB Reg., Mem. 1,1 1,2  

 

99

4,7 Subtract source and borrow from the accumulator

SBB M (Subtraction with Borrow)

This instruction is used to specify the subtraction of data available at the memory location, whose address is available at the H-L register & the borrow bit from the data present at the accumulator.

Example: SBB 1000H

INX r (Increment Extended Register)

This type of instruction is used to increase the data by 1 which is available at the register provided at the operand. The result will be stored at the same register.

Example: INX C

Instruction

Op-
code
Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

INX B INX Reg. Pair 1 1 03 6 Increment register pair by 1

DCX r (Decrement Extended Register)

This type of instruction decreases the data available at the register by 1 & the result will be stored in the same register.

Example: DCX C

Instruction

Op-
code
Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

DCX DCX Reg. Pair 1 1 1B 6 Decrement register pair by 1

DCR M (Decrement Register)

In an instruction, sometimes the operand holds a location of memory. The memory location address is available at the H-L pair. Thus the data available at that specific location will be decreased by 1.

Example: DCR 28H

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

DCR DCR Reg., Mem. 1,1 1,3 35 4,10 Decrement source by 1

DAA (Decimal Adjust Accumulator)

DAA is a decimal adjust accumulator, used to break the binary number from 8-bit to two 4-bit binary-coded decimal numbers.

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

DAA DAA None 1 1  

 

27

4 Decimal Adjust Accumulator

Logical Instruction

Logical instructions are mainly used to perform different operations like logical or Boolean over the data available in either memory or register. These instructions will modify the flag bits based on the operation executed.

CMP R/M (Compare the Register/Memory with the Accumulator) 

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 that is compared remains unchanged.

Example: CMP B

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

CMP CMP Reg., Mem. 1,1 1,2  

BE

4,7 Compare with accumulator

CPI Data (Compare immediate through the Accumulator)

This type of instruction compares the 8-bit data provided as operand within the instruction by the data available within the accumulator. This result is shown through the flags.

Example: CPI 50

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

CPI CPI 8-bit 2 2  

FE

7 Compare Immediate with accumulator

ANA R/M (Logical AND register or memory with the accumulator)

This instruction executes the AND operation of the data available within the accumulator to the data available in the memory or register. After the operation of AND, S, P, Z will be changed to show the outcome of the comparison.

Example: ANA C

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

ANA ANA Reg., mem. 1,1 1,2  

A6

4,7 Logical AND with Accumulator

ANI data (And Immediate with Accumulator)

This instruction executes AND operation for the immediate 8-bit data provided as operand by the data available in the accumulator.

Example: ANI 35H

Instruction

Op-
code
Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

ANI ANI 8-bit, data 2 2  

E6

7 AND immediate with accumulator

ORA R/M (OR Accumulator Register or Memory)

This instruction is used to perform OR operation of the data available within the accumulator by the data available in the memory location or register.

Example: ORA C

Instruction

Op-
code
Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

ORA ORA Reg., Mem. 1,1 1,2 B6 4,7 Logically OR with Accumulator

ORI data (OR Immediate Data)

The 8-bit data provided as an operand is ORed logically with the data within the accumulator. So, the output of this instruction can be saved within the accumulator.

Example: ORI 36H

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

ORI ORI 8 bit data 2 2 F6 7 Logically OR Immediate

XRA R/M (Exclusive OR Immediate with Accumulator)

This instruction is used to execute XOR operation through data available at the accumulator & the data present at the memory or register.

Example: XRA 2030

Instruction

Op-
code
Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

XRA XRA Reg., Mem. 1,1 1,2 EE 4,7 Exclusive OR with accumulator

XRI data (Exclusive OR Accumulator)

This type of instruction is used to execute the XOR operation of the 8-bit data specified as operand & the data present at the accumulator. The output will be stored at the accumulator.

Example: XRI 30

Instruction

Op-
code
Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

XRI XRI 8 bit data 2 2  

EE

7 Exclusive OR immediate with accumulator

RLC (Rotate Left Accumulator)

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 the last bit of the sequence i.e., D7, sets the CY flag.

Instruction

Op-
code
Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

RLC RLC None 1 1 07 4 Rotate Accumulator Left

RRC (Right Rotate Accumulator)

This instruction is used to rotate the bit toward the right with one position. So, in this case, D0 sets the CY flag.

Example: RRC

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

RRC RRC None 1 1 0F 4 Rotate Accumulator Right

RAL (Rotate Accumulator Left)

This type of instruction is used to rotate the bits toward the left with one of the data available within the accumulator through the carry flag. Here, D7 can be shifted to hold the flag & the bit within the carry flag can be shifted to D0.

Example: RAL

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

RAL RAL None 1 1  

17

4 Rotate accumulator left through carry

RAR (Rotate Accumulator Right)

This type of instruction is mainly used to rotate the data bits to the right which are available within the accumulator by the carry flag. Here, D0 can be shifted to hold the flag & the carry bit can be moved to the D7 position.

Example: RAR

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

RAR RAR None 1 1 1F 4 Rotate accumulator right through carry

STC (Set the Carry Flag)

This type of instruction is used to set the carry flag (CF) to 1 by not affecting any other flags.

Example: STC

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

STC STC None 1 1 37 4 Set Carry

CMA (Complement the Accumulator)

This type of instruction generates the complement of data at the accumulator. So, this function does not change any of the flags.

Example: CMA

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

CMA CMA None 1 1 2F 4 Complement Accumulator

CMC (Complement the Carry Flag)

This type of instruction is used to complement the data available at the carry flag (CF). So this instruction does not affect any other flag.

Example: CMC

Instruction

Op-
code
Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

CMC CMC None 1 1 3F 4 Complement Carry

Branching Instruction

These types of instructions are mainly used to transfer or switch the microprocessor from one location to another. So, it simply changes the general sequential flow.

JMP address (Jump unconditionally)

This type of instruction is mainly used to transfer the series of the current program to that location of memory whose 16-bit address can be simply specified within the operand of the instruction.

Example: JMP 2014H

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

JMP JMP 16 bit 3 3  

C3

10 Jump unconditionally

Jx Address

This is a conditional branching type instruction, where the series of current programs can be transferred to that specific location whose address can be provided at the operand. However this transferring mainly depends on the specified PSX flag.

Example: JZ 1200H

CALL address

This instruction shifts the control of a series of current programs toward the memory address available at the operand. However the PC gets decreased before transferring,

Example: CALL 2400H

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

CALL CALL 16-bit address 3 5  

CD

18 Unconditional Subroutine call

RET (Return from the Subroutine)

This type of instruction can cause the unconditional return of the sub-routine to the actual program.

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

RET RET None 1 3  

 

C9

10 Return from subroutine unconditionally

RST(Restart Instruction)

This type of instruction is mainly used to transfer the series from the main program to the interrupt service routine. Mostly, the transfer can be performed above one of the 8-bits which are indicated within the operand.

Control Instruction

These instructions are mainly used to control the microprocessor operations. These instructions are discussed below.

NOP (No operation)

NOP stands for no operation. Once the 8085 microprocessor gets this instruction, then it does not perform any operation based on execution.

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

NOP NOP None 1 1 00 4 No Operation

DI (Disable Interrupts)

DI is the disabling of the interrupt that is generated within the microprocessor. Interrupt resetting will allow disabling all the interrupts apart from TRAP.

Instruction

Op-
code
Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

DI DI None 1 1 F3 4 Disable Interrupts

EI (Enable Interrupts)

This type of instruction is mainly used to allow the interrupt. Once the interrupt enable pin is set then leads to enabling the interrupts within the system.

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

EI EI None 1 1 FB 4 Enable Interrupts

HLT (Halt & Enter Wait State)

Once the HLT interrupt is decoded through the microprocessor, it stops the current operation and waits for further instruction. To escape from the halt condition either a reset or an interrupt is necessary.

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex Code T-
states

Detail

HLT HLT None 1 2 or more 76 5 or more Halt and enter wait state

SIM (Set Interrupt Mask)

SIM is the set interrupt mask, which is used to execute the hardware interrupts programming & serial output.

Instruction

Op-
code
Opr Bytes Machine-
cycles
Hex code T-
states

Detail

SIM SIM None 1 1 30 4 Set Interrupt Mask

RIM (Read Interrupt Mask)

RIM is the read interrupt mask that is used to situate the preferred data at the accumulator based on the serial input & interrupt.

Instruction

Op-
code

Opr Bytes Machine-
cycles
Hex code T-
states

Detail

RIM RIM None 1 1 20 4 Read Interrupt Mask

Thus, this is all about an overview of the Instruction Set of the 8085 Microprocessor. The main function of instruction in an 8085 microprocessor is, it is a binary command used for executing an operation within the microprocessor over provided data. So, a set of instructions supported by the 8085 microprocessor is called an instruction set. Here is a question for you, what are the applications of the 8085 microprocessor?

Add Comment