SlideShare a Scribd company logo
1 of 16
8051 ADDRESSING MODES
Prepared by
Vima Mali
8051 Registers
D7 D6 D5 D4 D3 D2 D1 D0
DPTR
PC PC (Program counter)
DPH DPL
8 bit Registers of the 8051
8051 16 bit Registers
8 bit Registers
R6
R5
R4
R3
R2
R1
R0
B
A
R7
ADDRESSING MODES OF 8051
1. Immediate addressing
2. Register addressing
3. Direct addressing
4. Register indirect addressing
5. Indexed addressing
6. Relative addressing
7. Absolute addressing
8. Long addressing
9. Inherent addressing
10.Bit Inherent addressing
11. Bit Direct addressing
12. Stack addressing mode
Immediate Addressing Mode
MOV A, #25H ;load 25H into A
MOV R4, #62 ;load the decimal value 62 into R4
MOV B, #40H ;load 40H into B
MOV DPTR, #4521H ;DPTR=4521H
MOV DPTR, #2550H ;is the same as:
MOV DPL, #50H
MOV DPH, #25H
Register Addressing Mode
MOV A,R0 ;copy the contents of R0 into A
MOV R2,A ;copy the contents of A into R2
ADD A,R5 ;add the contents of R5 to contents of A
ADD A,R7 ;add the contents of R7 to contents of A
MOV R6,A ;save accumulator in R6
MOV DPTR,#25F5H
MOV R7,DPL
MOV R6,DPH
Direct Addressing Mode
MOV R0,40H ;save content of RAM location 40H in R0
MOV R4,7FH ;move contents of RAM location 7FH to R4
MOV A,4
MOV A,7
ADD A, 50
MOV A,2 ;is the same as
MOV A,R2 ;which means copy R2 into A
MOV A,0 ;is the same as
MOV A,R0 ;which means copy R0 into A
MOV R2,#5 ;R2=05
Register Indirect Addressing Mode
• Only R0, R1 &DPTR are the only registers that can be used
for pointers in register indirect addressing mode.
MOV A,@R0 ;move contents of RAM location whose
address is held by R0 into A
MOV @R1,B ;move contents of B into RAM location
whose address is held by R1
MOVX A,@DPTR ; copy the contents of external data memory
pointed by DPTR into the accumulator.
Indexed Addressing Mode
• It uses DPTR as a reference.
• 16 bits
MOVC A, @A+DPTR
MOVC A, @A+PC ; “C” means program
(code) space ROM
Relative addressing
 It is used for short JMP(Jump) and short
Call(8-bit) instructions in 8051 use the relative
addressing.
In relative addressing, a new program address
is not directed specified.
It is specified as PC+offset gives the new
program address.
For Ex: 2000: JMP 20
Absolute Addressing
• The addressing mode is similar to that of relative
addressing expect the offset length.
• Here, the offset is 11-bit instead of 8-bit in case of
relative addressing.
• The 11-bit offset gives an address range of from
0000H to 07FFH.
For example: AJMP NEXT
ACALL SUB1
Long addressing
 In long addressing mode (LJMP or LCALL) is
specified as entire new 16-bit address.
Since address is 16-bit, a jump or a call can be
made to a location within a 64-kbytes(0000-
FFFFH) code memory space.
For Example: LJMP 2000H
LCALL 3000H
Inherent addressing
 Inherent addressing refers to a specific register
such a accumulator or DPTR.
For ex: SWAP A
Bit Inherent Addressing
• Bit inherent addressing works on any single
bit.
For example: 1.CLR C
2.CPL C
Bit Direct addressing
• The RAM address space from 20H to 2FH and
some Special Function Registers(SFRs) are bit
addressable.
For Ex: SETB 06H
CLR P1.2
Stack Addressing Mode
• It is subtype of direct addressing mode in which
stack instructions(PUSH and POP) are used.
• Instruction such as “PUSH A” is invalid. Here,
we have to specify the address of register A.
For example:
1. PUSH 04 ; Push R4 onto stack
2. PUSH 06 ; Push R6 onto stack
3. POP 02 ; Pop top of stack into R2
4. POP 0F0H ; Pop top of stack into register B

More Related Content

What's hot

Interfacing stepper motor
Interfacing stepper motorInterfacing stepper motor
Interfacing stepper motorPRADEEP
 
Minimum Modes and Maximum Modes of 8086 Microprocessor
Minimum Modes and Maximum Modes of 8086 MicroprocessorMinimum Modes and Maximum Modes of 8086 Microprocessor
Minimum Modes and Maximum Modes of 8086 MicroprocessorNikhil Kumar
 
I/O port programming in 8051
I/O port programming in 8051I/O port programming in 8051
I/O port programming in 8051ssuser3a47cb
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessorAMAN SRIVASTAVA
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051Dr. AISHWARYA N
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085ShivamSood22
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacingdeval patel
 
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
 
