B.RAMA PRABHA
ASSISTANT PROFESSOR,
DEPARTMENT OF COMPUTER SCIENCE,
K.C.S.KASI NADAR COLLEGE OF ARTS & SCIENCE,
CHENNAI-21
“DATA TRANSFER INSTRUCTIONS
This group of instructions copy data from a
location called a source to another location called
a destination, without modifying the contents of the
source. In technical manuals, the term data
transfer is used for this copying function.
2
DATA TRANSFER (COPY)OPERATIONS
3
Several instructions are used to copy data. This sections concerned
with the following operations.
 MOV : Move (Copy a data byte)
 MVI : Move Immediate (Load a data byte directly)
 IN : Input from Port (Read a data byte from input device)
 OUT : Output to port (Write a data byte into output device)
 HLT :Halt (Stop processing and wait)
 NOP :No operation (Do not perform any operation)
MOV(MOVE)
MOV (Rd, Rs)
 This is a one byte instruction.
 This instruction MOV Rd, Rs copies the contents of the source register Rs into the
destination register Rd.
Example :MOV D, C
MOV M, Rs
 Copy content of Source register into memory whose address is pointed by HL Pair
of register
Example : MOV M,B
MOV Rd, M
 Copy content of memory into Source register. Memory locations address is pointed
by HL Pair of register.
Example : MOV B,M 4
MVI(MOVE IMMEDIATE)
MVI R,8 bit:
 This is a two byte instructions.
 Loads the 8 bit of second byte into the specified register.
Example : MVI B,05H
MVI M,data
 Loads the 8 bit data into a memory location, its location is
specified by the contents of the HL registers.
Example: MVI M, 57H
5
OUT(OUTPUT TO PORT)
OUT 8 bit port address
 This is a two byte instructions
 Sends (copies) the content of Accumulator(A) to the output port
specified in the second byte.
Example - OUT 50H
6
IN(INPUT FROM PORT)
IN 8 bit port address
 This is a two byte instructions
 Accepts data from the input port specified in the second byte and
loads in the Accumulator(A).
Example - IN 50H
7
HLT(HALT)
 This is a one byte instruction.
 The processor stops executing and enter into wait state.
 The address and data bus are high impedance state. No
register contents are affected.
Example : HLT
8
NOP(NO OPERATION)
NOP:
 This is a one byte instruction
 No operations are performed.
 Generally used to increase processing time.
9
16 bit data transfer
instructions
10
LXI D,DATA(LOAD REGISTER PAIR IMMEDIATE)
 LXI destination,(16-bit)Data
 It is a three bytes instruction
 Loading the destination with data 16-bit immediately, where the destination is
Registers Pair (BC, DE, HL) or 16 bit register SP.
Example : LXI B,3456
 Loading registers pair BC with data 3456 immediately where 34 loaded in register B
and 56 loaded in register C.
11
Opcode Operand Description
LXI Reg. pair, 16-bit data
Load the register pair
immediate
LDA 16 BIT DATA(LOAD THE ACCUMALATOR)
 It is a three bytes instruction
 The contents from the address (addresses in 8085 are 16-bit) are
copied to the accumulator register. The contents of the source location
remain unaltered.
 Example : LDA 2034H
 Contents stored at memory location 2034H are copied into the
accumulator.
12
Opcode Operand Description
LDA 16 BIT DATA Load the accumulator
LDAX(Load the accumulator indirect)
 It is a three bytes instruction
 The contents of the mentioned register pair point to a memory
location. LDAX instruction copies the contents of that particular
memory location into the accumulator register. Neither the contents of
the register pair nor that of the memory location is altered.
Example : LDAX B
13
Opcode Operand Description
LDAX
B/D Reg. pair Load the accumulator indirect
LHLD(Load H and L registers direct)
(Load the accumulator indirect)
 It is a three bytes instruction
 The LHLD instruction copies the contents of a specified memory
location pointed out by a 16-bit address into register L. The contents
of the next memory location are copied into register H.
Example : LHLD 2100H
14
Opcode Operand Description
LHLD 16-bit address Load H and L registers direct
STA(Store from the accumulator )
(Load H and L registers direct)
 It is a three bytes instruction
 The contents of the accumulator register are copied into a memory
location, which is specified by the operand.
Example : STA 1000H
15
Opcode Operand Description
STA 16-bit address value
Store from the accumulator into
a memory location
STAX(Store from the accumulator into register pair )
(Load H and L registers direct)
 It is a one bytes instruction
 The contents of the accumulator register are copied into the memory
specified by the register pair in the operand.
Example : STAX B
16
Opcode Operand Description
STAX Register pair
Store contents of the
accumulator into other register
pair
SHLD(Store from the HL register pair )
(Load H and L registers direct)
 It is a one bytes instruction
 The first 8-bit contents of the register L is stored into the memory
location specified by the 16-bit address. The next 8-bit contents of the
register H are stored into the subsequent memory location.
Example : SHLD 1200H 17
Opcode Operand Description
SHLD 16-bit address
Stores from the H-L registers
into the specified location
XCHG(EXCHANGE )
(Load H and L registers direct)
 It is a one bytes instruction
 The contents of register pair H-L are exchanged with the contents of
