Q. Explain any 5 instructions used in the 8085 processor and explain it.
1. MOV Instruction
● Format: MOV Rd, Rs
● Meaning: Copy the data from source register (Rs) to destination register (Rd).
● Operation: (Rd) ← (Rs)
● Example: MOV B, C → Contents of register C are copied to register B.
2. MVI Instruction (Move Immediate)
● Format: MVI R, data
● Meaning: Load an 8-bit immediate data into a register.
● Operation: (R) ← data
● Example: MVI A, 25H → The hexadecimal value 25 is loaded into accumulator A.
3. LDA Instruction (Load Accumulator Direct)
● Format: LDA 16-bit address
● Meaning: Load accumulator with the contents of a memory location given by the 16-bit
address.
● Operation: (A) ← (memory[address])
● Example: LDA 2050H → The contents of memory location 2050H are copied to the
accumulator A.
4. ADD Instruction
● Format: ADD R
● Meaning: Add the contents of register R to the accumulator. The result is stored in the
accumulator.
● Operation: (A) ← (A) + (R)
● Example: If A = 10H and B = 20H, then ADD B → A = 30H.
5. STA Instruction (Store Accumulator Direct)
● Format: STA 16-bit address
● Meaning: Store the contents of the accumulator into the memory location specified by
the 16-bit address.
● Operation: (memory[address]) ← (A)
● Example: STA 3050H → Contents of accumulator A are stored in memory location
3050H.
1. IN Instruction (Input)
● Format: IN port address
● Meaning: Read 8-bit data from an input port into the accumulator.
● Operation: (A) ← (port)
● Example: IN 01H → Reads data from port 01H into accumulator A.
2. OUT Instruction (Output)
● Format: OUT port address
● Meaning: Send the 8-bit data from accumulator to an output port.
● Operation: (port) ← (A)
● Example: OUT 02H → Sends contents of A to output port 02H.
3. SUB Instruction
● Format: SUB R
● Meaning: Subtract the contents of register R from the accumulator. Result stored in A.
● Operation: (A) ← (A) – (R)
● Example: If A = 40H and B = 10H, then SUB B → A = 30H.
4. INR Instruction (Increment Register)
● Format: INR R
● Meaning: Increase the content of register R by 1.
● Operation: (R) ← (R) + 1
● Example: If C = 09H, then INR C → C = 0AH.
5. DCR Instruction (Decrement Register)
● Format: DCR R
● Meaning: Decrease the content of register R by 1.
● Operation: (R) ← (R) – 1
● Example: If D = 05H, then DCR D → D = 04H.
❖ Operand (in Microprocessor)
● An operand is the data on which an instruction operates.
● In other words, it is the value or address that the CPU uses while executing an
instruction.
👉 Every instruction has two parts:
1. Opcode → Operation to be performed (like ADD, MOV, SUB).
2. Operand → Data or address on which the operation is carried out.
Examples
1. MVI A, 25H
○ Opcode: MVI (Move Immediate)
○ Operand: 25H (the data to load into A)
2. LDA 2050H
○ Opcode: LDA (Load Accumulator Direct)
○ Operand: 2050H (the memory address where data is stored)
3. ADD B
○ Opcode: ADD
○ Operand: B (register B)
In short: Operand = the data, register, or memory address that is needed by the instruction to
complete its task.
❖ What is Addressing Mode?
● Addressing mode tells the way of specifying data (operand) in an instruction.
● In other words, it defines where the operand is located:
○ In a register?
○ In memory?
○ Given directly in instruction?
It helps the 8085 processor understand how to fetch data for executing the instruction.
Types of Addressing Modes in 8085
1. Immediate Addressing Mode
● Data is given directly in the instruction itself.
● Example: MVI A, 32H → Load immediate data 32H into accumulator A.
● Operation: A ← 32H
2. Register Addressing Mode
● Operand (data) is in a register.
● Example: MOV B, C → Copy contents of C into B.
● Operation: B ← C
3. Direct Addressing Mode
● The memory address of the operand is given directly in the instruction.
● Example: LDA 2050H → Load accumulator with contents of memory location 2050H.
● Operation: A ← (2050H)
4. Indirect Addressing Mode
● The instruction specifies a register pair (HL, BC, DE) which holds the address of the
operand in memory.
● Example: MOV A, M → Copy data from memory location pointed by HL pair into
accumulator A.
● Operation: A ← (HL)
5. Implicit (or Inherent) Addressing Mode
● Operand is not specified in the instruction. It is implied/understood.
● Example: CMA → Complement the contents of accumulator. (No operand is written,
because A is understood.)
● Operation: A ← ¬A
Summary Table (for quick revision):
Addressing Mode Example Meaning
Immediate MVI A, 32H Load 32H directly into A
Register MOV B, C Copy C → B
Direct LDA 2050H A ← (2050H)
Indirect MOV A, M A ← (HL)
Implicit CMA A is complemented (no operand
written)