SlideShare a Scribd company logo
1 of 31
8051 ADDRESSING MODES (CONT.)
By: Mayank Garg
2013H140040H
“What is an addressing mode ?“
“What is an addressing mode ?“
Addressing mode is the way of addressing a
memory location in instruction. Microcntroller
needs data or operands on which the operation is
to be performed. The method of specifying source
of operand and output of result in an instruction is
known as addressing mode.
“What is an addressing mode ?“
Addressing mode is the way of addressing a memory
location in instruction. Microcntroller needs data or
operands on which the operation is to be performed. The
method of specifying source of operand and output of result
in an instruction is known as addressing mode.
Now question arises:
How many types of addressing
modes?
ADDRESSING MODES
The 8051 instructions use eight addressing
modes. These are:
1. Register
2. Direct
3. Indirect
4. Immediate
5. Relative
6. Absolute
7. Indexed
8. Long
ABSOLUTE ADDRESSING MODE
 There are only two instructions that use this
addressing:
 ACALL (absolute call)
 AJMP (absolute jump).
 These instructions perform branching within the
current 2K page of program memory.
 The branch address is obtained by successively
concatenating the five high-order bits of the
program counter, bits 5 – 7 of the op-code,and
the second byte of the instruction.
CONTD…
 The operation of the AJMP instruction is detailed
below:
 AJMP address
(PC) <- (PC) + 2
(PC10-PC0) <- address10 - address0
 The eleven least significant bits of the PC are
altered. The five most significant bits remain the
same. This means the AJMP will only allow you
to jump to a location in the same 2K page as the
instruction directly after the jump.
For example:
If the label THERE represents an instruction at address 0F46H and the
instruction AJMP THERE is in memory at locations 0900H and 0901H, the
assembler will encode the instruction as
11100001 1st byte (A10 - A8 + opcode)
01000110 2nd byte (A7 - A0)
The underlined bits are the low-order 11 bits of the destination address, 0F46H =
0000111101000110B. The upper five bits in the program counter will not change
when this instruction executes. Note that both the AJMP instruction and the
destination are within the 2K page bounded by 0800H and 0FFFH, and therefore
have the upper five address bits in common.
ANY Query regarding
this??
Lets move to next….
RELATIVE ADDRESING
 Relative addressing is used only with certain
jump instructions. The system executes a jump
by changing the contents of the PC to the
address of the next instruction to be executed.
 For example, if we wished to jump to the
instruction stored at location 4EH in code
memory, the PC would be loaded with 4EH.
Then, during the next execution cycle the
contents of the PC (4EH) are placed on the
address bus and the instruction at 4EH is
retrieved.
SJUMP is an unconditional jump and is a 2-byte
instruction. The number following it is an offset address. If
this instruction were stored in code memory at locations
100H and 101H, as shown below:
100H 80H
101H 06H
---The PC contains 100H, therefore the instruction 80H is
read into the IR.
---The instruction is decoded as the 2-byte SJMP
instruction.
---The PC is incremented so that the operand may be
retrieved.
---The operand is read from code memory and the PC is
incremented again (because this is a 2-bye instruction).
---The operand (06H) is added to the PC (102H + 06H =
108H).
ANY Query regarding
this??
Lets move to next….
INDEXED ADDRESSING MODE
 In this mode the 16-bit address in a base register is
added to a positive offset to form an effective address
for the jump indirect instruction
 JMP @A+DPTR
 the two move code byte instructions
 MOVC A,@A+DPTR and
 MOVC A,@A+PC.
 The base register in the jump instruction is the data
pointer and the positive offset is held in the
accumulator.
 For the move instructions the base register can either
be the data pointer or the program counter, and again
the positive offset is in the accumulator.
Example:
JMP @A+DPTR (PC)  (A)
+(DPTR)
MOVC A,@A+DPTR (A)  ((A) +
(DPTR))
MOVC A,@A+PC (PC)  (PC)
+ 1
(A)  ((A) +
(PC))
ANY Query regarding
this??
Lets move to next….
LONG ADDRESSING MODE
 Only two instructions use this addressing mode.
 These instructions are:
 LCALL addr16
 LJMP addr16.
 Both of these are three byte instructions with the op-
