SlideShare a Scribd company logo
1 of 27
 In order to facilitate efficient programming, 8085
offers 72 different instructions.
 These instructions may be grouped as below
 Data Transfer Group – These instructions transfer (i.e.
copy) the data item from one place (between memory and
registers) to another place.
 Arithmetic Group – This group of instructions are used to
perform a variety of addition or subtraction operation
using ALU.
8085 INSTRUCTIONS
 Logical Group – These instructions perform variety of
logical operations such as AND, OR, NOT etc. using ALU.
 Branch and Machine Control Group – This group includes
the instructions that are used for decision making,
changing the execution sequence etc.
 Stack, I/O and Interrupt Control Group – These instruction
are used to manage stack, subroutines, Input-Output
operations, manipulation of various interrupts etc.
8085 INSTRUCTIONS (CONTD.)
 An instruction is usually organized as below
 Instruction = Opcode + Operand
 Opcode is binary code that is used by the processor to
understand the instruction.
 Operand is the data item upon which processor has to
perform operation, as dictated by the Opcode.
 The Operand can be specified in a number of ways.
 Data Addressing Mode is actually the method by which an
Operand is specified in the instruction.
 There are 246 Opcodes in 8085 due to addressing modes.
8085 INSTRUCTIONS (CONTD.)
An instruction may access data in variety of methods,
called Data Addressing Modes. Following are the
supported addressing modes in 8085.
 Register Addressing.
 Immediate Addressing.
 Direct Addressing.
 Indirect Addressing.
 Implicit Addressing.
DATA ADDRESSING MODES
The designated data item is present in one of the
general purpose register of 8085. This mode is
primarily used to specify variables.
 e.g. MOV C, H
 Copy the content of register H into register C.
 The data item to be copied is present in a CPU
register H.
 Hence, it is Register Addressing Mode.
 Execution of MOV C, H is explained next.
REGISTER ADDRESSING
MOV RD, RS – Copy the content of Source Register
(RS) into Destination Register (RD).
 RS and RD can be any of the general purpose registers
(A, B, C, D, E, H, L).
 Examples MOV A, D; MOV H, C; MOV A, A etc.
 49 such Opcodes are there for MOV RD, RS.
 This is a 1-byte instruction.
 Takes 1-Machine Cycle (Opcode Fetch) to execute.
 None of the Flags are affected.
MOV RD, RS
The designated data item immediately follows the
Opcode and hence the name Immediate Addressing.
This mode is used to specify the constant data.
 e.g. MVI E, 50H
 Copy the 8-bit data 50H into register E.
 The data item (50H) to be copied is present
immediately after the Opcode MVI E.
 Hence, it is Immediate Addressing Mode.
 Execution of MVI E is explained next.
IMMEDIATE ADDRESSING
MVI R, DATA8 – Move (i.e. Copy) the 8-bit data
(DATA8) Immediately in to the specified register R.
 R can be any of the 8-bit general purpose registers
(A, B, C, D, E, H, L).
 Examples MVI A, 40; MVI D, 10 etc.
 7 such Opcodes are there for MVI R, DATA8.
 This is a 2-byte instruction.
 Takes 2-Machine Cycles (Opcode Fetch and Memory
Read) to execute.
 None of the Flags are affected.
MVI R, DATA8
MVI R, DATA8 – Move (i.e. Copy) the 8-bit data
(DATA8) Immediately in to the memory, specified
by the HL Pair.
 ((HL)) ← DATA8 .
 This is a 2-byte instruction.
 Takes 3-Machine Cycles (Opcode Fetch, Memory
Read, Memory Write) to execute.
 None of the Flags are affected.
 Execution of MVI M is explained next.
MVI M, DATA8
LXI RP, DATA16 – Load the 16-bit data (DATA16)
Immediately in to the specified register pair RP.
 RP can be one of the register pair (HL, BC, DE, SP).
 RP should be H for HL pair, B for BC Pair, D for DE Pair
 This is a 3-byte instruction.
 Takes 3-Machine Cycles (Opcode Fetch, Memory
Read, Memory Read) to execute.
 None of the Flags are affected.
 Execution of LXI D is explained next.
LXI RP, DATA16
The designated data item is stored in memory and
the memory address is specified directly in the
instruction.
 e.g. LDA, 5000H, Load accumulator directly from
memory address 5000H.
 A ← (5000H).
 e.g. STA, 5000H, Store accumulator directly at
