Skip to content
Question Bank (5 marks) · Q10

Q.Briefly explain different addressing modes in the 8051.

Karnataka PUCTextbookLong· 5mImportance★★★★★est
48% · 55/115 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

[!TLDR]

The 8051's five addressing modes — register, direct, immediate, indirect and base-plus-index — differ in how the operand is located; the first four are the common ones.

Addressing modes define the way in which the operands are accessed by an instruction. Since the CPU can hold data in registers, in internal memory or in an external source, it needs several ways to point to that data. In the 8051, the destination address is written first, followed by the source address. There are five addressing modes:

1. Register addressing mode: the registers A, DPTR, R0–R7, the accumulator and carry bit are used as part of the opcode mnemonics as source or destination. Register-to-register moves occur between A and R0–R7; the least significant bits of the opcode indicate which register is used.

MOV A, R0     ; copy the content of R0 into A
MOV R2, A     ; copy the content of A into R2

2. Direct addressing mode: the complete 128 bytes of internal RAM and the SFRs are addressed directly using the single-byte address assigned to each location. Internal RAM uses addresses 00H–7FH; the SFRs use 80H–FFH.

MOV A, 40H    ; copy the content of RAM location 40H into A
MOV 56H, A    ; save the content of A in RAM location 56H

3. Immediate addressing mode: the source of the data is made part of the opcode, so the data is immediately available. The mnemonic for immediate data is the pound sign (#), so the value must be preceded by #.

MOV A, #25H       ; load 25H into A
MOV DPTR, #4562H  ; load the 16-bit constant 4562H into DPTR

4. Indirect addressing mode: a register is used as a pointer to the data. Only R0 and R1 can be used for this, and they must be preceded by the @ (at) sign.

MOV A, @R0    ; copy the RAM location whose address is in R0 into A
MOV @R1, B    ; move B into the RAM location whose address is in R1
``` …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.