code being the first byte and the following two bytes
are the address high-byte and address low-byte
respectively.
 These instructions enable the program to branch to
anywhere within the full 64 K-bytes of program
memory address space
ANY Query regarding
this??
Lets move to next….
INDIRECT ADDRESSING MODE
 In this mode of addressing the instruction
performs an operation on the data whose
address is contained in register R0 or R1.
Instructions using indirect addressing are
single byte instructions.
 In 8051 assembly language the symbol @
before R0 or
 SUBB A, @R0 R1
(denotes indirect addressing.)
This instruction performs the operation:
(A) (A) (C)  ((R0)).
For example,
***if you had an array of 8-bit numbers stored in
memory, starting at address 30H, you may wish to examine
the contents of each number in the array (perhaps to find the
smallest number).
***To do so, you would need to read location 30H, then
31H, then 32H and so on.
This can be achieved using indirect addressing. R0 and
R1 may be used as pointer registers.
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
ANY Query regarding
this??
So now we know all addressing modes.
What is next now??
What is the difference between
Microprocessor and Microcontroller???
Microprocessors generally require external
components to implement program memory, ram
memory and Input/output.
-Here cpu is stand alone,RAM ROM I/O, timer are
separate.
-It is expensive n versatile.
-used for general purpose.
-RAM n ROM size is user defined.
-bit manipulation is less.
-access time is less.
-more hardware is used.
MICROCONTROLLER
 Microcontrollers incorporate program memory, ram
memory and input/output resources internal to the
chip.
-Here cpu RAM ROM I/O, timer are on a single chip.
-It is cheaper as compared to microprocessor.
-used for single purpose.
-fixed amount of on chip RAM,ROM and I/O ports.
-bit manipulation is more.
-access time is more.
-less hardware is used.
WHAT IS DIFFERENCE BETWEEN:
 8085
 8086
 8051
???
8051
 16 bit Microcontroller
 On chip ROM( 8KB) and On chip RAM (128 bytes)
 Two 16 bit timer/counter.
 Four 8-bit ports for input/output
 Fully duplex serial receiver/transmitter.
 No pre-fetching of instruction.
 16 address pins
8086
 16 bit Microprocessor
 No on chip memory.
 Memory is divided into two banks to increase
the processing speed.
 Pre-fetching of 6 bytes of instruction in a
queue.
 20 address pins
8085
 8 bit microprocessor
 16-bit address bus
 8-bit registers
 16-bit register pairs, BC, DE, and HL
 256 input/output (I/O) ports
 External Memory
REFERENCES
 https://www.silabs.com/Support%20Documents/Softw
are/8051_Instruction_Set.pdf
 http://coitweb.uncc.edu/~abw/ITCS3182F09/slides3.p
df
 http://www.cs.iit.edu/~virgil/cs470/Book/chapter4.pd
 http://www.slideshare.net/chappidi_saritha/addressin
g-modes-of-8051
 http://www.edsim51.com/8051Notes/8051/instruction
SetSummary.html
 http://www.nptel.iitm.ac.in/courses/Webcourse-
contents/IITKANPUR/microcontrollers/micro/ui/Cours
e_home2_6.htm
So now move to what is
instruction?
Types of instructions???

More Related Content

What's hot

Addressing modes
Addressing modesAddressing modes
Addressing modesAsif Iqbal
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 80869840596838
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051SARITHA REDDY
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Jismy .K.Jose
 
Types of Addressing modes- COA
Types of Addressing modes- COATypes of Addressing modes- COA
Types of Addressing modes- COARuchi Maurya
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085ShivamSood22
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architectureprasadpawaskar
 
Microprogram Control
Microprogram Control Microprogram Control
Microprogram Control Anuj Modi
 
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
 
8086 modes
8086 modes8086 modes
8086 modesPDFSHARE
 
Computer organization memory
Computer organization memoryComputer organization memory
Computer organization memoryDeepak John
 
Memory mapped I/O and Isolated I/O
Memory mapped I/O and Isolated I/OMemory mapped I/O and Isolated I/O
Memory mapped I/O and Isolated I/OBharat Kharbanda
 
Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Urvashi Singh
 
instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modesRamaPrabha24
 
Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Gaditek
 

What's hot (20)

Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086
 
Types of Addressing modes- COA
Types of Addressing modes- COATypes of Addressing modes- COA
Types of Addressing modes- COA
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
 
Microprogram Control
Microprogram Control Microprogram Control
Microprogram Control
 
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
 
8086 modes
8086 modes8086 modes
8086 modes
 
Computer organization memory
Computer organization memoryComputer organization memory
Computer organization memory
 
Memory mapped I/O and Isolated I/O
Memory mapped I/O and Isolated I/OMemory mapped I/O and Isolated I/O
Memory mapped I/O and Isolated I/O
 
Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086
 
instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modes
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)
 
Unit 2 mpmc
Unit 2 mpmcUnit 2 mpmc
Unit 2 mpmc
 
Microoperations
MicrooperationsMicrooperations
Microoperations
 

Viewers also liked

11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes Sher Shah Merkhel
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modessb108ec
 
Addressing mode of 8051
Addressing mode of 8051Addressing mode of 8051
Addressing mode of 8051Nitin Ahire
 
Addressing modes of 8051
Addressing modes  of 8051Addressing modes  of 8051
Addressing modes of 8051Bharath Reddy
 
8086 addressing modes
8086 addressing modes8086 addressing modes
8086 addressing modesj4jiet
 
1327 Addressing Modes Of 8086
1327 Addressing Modes Of 80861327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086techbed
 
Addressing Modes Of 8086
Addressing Modes Of 8086Addressing Modes Of 8086
Addressing Modes Of 8086Ikhlas Rahman
 
8051 addressing modes
 8051 addressing modes 8051 addressing modes
8051 addressing modesghoshshweta
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)Mahesh Kumar Attri
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructionsihsanjamil
 
Addressing modes
Addressing modesAddressing modes
Addressing modesAJAL A J
 
Three complementary approaches to boost enterprise knowledge work development
Three complementary approaches to boost enterprise knowledge work developmentThree complementary approaches to boost enterprise knowledge work development
Three complementary approaches to boost enterprise knowledge work developmentAntti Martikainen
 
Comparative study of 8085,86,286
Comparative study of 8085,86,286Comparative study of 8085,86,286
Comparative study of 8085,86,286Pravin Kulkarni
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085varun sukheja
 

Viewers also liked (20)

ADDRESSING MODE
ADDRESSING MODEADDRESSING MODE
ADDRESSING MODE
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
 
Addressing mode of 8051
Addressing mode of 8051Addressing mode of 8051
Addressing mode of 8051
 
Addressing modes of 8051
Addressing modes  of 8051Addressing modes  of 8051
Addressing modes of 8051
 
8086 addressing modes
8086 addressing modes8086 addressing modes
8086 addressing modes
 
1327 Addressing Modes Of 8086
1327 Addressing Modes Of 80861327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086
 
Addressing Modes Of 8086
Addressing Modes Of 8086Addressing Modes Of 8086
Addressing Modes Of 8086
 
8051 Addressing modes
8051 Addressing modes8051 Addressing modes
8051 Addressing modes
 
8051 addressing modes
 8051 addressing modes 8051 addressing modes
8051 addressing modes
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
8051 addressing
8051 addressing8051 addressing
8051 addressing
 
8051 MICROCONTROLLER
8051 MICROCONTROLLER 8051 MICROCONTROLLER
8051 MICROCONTROLLER
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Three complementary approaches to boost enterprise knowledge work development
Three complementary approaches to boost enterprise knowledge work developmentThree complementary approaches to boost enterprise knowledge work development
Three complementary approaches to boost enterprise knowledge work development
 
Comparative study of 8085,86,286
Comparative study of 8085,86,286Comparative study of 8085,86,286
Comparative study of 8085,86,286
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085
 

Similar to 8051 ADDRESSING MODES (CONT.) explained

8051 instruction set
8051 instruction set8051 instruction set
8051 instruction setStefan Oprea
 
microprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmicroprocessor and microcontroller notes ppt
microprocessor and microcontroller notes pptmananjain543
 
Memory intrface and addrs modes
Memory intrface and addrs modesMemory intrface and addrs modes
Memory intrface and addrs modesbalbirvirdi
 