memory address 5000H.
 A → (5000H).
 Execution of LDA and STA is explained next.
DIRECT ADDRESSING
 LHLD, 5000H, Load HL Pair directly from memory
address 5000H.
 L ← (5000H).
 H ← (5001H).
 SHLD, 5000H, Store HL Pair directly at memory
address 5000H.
 L → (5000H).
 H → (5001H).
 Execution of LHLD and SHLD is explained next.
LHLD & SHLD
Write an 8085 ALP (Assembly Language Program) to
copy the data 25H at memory location 2100H and
data 30H at memory location 2101H.
MVI A, 25H ; Get 25H in A i.e. A=25H
STA 2100H ; Store A (i.e. 25H) at 2100.
MVI A, 30H ; Get 30H in A i.e. A=30H
STA 2101H ; Store A (i.e. 30H) at 2101.
HLT ; Stop
A Simple Program (P1)
MVI L, 25H ; Get 25H in L i.e. L=25H
MVI H, 30H ; Get 30H in H i.e. H=30H
SHLD 2100H ; Store L at 2100 and H at 2101.
HLT
LXI H, 3025H ; Get 25H in L and 30H in H
SHLD 2100H ; Store L at 2100 and H at 2101.
HLT
Alternate Programs (P1)
Two data items are stored at locations 2050H and
2051H. Write an 8085 ALP (Assembly Language
Program) to copy these data at memory locations
2100H and 2101H.
LDA 2050H ; Get data from 2050H in A.
STA 2100H ; Store A at 2100.
LDA 2051H ; Get data from 2051H in A.
STA 2101H ; Store A at 2101.
HLT
A Simple Program (P2)
LDA SOURCE1 ; Get data from address SOURCE1 in A.
STA TARGET1 ; Store A at address TARGET1.
LDA SOURCE2 ; Get data from address SOURCE2 in A.
STA TARGET2 ; Store A at TARGET2.
HLT ; Stop
 Use of Symbolic address is much preferred in assembly
language.
 At the time of execution any memory address can be
specified as SOURCE and TARGET address.
Alternate Program (P2)
Two data items are stored at locations 2050H and
2051H. Write an 8085 ALP (Assembly Language
Program) to exchange data items at these memory
locations.
LDA 2050H ; Get DATA1 from 2050H in A.
MOV B, A ; Copy DATA1 in B.
LDA 2051H ; Get DATA2 from 2051H in A.
STA 2050H ; Store DATA2 at 2050H.
MOV A, B ; Get DATA1 in A.
STA 2051H ; Store DATA1 at 2051H.
HLT
A Simple Program (P3)
LDA ADDR1
MOV B, A ; Get DATA1 into B.
LDA ADDR2 ; Get DATA2 in A.
STA ADDR1 ; Store DATA2 at ADDR1.
MOV A, B ; Get DATA1 in A.
STA ADDR2 ; Store DATA1 at ADDR2.
HLT
 Use of symbolic addresses make the program more
readable and easy to understand.
Alternate Program (P3)
The designated data item is stored in memory and the
memory address is specified through a register pair (i.e.
indirectly) in the instruction. This addressing mode is
most suitable for tabular processing.
 e.g. MOV B, M
 Copy an 8-bit memory data indirectly into register B,
where memory address is specified by HL Pair.
 B ← ((HL)).
 Since memory address is not the part of instruction it is
indirect addressing.
 Execution of MOV B, M is explained next.
INDIRECT ADDRESSING
 MOV R, M
 Copy an 8-bit memory data indirectly into register R.
 R ← ((HL)).
 MOV M, R
 Copy an 8-bit data indirectly into memory from register R.
 R  ((HL)).
 R can be any of the 8-bit general purpose registers (A, B, C, D,
E, H, L).
 14 Opcodes are there for both the MOVes.
 They are 1-byte instructions but take 2-Machine Cycles to
execute.
 Execution of MOV M, B is explained next.
MEMORY MOVES
 LDAX RP – Load the accumulator Indirectly through
specified register pair RP.
 A ← ((RP)).
 BC and DE are the only register pairs valid for RP.
 This is a 1-byte instruction but takes 2-Machine
Cycles (Opcode Fetch, Memory Read) to execute.
 STAX RP – Store the accumulator Indirectly through
specified register pair RP.
 Execution of LDAX and STAX is explained next.
