SlideShare a Scribd company logo
3
Most read
5
Most read
7
Most read
MICROCONTROLLERS
           8051
 Created By: Sachin Bhalavat
             (Elect. & Comm. Engg.)
             profspbhalavat@gmail.com
8051 addressing modes
• The first byte of an instruction is known as the opcode
  (operation code) because this is the byte that is decoded by
  the processor - from this code the processor can work out
  what operation it must perform.
• For a one-byte instruction there is only the opcode.
• For a two-byte instruction the second byte is the operand.
• The operand can be data or an 8-bit address.
• For a three-byte instruction the second and third bytes make
  up the operand.
• A two-byte operand is usually a 16-bit address, as we shall see
  when we look at long addressing
The five addressing modes are:

Immediate addressing modes

Register addressing modes

Direct addressing modes

Indirect addressing modes

Register specific addressing mode
 Immediate addressing is only use when the data to be read is a
constant.
 The data is numeric constant in the operand indicated by a “#” sign
 Useful for getting constants into registers.
 For example, if your program needed to perform some calculations
based on the number of weeks in the year, you could use immediate
addressing to load the number 52 (34H) into a register and then perform
arithmetic operations upon this data.
               MOV R0, #34H
 The above instruction is an example of immediate addressing. It moves
the data 34H into R0.
 The has symbol (#) is used for this purpose (whenever the assembler
sees # before a number it knows this is immediate addressing).
 This is a two-byte instruction.
 Data can be 16-bits when dealing with the DPTR register .
             MOV DPTR, #2500H
 Direct access to eight registers (R0-R7).
 There are 4 banks of registers accessible through register
  addressing.
 Only one bank can be accessed at a time controllable through bit
  RS0 and RS1 of the PSW.
 Often we need to move data from a register into the accumulator
  so that we can perform arithmetic operations upon it. For
  example, we may wish to move the contents of R5 into the
  accumulator.
                MOV A, R5
 This is an example of register addressing. It moves data from R5
  (in the currently selected register bank) into the accumulator.
 Direct addressing is Used to access any on-chip RAM location, General
  purpose registers, Control registers or SFRs, which can be addressed by
  address or name.
           MOV A, 67
    The above instruction moves the data in location 67H into the
  accumulator.
 Note the difference between this and immediate addressing. Immediate
  addressing uses the data, which is immediately after the instruction.
  With direct addressing, the operand is an address.
 The data to be operated upon is stored in that address.
 The assembler realises this is an address and not data because there is
  no hash symbol before it.
 R0 or R1 hold the location of the internal RAM
 location. Indicated by the @ sign.
 It Can be used for accessing external memory, where R0 and R1 point to
  external memory locations 00H to FFH.
 Example:
                            MOV A, @Ri
 where Ri is either R0 or R1. Now, we can read the contents of location
  30H through indirect addressing:
                            MOV R0, #30H
                            MOV A, @R0
 The first instruction is an example of immediate addressing where the
  data 30H is placed in R0. The second instruction is indirect addressing. It
  moves the contents of location 30H into the accumulator.
• In this addressing mode the instruction refer to a
  specific register such as accumulator or a data
  pointer.
• Example:
    DA A :decimal adjust accumulator for addition
    RR A :rotate the content of accumulator to the right
    SWAP A:swap the nibble within the accumulator

More Related Content

What's hot (20)

PPT
8051 addressing modes
ghoshshweta
 
PPTX
8051 Addressing modes
Ravikumar Tiwari
 
PDF
Addressing modes of 8085 by Er. Swapnil V. Kaware
Prof. Swapnil V. Kaware
 
PPTX
Addressing mode & data transfer instruction of 8085
Chinmayee samal
 
PDF
Instruction.pdf
ISMT College
 
PPTX
8051 addressing modes & instruction set
Manoj Babar
 
PDF
8085 instructions and addressing modes
Suchismita Paul
 
PDF
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
samirbharat77
 
PPTX
Addressing modes of 8085
Gaurav Solanki
 
PDF
8051 instruction set
Stefan Oprea
 
PPT
8051 Addressing Modes
Senthil Kumar
 
PPT
8085 instruction set and Programming
pooja saini
 
PPTX
8051 addressing modes
Vima Mali
 
PPTX
3. Addressing Modes in 8085 microprocessor.pptx
ISMT College
 
PPTX
Instruction set 8085
varun sukheja
 
PPTX
Types of Addressing modes- COA
Ruchi Maurya
 
PPTX
Register transfer language
Sanjeev Patel
 
PPTX
Addressing mode Computer Architecture
Haris456
 
PPT
8051d
Senthil Kumar
 
PPTX
addressing modes
Sadaf Rasheed
 
8051 addressing modes
ghoshshweta
 
8051 Addressing modes
Ravikumar Tiwari
 
Addressing modes of 8085 by Er. Swapnil V. Kaware
Prof. Swapnil V. Kaware
 
Addressing mode & data transfer instruction of 8085
Chinmayee samal
 
Instruction.pdf
ISMT College
 
8051 addressing modes & instruction set
Manoj Babar
 
8085 instructions and addressing modes
Suchismita Paul
 
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
samirbharat77
 
Addressing modes of 8085
Gaurav Solanki
 
8051 instruction set
Stefan Oprea
 
8051 Addressing Modes
Senthil Kumar
 
8085 instruction set and Programming
pooja saini
 
8051 addressing modes
Vima Mali
 
3. Addressing Modes in 8085 microprocessor.pptx
ISMT College
 
Instruction set 8085
varun sukheja
 
Types of Addressing modes- COA
Ruchi Maurya
 
Register transfer language
Sanjeev Patel
 
Addressing mode Computer Architecture
Haris456
 
addressing modes
Sadaf Rasheed
 

Viewers also liked (20)

PPT
8051 instruction set
Andri Prastiyo
 
PPT
Microcontroller 8051
Rashmi
 
PPT
Addressing modes
Mahesh Kumar Attri
 
PPTX
ADDRESSING MODE
Anika Shahabuddin
 
DOC
8051 Microcontroller Notes
Dr.YNM
 
PPT
MPMC Unit-1
A.S. Krishna
 
PPT
11 instruction sets addressing modes
Sher Shah Merkhel
 
PPT
8051 MICROCONTROLLER
THANDAIAH PRABU
 
PPTX
Microcontroller directives
Manoj Harsule
 
PPTX
03loop conditional statements
Abdul Samad
 
PPTX
Conditional jump
Sandeep Kamath
 
PDF
8051,chapter1,architecture and peripherals
amrutachintawar239
 
PDF
Microcontrollers(8051) Notes written by Arun Kumar G, Associate Professor, De...
Arunkumar Gowdru
 
PPT
Media Access Methods
nizam143
 
PPTX
Data link control protocol(2)
Jeffrey Des Binwag
 
PPTX
M.A.C (Medium Access Control)
JaironLanda
 
PPTX
Pentium (80586) Microprocessor By Er. Swapnil Kaware
Prof. Swapnil V. Kaware
 
PDF
Computer architecture
Zuhaib Zaroon
 
PPTX
Data link control protocol(1)
Jeffrey Des Binwag
 
PPTX
Data link control & protocol concepts
Raji Lakshmi
 
8051 instruction set
Andri Prastiyo
 
Microcontroller 8051
Rashmi
 
Addressing modes
Mahesh Kumar Attri
 
ADDRESSING MODE
Anika Shahabuddin
 
8051 Microcontroller Notes
Dr.YNM
 
MPMC Unit-1
A.S. Krishna
 
11 instruction sets addressing modes
Sher Shah Merkhel
 
8051 MICROCONTROLLER
THANDAIAH PRABU
 
Microcontroller directives
Manoj Harsule
 
03loop conditional statements
Abdul Samad
 
Conditional jump
Sandeep Kamath
 
8051,chapter1,architecture and peripherals
amrutachintawar239
 
Microcontrollers(8051) Notes written by Arun Kumar G, Associate Professor, De...
Arunkumar Gowdru
 
Media Access Methods
nizam143
 
Data link control protocol(2)
Jeffrey Des Binwag
 
M.A.C (Medium Access Control)
JaironLanda
 
Pentium (80586) Microprocessor By Er. Swapnil Kaware
Prof. Swapnil V. Kaware
 
Computer architecture
Zuhaib Zaroon
 
Data link control protocol(1)
Jeffrey Des Binwag
 
Data link control & protocol concepts
Raji Lakshmi
 
Ad

Similar to 8051 addressing modes (20)

PDF
addressing-mode-of-8051.pdf
DhilibanSwaminathan
 
PPTX
2. Instruction Set.pptx huishiuhfuidhiuhdfuhdu
mohitcool2k5
 
PPTX
Addressing modes of 8051
Dr. AISHWARYA N
 
PPTX
Expanation about Addressing Mode of 8051
maniarer
 
PPTX
module-3.pptx
Ambika Naik
 
PPT
microprocessor and microcontroller notes ppt
mananjain543
 
PPT
addressingmodes8051.ppt
DhilibanSwaminathan
 
PPTX
Microcontroller 8051 addressing modes
UshaRani289
 
PPTX
CH13-COA10e update Addressing mode of instruction.pptx
ArifatunNesa
 
PPT
Lecture 06
sohelranasweet
 
PPTX
Addressing modes
RAMESHBABUA3
 
PPTX
addressing modes of microcontrooller 8051
divyagupta418625
 
PPTX
Addressing modes
rajukarki1599
 
PPTX
Lecture 10
talhashahid40
 
PPTX
Instruction Formats in computer architecture.pptx
tgoswami1907
 
PPTX
instructionformat-110818112559-phpapp01.pptx
KUNALTURKAR1
 
PPT
8051d.ppt microcontroller instruction set summary
anushkayadav3011
 
PPTX
Addressing Modes of 8051.pptx
TumkurInfomedia
 
PPTX
module 3 instruction set and control unit
sindhujam30
 
DOCX
Addressing modes Breifly
Tahir Jalali
 
addressing-mode-of-8051.pdf
DhilibanSwaminathan
 
2. Instruction Set.pptx huishiuhfuidhiuhdfuhdu
mohitcool2k5
 
Addressing modes of 8051
Dr. AISHWARYA N
 
Expanation about Addressing Mode of 8051
maniarer
 
module-3.pptx
Ambika Naik
 
microprocessor and microcontroller notes ppt
mananjain543
 
addressingmodes8051.ppt
DhilibanSwaminathan
 
Microcontroller 8051 addressing modes
UshaRani289
 
CH13-COA10e update Addressing mode of instruction.pptx
ArifatunNesa
 
Lecture 06
sohelranasweet
 
Addressing modes
RAMESHBABUA3
 
addressing modes of microcontrooller 8051
divyagupta418625
 
Addressing modes
rajukarki1599
 
Lecture 10
talhashahid40
 
Instruction Formats in computer architecture.pptx
tgoswami1907
 
instructionformat-110818112559-phpapp01.pptx
KUNALTURKAR1
 
8051d.ppt microcontroller instruction set summary
anushkayadav3011
 
Addressing Modes of 8051.pptx
TumkurInfomedia
 
module 3 instruction set and control unit
sindhujam30
 
Addressing modes Breifly
Tahir Jalali
 
Ad

8051 addressing modes

  • 1. MICROCONTROLLERS 8051 Created By: Sachin Bhalavat (Elect. & Comm. Engg.) [email protected]
  • 3. • The first byte of an instruction is known as the opcode (operation code) because this is the byte that is decoded by the processor - from this code the processor can work out what operation it must perform. • For a one-byte instruction there is only the opcode. • For a two-byte instruction the second byte is the operand. • The operand can be data or an 8-bit address. • For a three-byte instruction the second and third bytes make up the operand. • A two-byte operand is usually a 16-bit address, as we shall see when we look at long addressing
  • 4. The five addressing modes are: Immediate addressing modes Register addressing modes Direct addressing modes Indirect addressing modes Register specific addressing mode
  • 5.  Immediate addressing is only use when the data to be read is a constant.  The data is numeric constant in the operand indicated by a “#” sign  Useful for getting constants into registers.  For example, if your program needed to perform some calculations based on the number of weeks in the year, you could use immediate addressing to load the number 52 (34H) into a register and then perform arithmetic operations upon this data. MOV R0, #34H  The above instruction is an example of immediate addressing. It moves the data 34H into R0.  The has symbol (#) is used for this purpose (whenever the assembler sees # before a number it knows this is immediate addressing).  This is a two-byte instruction.  Data can be 16-bits when dealing with the DPTR register . MOV DPTR, #2500H
  • 6.  Direct access to eight registers (R0-R7).  There are 4 banks of registers accessible through register addressing.  Only one bank can be accessed at a time controllable through bit RS0 and RS1 of the PSW.  Often we need to move data from a register into the accumulator so that we can perform arithmetic operations upon it. For example, we may wish to move the contents of R5 into the accumulator. MOV A, R5  This is an example of register addressing. It moves data from R5 (in the currently selected register bank) into the accumulator.
  • 7.  Direct addressing is Used to access any on-chip RAM location, General purpose registers, Control registers or SFRs, which can be addressed by address or name. MOV A, 67  The above instruction moves the data in location 67H into the accumulator.  Note the difference between this and immediate addressing. Immediate addressing uses the data, which is immediately after the instruction. With direct addressing, the operand is an address.  The data to be operated upon is stored in that address.  The assembler realises this is an address and not data because there is no hash symbol before it.
  • 8.  R0 or R1 hold the location of the internal RAM  location. Indicated by the @ sign.  It Can be used for accessing external memory, where R0 and R1 point to external memory locations 00H to FFH.  Example: MOV A, @Ri  where Ri is either R0 or R1. Now, we can read the contents of location 30H through indirect addressing: MOV R0, #30H MOV A, @R0  The first instruction is an example of immediate addressing where the data 30H is placed in R0. The second instruction is indirect addressing. It moves the contents of location 30H into the accumulator.
  • 9. • In this addressing mode the instruction refer to a specific register such as accumulator or a data pointer. • Example: DA A :decimal adjust accumulator for addition RR A :rotate the content of accumulator to the right SWAP A:swap the nibble within the accumulator