0% found this document useful (0 votes)
83 views12 pages

8051 Microcontroller Addressing Modes

The document discusses the different addressing modes of the 8051 microcontroller including: immediate, register, direct, register indirect, indexed, relative, absolute, and long addressing modes. It provides examples of instructions that use each addressing mode and briefly describes how each mode specifies the location of operands.

Uploaded by

Aishwarya Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views12 pages

8051 Microcontroller Addressing Modes

The document discusses the different addressing modes of the 8051 microcontroller including: immediate, register, direct, register indirect, indexed, relative, absolute, and long addressing modes. It provides examples of instructions that use each addressing mode and briefly describes how each mode specifies the location of operands.

Uploaded by

Aishwarya Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

8051 MICRO CONTROLLER

Mr. A.Baskar

Mr.A.Baskar
Assistant Professor(Sr.Gr)
Dept. of CSE
Amrita Vishwa Vidyapeetham
8051 INSTRUCTION SET FORMAT
ADDRESSING MODE
 Definition
 The different ways in which a source operand in an
instruction are known as the addressing modes.
 The 8051 provides a total of 5 distinct addressing
modes.
 Immediate Addressing
 Register Addressing
 Direct Addressing
 Register – Indirect Addressing
 Indexed Addressing
 Relative Addressing
 Absolute Addressing
 Long Addressing
IMMEDIATE ADDRESSING
 the operand, which follows the Opcode, is a
constant data of either 8 or 16 bits.
MOV DPTR,#4532H
REGISTER ADDRESSING
 Register addressing mode involves the use of
registers to hold the data to be manipulated.
Note:
Not
allowed

Mov R,R
DIRECT ADDRESSING
 the address of the data is specified as the
Operand in the instruction. Using Direct
Addressing Mode, we can access any register or
on-chip variable. This includes general purpose
RAM, SFRs, I/O Ports, Control registers.
 MOV R0,40H

save content of RAM


location 40h into R0.
 MOV 56H,A

save content of A in
RAM location 56H
REGISTER – INDIRECT ADDRESSING
 the address of the Operand is specified as the
content of a Register. Only R0 and R1 are
allowed in Indirect Addressing Mode. These
register in the indirect addressing mode are
called as
Pointer registers.
 All register banks

are allowed.

MOV A,@R0
MOV @R1,B
INDEXED ADDRESSING
INDEXED ADDRESSING
 Indexed addressing mode is widely used in
accessing data elements of look-up table entries
located in the program ROM space of the 8051.

MOV dptr, #4000H


MOV a, #5
MOVC a, @a+ dptr a<-m[4005]
RELATIVE ADDRESSING
 This is a special addressing mode used with
certain jump instructions.
ABSOLUTE ADDRESSING
 Absolute addressing is only used with the ACALL
and AJMP instructions.
 ACALL - subroutine call (2 byte instruction)

 AJMP - unconditional jump (2 byte instruction)

 These instructions allow you to move to any


instruction within the same 2K of memory.
LONG ADDRESSING
 The long addressing mode within the 8051 is
used with the instructions LJMP and LCALL.
 The address specifies a full 16 bit destination
address so that a jump or a call can be made to a
location within a 64KByte code memory space
(216 = 64K).
 An example instruction is:

LJMP 5000h ; full 16 bit address is specified in


operand

You might also like