SlideShare uma empresa Scribd logo
1 de 4
Baixar para ler offline
FOR B.TECH (ECE) 3RD YEAR STUDENTS (HELPFUL IN UPTU/GBTU EXAM)
(MICROPROCESSOR)
BY
ER. ANUPAM KUMAR (anupamkumarmtec@gmail.com)
ELECTRONICS & COMMUNICATION ENGINEERING
ASHOKA INSTITUTE OF TECHNOLOGY & MANAGEMENT, VARANASI, UTTAR
PRADESH, INDIA

SOME ADVANCED INSTRUCTIONS OF THE 8085
MICROPROCESSORS

ADVANCE INSTRUCTIONS FOR 16-BIT DATA/ADDRESS
TRANSFER
1.1 LHLD16-bit address
; load HL register pair
 For example- Assume HL contains 3F90H i.e. H=3FH and L=90H. 2030H and
2031H memory locations contain are AFH & 24H respectively.
 No flags are modified.
1.2 SHLD16-bit address
; Store HL register pair
 This instructions works just reverse to the LHLD.
 For example- Assume HL contains 3F90H i.e. H=3FH & L=90H.The memory
location 2030H contains AFH & 24His contains of 2031H.
 No flags are modified.
1.3 XCHG- Exchange the contents of HL register pair is 3F90H and contains of DE is
929FH.
 Instruction Cycle-Op-code fetch machine cycle only.
 No flags are modified.
2.2 ADVANCED INSTRUCTIONS RELATED TO THE 8085 16BIT REGISTERS

2.1 SPHL none ;the contents of HL register pair copies into stack pointer(SP):SP HL
 The contents is copied in same manner into stack pointer(sp) as in HL register
pair i.e. the contents of H AND L registers copied into higher byte & lower byte
of stack pointer(SP) respectively.
 No flags are modified.
2.2 XTHL none; this instructions exchange the top (pointed by SP) contents of stack
memory with the contents of HL register pair.
 The contents of stack memory location pointed by stack pointer, exchange with
the contents of L register & the contents of next memory location with the
contents of H register.
 However, after execution of this instruction the contents or position of Stack
Pointer (SP) remain same as before.
For example-Assume the contents of SP is 2FFEH, HL=203FH i.e. H=20H & L=3FH
and the contents of memory locations 2FFEH hold 72H and 2FFFH contains AFH.
SP

2FFE
2FFF
3000

72
AF

XTHL; after execution of this instruction the contents of HL is AF72H (H=AFH and
L=72H), the contents of stack pointer SP is remains as before i.e. SP=2FFEH and the
contents of memory location 2FFEH is 3FH and 2FFFH contains 20H.
 Instruction cycle: Op-code fetch, two consecutive memory read, and two
consecutive memory write machine cycles.
 No flags are modified.
2.3 PCHL none; data of HL register pair transfer to the Program Counter (PC):
PC HL
 The contents is copied in same manner into Program Counter (PC) as in HL
register pair i.e. H into higher-order byte and L into low-order byte of Program
Counter (PC).
 Instruction Cycle: Op-code fetch (takes 6-T States) machine cycle only.
 No flags are modified.
For Example: W.A.A.P. to transfer program control/execution without using
JMP or CALL instructions.
Assume program execution starts from 2000H program memory location and we
want to execute program/instructions from 3000H.
ORG 2000H
2000H

LXI H, 3000H

; HL=3000H

2003
PCHL
; after execution of this one-byte instruction PC hold
3000H and execution transfer to location 3000H
2004H

MVI A, 1FH

; not executed

…….
3000H

MVI A, 1FH

; Program execution starts from here i.e. A=1FH

3002H HLT

10.3 ADVANCE INSTRUCTION FOR ARITHMETIC
OPERATIONS





ACI- ADD IMMEDIATE TO A WITH CARRY
ADC- ADD REGISTER/MEMORY TO A WITH CARRY
SBB- SUBTRACT REGISTER/MEMORY WITH BORROW FROM A
SBI- SUBTRACT IMMEDIATE WITH BORROW FROM A
 Another advanced instructions in this group DAD (add register pair to HL
register pair) which is related to 16-bit register pair.

