SlideShare a Scribd company logo
1 of 9
MICROCONTROLLERS
           8051
 Created By: Sachin Bhalavat
             (Elect. & Comm. Engg.)
             profspbhalavat@gmail.com
• 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

8051 addressing modes
 8051 addressing modes 8051 addressing modes
8051 addressing modesghoshshweta
 
Addressing modes of 8085 by Er. Swapnil V. Kaware
Addressing modes of 8085 by Er. Swapnil V. KawareAddressing modes of 8085 by Er. Swapnil V. Kaware
Addressing modes of 8085 by Er. Swapnil V. KawareProf. Swapnil V. Kaware
 
Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Chinmayee samal
 
8051 addressing modes & instruction set
8051 addressing modes & instruction set8051 addressing modes & instruction set
8051 addressing modes & instruction setManoj Babar
 
8085 instructions and addressing modes
8085 instructions and addressing modes8085 instructions and addressing modes
8085 instructions and addressing modesSuchismita Paul
 
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086samirbharat77
 
Addressing modes of 8085
Addressing modes of 8085Addressing modes of 8085
Addressing modes of 8085Gaurav Solanki
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction setStefan Oprea
 
8051 Addressing Modes
8051 Addressing Modes8051 Addressing Modes
8051 Addressing ModesSenthil Kumar
 
8085 instruction set and Programming
8085 instruction set and Programming 8085 instruction set and Programming
8085 instruction set and Programming pooja saini
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modesVima Mali
 
3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptxISMT College
 
Instruction set 8085
Instruction set 8085Instruction set 8085
Instruction set 8085varun sukheja
 
Types of Addressing modes- COA
Types of Addressing modes- COATypes of Addressing modes- COA
Types of Addressing modes- COARuchi Maurya
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer languageSanjeev Patel
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer ArchitectureHaris456
 

What's hot (20)

8051 addressing modes
 8051 addressing modes 8051 addressing modes
8051 addressing modes
 
8051 Addressing modes
8051 Addressing modes8051 Addressing modes
8051 Addressing modes
 
Addressing modes of 8085 by Er. Swapnil V. Kaware
Addressing modes of 8085 by Er. Swapnil V. KawareAddressing modes of 8085 by Er. Swapnil V. Kaware
Addressing modes of 8085 by Er. Swapnil V. Kaware
 
Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085
 
Instruction.pdf
Instruction.pdfInstruction.pdf
Instruction.pdf
 
8051 addressing modes & instruction set
8051 addressing modes & instruction set8051 addressing modes & instruction set
8051 addressing modes & instruction set
 
8085 instructions and addressing modes
8085 instructions and addressing modes8085 instructions and addressing modes
8085 instructions and addressing modes
 
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
 
Addressing modes of 8085
Addressing modes of 8085Addressing modes of 8085
Addressing modes of 8085
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
8051 Addressing Modes
8051 Addressing Modes8051 Addressing Modes
8051 Addressing Modes
 
8085 instruction set and Programming
8085 instruction set and Programming 8085 instruction set and Programming
8085 instruction set and Programming
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
 
3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx
 
Instruction set 8085
Instruction set 8085Instruction set 8085
Instruction set 8085
 
Types of Addressing modes- COA
Types of Addressing modes- COATypes of Addressing modes- COA
Types of Addressing modes- COA
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer language
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer Architecture
 
8051d
8051d8051d
8051d
 
addressing modes
addressing modesaddressing modes
addressing modes
 

Viewers also liked

Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051Rashmi
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller NotesDr.YNM
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes Sher Shah Merkhel
 
Microcontroller directives
Microcontroller directivesMicrocontroller directives
Microcontroller directivesManoj Harsule
 
03loop conditional statements
03loop conditional statements03loop conditional statements
03loop conditional statementsAbdul Samad
 
8051,chapter1,architecture and peripherals
8051,chapter1,architecture and peripherals8051,chapter1,architecture and peripherals
8051,chapter1,architecture and peripheralsamrutachintawar239
 
Microcontrollers(8051) Notes written by Arun Kumar G, Associate Professor, De...
Microcontrollers(8051) Notes written by Arun Kumar G, Associate Professor, De...Microcontrollers(8051) Notes written by Arun Kumar G, Associate Professor, De...
Microcontrollers(8051) Notes written by Arun Kumar G, Associate Professor, De...Arunkumar Gowdru
 
Media Access Methods
Media Access MethodsMedia Access Methods
Media Access Methodsnizam143
 
M.A.C (Medium Access Control)
M.A.C (Medium Access Control)M.A.C (Medium Access Control)
M.A.C (Medium Access Control)JaironLanda
 
Pentium (80586) Microprocessor By Er. Swapnil Kaware
Pentium (80586) Microprocessor By Er. Swapnil KawarePentium (80586) Microprocessor By Er. Swapnil Kaware
Pentium (80586) Microprocessor By Er. Swapnil KawareProf. Swapnil V. Kaware
 
Computer architecture
Computer architectureComputer architecture
Computer architectureZuhaib Zaroon
 