the register-pair D-E. The information stored in register H is
exchanged with that of D; similarly, that in register L is exchanged
with the contents of the register E.
Example : XCHG
18
Opcode Operand Description
XCHG None Exchange H-L with D-E
PUSH(PUSH IN TO STACK)
(Load H and L registers direct)
 It is a one bytes instruction
 The PUSH command pushes the contents of the register onto the stack
in 8085, which saves it as a temporary copy
Example : PUSH H
19
Opcode Operand Description
PUSH R Pushes onto stack
PUSH PSW(PUSH PSW ON TO STACK)
(Load H and L registers direct)
 It is a one bytes instruction
 The PUSH PSW command pushes the contents of the PSW (Program status word or
flag register) onto the stack in 8085, which saves it as a temporary copy.
 The stack pointer is first decremented by one, and the contents of the accumulator are
copied to that particular location. The stack pointer is again decremented by one, and
the contents of the flag register (PSW) are copied to that location.
Example : PUSH PSW 20
Opcode Operand Description
PUSH PSW Pushes PSW onto the stack
POP(PUSH FROM THE STACK)
(Load H and L registers direct)
 It is a one bytes instruction
 The POP command pops the contents stored onto the stack (where it might have been
saved as a temporary copy) to a
Example : POP B
21
Opcode Operand Description
POP R Pops from the stack
POP PSW(P0P PSW FROM THE STACK)
(Load H and L registers direct)
 It is a one bytes instruction
 The data at the memory location pointed by the stack pointer are copied to the flag
register. The stack pointer is incremented by one, and the contents of that location are
copied to the accumulator. The stack pointer is again incremented by one.
Example : POP PSW
22
Opcode Operand Description
POP PSW Pops PSW from the stack
SPHL
)
 It is a one bytes instruction
 Contents of L register are exchanged with top of the stack. The stack pointer is
incremented, and the contents of the next location of the stack are exchanged with H
register. The contents of the stack pointer register are not altered.
Example : SPHL
23
Opcode Operand Description
SPHL –
Move contents of HL pair to SP
register
XTHL
)
 It is a one bytes instruction
 Contents of L register are exchanged with top of the stack. The stack pointer is
incremented, and the contents of the next location of the stack are exchanged with H
register. The contents of the stack pointer register are not altered.
Example : XTHL
24
Opcode Operand Description
XTHL –
Exchange the contents at the top
of the stack with HL pair
“
25