DAD Reg. pair/SP
Pointer.

; Double Addition (in sense of 16-bit) of HL register pair or Stack

 The default operand of this instruction is HL register pair i.e. to the register pair (BC, DE,
HL or SP) is added to the contents of the HL register pair and the result/sum is saved in
the HL register pair.
 Only carry flag is affected by this instruction i.e. if the sum is larger than 16-bits the carry
flag is set. The contents of the source register pair are not altered.
Example:
DAD H

; add the contents of reg. pair itself or multiply by 2.

 Instruction cycle: Op-code fetches Bus Idle and Bus Idle machine cycles.
 Flags: no flags are modified except Carry.

PROGRAM: Add two 16-bit numbers.
LHLD 4000H

; Get first 16-bit number

XCHG

; Save first 16-bit number in DE

LHLD 4002H

; Get second 16-bit number in HL

DAD D

; Add DE and HL

SHLD 4004H
locations 4004H and 4005H
HLT

; Store 16-bit result in memory

; Terminate program execution

Mais conteúdo relacionado

Mais procurados

Decoders
DecodersDecoders
Decoders
Re Man
 

Mais procurados (20)

Arithmetic and logical instructions
Arithmetic and logical instructionsArithmetic and logical instructions
Arithmetic and logical instructions
 
BCD arithmetic and 16-bit data operations
BCD arithmetic and 16-bit data operationsBCD arithmetic and 16-bit data operations
BCD arithmetic and 16-bit data operations
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
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
 
8085-microprocessor
8085-microprocessor8085-microprocessor
8085-microprocessor
 
8051 Architecture
8051 Architecture8051 Architecture
8051 Architecture
 
8086 class notes-Y.N.M
8086 class notes-Y.N.M8086 class notes-Y.N.M
8086 class notes-Y.N.M
 
Decoders
DecodersDecoders
Decoders
 
Stack in 8085 microprocessor
Stack in 8085 microprocessorStack in 8085 microprocessor
Stack in 8085 microprocessor
 
8085 architecture
8085 architecture8085 architecture
8085 architecture
 
MIPS Architecture
MIPS ArchitectureMIPS Architecture
MIPS Architecture
 
Addressing modes of 8085
Addressing modes of 8085Addressing modes of 8085
Addressing modes of 8085
 
Digital logic
Digital logicDigital logic
Digital logic
 
Assembly level language
Assembly level languageAssembly level language
Assembly level language
 
Advanced micro -processor
Advanced micro -processorAdvanced micro -processor
Advanced micro -processor
 
Arithmetic and logical instructions 8051 microcontroller
Arithmetic and logical instructions 8051 microcontrollerArithmetic and logical instructions 8051 microcontroller
Arithmetic and logical instructions 8051 microcontroller
 
Flip flops and registers
Flip flops and registersFlip flops and registers
Flip flops and registers
 
Mips
MipsMips
Mips
 

Destaque (6)

8085 microprocessor architecture ppt
8085 microprocessor architecture ppt8085 microprocessor architecture ppt
8085 microprocessor architecture ppt
 
8085 microprocessor notes
8085 microprocessor notes8085 microprocessor notes
8085 microprocessor notes
 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
 
MICROPROCESSOR 8085 WITH PROGRAMS
MICROPROCESSOR 8085 WITH PROGRAMSMICROPROCESSOR 8085 WITH PROGRAMS
MICROPROCESSOR 8085 WITH PROGRAMS
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkar
 
List of 8085 programs
List of 8085 programsList of 8085 programs
List of 8085 programs
 

Semelhante a Some advanced instructions of the 8085 microprocessors

instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).ppt
ssuserb448e2
 

Semelhante a Some advanced instructions of the 8085 microprocessors (20)

UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
 
Microprocessor Basics CH-3
Microprocessor Basics CH-3Microprocessor Basics CH-3
Microprocessor Basics CH-3
 
T imingdiagram
T imingdiagramT imingdiagram
T imingdiagram
 
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
 
Lecture 05 NOP and Stack Group of Instructions
Lecture 05 NOP and Stack Group of InstructionsLecture 05 NOP and Stack Group of Instructions
Lecture 05 NOP and Stack Group of Instructions
 
Instructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIRInstructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIR
 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).ppt
 
instruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptinstruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.ppt
 
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
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
03 addr mode & instructions
03 addr mode & instructions03 addr mode & instructions
03 addr mode & instructions
 
8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS
 
8085 instructions details
8085 instructions details8085 instructions details
8085 instructions details
 
B sc e 5.2 mp unit 2 soft ware(alp)
B sc e 5.2 mp unit 2 soft ware(alp)B sc e 5.2 mp unit 2 soft ware(alp)
B sc e 5.2 mp unit 2 soft ware(alp)
 

Mais de ASHOKA INSTITUTE OF TECHNOLOGY & MANAGEMENT,VARANASI,U.P.

Mais de ASHOKA INSTITUTE OF TECHNOLOGY & MANAGEMENT,VARANASI,U.P. (20)

Microprocessor lab manual
Microprocessor lab manualMicroprocessor lab manual
Microprocessor lab manual
 
Anupam kumar re2106 a55
Anupam kumar re2106 a55Anupam kumar re2106 a55
Anupam kumar re2106 a55
 
Electronika de fiesta 2014
Electronika de fiesta 2014Electronika de fiesta 2014
Electronika de fiesta 2014
 
Departmental notice,ece
Departmental notice,eceDepartmental notice,ece
Departmental notice,ece
 
Departmental notice,ece
Departmental notice,eceDepartmental notice,ece
Departmental notice,ece
 
Electronics switching-eec-802
Electronics switching-eec-802Electronics switching-eec-802
Electronics switching-eec-802
 
8254 presentation
8254 presentation8254 presentation
8254 presentation
 
8254 presentation
8254 presentation8254 presentation
8254 presentation
 
4 5 marks importnt question dcn
4 5 marks importnt question dcn4 5 marks importnt question dcn
4 5 marks importnt question dcn
 
8254 presentation
8254 presentation8254 presentation
8254 presentation
 
Cyptography ece 702
Cyptography ece 702Cyptography ece 702
Cyptography ece 702
 
Connecting devices ece 702
Connecting devices ece 702Connecting devices ece 702
Connecting devices ece 702
 
Connecting devices ece 702
Connecting devices ece 702Connecting devices ece 702
Connecting devices ece 702
 
Introduction to-microprocessors-unit-1
Introduction to-microprocessors-unit-1Introduction to-microprocessors-unit-1
Introduction to-microprocessors-unit-1
 
Eec503, mp 30 questions
Eec503, mp 30 questionsEec503, mp 30 questions
Eec503, mp 30 questions
 
Dcn previous que4 with solutions
Dcn previous que4 with solutionsDcn previous que4 with solutions
Dcn previous que4 with solutions
 
Dcn previous que3 with solutions
Dcn previous que3 with solutionsDcn previous que3 with solutions
Dcn previous que3 with solutions
 
Dcn previous que2 with solutions
Dcn previous que2 with solutionsDcn previous que2 with solutions
Dcn previous que2 with solutions
 
Dcn previous que1 with solutions
Dcn previous que1 with solutionsDcn previous que1 with solutions
Dcn previous que1 with solutions
 
Microprocessor paper 4 with solutions
Microprocessor paper 4 with solutionsMicroprocessor paper 4 with solutions
Microprocessor paper 4 with solutions
 

