SlideShare a Scribd company logo
1 of 9
ADDRESSING
MODES OF 8051
Prepared By,
Dr. N. AISHWARYA,
R.M.K College of Engineering and Technology
Definition:
The ways in which the operands are represented in an instruction is
called addressing modes.
• In 8051, there are 5 addressing modes.
CLASSIFICATION OF ADDRESSING MODES
 Immediate Addressing Mode
 Register Addressing Mode
 Direct Addressing Mode
 Register-Indirect Addressing Mode
 Indexed Addressing Mode
IMMEDIATE ADDRESSING MODE
• The data will be specified directly in the source operand.
• Since 8051 Microcontroller is a 8 bit microcontroller, only 8 bit data (2 decimal digits) can
be specified.
• The immediate data will be followed by the symbol #
Example:
 MOV A, #04H- The 8 bit data 04H will be moved to accumulator (A) register.
 MOV R3, #0AE H- The 8 bit data AE is moved to R3 register.
Note: In 8051, A, B and R0-R7 registers will be generally used.
Also, whenever the data starts from A to F, the data must be preceded by 0.
Before Execution After Execution
The value of A---->09 The value of A---->04
REGISTER ADDRESSING MODE
• In this mode, both source and destination operands are registers.
Example:
 MOV A, R0- The data which resides in R0 register is moved/copied to A register.
 ADD A, R1- The data in R1 register and A register are summed up and the result is stored
in A register.
Note: Both the source and the destination operand cannot be register banks(R0-R7). For eg,
MOV R3,R7 is not possible. The sequence can be,
MOV A, R7
MOV R3, A
Before Execution After Execution
The value of A---->0C
The value of R0--->09
The value of A---->09
The value of R0--->09
Before Execution After Execution
The value of A---->0C
The value of R1--->09
The value of A---->15
The value of R1--->09
DIRECT ADDRESSING MODE
• Here the address of the data is specified either in source operand or destination operand.
Example:
 MOV R2, 04 - The data which resides in memory location 04H is moved to R2 register.
Don’t use # symbol, otherwise 04 becomes data rather than address.
Only the internal memory address (00 to 7F) will be used in this mode.
 Assume the data in 04 address----> 0C.
Before Execution After Execution
The value of R2---->09 The value of R2---->0C
REGISTER INDIRECT ADDRESSING MODE
• As the name suggests, the address of the memory location which contains the data (will be
enclosed in square brackets) is specified by registers.
• The @ symbol in the instruction specifies this addressing mode.
• Only R0 and R1 registers can be accessed via this mode.
Example:
 MOV A, @R0-Assume the R0 register is pointing to location 80H. Then the value say 0E
in 80H is moved to A register.
MOV @R1, 85-Assume the value in 85H is 02. This data is moved to the memory location
pointed by R1 register.
In other words, this example moves data from one location to another location.
Before Execution After Execution
The value of A--->0C The value of A---->0E
INDEXED ADDRESSING MODE
• In this mode, the effective address is formed by summing up the base register and
accumulator register.
• Base registers-PC (Program counter), DPTR (Data pointer register)
• The destination operand will be always A register.
• The source memory can be accessed only by program memory which is represented by
letter C (means code) in the instruction.
Example:
 MOVC A, @A+PC- Assume the A register holds the value 07H and the PC has the value
4100H. Then, the data in memory location 4107H(4100+07) is moved to A register.
MOVC A, @A+DPTR- The same explanation holds good for this instruction also.
THANK YOU!!!

More Related Content

What's hot

Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086Dr. AISHWARYA N
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly languageMir Majid
 
8051 addressing modes & instruction set
8051 addressing modes & instruction set8051 addressing modes & instruction set
8051 addressing modes & instruction setManoj Babar
 
Stacks & subroutines 1
Stacks & subroutines 1Stacks & subroutines 1
Stacks & subroutines 1deval patel
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor DebrajJana4
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051SARITHA REDDY
 
Branch instructions in 8051 micrcocontroller
Branch instructions in 8051 micrcocontrollerBranch instructions in 8051 micrcocontroller
Branch instructions in 8051 micrcocontrollerUshaRani289
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051hello_priti
 
DAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdfDAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdfSrikrishna Thota
 
Interfacing adc
Interfacing adcInterfacing adc
Interfacing adcPRADEEP
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 80869840596838
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...NimeshSingh27
 
Data transfer techniques 8085
Data transfer techniques 8085Data transfer techniques 8085
Data transfer techniques 8085ShivamSood22
 
8051 data types and directives
8051 data types and directives8051 data types and directives
8051 data types and directivesSARITHA REDDY
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessorAMAN SRIVASTAVA
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil KawareProf. Swapnil V. Kaware
 

What's hot (20)

Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly language
 
8051 addressing modes & instruction set
8051 addressing modes & instruction set8051 addressing modes & instruction set
8051 addressing modes & instruction set
 
Stacks & subroutines 1
Stacks & subroutines 1Stacks & subroutines 1
Stacks & subroutines 1
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051Interfacing Stepper motor with 8051
Interfacing Stepper motor with 8051
 
Branch instructions in 8051 micrcocontroller
Branch instructions in 8051 micrcocontrollerBranch instructions in 8051 micrcocontroller
Branch instructions in 8051 micrcocontroller
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
DAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdfDAC Interfacing with 8051.pdf
DAC Interfacing with 8051.pdf
 
Interfacing adc
Interfacing adcInterfacing adc
Interfacing adc
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
 
8255 PPI
8255 PPI8255 PPI
8255 PPI
 
Data transfer techniques 8085
Data transfer techniques 8085Data transfer techniques 8085
Data transfer techniques 8085
 
