SlideShare a Scribd company logo
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

More Related Content

PDF
DSP, Differences between Fourier series ,Fourier Transform and Z transform
PPTX
Datapath Design of Computer Architecture
PPTX
P, PI AND PID CONTROLLER
DOCX
8051 data types and directives
PDF
Serial communication of microcontroller 8051
PDF
interfacing matlab with embedded systems
PPT
Booth Multiplier
PPTX
Control Function - Computer Architecture
DSP, Differences between Fourier series ,Fourier Transform and Z transform
Datapath Design of Computer Architecture
P, PI AND PID CONTROLLER
8051 data types and directives
Serial communication of microcontroller 8051
interfacing matlab with embedded systems
Booth Multiplier
Control Function - Computer Architecture

What's hot (20)

PPTX
Risc and cisc
PDF
PID control dynamics of a robotic arm manipulator with two degrees of freedom.
PPT
Minimization Technique .ppt
PPTX
Synchronous Counter
PPT
PIC 16F877A by PARTHIBAN. S.
PPTX
boolean 8051
PPTX
Plc example presentation
PDF
Basic cdma for 2 g and 3g
PPT
I o ports and timers of 8051
PDF
8051 Timers / Counters
PDF
Stack and subroutine
PPT
Analog modulation
PPTX
register file structure of PIC controller
PPTX
8051 microprocessor
PPTX
Introduction to Assembly Language
PPTX
Input - Output Organization and I/O Interface
PPT
Architecture of 8086 Microprocessor
PPTX
HDL (hardware description language) presentation
PDF
Lecture 10 (serial communication)
PPTX
Computer architecture control unit
Risc and cisc
PID control dynamics of a robotic arm manipulator with two degrees of freedom.
Minimization Technique .ppt
Synchronous Counter
PIC 16F877A by PARTHIBAN. S.
boolean 8051
Plc example presentation
Basic cdma for 2 g and 3g
I o ports and timers of 8051
8051 Timers / Counters
Stack and subroutine
Analog modulation
register file structure of PIC controller
8051 microprocessor
Introduction to Assembly Language
Input - Output Organization and I/O Interface
Architecture of 8086 Microprocessor
HDL (hardware description language) presentation
Lecture 10 (serial communication)
Computer architecture control unit
Ad

Viewers also liked (6)

PPT
8085 microprocessor architecture ppt
PDF
8085 microprocessor notes
PPTX
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
PDF
MICROPROCESSOR 8085 WITH PROGRAMS
PDF
8085 microprocessor ramesh gaonkar
8085 microprocessor architecture ppt
8085 microprocessor notes
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
MICROPROCESSOR 8085 WITH PROGRAMS
8085 microprocessor ramesh gaonkar
Ad

Similar to Some advanced instructions of the 8085 microprocessors (20)

PPTX
UNIT II.pptx
PPT
8085 instruction set
PDF
Instructionsetof8086 180224060745(3)
DOCX
Instruction set of 8086
PPTX
2. Instruction Set.pptx huishiuhfuidhiuhdfuhdu
PDF
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
PPT
Chapter 3 instruction set-of-8085
PPT
Instruction set of 8085
PPT
Instruction set-of-8085
DOC
Microprocessor Basics CH-3
PPT
T imingdiagram
PPTX
4. Instruction Set Of MP 8085.pptx
PDF
Lecture 05 NOP and Stack Group of Instructions
PDF
Instructionset8085 by NCIT SAROZ BISTA SIR
PPT
instruction-set-of-8085 (1).ppt
PPT
instruction-set-of-8086-mr-binu-joy3.ppt
PPT
microp-8085 74 instructions for mct-A :P-2
PPT
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
PPT
microp-8085 74 instructions for mct-A :P
UNIT II.pptx
8085 instruction set
Instructionsetof8086 180224060745(3)
Instruction set of 8086
2. Instruction Set.pptx huishiuhfuidhiuhdfuhdu
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
Chapter 3 instruction set-of-8085
Instruction set of 8085
Instruction set-of-8085
Microprocessor Basics CH-3
T imingdiagram
4. Instruction Set Of MP 8085.pptx
Lecture 05 NOP and Stack Group of Instructions
Instructionset8085 by NCIT SAROZ BISTA SIR
instruction-set-of-8085 (1).ppt
instruction-set-of-8086-mr-binu-joy3.ppt
microp-8085 74 instructions for mct-A :P-2
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
microp-8085 74 instructions for mct-A :P

More from ASHOKA INSTITUTE OF TECHNOLOGY & MANAGEMENT,VARANASI,U.P. (20)

PDF
Introduction to-microprocessors-unit-1
PDF
Microprocessor paper 4 with solutions
Introduction to-microprocessors-unit-1
Microprocessor paper 4 with solutions

Recently uploaded (20)

PPTX
Institutional Correction lecture only . . .
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Basic Mud Logging Guide for educational purpose
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
Insiders guide to clinical Medicine.pdf
PDF
Pre independence Education in Inndia.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Cell Types and Its function , kingdom of life
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Cell Structure & Organelles in detailed.
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
master seminar digital applications in india
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Pharma ospi slides which help in ospi learning
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Institutional Correction lecture only . . .
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
VCE English Exam - Section C Student Revision Booklet
Basic Mud Logging Guide for educational purpose
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
RMMM.pdf make it easy to upload and study
Insiders guide to clinical Medicine.pdf
Pre independence Education in Inndia.pdf
GDM (1) (1).pptx small presentation for students
Cell Types and Its function , kingdom of life
Module 4: Burden of Disease Tutorial Slides S2 2025
Cell Structure & Organelles in detailed.
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
O5-L3 Freight Transport Ops (International) V1.pdf
Sports Quiz easy sports quiz sports quiz
master seminar digital applications in india
Supply Chain Operations Speaking Notes -ICLT Program
Pharma ospi slides which help in ospi learning
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...

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