8086 instruction is categorized into the following main categories.
1. Data Copy/Transfer Instructions:
Store, Move, Load, Exchange, Input and Output Instruction belong to this category.

2. Arithmetic and Logical Instruction

Increment, Decrement, Compare, and Scan instruction belong to this category.

3. Branch Instruction
All the call, jump, Interrupt and return instruction come under this category.

4.Loop Instructions:
• The LOOP, LOOPNZ and LOOPZ instructions belong to this category.

5. Machine Control Instructions:
These instructions control the machine status.• NOP, HLT, WAIT, and LOCK instructions belong to this class.

6. Flag Manipulation Instructions:
All the instructions which directly affect the flag register belong to this category.
Example:- Instructions like CLD, STD, CLI, STI, etc.

7. Shift and Rotate Instructions:-
Bitwise shifting or rotating direction with or without a count in CX.

8. String Instructions:-
Instruction involving various string manipulation operations like load, move, scan, compare, store, etc.

Data Transfer Instruction –
1. MOV
MOV Destination, Source
Flags affect None
No MOV from Memory to Memory.
Or if the Destination is Segment Register.

2. XCHG

Example: XCHG [1234h], BX

3. LEA, LDS, LES
None of the flags are affected.

LEA (Load Effective Address)
Format– LEA Reg16, EA

LDS (Load Register and DS)
Format– LDS Reg16,Mem32
Operation
[Mem32]->[Reg16]
[Mem32+2]->[Ds]

LDS (Load Register and DS)
Format- LDS Reg16,Mem32
Operation
[Mem32]->[Reg16]
[Mem32+2]->[DS]

LDS (Load Register and ES)
Format- LES Reg16,Mem32
Operation
[Mem32]->[Reg16]
[Mem32+2]->[ES]

LEA SI DATA (or) MOV SI Offset DATA

Arithmetic Instructions:
ADD, ADC, INC, AAA, DAA

MnemonicMeaningFormatOperationFlag
ADDAdditionADD D,S [S]+[D]->[D]
Carry -> [CF]
ALL
ADCAdd with carryADC D,S [S]+[D]+[CF] ->[D]
Carry -> [CF]
ALL
INCIncrement by oneINC D[D]+1 ->[D]ALL but CY
DAADecimal adjust for additionDAAAdjust AL for decimal Packed BCDALL

Understanding ADC

BeforeAfter
(E)10H 10H
(A)A0H B1H
(F)Cy=1, Other flag bits may have any value Cy=0,AC=0,Z=0,P=1,S=1

DAA (Decimal Adjust for addition)

 38 ---> 0011 1000
+ 45 ---> 0100 0101
----     ---------
  83     0111 1101
         ---- ----
            7    D

[AL] that is 1101 will be with Binary of 6 that is 0110(06H)

  1000 0011 ---> 83 (Decimal sum) 

MnemonicMeaningFormatOperationFlag
SUBSubtractSUB D,S [D]- [S] ->[D]
Borrow -> [CF]
ALL
SBBSubtract with CarrySBB D,S [D]- [S]-[CF] ->[D] ALL
DECDecrement by oneDEC D[D]-1 ->[D]ALL but CY
DAADecimal adjust for additionDAAAdjust AL for decimal Packed BCDALL
NEGNegateNEG D ALL

MOV BL, 28H
MOV AL, 83H
SUB AL,BL ;
AL=5BH
DAS ; adjust as AL=55H

MnemonicMeaningFormatOperationFlag
MULMultiply (Unsigned)MUL S[AL].S8 -> AX [AX].S16 -> DX, AXALL
DIVDivision (Unsigned)DIV S1) Q([AX]/S8) ->AL R([AX]/S8) -> AH
2) Q([DX, AX]/S16 -> AX R([DX, AX]/S16 ->DX
ALL
IMULInteger Multiply(Signed)IMUL S [AL].S8 ->AX [AX].S16 ->DX, AXALL
IDIV Integer Divison (Signed)IDIV S1) Q([AX]/S8) ->AL R([AX]/S8) ->AHALL
CBW Convert signed byte to wordCBW CBW MSB of AL  All bits of AHNo Flags
CWDConvert signed word to d. wordCWD MSB of AX-> All bits of DXNo flags

Understanding IMUL
AL=85H
BL=35H

IMUL-> 2’s complement of (AL*BL)
2’s Complement (85H)* 35H =1B89H
Hence AX will be 1B89H

Understanding DIV
DIV BL -> AX/BL =0085H/35H

AH=(85-02*35)H=(1B)H
AL=02H

Second
Now Suppose
AL=F3H, BL=91H, AH=00H

MUL BL-> AL*BL=89A3H

IMUL BL-> AL*BL
2’s Complement of AL* 2’s Complement of BL
0DH*6FH=05A3H

IDIV = AX/BL =00F3H/2’s Complement(91h)
00F3H/6FH=2->(00F3-2*6F)=15H

AH will store the remainder
AL will store the Quotient
Hence AL will be the complement of 02h that is FEh

DIV
DIV BL -> AX/BL
00F3H/91H =01H
(F3-1*91)H=62h
Hence AH will store 62h and AL will store 01h

Logical Instruction– AND, OR, XOR and NOT

AND is used in clearing certain bits(masking.
XXXX xxx AND 0000 1111= 0000 XXXX Clears the upper four bits.

OR is used in setting certain bits.
xxxx xxxx OR 0000 1111= xxxx 1111
//Set the lower four bit

XOR is used in inverting bits.

Shift and Rotate Instruction
SHL/SAL- shift logical left/shift arithmetic left
SHR: Shift logical right
SAR: shift arithmetic right
ROL: rotate left
ROR: rotate right
RCL: rotate left through carry.
RCR: rotate right through carry.



Image result for logical vs arithmetic shift
logical shift fills the newly created bit position with zero
Image result for logical vs arithmetic shift
Arithmetic shift fills the newly created bit position with a copy of the number’s sign bit

Shift arithmetic left/shift logical left
SHL/SAL D, Count; shift the D left by the number of bit position equal to the count and fill the vacated bits positions on the right with zeros.
All Flags are affected.
Operand types
SHL reg, imm8;
SHL mem, imm8;
SHL reg, cl;
Shl mem, cl;

Shift logical Right: SHR D, Count
The vacated bits position on the left is filled with zeros.
All Flags are affected.

SAR: Shift arithmetic right
SAR D, Count; Shift the (D) right by the number of bit positions equal to the count and fill the vacated bits position on the left with the original most significant bits.