LDAX & STAX
Write an 8085 ALP (Assembly Language Program) to
copy the data 25H at memory location 2100H and data
30H at memory location 2101H using indirect
addressing.
LXI D, 2100H ; Load memory addresses in reg pairs
LXI H, 2101H
MVI A, 25H ; Get 25H in A i.e. A=25H
MVI B, 30H ; Get 30H in B i.e. B=30H
STAX D ; Store A (i.e. 25H) at 2100H indirectly.
MOV M, B ; Store B (i.e. 30H) at 2101H indirectly.
HLT ; Stop
A Simple Program (P4)
LXI D, ADDR1 ; Load memory addresses in reg pairs
LXI H, ADDR2
MVI A, DATA1 ; Get DATA1 in A (i.e. A=25H)
MVI B, DATA2 ; Get DATA2 in B (i.e. B=30H)
STAX D ; Store A at ADDR1 (2100H) indirectly.
MOV M, B ; Store B at ADDR2 (2101H) indirectly.
HLT ; Stop
Alternate Program (P4)
LXI D, ADDR1 ; Load memory addresses in reg pairs
LXI B, ADDR2
MVI A, DATA1 ; Get DATA1 in A (i.e. A=25H)
STAX D ; Store A at ADDR1 (2100H) indirectly.
MVI A, DATA2 ; Get DATA2 in A (i.e. A=30H)
STAX B ; Store A at ADDR2 (2101H) indirectly.
HLT ; Stop
Alternate Program (P4)
Two data items are stored at locations 2050H and 2051H.
Write an 8085 ALP (Assembly Language Program) to
exchange data items indirectly at these memory locations.
LXI D ADDR1
LXI H ADDR2 ; Load Memory addresses of DATA1 & DATA2.
LDAX D ; Get DATA1 in A.
MOV B, M ; Get DATA2 in B.
MOV M, A ; Store DATA2 at ADDR1.
MOV A, B ; Get DATA1 in A.
STAX D ; Store DATA1 at ADDR2.
HLT
A Simple Program (P5)
The designated data item is stored in CPU registers
or machine component but the name of operand is
not defined in the instruction.
 e.g. XCHG, Exchange the content of HL Pair with
DE Pair.
 HL  DE.
 Since operand names HL or DE is not specified in
instruction it is Implicit Addressing.
 Execution of XCHG is explained next.
IMPLICIT ADDRESSING
Two data items are stored at locations ADDR1 and ADDR2.
Write an 8085 ALP (Assembly Language Program) to
exchange data items indirectly at these memory locations.
LXI D ADDR1
LXI H ADDR2 ; Load Memory addresses of DATA1 & DATA2.
LDAX D ; Get DATA1 in A.
MOV B, M ; Get DATA2 in B.
XCHG ; Exchange the addresses in HL & DE Pair.
HL = ADDR1 and DE = ADDR2.
STAX D ; Store DATA1 at ADDR2.
MOV M, B ; Store DATA2 at ADDR1.
HLT
Program (P5) Revisited

More Related Content

What's hot

Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
saleForce
 
Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)
Safin Biswas
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
jemimajerome
 
Microprocessor lab
Microprocessor labMicroprocessor lab
Microprocessor lab
kpaulraj
 
Programming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingProgramming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacing
Amitabh Shukla
 
Genius it ians™ 8085 programming (part 2)
Genius it ians™  8085 programming (part 2)Genius it ians™  8085 programming (part 2)
Genius it ians™ 8085 programming (part 2)
Manoj Shahu
 

What's hot (19)

Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
 
Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)
 
4. Instruction Set Of MP 8085.pptx
4. Instruction Set Of MP 8085.pptx4. Instruction Set Of MP 8085.pptx
4. Instruction Set Of MP 8085.pptx
 
8085 instruction set (detailed)
8085 instruction set (detailed)8085 instruction set (detailed)
8085 instruction set (detailed)
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
 
8085 alp programs
8085 alp programs8085 alp programs
8085 alp programs
 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085
 
8085 micro processor
8085 micro processor8085 micro processor
8085 micro processor
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
Microcontroller instruction set
Microcontroller instruction setMicrocontroller instruction set
Microcontroller instruction set
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
Programming with 8085
Programming with 8085Programming with 8085
Programming with 8085
 
Microprocessor lab
Microprocessor labMicroprocessor lab
Microprocessor lab
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
 
Intel 8085 mp
Intel 8085 mpIntel 8085 mp
Intel 8085 mp
 
Programming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingProgramming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacing
 
Genius it ians™ 8085 programming (part 2)
Genius it ians™  8085 programming (part 2)Genius it ians™  8085 programming (part 2)
Genius it ians™ 8085 programming (part 2)
 
