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
9 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.
11. XCHG:– Exchange the contents of
This instruction exchange the contents of HL Register pair with de register pair.
Op code is XCHG operand is null and size us 1 byte. In this instruction the contents of H registers are exchanged with the contents of D register and the content of L register with E register. No flags are affected and implicit is used
Example :– XCHG
assume D register contains 20H And E register contains 80H and H register 50and L register contain 90.
After the execution of instruction DE AND HL are exchanged.
12. IN :– MEans input data to accumulator from the input port specified with 8 bit address
IN 8bit address
Opcode is IN and operand is 8bits data and it’s size is 2 bytes.
The contents of the input port whose address is specified in the instruction are read and copied to the accumulator the input and output devices connected to the 8085 microprocessor have 8 bit address. No flags are affected.
Example :– IN 02H.A
13. OUT :– Output dat from accumulator to a port with 8 bit address and op code is OUT and operand is 8 bit address it is 2 byte address
The contents of the accumulator are copied into the output port whose 8 bit address is specified in the instruction are print to the accumulator. . No flags are affected.
Example :– OUT 02H.A
The in and out instruction are used to transfer data between input and output devices or accumulator so they may be grouped as input,output instruction.
14. PUSH :– It pushes register pair on to stack
PUSH Rp
Opcode is PUSH operand is Rp and this is 1 byte.
The contents of the register pair given in the instruction are copied into the stack. The stack pointer register incremented and the contents of the high order register are copied into that stack location. The SP again incremented and the content of low order register are copied into that location the operand PSW(program status word) gives the contents of accumulator and flag register
Accumulator is high order register and flag us a low order register.
Example :– Push B
Assume that stack pointer contains the address 2050 B contains 32H and C contains 50H . The instructions will copy the contents of register pair BC on the top of the stack.
15. POP:– Pop of top of stack to the register pair. Pop is op code and Rp is operand and size is 1 byte
The contents of the memory location whose address is pointed by ye stack pointer register are copied into register pair given in the instruction the contents of memory location pointed by the stack pointer are copied to the low order register and stack pointer is decremented by 1. Again the contents of the memory location are copied to high order register given in the register and stack pointer is again decremented by 1. No flags are affected.
Example :– POP H
Assume SP contains the address 2050 and H and L contains no data. The instructions pop H will copy the contents of memory location 2050 into the L Register and 2049 into the H register and the new stack top will changed from 2050 to 2048. The pop and push instruction are also known as stack instruction.
16. XTHL :– Exchange the contents of HL register with the stack top. Op code is XTHL and operands is null and size is 1 byte.
The contents of the stack location whose address is given by the stack pointer are exchanged with the register L and the contents of register H are exchanged with the contents of the next stack location that is by incrementing stack pointer the contents of the stack pointer register are not changed. No flags are affected.
Example:–
Assume that stack pointer contains 2050 and value 37 stack pointer+1 contains 2051 and value 52 and H contains 32 and L contains 50 so the value of 2050 address pointed by SP is copied into L register and that is 2050 new value is 50 and L register new value is 50 also the value at the address 2051 is exchanged with the contents of H register that is new value that is 32 and the new value is 37
17. SPHL:– Contents of HL register pair are copied into the stack pointer op is SPHL And instruction is of 1 byte.
The instruction will copy the contents of H register into the high order address and the content of L Register into the low order address. No flags are affected and tge contents of register pair are not changed.
Example:– SPHL