8085 microprocessor architecture ppt
8085 microprocessor architecture ppt8085 microprocessor architecture ppt
8085 microprocessor architecture pptParvesh Gautam
 
8086 modes
8086 modes8086 modes
8086 modesPDFSHARE
 
8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller pptRahul Kumar
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085techbed
 
8051 Addressing Modes
8051 Addressing Modes8051 Addressing Modes
8051 Addressing ModesSenthil Kumar
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controllerTech_MX
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051hello_priti
 

What's hot (20)

Interfacing stepper motor
Interfacing stepper motorInterfacing stepper motor
Interfacing stepper motor
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
8279 PKDI
8279 PKDI8279 PKDI
8279 PKDI
 
Minimum Modes and Maximum Modes of 8086 Microprocessor
Minimum Modes and Maximum Modes of 8086 MicroprocessorMinimum Modes and Maximum Modes of 8086 Microprocessor
Minimum Modes and Maximum Modes of 8086 Microprocessor
 
I/O port programming in 8051
I/O port programming in 8051I/O port programming in 8051
I/O port programming in 8051
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessor
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
 
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
 
8085 microprocessor architecture ppt
8085 microprocessor architecture ppt8085 microprocessor architecture ppt
8085 microprocessor architecture ppt
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
8086 modes
8086 modes8086 modes
8086 modes
 
8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller ppt
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 
8051 Addressing Modes
8051 Addressing Modes8051 Addressing Modes
8051 Addressing Modes
 
Intel 8051 Programming in C
Intel 8051 Programming in CIntel 8051 Programming in C
Intel 8051 Programming in C
 
8237 dma controller
8237 dma controller8237 dma controller
8237 dma controller
 
PIC Microcontrollers
PIC MicrocontrollersPIC Microcontrollers
PIC Microcontrollers
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 

Similar to 8051 addressing modes

Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.pptsteffydean
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller nitugatkal
 
Microcontroller 8051 soft
Microcontroller 8051  softMicrocontroller 8051  soft
Microcontroller 8051 softbaluusa8
 
Instruction set summary
Instruction set summary Instruction set summary
Instruction set summary janicetiong
 
Https _doc-0o-c4-apps-viewer.googleusercontent
Https  _doc-0o-c4-apps-viewer.googleusercontent Https  _doc-0o-c4-apps-viewer.googleusercontent
Https _doc-0o-c4-apps-viewer.googleusercontent vijaydeepakg
 
1347 Assembly Language Programming Of 8051
1347 Assembly Language Programming Of 80511347 Assembly Language Programming Of 8051
1347 Assembly Language Programming Of 8051techbed
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction setStefan Oprea
 
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
 
Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01cairo university
 
microprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmicroprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmananjain543
 
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdfARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdfeklavya0304
 

Similar to 8051 addressing modes (20)

Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
Microcontroller 8051 soft
Microcontroller 8051  softMicrocontroller 8051  soft
Microcontroller 8051 soft
 
Instruction set summary
Instruction set summary Instruction set summary
Instruction set summary
 
Https _doc-0o-c4-apps-viewer.googleusercontent
Https  _doc-0o-c4-apps-viewer.googleusercontent Https  _doc-0o-c4-apps-viewer.googleusercontent
Https _doc-0o-c4-apps-viewer.googleusercontent
 
1347 Assembly Language Programming Of 8051
1347 Assembly Language Programming Of 80511347 Assembly Language Programming Of 8051
1347 Assembly Language Programming Of 8051
 
addressing-mode-of-8051.pdf
addressing-mode-of-8051.pdfaddressing-mode-of-8051.pdf
addressing-mode-of-8051.pdf
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
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
 
The 8051 microcontroller
The 8051 microcontrollerThe 8051 microcontroller
The 8051 microcontroller
 
Microcontroller .pptx
Microcontroller .pptxMicrocontroller .pptx
Microcontroller .pptx
 
Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01
 
8051assembly language
8051assembly language8051assembly language
8051assembly language
 
mup
mupmup
mup
 
5 addressing modes
5 addressing modes5 addressing modes
5 addressing modes
 
microprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmicroprocessor and microcontroller notes ppt
microprocessor and microcontroller notes ppt
 
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdfARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
 
addressingmodes8051.ppt
addressingmodes8051.pptaddressingmodes8051.ppt
addressingmodes8051.ppt
 
8051 instruction_set.ppt
8051 instruction_set.ppt8051 instruction_set.ppt
8051 instruction_set.ppt
 
12 mt06ped008
12 mt06ped008 12 mt06ped008
12 mt06ped008
 

More from Vima Mali

Illumination
IlluminationIllumination
IlluminationVima Mali
 
Electrical safety
Electrical safetyElectrical safety
Electrical safetyVima Mali
 
Efficient lighting
Efficient lightingEfficient lighting
Efficient lightingVima Mali
 
Domestic wiring
Domestic wiringDomestic wiring
Domestic wiringVima Mali
 