Último

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Último (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

Some advanced instructions of the 8085 microprocessors

  • 1. FOR B.TECH (ECE) 3RD YEAR STUDENTS (HELPFUL IN UPTU/GBTU EXAM) (MICROPROCESSOR) BY ER. ANUPAM KUMAR (anupamkumarmtec@gmail.com) ELECTRONICS & COMMUNICATION ENGINEERING ASHOKA INSTITUTE OF TECHNOLOGY & MANAGEMENT, VARANASI, UTTAR PRADESH, INDIA SOME ADVANCED INSTRUCTIONS OF THE 8085 MICROPROCESSORS ADVANCE INSTRUCTIONS FOR 16-BIT DATA/ADDRESS TRANSFER 1.1 LHLD16-bit address ; load HL register pair  For example- Assume HL contains 3F90H i.e. H=3FH and L=90H. 2030H and 2031H memory locations contain are AFH & 24H respectively.  No flags are modified. 1.2 SHLD16-bit address ; Store HL register pair  This instructions works just reverse to the LHLD.  For example- Assume HL contains 3F90H i.e. H=3FH & L=90H.The memory location 2030H contains AFH & 24His contains of 2031H.  No flags are modified. 1.3 XCHG- Exchange the contents of HL register pair is 3F90H and contains of DE is 929FH.  Instruction Cycle-Op-code fetch machine cycle only.  No flags are modified.
  • 2. 2.2 ADVANCED INSTRUCTIONS RELATED TO THE 8085 16BIT REGISTERS 2.1 SPHL none ;the contents of HL register pair copies into stack pointer(SP):SP HL  The contents is copied in same manner into stack pointer(sp) as in HL register pair i.e. the contents of H AND L registers copied into higher byte & lower byte of stack pointer(SP) respectively.  No flags are modified. 2.2 XTHL none; this instructions exchange the top (pointed by SP) contents of stack memory with the contents of HL register pair.  The contents of stack memory location pointed by stack pointer, exchange with the contents of L register & the contents of next memory location with the contents of H register.  However, after execution of this instruction the contents or position of Stack Pointer (SP) remain same as before. For example-Assume the contents of SP is 2FFEH, HL=203FH i.e. H=20H & L=3FH and the contents of memory locations 2FFEH hold 72H and 2FFFH contains AFH. SP 2FFE 2FFF 3000 72 AF XTHL; after execution of this instruction the contents of HL is AF72H (H=AFH and L=72H), the contents of stack pointer SP is remains as before i.e. SP=2FFEH and the contents of memory location 2FFEH is 3FH and 2FFFH contains 20H.  Instruction cycle: Op-code fetch, two consecutive memory read, and two consecutive memory write machine cycles.  No flags are modified. 2.3 PCHL none; data of HL register pair transfer to the Program Counter (PC): PC HL
  • 3.  The contents is copied in same manner into Program Counter (PC) as in HL register pair i.e. H into higher-order byte and L into low-order byte of Program Counter (PC).  Instruction Cycle: Op-code fetch (takes 6-T States) machine cycle only.  No flags are modified. For Example: W.A.A.P. to transfer program control/execution without using JMP or CALL instructions. Assume program execution starts from 2000H program memory location and we want to execute program/instructions from 3000H. ORG 2000H 2000H LXI H, 3000H ; HL=3000H 2003 PCHL ; after execution of this one-byte instruction PC hold 3000H and execution transfer to location 3000H 2004H MVI A, 1FH ; not executed ……. 3000H MVI A, 1FH ; Program execution starts from here i.e. A=1FH 3002H HLT 10.3 ADVANCE INSTRUCTION FOR ARITHMETIC OPERATIONS     ACI- ADD IMMEDIATE TO A WITH CARRY ADC- ADD REGISTER/MEMORY TO A WITH CARRY SBB- SUBTRACT REGISTER/MEMORY WITH BORROW FROM A SBI- SUBTRACT IMMEDIATE WITH BORROW FROM A  Another advanced instructions in this group DAD (add register pair to HL register pair) which is related to 16-bit register pair. DAD Reg. pair/SP Pointer. ; Double Addition (in sense of 16-bit) of HL register pair or Stack  The default operand of this instruction is HL register pair i.e. to the register pair (BC, DE, HL or SP) is added to the contents of the HL register pair and the result/sum is saved in the HL register pair.  Only carry flag is affected by this instruction i.e. if the sum is larger than 16-bits the carry flag is set. The contents of the source register pair are not altered.
  • 4. Example: DAD H ; add the contents of reg. pair itself or multiply by 2.  Instruction cycle: Op-code fetches Bus Idle and Bus Idle machine cycles.  Flags: no flags are modified except Carry. PROGRAM: Add two 16-bit numbers. LHLD 4000H ; Get first 16-bit number XCHG ; Save first 16-bit number in DE LHLD 4002H ; Get second 16-bit number in HL DAD D ; Add DE and HL SHLD 4004H locations 4004H and 4005H HLT ; Store 16-bit result in memory ; Terminate program execution