 Hello everyone, this is Vishwana Chawad from the Computer Science and Engineering Department, Walton Institute of Technology, Solapur. At the end of this session, the students will be able to explain the working of arithmetic and logical instructions of Micro Professor 8086. So we will focus on two main types of instruction, arithmetic and logical. In case of arithmetic instruction, we are having addition instruction, subtraction, multiplication, division. And in case of logical instruction and logical or XOR, not energy compare. So first we will see addition, syntax is add destination comma source and ADC, ADC destination comma source. So here the content of source and destinations are added and the results will be stored in destination. But in case of second, here it will add content of source and destination, including carry and result will be stored in destination. So after execution of this instruction, these are the flags which are going to affect auxiliary carry, carry flag, overflow, sign, Z flag. These are the examples add AX comma 74. It add immediate number 74 to content of AL, result in AL, ADC CL comma BL. It add content of BL plus carry status to content of CL. So these are the few more examples add DX comma BX, it will add BX to content of DX, add DX comma SI, add a word from memory at offset SI in DS to content of DX, ADC AL comma price into bracket BX. So it will add a byte effective address price into bracket BX plus carry status to content of AL. Now second type of arithmetic, subtraction, subtract destination comma source, SBB destination comma source. So here the flags A, C, O, P, S and F, Z are going to affect. So example subtract CX comma BX. So here BX is subtracted from CX and the result is stored in CX, SBB CH comma AL, so it subtract the content of AL and content of CF from content of CH and result in CH. Subtract AX comma 3427H, it subtract immediate number 3427H from AX. These are the other examples SBB BX comma 3427, SUB price BX comma 04, SBB CX comma table into bracket BX, SBB table into bracket BX comma CX. Now we will see third type of arithmetic MUL, syntax is MUL source. So example MUL BH, it multiply AL with BH and result will be stored in AX. Second example MUL CX, it multiply AX with CX and result high word in DX and low word in AX. MUL byte pointer, it multiply AL with byte in DS pointed to by BX. MUL factor into bracket BX, it multiply AL with byte at effective address factor BX. If it is declared as a byte type with DB, multiply AX with word at effective address factor to bracket BX. If it is declared as type word in as DW. I MUL source, example I MUL BH, it multiply signed byte in AL with signed byte in BH. So difference between MUL and I MUL is in case of I MUL, signed numbers are used to find the product. Second example I MUL AX, multiply AX times AX and result in DX and AX. Fourth division, DIV source. So it divide BL, divide a word in AX by byte in BL and quotient in AL, reminder in AH. DIV CX divide downward in DX and AX by word in CX, quotient in AX and reminder in DX. I DIV source, example DIV BL, signed word in AX divided by signed byte in BL. I DIV BP, signed double word in DX and AX divided by signed word in BP. INC increment destination, example INC BL, it add one to contents of BL register. INC CX, it add one to content of CX register. Third example INC byte pointer into bracket BX, it increment byte in a data segment at offset contained in BX. INC word pointer into bracket BX, it increment word at offset of BX and BX plus one in the data segment. Decrement, syntax is decrement destination. It subtract one from content of CL register. Dec BP, it subtract one from content of BP register. Dec byte pointer into bracket BX, it subtract one from byte at offset BX in DS. So think about this question and write down the answer. The question is what are the different types of arithmetic instructions? Pause the video and write the answer. I hope you answered. So the different types of arithmetic instructions are addition, subtraction, multiplication and division. Now we will move to second type of instruction which is logical. First one, logical and. The syntax is and destination comma source, example and CX comma SI. So it will perform logical and word in DS at offset SI with word in CX register and the result is stored in CX and these are the other examples. Second type or or destination comma source, example or AH comma CL, CL content is or with AH and result in AH CL will not be changed. Second example or BP comma SI, so SI or with BP. Then BP and SI will not change, third type or SI comma BP, BP is or with SI and result in SI BP will not change or BL comma ATH, BL is or with immediate number ATH and set MSB of BL to one or CX comma table into bracket SI, CX is or with word from effective address table of SI, content of memory is not changed, XOR, XOR destination comma source, example XOR CL comma BH. So byte in BH is exclusive or with byte in CL, result in CL and BH not changed, XOR BP comma DI, word in DI exclusive or with a word in BP and result in BP, DI not changed, XOR word pointer into bracket BX, 00FFH, exclusive or immediate number 00FF with word at offset BX in data segment, result in memory location BX. Next not, syntax is not destination, not BX, complement content of BX register, not byte pointer into bracket BX, complement memory byte at offset BX in data segment. Next one, NEG destination, example NEG AL, it replace number in AL with twos complement, negation, negate BX replace number in BX with twos complement, NEG byte pointer into bracket BX, replaces byte at offset BX in DX with twos complement and this is another example. Compare destination comma source, so this instruction compares two values and the respective flags will be set, example compare AL comma 01, it compare immediate number 01 with byte in AL, so if depends on the content it sets either C flag or Z flag or S flag, so depending on flag status further action will be taken, so these are the few more other examples, so these are my references, thank you.