8085 DATA TRANSFER INSTRUCTIONS

  • 1.
    B.RAMA PRABHA ASSISTANT PROFESSOR, DEPARTMENTOF COMPUTER SCIENCE, K.C.S.KASI NADAR COLLEGE OF ARTS & SCIENCE, CHENNAI-21
  • 2.
    “DATA TRANSFER INSTRUCTIONS Thisgroup of instructions copy data from a location called a source to another location called a destination, without modifying the contents of the source. In technical manuals, the term data transfer is used for this copying function. 2
  • 3.
    DATA TRANSFER (COPY)OPERATIONS 3 Severalinstructions are used to copy data. This sections concerned with the following operations.  MOV : Move (Copy a data byte)  MVI : Move Immediate (Load a data byte directly)  IN : Input from Port (Read a data byte from input device)  OUT : Output to port (Write a data byte into output device)  HLT :Halt (Stop processing and wait)  NOP :No operation (Do not perform any operation)
  • 4.
    MOV(MOVE) MOV (Rd, Rs) This is a one byte instruction.  This instruction MOV Rd, Rs copies the contents of the source register Rs into the destination register Rd. Example :MOV D, C MOV M, Rs  Copy content of Source register into memory whose address is pointed by HL Pair of register Example : MOV M,B MOV Rd, M  Copy content of memory into Source register. Memory locations address is pointed by HL Pair of register. Example : MOV B,M 4
  • 5.
    MVI(MOVE IMMEDIATE) MVI R,8bit:  This is a two byte instructions.  Loads the 8 bit of second byte into the specified register. Example : MVI B,05H MVI M,data  Loads the 8 bit data into a memory location, its location is specified by the contents of the HL registers. Example: MVI M, 57H 5
  • 6.
    OUT(OUTPUT TO PORT) OUT8 bit port address  This is a two byte instructions  Sends (copies) the content of Accumulator(A) to the output port specified in the second byte. Example - OUT 50H 6
  • 7.
    IN(INPUT FROM PORT) IN8 bit port address  This is a two byte instructions  Accepts data from the input port specified in the second byte and loads in the Accumulator(A). Example - IN 50H 7
  • 8.
    HLT(HALT)  This isa one byte instruction.  The processor stops executing and enter into wait state.  The address and data bus are high impedance state. No register contents are affected. Example : HLT 8
  • 9.
    NOP(NO OPERATION) NOP:  Thisis a one byte instruction  No operations are performed.  Generally used to increase processing time. 9
  • 10.
    16 bit datatransfer instructions 10
  • 11.
    LXI D,DATA(LOAD REGISTERPAIR IMMEDIATE)  LXI destination,(16-bit)Data  It is a three bytes instruction  Loading the destination with data 16-bit immediately, where the destination is Registers Pair (BC, DE, HL) or 16 bit register SP. Example : LXI B,3456  Loading registers pair BC with data 3456 immediately where 34 loaded in register B and 56 loaded in register C. 11 Opcode Operand Description LXI Reg. pair, 16-bit data Load the register pair immediate
  • 12.
    LDA 16 BITDATA(LOAD THE ACCUMALATOR)  It is a three bytes instruction  The contents from the address (addresses in 8085 are 16-bit) are copied to the accumulator register. The contents of the source location remain unaltered.  Example : LDA 2034H  Contents stored at memory location 2034H are copied into the accumulator. 12 Opcode Operand Description LDA 16 BIT DATA Load the accumulator
  • 13.
    LDAX(Load the accumulatorindirect)  It is a three bytes instruction  The contents of the mentioned register pair point to a memory location. LDAX instruction copies the contents of that particular memory location into the accumulator register. Neither the contents of the register pair nor that of the memory location is altered. Example : LDAX B 13 Opcode Operand Description LDAX B/D Reg. pair Load the accumulator indirect
  • 14.
    LHLD(Load H andL registers direct) (Load the accumulator indirect)  It is a three bytes instruction  The LHLD instruction copies the contents of a specified memory location pointed out by a 16-bit address into register L. The contents of the next memory location are copied into register H. Example : LHLD 2100H 14 Opcode Operand Description LHLD 16-bit address Load H and L registers direct
  • 15.
    STA(Store from theaccumulator ) (Load H and L registers direct)  It is a three bytes instruction  The contents of the accumulator register are copied into a memory location, which is specified by the operand. Example : STA 1000H 15 Opcode Operand Description STA 16-bit address value Store from the accumulator into a memory location
  • 16.
    STAX(Store from theaccumulator into register pair ) (Load H and L registers direct)  It is a one bytes instruction  The contents of the accumulator register are copied into the memory specified by the register pair in the operand. Example : STAX B 16 Opcode Operand Description STAX Register pair Store contents of the accumulator into other register pair
  • 17.
    SHLD(Store from theHL register pair ) (Load H and L registers direct)  It is a one bytes instruction  The first 8-bit contents of the register L is stored into the memory location specified by the 16-bit address. The next 8-bit contents of the register H are stored into the subsequent memory location. Example : SHLD 1200H 17 Opcode Operand Description SHLD 16-bit address Stores from the H-L registers into the specified location
  • 18.
    XCHG(EXCHANGE ) (Load Hand L registers direct)  It is a one bytes instruction  The contents of register pair H-L are exchanged with the contents of the register-pair D-E. The information stored in register H is exchanged with that of D; similarly, that in register L is exchanged with the contents of the register E. Example : XCHG 18 Opcode Operand Description XCHG None Exchange H-L with D-E
  • 19.
    PUSH(PUSH IN TOSTACK) (Load H and L registers direct)  It is a one bytes instruction  The PUSH command pushes the contents of the register onto the stack in 8085, which saves it as a temporary copy Example : PUSH H 19 Opcode Operand Description PUSH R Pushes onto stack
  • 20.
    PUSH PSW(PUSH PSWON TO STACK) (Load H and L registers direct)  It is a one bytes instruction  The PUSH PSW command pushes the contents of the PSW (Program status word or flag register) onto the stack in 8085, which saves it as a temporary copy.  The stack pointer is first decremented by one, and the contents of the accumulator are copied to that particular location. The stack pointer is again decremented by one, and the contents of the flag register (PSW) are copied to that location. Example : PUSH PSW 20 Opcode Operand Description PUSH PSW Pushes PSW onto the stack
  • 21.
    POP(PUSH FROM THESTACK) (Load H and L registers direct)  It is a one bytes instruction  The POP command pops the contents stored onto the stack (where it might have been saved as a temporary copy) to a Example : POP B 21 Opcode Operand Description POP R Pops from the stack
  • 22.
    POP PSW(P0P PSWFROM THE STACK) (Load H and L registers direct)  It is a one bytes instruction  The data at the memory location pointed by the stack pointer are copied to the flag register. The stack pointer is incremented by one, and the contents of that location are copied to the accumulator. The stack pointer is again incremented by one. Example : POP PSW 22 Opcode Operand Description POP PSW Pops PSW from the stack
  • 23.
    SPHL )  It isa one bytes instruction  Contents of L register are exchanged with top of the stack. The stack pointer is incremented, and the contents of the next location of the stack are exchanged with H register. The contents of the stack pointer register are not altered. Example : SPHL 23 Opcode Operand Description SPHL – Move contents of HL pair to SP register
  • 24.
    XTHL )  It isa one bytes instruction  Contents of L register are exchanged with top of the stack. The stack pointer is incremented, and the contents of the next location of the stack are exchanged with H register. The contents of the stack pointer register are not altered. Example : XTHL 24 Opcode Operand Description XTHL – Exchange the contents at the top of the stack with HL pair
  • 25.