Bca examination 2016 csa
Bca examination 2016 csaBca examination 2016 csa
Bca examination 2016 csaAnjaan Gajendra
 
Micro controller(pratheesh)
Micro controller(pratheesh)Micro controller(pratheesh)
Micro controller(pratheesh)Pratheesh Pala
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller nitugatkal
 
8051 Programming (1).pptx
8051 Programming (1).pptx8051 Programming (1).pptx
8051 Programming (1).pptxDhyeayaParmar
 
5th unit Microprocessor 8085
5th unit Microprocessor 80855th unit Microprocessor 8085
5th unit Microprocessor 8085Mani Afranzio
 
4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]shibbirtanvin
 
4bit PC report
4bit PC report4bit PC report
4bit PC reporttanvin
 
8051 data type and directives
8051 data type and directives8051 data type and directives
8051 data type and directivesSARITHA REDDY
 

Similar to 8051 ADDRESSING MODES (CONT.) explained (20)

module-3.pptx
module-3.pptxmodule-3.pptx
module-3.pptx
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
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 intrface and addrs modes
Memory intrface and addrs modesMemory intrface and addrs modes
Memory intrface and addrs modes
 
Bca examination 2016 csa
Bca examination 2016 csaBca examination 2016 csa
Bca examination 2016 csa
 
Micro controller(pratheesh)
Micro controller(pratheesh)Micro controller(pratheesh)
Micro controller(pratheesh)
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
8051 Programming (1).pptx
8051 Programming (1).pptx8051 Programming (1).pptx
8051 Programming (1).pptx
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
8051d
8051d8051d
8051d
 
Pdemodule 4
Pdemodule 4Pdemodule 4
Pdemodule 4
 
Microcontroller .pptx
Microcontroller .pptxMicrocontroller .pptx
Microcontroller .pptx
 
viva q&a for mp lab
viva q&a for mp labviva q&a for mp lab
viva q&a for mp lab
 
5th unit Microprocessor 8085
5th unit Microprocessor 80855th unit Microprocessor 8085
5th unit Microprocessor 8085
 
12 mt06ped008
12 mt06ped008 12 mt06ped008
12 mt06ped008
 
MPMC UNIT-2.pdf
MPMC UNIT-2.pdfMPMC UNIT-2.pdf
MPMC UNIT-2.pdf
 
4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]
 
4bit PC report
4bit PC report4bit PC report
4bit PC report
 
8051 data type and directives
8051 data type and directives8051 data type and directives
8051 data type and directives
 

More from Mayank Garg

Real time system in Multicore/Multiprocessor system
Real time system in Multicore/Multiprocessor systemReal time system in Multicore/Multiprocessor system
Real time system in Multicore/Multiprocessor systemMayank Garg
 
Max flow min cut
Max flow min cutMax flow min cut
Max flow min cutMayank Garg
 
Habits for computer
Habits for computerHabits for computer
Habits for computerMayank Garg
 
Wireless charging of mobilephones using microwaves
Wireless charging of mobilephones using microwavesWireless charging of mobilephones using microwaves
Wireless charging of mobilephones using microwavesMayank Garg
 
Presentation on green IT
Presentation on green ITPresentation on green IT
Presentation on green ITMayank Garg
 
Image attendance system
Image attendance systemImage attendance system
Image attendance systemMayank Garg
 
Cell phone operated land rover
Cell phone operated land roverCell phone operated land rover
Cell phone operated land roverMayank Garg
 
Broadband networking through human body
Broadband networking through human bodyBroadband networking through human body
Broadband networking through human bodyMayank Garg
 

More from Mayank Garg (20)

Windows CE
Windows CEWindows CE
Windows CE
 
Real time system in Multicore/Multiprocessor system
Real time system in Multicore/Multiprocessor systemReal time system in Multicore/Multiprocessor system
Real time system in Multicore/Multiprocessor system
 
Max flow min cut
Max flow min cutMax flow min cut
Max flow min cut
 
3 g successor
3 g successor3 g successor
3 g successor
 
Habits for computer
Habits for computerHabits for computer
Habits for computer
 