Data link control & protocol concepts
Data link control & protocol conceptsData link control & protocol concepts
Data link control & protocol conceptsRaji Lakshmi
 

Viewers also liked (20)

8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
ADDRESSING MODE
ADDRESSING MODEADDRESSING MODE
ADDRESSING MODE
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller Notes
 
MPMC Unit-1
MPMC Unit-1MPMC Unit-1
MPMC Unit-1
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
8051 MICROCONTROLLER
8051 MICROCONTROLLER 8051 MICROCONTROLLER
8051 MICROCONTROLLER
 
Microcontroller directives
Microcontroller directivesMicrocontroller directives
Microcontroller directives
 
03loop conditional statements
03loop conditional statements03loop conditional statements
03loop conditional statements
 
Conditional jump
Conditional jumpConditional jump
Conditional jump
 
8051,chapter1,architecture and peripherals
8051,chapter1,architecture and peripherals8051,chapter1,architecture and peripherals
8051,chapter1,architecture and peripherals
 
Microcontrollers(8051) Notes written by Arun Kumar G, Associate Professor, De...
Microcontrollers(8051) Notes written by Arun Kumar G, Associate Professor, De...Microcontrollers(8051) Notes written by Arun Kumar G, Associate Professor, De...
Microcontrollers(8051) Notes written by Arun Kumar G, Associate Professor, De...
 
Media Access Methods
Media Access MethodsMedia Access Methods
Media Access Methods
 
Data link control protocol(2)
Data link control protocol(2)Data link control protocol(2)
Data link control protocol(2)
 
M.A.C (Medium Access Control)
M.A.C (Medium Access Control)M.A.C (Medium Access Control)
M.A.C (Medium Access Control)
 
Pentium (80586) Microprocessor By Er. Swapnil Kaware
Pentium (80586) Microprocessor By Er. Swapnil KawarePentium (80586) Microprocessor By Er. Swapnil Kaware
Pentium (80586) Microprocessor By Er. Swapnil Kaware
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Data link control protocol(1)
Data link control protocol(1)Data link control protocol(1)
Data link control protocol(1)
 
Data link control & protocol concepts
Data link control & protocol conceptsData link control & protocol concepts
Data link control & protocol concepts
 

Similar to Guide to 8051 microcontroller addressing modes

Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051Dr. AISHWARYA N
 
432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdf432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdfShreeKrishnaTarai
 
microprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmicroprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmananjain543
 
Memory Access Instructions
Memory Access InstructionsMemory Access Instructions
Memory Access InstructionsSharif Ullah
 
Unit ii microcontrollers final
Unit ii microcontrollers finalUnit ii microcontrollers final
Unit ii microcontrollers finalSARITHA REDDY
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction SetDr. Pankaj Zope
 
Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01cairo university
 
8051 Programming (1).pptx
8051 Programming (1).pptx8051 Programming (1).pptx
8051 Programming (1).pptxDhyeayaParmar
 
MICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptxMICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptxAmoghR3
 
Memory intrface and addrs modes
Memory intrface and addrs modesMemory intrface and addrs modes
Memory intrface and addrs modesbalbirvirdi
 
Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes UshaRani289
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085ShivamSood22
 

Similar to Guide to 8051 microcontroller addressing modes (20)

addressing-mode-of-8051.pdf
addressing-mode-of-8051.pdfaddressing-mode-of-8051.pdf
addressing-mode-of-8051.pdf
 
Microcontroller .pptx
Microcontroller .pptxMicrocontroller .pptx
Microcontroller .pptx
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdf432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdf
 
microprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmicroprocessor and microcontroller notes ppt
microprocessor and microcontroller notes ppt
 
addressingmodes8051.ppt
addressingmodes8051.pptaddressingmodes8051.ppt
addressingmodes8051.ppt
 
Memory Access Instructions
Memory Access InstructionsMemory Access Instructions
Memory Access Instructions
 
Unit ii microcontrollers final
Unit ii microcontrollers finalUnit ii microcontrollers final
Unit ii microcontrollers final
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
 
Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01
 
8051 Programming (1).pptx
8051 Programming (1).pptx8051 Programming (1).pptx
8051 Programming (1).pptx
 
MICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptxMICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptx
 
Memory intrface and addrs modes
Memory intrface and addrs modesMemory intrface and addrs modes
Memory intrface and addrs modes
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
5 addressing modes
5 addressing modes5 addressing modes
5 addressing modes
 
Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes
 
MES_MODULE 2.pptx
MES_MODULE 2.pptxMES_MODULE 2.pptx
MES_MODULE 2.pptx
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
8051 instruction_set.ppt
8051 instruction_set.ppt8051 instruction_set.ppt
8051 instruction_set.ppt
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085
 

Guide to 8051 microcontroller addressing modes

  • 1. MICROCONTROLLERS 8051 Created By: Sachin Bhalavat (Elect. & Comm. Engg.) profspbhalavat@gmail.com
  • 2.
  • 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