Instruction set 8085
Instruction set 8085Instruction set 8085
Instruction set 8085
 
Chapter 6 - Introduction to 8085 Instructions
Chapter 6 - Introduction to 8085 InstructionsChapter 6 - Introduction to 8085 Instructions
Chapter 6 - Introduction to 8085 Instructions
 

Similar to 03 addr mode & instructions

Basic programming of 8085
Basic programming of 8085 Basic programming of 8085
Basic programming of 8085
vijaydeepakg
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Swati Watve-Phadke
 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).ppt
ssuserb448e2
 

Similar to 03 addr mode & instructions (20)

MPMC UNIT-2.pdf
MPMC UNIT-2.pdfMPMC UNIT-2.pdf
MPMC UNIT-2.pdf
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdf
 
Basic programming of 8085
Basic programming of 8085 Basic programming of 8085
Basic programming of 8085
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :P
 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
12 mt06ped008
12 mt06ped008 12 mt06ped008
12 mt06ped008
 
8085 Architecture
8085 Architecture8085 Architecture
8085 Architecture
 
8085 alp programs
8085 alp programs8085 alp programs
8085 alp programs
 
Assembly language i
Assembly language iAssembly language i
Assembly language i
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
 
MicroProcessors
MicroProcessors MicroProcessors
MicroProcessors
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02
 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).ppt
 
T imingdiagram
T imingdiagramT imingdiagram
T imingdiagram
 
Introduction to 8085 by adi ppt
Introduction to 8085 by adi pptIntroduction to 8085 by adi ppt
Introduction to 8085 by adi ppt
 
Microprocessor Basics CH-3
Microprocessor Basics CH-3Microprocessor Basics CH-3
Microprocessor Basics CH-3
 

Recently uploaded

VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 

Recently uploaded (20)

The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 