7 quality control tools
7 quality  control tools7 quality  control tools
7 quality control toolsVima Mali
 

More from Vima Mali (8)

Timers
TimersTimers
Timers
 
Illumination
IlluminationIllumination
Illumination
 
Grounding
GroundingGrounding
Grounding
 
Energy
EnergyEnergy
Energy
 
Electrical safety
Electrical safetyElectrical safety
Electrical safety
 
Efficient lighting
Efficient lightingEfficient lighting
Efficient lighting
 
Domestic wiring
Domestic wiringDomestic wiring
Domestic wiring
 
7 quality control tools
7 quality  control tools7 quality  control tools
7 quality control tools
 

Recently uploaded

Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
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
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
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
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
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
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
(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
 
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
 
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
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 

Recently uploaded (20)

Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
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
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
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
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
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...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
(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...
 
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🔝
 
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
 
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
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 

8051 addressing modes

  • 2. 8051 Registers D7 D6 D5 D4 D3 D2 D1 D0 DPTR PC PC (Program counter) DPH DPL 8 bit Registers of the 8051 8051 16 bit Registers 8 bit Registers R6 R5 R4 R3 R2 R1 R0 B A R7
  • 3. ADDRESSING MODES OF 8051 1. Immediate addressing 2. Register addressing 3. Direct addressing 4. Register indirect addressing 5. Indexed addressing 6. Relative addressing 7. Absolute addressing 8. Long addressing 9. Inherent addressing 10.Bit Inherent addressing 11. Bit Direct addressing 12. Stack addressing mode
  • 4. Immediate Addressing Mode MOV A, #25H ;load 25H into A MOV R4, #62 ;load the decimal value 62 into R4 MOV B, #40H ;load 40H into B MOV DPTR, #4521H ;DPTR=4521H MOV DPTR, #2550H ;is the same as: MOV DPL, #50H MOV DPH, #25H
  • 5. Register Addressing Mode MOV A,R0 ;copy the contents of R0 into A MOV R2,A ;copy the contents of A into R2 ADD A,R5 ;add the contents of R5 to contents of A ADD A,R7 ;add the contents of R7 to contents of A MOV R6,A ;save accumulator in R6 MOV DPTR,#25F5H MOV R7,DPL MOV R6,DPH
  • 6. Direct Addressing Mode MOV R0,40H ;save content of RAM location 40H in R0 MOV R4,7FH ;move contents of RAM location 7FH to R4 MOV A,4 MOV A,7 ADD A, 50
  • 7. MOV A,2 ;is the same as MOV A,R2 ;which means copy R2 into A MOV A,0 ;is the same as MOV A,R0 ;which means copy R0 into A MOV R2,#5 ;R2=05
  • 8. Register Indirect Addressing Mode • Only R0, R1 &DPTR are the only registers that can be used for pointers in register indirect addressing mode. MOV A,@R0 ;move contents of RAM location whose address is held by R0 into A MOV @R1,B ;move contents of B into RAM location whose address is held by R1 MOVX A,@DPTR ; copy the contents of external data memory pointed by DPTR into the accumulator.
  • 9. Indexed Addressing Mode • It uses DPTR as a reference. • 16 bits MOVC A, @A+DPTR MOVC A, @A+PC ; “C” means program (code) space ROM
  • 10. Relative addressing  It is used for short JMP(Jump) and short Call(8-bit) instructions in 8051 use the relative addressing. In relative addressing, a new program address is not directed specified. It is specified as PC+offset gives the new program address. For Ex: 2000: JMP 20
  • 11. Absolute Addressing • The addressing mode is similar to that of relative addressing expect the offset length. • Here, the offset is 11-bit instead of 8-bit in case of relative addressing. • The 11-bit offset gives an address range of from 0000H to 07FFH. For example: AJMP NEXT ACALL SUB1
  • 12. Long addressing  In long addressing mode (LJMP or LCALL) is specified as entire new 16-bit address. Since address is 16-bit, a jump or a call can be made to a location within a 64-kbytes(0000- FFFFH) code memory space. For Example: LJMP 2000H LCALL 3000H
  • 13. Inherent addressing  Inherent addressing refers to a specific register such a accumulator or DPTR. For ex: SWAP A
  • 14. Bit Inherent Addressing • Bit inherent addressing works on any single bit. For example: 1.CLR C 2.CPL C
  • 15. Bit Direct addressing • The RAM address space from 20H to 2FH and some Special Function Registers(SFRs) are bit addressable. For Ex: SETB 06H CLR P1.2
  • 16. Stack Addressing Mode • It is subtype of direct addressing mode in which stack instructions(PUSH and POP) are used. • Instruction such as “PUSH A” is invalid. Here, we have to specify the address of register A. For example: 1. PUSH 04 ; Push R4 onto stack 2. PUSH 06 ; Push R6 onto stack 3. POP 02 ; Pop top of stack into R2 4. POP 0F0H ; Pop top of stack into register B