Wireless charging of mobilephones using microwaves
Wireless charging of mobilephones using microwavesWireless charging of mobilephones using microwaves
Wireless charging of mobilephones using microwaves
 
Radar
RadarRadar
Radar
 
Presentation on green IT
Presentation on green ITPresentation on green IT
Presentation on green IT
 
DTH System
DTH SystemDTH System
DTH System
 
Image attendance system
Image attendance systemImage attendance system
Image attendance system
 
Electronic nose
Electronic noseElectronic nose
Electronic nose
 
Cell phone operated land rover
Cell phone operated land roverCell phone operated land rover
Cell phone operated land rover
 
Oracle Database
Oracle DatabaseOracle Database
Oracle Database
 
Broadband networking through human body
Broadband networking through human bodyBroadband networking through human body
Broadband networking through human body
 
Mems paper
Mems paperMems paper
Mems paper
 
Stegnography
StegnographyStegnography
Stegnography
 
8051 memory
8051 memory8051 memory
8051 memory
 
Cybercrime
CybercrimeCybercrime
Cybercrime
 
Brain gate
Brain gateBrain gate
Brain gate
 
Database
DatabaseDatabase
Database
 

Recently uploaded

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

8051 ADDRESSING MODES (CONT.) explained

  • 1. 8051 ADDRESSING MODES (CONT.) By: Mayank Garg 2013H140040H
  • 2. “What is an addressing mode ?“
  • 3. “What is an addressing mode ?“ Addressing mode is the way of addressing a memory location in instruction. Microcntroller needs data or operands on which the operation is to be performed. The method of specifying source of operand and output of result in an instruction is known as addressing mode.
  • 4. “What is an addressing mode ?“ Addressing mode is the way of addressing a memory location in instruction. Microcntroller needs data or operands on which the operation is to be performed. The method of specifying source of operand and output of result in an instruction is known as addressing mode. Now question arises: How many types of addressing modes?
  • 5. ADDRESSING MODES The 8051 instructions use eight addressing modes. These are: 1. Register 2. Direct 3. Indirect 4. Immediate 5. Relative 6. Absolute 7. Indexed 8. Long
  • 6. ABSOLUTE ADDRESSING MODE  There are only two instructions that use this addressing:  ACALL (absolute call)  AJMP (absolute jump).  These instructions perform branching within the current 2K page of program memory.  The branch address is obtained by successively concatenating the five high-order bits of the program counter, bits 5 – 7 of the op-code,and the second byte of the instruction.
  • 7. CONTD…  The operation of the AJMP instruction is detailed below:  AJMP address (PC) <- (PC) + 2 (PC10-PC0) <- address10 - address0  The eleven least significant bits of the PC are altered. The five most significant bits remain the same. This means the AJMP will only allow you to jump to a location in the same 2K page as the instruction directly after the jump.
  • 8. For example: If the label THERE represents an instruction at address 0F46H and the instruction AJMP THERE is in memory at locations 0900H and 0901H, the assembler will encode the instruction as 11100001 1st byte (A10 - A8 + opcode) 01000110 2nd byte (A7 - A0) The underlined bits are the low-order 11 bits of the destination address, 0F46H = 0000111101000110B. The upper five bits in the program counter will not change when this instruction executes. Note that both the AJMP instruction and the destination are within the 2K page bounded by 0800H and 0FFFH, and therefore have the upper five address bits in common.
  • 10. RELATIVE ADDRESING  Relative addressing is used only with certain jump instructions. The system executes a jump by changing the contents of the PC to the address of the next instruction to be executed.  For example, if we wished to jump to the instruction stored at location 4EH in code memory, the PC would be loaded with 4EH. Then, during the next execution cycle the contents of the PC (4EH) are placed on the address bus and the instruction at 4EH is retrieved.
  • 11. SJUMP is an unconditional jump and is a 2-byte instruction. The number following it is an offset address. If this instruction were stored in code memory at locations 100H and 101H, as shown below: 100H 80H 101H 06H ---The PC contains 100H, therefore the instruction 80H is read into the IR. ---The instruction is decoded as the 2-byte SJMP instruction. ---The PC is incremented so that the operand may be retrieved. ---The operand is read from code memory and the PC is incremented again (because this is a 2-bye instruction). ---The operand (06H) is added to the PC (102H + 06H = 108H).
  • 13. INDEXED ADDRESSING MODE  In this mode the 16-bit address in a base register is added to a positive offset to form an effective address for the jump indirect instruction  JMP @A+DPTR  the two move code byte instructions  MOVC A,@A+DPTR and  MOVC A,@A+PC.  The base register in the jump instruction is the data pointer and the positive offset is held in the accumulator.  For the move instructions the base register can either be the data pointer or the program counter, and again the positive offset is in the accumulator.
  • 14. Example: JMP @A+DPTR (PC)  (A) +(DPTR) MOVC A,@A+DPTR (A)  ((A) + (DPTR)) MOVC A,@A+PC (PC)  (PC) + 1 (A)  ((A) + (PC))
  • 16. LONG ADDRESSING MODE  Only two instructions use this addressing mode.  These instructions are:  LCALL addr16  LJMP addr16.  Both of these are three byte instructions with the op- code being the first byte and the following two bytes are the address high-byte and address low-byte respectively.  These instructions enable the program to branch to anywhere within the full 64 K-bytes of program memory address space
  • 18. INDIRECT ADDRESSING MODE  In this mode of addressing the instruction performs an operation on the data whose address is contained in register R0 or R1. Instructions using indirect addressing are single byte instructions.  In 8051 assembly language the symbol @ before R0 or  SUBB A, @R0 R1 (denotes indirect addressing.)
  • 19. This instruction performs the operation: (A) (A) (C)  ((R0)). For example, ***if you had an array of 8-bit numbers stored in memory, starting at address 30H, you may wish to examine the contents of each number in the array (perhaps to find the smallest number). ***To do so, you would need to read location 30H, then 31H, then 32H and so on.
  • 20. This can be achieved using indirect addressing. R0 and R1 may be used as pointer registers. 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
  • 21. ANY Query regarding this?? So now we know all addressing modes. What is next now??
  • 22. What is the difference between Microprocessor and Microcontroller???
  • 23. Microprocessors generally require external components to implement program memory, ram memory and Input/output. -Here cpu is stand alone,RAM ROM I/O, timer are separate. -It is expensive n versatile. -used for general purpose. -RAM n ROM size is user defined. -bit manipulation is less. -access time is less. -more hardware is used.
  • 24. MICROCONTROLLER  Microcontrollers incorporate program memory, ram memory and input/output resources internal to the chip. -Here cpu RAM ROM I/O, timer are on a single chip. -It is cheaper as compared to microprocessor. -used for single purpose. -fixed amount of on chip RAM,ROM and I/O ports. -bit manipulation is more. -access time is more. -less hardware is used.
  • 25. WHAT IS DIFFERENCE BETWEEN:  8085  8086  8051 ???
  • 26. 8051  16 bit Microcontroller  On chip ROM( 8KB) and On chip RAM (128 bytes)  Two 16 bit timer/counter.  Four 8-bit ports for input/output  Fully duplex serial receiver/transmitter.  No pre-fetching of instruction.  16 address pins
  • 27. 8086  16 bit Microprocessor  No on chip memory.  Memory is divided into two banks to increase the processing speed.  Pre-fetching of 6 bytes of instruction in a queue.  20 address pins
  • 28. 8085  8 bit microprocessor  16-bit address bus  8-bit registers  16-bit register pairs, BC, DE, and HL  256 input/output (I/O) ports  External Memory
  • 29. REFERENCES  https://www.silabs.com/Support%20Documents/Softw are/8051_Instruction_Set.pdf  http://coitweb.uncc.edu/~abw/ITCS3182F09/slides3.p df  http://www.cs.iit.edu/~virgil/cs470/Book/chapter4.pd  http://www.slideshare.net/chappidi_saritha/addressin g-modes-of-8051  http://www.edsim51.com/8051Notes/8051/instruction SetSummary.html  http://www.nptel.iitm.ac.in/courses/Webcourse- contents/IITKANPUR/microcontrollers/micro/ui/Cours e_home2_6.htm
  • 30.
  • 31. So now move to what is instruction? Types of instructions???