03 addr mode & instructions

  • 1.  In order to facilitate efficient programming, 8085 offers 72 different instructions.  These instructions may be grouped as below  Data Transfer Group – These instructions transfer (i.e. copy) the data item from one place (between memory and registers) to another place.  Arithmetic Group – This group of instructions are used to perform a variety of addition or subtraction operation using ALU. 8085 INSTRUCTIONS
  • 2.  Logical Group – These instructions perform variety of logical operations such as AND, OR, NOT etc. using ALU.  Branch and Machine Control Group – This group includes the instructions that are used for decision making, changing the execution sequence etc.  Stack, I/O and Interrupt Control Group – These instruction are used to manage stack, subroutines, Input-Output operations, manipulation of various interrupts etc. 8085 INSTRUCTIONS (CONTD.)
  • 3.  An instruction is usually organized as below  Instruction = Opcode + Operand  Opcode is binary code that is used by the processor to understand the instruction.  Operand is the data item upon which processor has to perform operation, as dictated by the Opcode.  The Operand can be specified in a number of ways.  Data Addressing Mode is actually the method by which an Operand is specified in the instruction.  There are 246 Opcodes in 8085 due to addressing modes. 8085 INSTRUCTIONS (CONTD.)
  • 4. An instruction may access data in variety of methods, called Data Addressing Modes. Following are the supported addressing modes in 8085.  Register Addressing.  Immediate Addressing.  Direct Addressing.  Indirect Addressing.  Implicit Addressing. DATA ADDRESSING MODES
  • 5. The designated data item is present in one of the general purpose register of 8085. This mode is primarily used to specify variables.  e.g. MOV C, H  Copy the content of register H into register C.  The data item to be copied is present in a CPU register H.  Hence, it is Register Addressing Mode.  Execution of MOV C, H is explained next. REGISTER ADDRESSING
  • 6. MOV RD, RS – Copy the content of Source Register (RS) into Destination Register (RD).  RS and RD can be any of the general purpose registers (A, B, C, D, E, H, L).  Examples MOV A, D; MOV H, C; MOV A, A etc.  49 such Opcodes are there for MOV RD, RS.  This is a 1-byte instruction.  Takes 1-Machine Cycle (Opcode Fetch) to execute.  None of the Flags are affected. MOV RD, RS
  • 7. The designated data item immediately follows the Opcode and hence the name Immediate Addressing. This mode is used to specify the constant data.  e.g. MVI E, 50H  Copy the 8-bit data 50H into register E.  The data item (50H) to be copied is present immediately after the Opcode MVI E.  Hence, it is Immediate Addressing Mode.  Execution of MVI E is explained next. IMMEDIATE ADDRESSING
  • 8. MVI R, DATA8 – Move (i.e. Copy) the 8-bit data (DATA8) Immediately in to the specified register R.  R can be any of the 8-bit general purpose registers (A, B, C, D, E, H, L).  Examples MVI A, 40; MVI D, 10 etc.  7 such Opcodes are there for MVI R, DATA8.  This is a 2-byte instruction.  Takes 2-Machine Cycles (Opcode Fetch and Memory Read) to execute.  None of the Flags are affected. MVI R, DATA8
  • 9. MVI R, DATA8 – Move (i.e. Copy) the 8-bit data (DATA8) Immediately in to the memory, specified by the HL Pair.  ((HL)) ← DATA8 .  This is a 2-byte instruction.  Takes 3-Machine Cycles (Opcode Fetch, Memory Read, Memory Write) to execute.  None of the Flags are affected.  Execution of MVI M is explained next. MVI M, DATA8
  • 10. LXI RP, DATA16 – Load the 16-bit data (DATA16) Immediately in to the specified register pair RP.  RP can be one of the register pair (HL, BC, DE, SP).  RP should be H for HL pair, B for BC Pair, D for DE Pair  This is a 3-byte instruction.  Takes 3-Machine Cycles (Opcode Fetch, Memory Read, Memory Read) to execute.  None of the Flags are affected.  Execution of LXI D is explained next. LXI RP, DATA16
  • 11. The designated data item is stored in memory and the memory address is specified directly in the instruction.  e.g. LDA, 5000H, Load accumulator directly from memory address 5000H.  A ← (5000H).  e.g. STA, 5000H, Store accumulator directly at memory address 5000H.  A → (5000H).  Execution of LDA and STA is explained next. DIRECT ADDRESSING
  • 12.  LHLD, 5000H, Load HL Pair directly from memory address 5000H.  L ← (5000H).  H ← (5001H).  SHLD, 5000H, Store HL Pair directly at memory address 5000H.  L → (5000H).  H → (5001H).  Execution of LHLD and SHLD is explained next. LHLD & SHLD
  • 13. Write an 8085 ALP (Assembly Language Program) to copy the data 25H at memory location 2100H and data 30H at memory location 2101H. MVI A, 25H ; Get 25H in A i.e. A=25H STA 2100H ; Store A (i.e. 25H) at 2100. MVI A, 30H ; Get 30H in A i.e. A=30H STA 2101H ; Store A (i.e. 30H) at 2101. HLT ; Stop A Simple Program (P1)
  • 14. MVI L, 25H ; Get 25H in L i.e. L=25H MVI H, 30H ; Get 30H in H i.e. H=30H SHLD 2100H ; Store L at 2100 and H at 2101. HLT LXI H, 3025H ; Get 25H in L and 30H in H SHLD 2100H ; Store L at 2100 and H at 2101. HLT Alternate Programs (P1)
  • 15. Two data items are stored at locations 2050H and 2051H. Write an 8085 ALP (Assembly Language Program) to copy these data at memory locations 2100H and 2101H. LDA 2050H ; Get data from 2050H in A. STA 2100H ; Store A at 2100. LDA 2051H ; Get data from 2051H in A. STA 2101H ; Store A at 2101. HLT A Simple Program (P2)
  • 16. LDA SOURCE1 ; Get data from address SOURCE1 in A. STA TARGET1 ; Store A at address TARGET1. LDA SOURCE2 ; Get data from address SOURCE2 in A. STA TARGET2 ; Store A at TARGET2. HLT ; Stop  Use of Symbolic address is much preferred in assembly language.  At the time of execution any memory address can be specified as SOURCE and TARGET address. Alternate Program (P2)
  • 17. Two data items are stored at locations 2050H and 2051H. Write an 8085 ALP (Assembly Language Program) to exchange data items at these memory locations. LDA 2050H ; Get DATA1 from 2050H in A. MOV B, A ; Copy DATA1 in B. LDA 2051H ; Get DATA2 from 2051H in A. STA 2050H ; Store DATA2 at 2050H. MOV A, B ; Get DATA1 in A. STA 2051H ; Store DATA1 at 2051H. HLT A Simple Program (P3)
  • 18. LDA ADDR1 MOV B, A ; Get DATA1 into B. LDA ADDR2 ; Get DATA2 in A. STA ADDR1 ; Store DATA2 at ADDR1. MOV A, B ; Get DATA1 in A. STA ADDR2 ; Store DATA1 at ADDR2. HLT  Use of symbolic addresses make the program more readable and easy to understand. Alternate Program (P3)
  • 19. The designated data item is stored in memory and the memory address is specified through a register pair (i.e. indirectly) in the instruction. This addressing mode is most suitable for tabular processing.  e.g. MOV B, M  Copy an 8-bit memory data indirectly into register B, where memory address is specified by HL Pair.  B ← ((HL)).  Since memory address is not the part of instruction it is indirect addressing.  Execution of MOV B, M is explained next. INDIRECT ADDRESSING
  • 20.  MOV R, M  Copy an 8-bit memory data indirectly into register R.  R ← ((HL)).  MOV M, R  Copy an 8-bit data indirectly into memory from register R.  R  ((HL)).  R can be any of the 8-bit general purpose registers (A, B, C, D, E, H, L).  14 Opcodes are there for both the MOVes.  They are 1-byte instructions but take 2-Machine Cycles to execute.  Execution of MOV M, B is explained next. MEMORY MOVES
  • 21.  LDAX RP – Load the accumulator Indirectly through specified register pair RP.  A ← ((RP)).  BC and DE are the only register pairs valid for RP.  This is a 1-byte instruction but takes 2-Machine Cycles (Opcode Fetch, Memory Read) to execute.  STAX RP – Store the accumulator Indirectly through specified register pair RP.  Execution of LDAX and STAX is explained next. LDAX & STAX
  • 22. Write an 8085 ALP (Assembly Language Program) to copy the data 25H at memory location 2100H and data 30H at memory location 2101H using indirect addressing. LXI D, 2100H ; Load memory addresses in reg pairs LXI H, 2101H MVI A, 25H ; Get 25H in A i.e. A=25H MVI B, 30H ; Get 30H in B i.e. B=30H STAX D ; Store A (i.e. 25H) at 2100H indirectly. MOV M, B ; Store B (i.e. 30H) at 2101H indirectly. HLT ; Stop A Simple Program (P4)
  • 23. LXI D, ADDR1 ; Load memory addresses in reg pairs LXI H, ADDR2 MVI A, DATA1 ; Get DATA1 in A (i.e. A=25H) MVI B, DATA2 ; Get DATA2 in B (i.e. B=30H) STAX D ; Store A at ADDR1 (2100H) indirectly. MOV M, B ; Store B at ADDR2 (2101H) indirectly. HLT ; Stop Alternate Program (P4)
  • 24. LXI D, ADDR1 ; Load memory addresses in reg pairs LXI B, ADDR2 MVI A, DATA1 ; Get DATA1 in A (i.e. A=25H) STAX D ; Store A at ADDR1 (2100H) indirectly. MVI A, DATA2 ; Get DATA2 in A (i.e. A=30H) STAX B ; Store A at ADDR2 (2101H) indirectly. HLT ; Stop Alternate Program (P4)
  • 25. Two data items are stored at locations 2050H and 2051H. Write an 8085 ALP (Assembly Language Program) to exchange data items indirectly at these memory locations. LXI D ADDR1 LXI H ADDR2 ; Load Memory addresses of DATA1 & DATA2. LDAX D ; Get DATA1 in A. MOV B, M ; Get DATA2 in B. MOV M, A ; Store DATA2 at ADDR1. MOV A, B ; Get DATA1 in A. STAX D ; Store DATA1 at ADDR2. HLT A Simple Program (P5)
  • 26. The designated data item is stored in CPU registers or machine component but the name of operand is not defined in the instruction.  e.g. XCHG, Exchange the content of HL Pair with DE Pair.  HL  DE.  Since operand names HL or DE is not specified in instruction it is Implicit Addressing.  Execution of XCHG is explained next. IMPLICIT ADDRESSING
  • 27. Two data items are stored at locations ADDR1 and ADDR2. Write an 8085 ALP (Assembly Language Program) to exchange data items indirectly at these memory locations. LXI D ADDR1 LXI H ADDR2 ; Load Memory addresses of DATA1 & DATA2. LDAX D ; Get DATA1 in A. MOV B, M ; Get DATA2 in B. XCHG ; Exchange the addresses in HL & DE Pair. HL = ADDR1 and DE = ADDR2. STAX D ; Store DATA1 at ADDR2. MOV M, B ; Store DATA2 at ADDR1. HLT Program (P5) Revisited