8051 data types and directives
8051 data types and directives8051 data types and directives
8051 data types and directives
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessor
 
8051 Inturrpt
8051 Inturrpt8051 Inturrpt
8051 Inturrpt
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 

Similar to Addressing modes of 8051

8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modessb108ec
 
MICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptxMICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptxAmoghR3
 
Unit ii microcontrollers final
Unit ii microcontrollers finalUnit ii microcontrollers final
Unit ii microcontrollers finalSARITHA REDDY
 
microprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmicroprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmananjain543
 
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
 
The 8051 microcontroller
The 8051 microcontrollerThe 8051 microcontroller
The 8051 microcontrollerPallaviHailkar
 
Instruction set summary
Instruction set summary Instruction set summary
Instruction set summary janicetiong
 
8085 paper-presentation
8085 paper-presentation8085 paper-presentation
8085 paper-presentationJiMs ChAcko
 
Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes UshaRani289
 
8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).pptKanikaJindal9
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.pptsteffydean
 

Similar to Addressing modes of 8051 (20)

8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
 
addressing-mode-of-8051.pdf
addressing-mode-of-8051.pdfaddressing-mode-of-8051.pdf
addressing-mode-of-8051.pdf
 
MICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptxMICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptx
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Unit ii microcontrollers final
Unit ii microcontrollers finalUnit ii microcontrollers final
Unit ii microcontrollers final
 
microprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmicroprocessor and microcontroller notes ppt
microprocessor and microcontroller notes ppt
 
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
 
8051 instruction_set.ppt
8051 instruction_set.ppt8051 instruction_set.ppt
8051 instruction_set.ppt
 
addressingmodes8051.ppt
addressingmodes8051.pptaddressingmodes8051.ppt
addressingmodes8051.ppt
 
The 8051 microcontroller
The 8051 microcontrollerThe 8051 microcontroller
The 8051 microcontroller
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Instruction set summary
Instruction set summary Instruction set summary
Instruction set summary
 
Microcontroller .pptx
Microcontroller .pptxMicrocontroller .pptx
Microcontroller .pptx
 
8085 paper-presentation
8085 paper-presentation8085 paper-presentation
8085 paper-presentation
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
mup
mupmup
mup
 
Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes Microcontroller 8051 addressing modes
Microcontroller 8051 addressing modes
 
8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
 

Recently uploaded

microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 

Recently uploaded (20)

microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 

Addressing modes of 8051

  • 1. ADDRESSING MODES OF 8051 Prepared By, Dr. N. AISHWARYA, R.M.K College of Engineering and Technology
  • 2. Definition: The ways in which the operands are represented in an instruction is called addressing modes. • In 8051, there are 5 addressing modes.
  • 3. CLASSIFICATION OF ADDRESSING MODES  Immediate Addressing Mode  Register Addressing Mode  Direct Addressing Mode  Register-Indirect Addressing Mode  Indexed Addressing Mode
  • 4. IMMEDIATE ADDRESSING MODE • The data will be specified directly in the source operand. • Since 8051 Microcontroller is a 8 bit microcontroller, only 8 bit data (2 decimal digits) can be specified. • The immediate data will be followed by the symbol # Example:  MOV A, #04H- The 8 bit data 04H will be moved to accumulator (A) register.  MOV R3, #0AE H- The 8 bit data AE is moved to R3 register. Note: In 8051, A, B and R0-R7 registers will be generally used. Also, whenever the data starts from A to F, the data must be preceded by 0. Before Execution After Execution The value of A---->09 The value of A---->04
  • 5. REGISTER ADDRESSING MODE • In this mode, both source and destination operands are registers. Example:  MOV A, R0- The data which resides in R0 register is moved/copied to A register.  ADD A, R1- The data in R1 register and A register are summed up and the result is stored in A register. Note: Both the source and the destination operand cannot be register banks(R0-R7). For eg, MOV R3,R7 is not possible. The sequence can be, MOV A, R7 MOV R3, A Before Execution After Execution The value of A---->0C The value of R0--->09 The value of A---->09 The value of R0--->09 Before Execution After Execution The value of A---->0C The value of R1--->09 The value of A---->15 The value of R1--->09
  • 6. DIRECT ADDRESSING MODE • Here the address of the data is specified either in source operand or destination operand. Example:  MOV R2, 04 - The data which resides in memory location 04H is moved to R2 register. Don’t use # symbol, otherwise 04 becomes data rather than address. Only the internal memory address (00 to 7F) will be used in this mode.  Assume the data in 04 address----> 0C. Before Execution After Execution The value of R2---->09 The value of R2---->0C
  • 7. REGISTER INDIRECT ADDRESSING MODE • As the name suggests, the address of the memory location which contains the data (will be enclosed in square brackets) is specified by registers. • The @ symbol in the instruction specifies this addressing mode. • Only R0 and R1 registers can be accessed via this mode. Example:  MOV A, @R0-Assume the R0 register is pointing to location 80H. Then the value say 0E in 80H is moved to A register. MOV @R1, 85-Assume the value in 85H is 02. This data is moved to the memory location pointed by R1 register. In other words, this example moves data from one location to another location. Before Execution After Execution The value of A--->0C The value of A---->0E
  • 8. INDEXED ADDRESSING MODE • In this mode, the effective address is formed by summing up the base register and accumulator register. • Base registers-PC (Program counter), DPTR (Data pointer register) • The destination operand will be always A register. • The source memory can be accessed only by program memory which is represented by letter C (means code) in the instruction. Example:  MOVC A, @A+PC- Assume the A register holds the value 07H and the PC has the value 4100H. Then, the data in memory location 4107H(4100+07) is moved to A register. MOVC A, @A+DPTR- The same explanation holds good for this instruction also.