microprocessor 8085 instruction in Data function group


8085 INSTRUCTIONS:–

In 8085 there are 246 instructions. These instructions are of 80 different types these instructions can be classified into 5 functional group

1. Data
2. Arithmetic
3. Logical
4. Branch
5. Machine control group.

1.DATA FUNCTIONAL GROUP :– this group of instruction transfers or copies data from one location that is source to another location that is destination without changing the content of source. The term data transfer means copying data. The contents of destination are modified whereas the contents of source are not changed. Flag registers are not affected by the data transfer instructions. Various data transfer instructions are as follows:–

1.MVI INSTRUCTIONS :– Move immediate 8 bit data. Op code is MVI and operand R,data M,data.

In this instruction 8 bit data is copied or moved in the destination register or memory location. If the operand is memory its address is specified by HL register pair. No flag is affected and immediate addressing mode is used for source operand.

Example:– MVI B,92H.

In this instruction the data 92H is copied in the register B.

Example 2 MVI M,38H.

H-20H , L-50H

2. LXI :– Load register pair immediate.

Rp,16 bit data. Op code is LXI, operands Rp, 16 bit data.

This instruction will load the given 16 bit data in the register pair specify in the operand here Rp means register pair no flag is affected. Immediate addressing mode is used as source operand.

Example:– LXI B,2050H

THIS instruction will load 16 bit data 2050H in the register pair BC register.

3. Mov:– move data from one register to another register

            MOV Rd,Rs

This instruction copies the content of source register that is Rs into the destination register that is Rd but the contents of source register are not changed. Register addressing is used for both source and destination operands. No flag is affected.

Example:– MOV B,C

THIS instruction will copy the content of C into the destination register B.

Let us assume that B contains 72 and C 9F then 72 will overwrited with 9F  and 72 will erased

4. MOV Rd ,M:–  It will move the contents of memory location into the destination register Rd. This instruction will copy the contents of memory location whise address. In HL pair register into the destination register. The contents of memory location are not changed.

Register addressing mode is used for destination operand and indirect addressing mode is used for source operand. No flag is affected.

Example :– MOV B,M  H-20H ,L-50H.

This instruction will copy the contents of memory location whose address is in the HL register into the B register.

Suppose H contain 20H and L contains 50H and memory location 2050H contains data 3AH

5. LDA  Address:– Load accumulator direct.

Opcode LDA AND operand

In this instruction 16 bit address of a memory location where data resigns is specified inn the instruction. Thia instructions will copy the contents if memory location with the address given into the accumulator the contents of memory location are not changed thus a 3 byte instruction 1 byte gives the op code whereas 2nd and 3rd bytes specifies the high and low order address. No flag is affected and direct Addressing mode is used.

EXAMPLE:– LDA 2400H

Assume that 2400H address contain data 3A this instruction will load data of memory location whose address is 2400H into the accumulator.

6. STA ADDRESS:– Store accumulator.

Op code is STA and operand is the 16 bit address.

The contents of the accumulator are copied to a memory location whose address is given in the instruction this is a 3 byte instruction 1st byte is op code , 2nd and 3rd byte high and low order address. No flags are affected and direct addressing modes are used.

Example :– STA 2400H

7. LHLD address :– load HL DIRECT.

Load HL pair register direct  .op code is LHLD .AND operand is 16 bit address .

This instruction will load the data of the memory location whose address is specified in the instruction into the L register. And data of the next memory location that is address +1 is loaded into the H register the data of the memory location are not changed no flags are affected. Direct addressing mode is used

Example:– LHLD 2400H.

Assume that memory location 2400 contains the data 78H and 2401 contains 3AH. This instruction will copy the data of memory location 2400 into the L register and 2401 into the H register.

8. SHLD address:— SHLD address op code is SHLD OPERAND 16 BIT ADDRESS

STORE HL REGISTER PAIR DIRECT.

THE contents of HL register pair are stored in the memory location specified by the 16 bit address the contents of L register are stored in the memory location given by 16 but address and the content of H register are stored in next memory location. The contents of HL register pair are not changed it is a 3 byte . No flag is affected and direct addressing mode is used.

Example :– SHLD 2400G

LDAX Rp :– op code is LDAX AND operand is Rp. LOAD ACCUMULATOR REGISTER PAIR INDIRECT. It will be of 1 byte.

This instruction will load the contents of memory location whose address is specified in the register pair into the accumulator the contents of register pair are not changed. No flags are affected and indirect addressing mode is used for the source operand.

This instruction is used only for BC OR DE register pair.

Example :–LDAX. B

assume that register B contain 20H and reguster C contains 50H and the memory location 2050 contains the data 3A

This instruction will load the contents of memory location that is 2050 given in BC. register pair into the accumulator.

10  STAX :– STORE ACCUMULATOR REGISTER PAIR INDIRECT.

STAX =OPCODE

Contents of accumulator are copied into the memory location. Whose address is given into the register pair. The contents of accumulator or the register pair are not changed. No flag are affected and indirect addressing mode is used. For  Destination operands.