INSTRUCTION SET OF 8085
After this module you will be able to understand
1)Data transfer instructions
2)Arithmetic instructions
3)Logical Instructions
4)Branching Instructions
5)Stack, I/O, Machine control instructions
TOPIC -1-INTRODUCTIONS
*An instruction is a command given to the computer to perform some operation on the
given data.
*Instruction set is collection of instructions in a microprocessor.
*Mainly they are classified as
1) Data Transfer Group
2)ArithmeticGroup
3) Logical Group
4)Branchinstructio
n
5)I/O and Machine control group.
*Data transfer instructions are used to transfer or move data from one register to another
or from memory to register, or from register to memory.
Example MOV , MVI , LXI, LDA , STA etc.
Here data is transferred from source to destination for example MOV A,B means B is
the source register while A is the destination.
Now LDA 2500 mean the content of the memory location 2500 is loaded into accumulator
but the content of 2500 will remain unaltered(no changes).
,*Arithmetic used to perform addition , subtraction , increment , decrement of the
content of registers or memory
Example ADD, SUB , INR, DAD etc
*Logical used to perform logical operations such as AND , OR , NOT , XOR , as well as
compare , rotate . Example ANA , XRA , ORA , CMP , RAL etc
*Branch instructions are used for conditional and unconditional jump , call or
return restart . Example JMP , JC , JZ, CALL , CZ ,RST etc
*I/O and machine control instructions are used for input/output ports , stack and
machinr control. Example IN , OUT , PUSH , POP ,HLT , INTA, INTR etc
NOTE:
*Instructions can also classified on the basis of length ie one byte , two byte , three byte
similarly on the basis of addressing like direct addressing , indirect addressing, register
addressing, immediate addressing , register indirect addressing
, TOPIC -2- INSTRUCTION AND DATA FROMATS
*8085 is an 8 bit microprocessor.
*It means it handles 8 data at a time OR 8 BIT OF DATA IS TRASFERRED AT A TIME .
*One byte = 8 bits .
*The memory location of 8085 MP is designed to accommodate 8 bit data.
*If 16 bit data to be stored they are stored in consecutive memoty locations (BC
, DE, HL pairs).
*The address of memory location is 16 bit ie 2 byte.
*VARIOUS METHODS TO SPECIFY OR GIVE DATA IN INSTRUCTIONS
1)8 BIT DATA or 16 BIT DATA can be directly given in the instruction example mov A,FF.
The address of the memory location ( eg 2400) or I/O port or I/O device where the data
resides may be given in the instruction itself
Example MVI A,M , LDA 2500
2)In some instructions only one registers is specified. In that case the other will
be accumulator Example ADD B , means the content of B register is added with
Accumulator
1) Some instructions specify two registers. The data will be inside the
specified register. Example ADD B,C
2) In some instruction the data value will
be given, Example ADI M,FF. OR ADI
A,06H
AGAIN BASED ON LENGTH OF INSTRUCTION ALL THIS CAN BE CLASSIFIED
INTO 3 TYPES
Classification based on length:
1)One-byte instructions:
Instruction having one byte in machine code. ie;They include
opcode and operands in the same byte.
, Operands are internal registers and coded into the instruction.
Instructions require one memory location to store the single byte in the memory.
Examples are depicted in Table 2.
Table2 Examples of one byte instructions
Opcode Operand Machine code/Hex
code
MOV A, B 78
ADD M 86
2)Two-byte instructions: Instruction having two byte in machine code. Ie; the
first byte is used to represent “opcode” and second byte is used to represent
“operands”.
It means the instruction requires two memory locations one for opcode And other for
operand
Examples of two byte instructions
Opcode Operand Machine code/Hex Byte
code description
MVI A, 7FH 3E First byte
7F Second byte
ADI 0FH C6 First byte
0F Second byte
3)Three-byte instructions: In a three-byte instruction, the first byte specifies
the opcode, and the following two bytes specify the 16-bit operand.
The second byte is the low-order operand and the third byte is the high-order
operand.
If a 16-bit numeral is present in the instruction then that instruction will be of
three- byte. Here, the numeral may be a data or an address, for example, in LXI
H,3500H and STA 2500H, etc.
Examples are depicted in Table 4.