IITIAN1997 STUDIO

Microprocessors and microcontrollers

JLEE ECE / ETE · 10 practice questions with answers

Practise and take a mock test →

8085, 8086, 8051 and interfacing

Topics: 8085 architecture, pins, registers, flags, addressing modes, instructions, timing, interrupts; memory and I/O interfacing, 8255, 8253; 8086 basics; 8051 microcontroller, ports, timers, serial; embedded systems.

8085 architecture

The 8085 is an 8-bit processor with a 16-bit address bus (64 KB) and a multiplexed lower address/data bus (AD0–AD7, separated with ALE). Registers: accumulator A, B, C, D, E, H, L (pairs BC, DE, HL), stack pointer and program counter; flags S, Z, AC, P, CY. A 6 MHz crystal gives a 3 MHz clock, so one T-state is about 0.33 µs.

  • 8-bit data, 16-bit address (64 KB)
  • Flags: S Z AC P CY
  • 3 MHz: T-state ≈ 0.333 µs

Example: An instruction takes 7 T-states at 3 MHz. How long does it take?

  1. One T-state = 1/3 µs.
  2. 7/3 ≈ 2.33 µs.

Answer: ≈ 2.33 µs

Example: MVI A, 32H then ADI CEH. Give A and the carry and zero flags.

  1. 32H + CEH = 100H.
  2. A = 00H, CY = 1, Z = 1.

Answer: A = 00H, CY = 1, Z = 1

Instructions, addressing modes and interrupts

Addressing modes: immediate (MVI A, 05H), register (MOV A, B), direct (LDA 2050H), register indirect (MOV A, M using HL) and implied (CMA). Interrupts in priority order: TRAP (non-maskable), RST 7.5, RST 6.5, RST 5.5, INTR. A restart RST n jumps to address 8n (in hex: RST 7.5 → 003CH).

  • LDA: direct; MOV A, M: indirect
  • TRAP: highest priority, non-maskable
  • RST n vector = 8n

Example: Which addressing mode does LDA 2050H use?

  1. The address is given in the instruction itself.
  2. Direct addressing.

Answer: Direct

Example: Find the vector address of RST 7.5.

  1. 8 × 7.5 = 60.
  2. 60 = 003CH.

Answer: 003CH

Interfacing, the 8086 and the 8051

Peripheral chips: 8255 programmable peripheral interface (three 8-bit ports), 8253/8254 timer, 8259 interrupt controller, 8251 serial. The 8086 is 16-bit with a 20-bit address (1 MB); physical address = segment × 16 + offset. The 8051 microcontroller has 4 KB ROM, 128 bytes RAM, four 8-bit ports, two timers and a serial port; one machine cycle is 12 clock periods.

  • 8086 physical = segment × 10H + offset
  • 8051: 4 ports, 2 timers
  • 8051 machine cycle = 12 clocks

Example: Find the physical address for segment 1000H and offset 0020H.

  1. 1000H × 10H = 10000H.
  2. + 0020H = 10020H.

Answer: 10020H

Example: An 8051 runs from a 12 MHz crystal. Find the machine-cycle time.

  1. 12 clocks per machine cycle.
  2. 12/12 MHz = 1 µs.

Answer: 1 µs

The 8085 is an 8-bit processor with 16-bit address bus (64 kB), multiplexed lower address/data lines AD0–AD7, separated by ALE. Registers are A, B, C, D, E, H, L, SP and PC; flags are S, Z, AC, P, CY. TRAP is the highest priority interrupt and non-maskable. The 8086 is 16-bit with a 20-bit address bus (1 MB) and segmented memory. The 8051 microcontroller has 4 kB ROM, 128 bytes RAM, 4 I/O ports, 2 timers and a serial port; the 8255 is a programmable peripheral interface, and the 8253/8254 a programmable timer. A microcontroller integrates CPU, memory and I/O on one chip.

  • Addressing modes: immediate, register, direct, indirect, implicit.
  • MVI A, 32H is immediate; MOV A, B is register.
  • 8085 interrupts: TRAP, RST 7.5, 6.5, 5.5, INTR.
  • 8051: Port 0 needs pull-ups; SFRs at 80H–FFH.
  • Embedded systems run dedicated real-time tasks.

Key formulas

  • Memory = 2^(address lines) bytes
  • T = 1/f
  • Physical address = segment × 10H + offset

Practice questions

The 8085 address bus is

  1. 8 bits
  2. 16 bits
  3. 20 bits
  4. 32 bits
Show the answer

Answer: B. 16 bits 64 kB.

ALE in the 8085 is used to

  1. separate address and data
  2. stop the clock
  3. reset
  4. raise interrupts
Show the answer

Answer: A. separate address and data Demultiplex AD0–AD7.

The highest priority 8085 interrupt is

  1. TRAP
  2. RST 7.5
  3. INTR
  4. RST 5.5
Show the answer

Answer: A. TRAP Non-maskable.

The 8086 address bus is

  1. 16 bits
  2. 20 bits
  3. 24 bits
  4. 8 bits
Show the answer

Answer: B. 20 bits 1 MB.

The 8051 has on-chip RAM of

  1. 128 bytes
  2. 4 kB
  3. 64 kB
  4. 1 MB
Show the answer

Answer: A. 128 bytes 8051 base.

The 8255 is a

  1. timer
  2. PPI
  3. DMA controller
  4. UART
Show the answer

Answer: B. PPI Programmable peripheral interface.

MVI A, 32H uses

  1. register addressing
  2. immediate addressing
  3. direct addressing
  4. indirect addressing
Show the answer

Answer: B. immediate addressing Data in the instruction.

The accumulator is

  1. 16 bits
  2. 8 bits in 8085
  3. 20 bits
  4. 4 bits
Show the answer

Answer: B. 8 bits in 8085 Register A.

Port count of the 8051 is

  1. 2
  2. 3
  3. 4
  4. 8
Show the answer

Answer: C. 4 P0–P3.

A microcontroller differs from a microprocessor in having

  1. on-chip memory and I/O
  2. no CPU
  3. no program
  4. only analogue circuits
Show the answer

Answer: A. on-chip memory and I/O Single-chip computer.

The practice questions were written for this studio; they are not copied from ASTU papers. ASTU publishes no topic syllabus for these exams, so the topics are an informed guide based on diploma courses, not an official list.

Practise and take a mock test →