 from computer science and engineering department, Walton Institute of Technologist, Solapur. Now, I am here to explain the 8086 instruction site. At the end of this session, the students will be able to understand the working of bit manipulation and program execution transfer instructions of microprocessor 8086. So, we will focus on two main type of instructions. First one, bit manipulation instructions. Second one, program execution transfer instructions. Under bit manipulation instructions, three types, logical instructions, shift instructions, rotate instructions. And under program execution transfer instructions of four types, unconditional transfer instructions, conditional transfer instructions, iteration control instructions, interrupt instructions. Now, first we will focus on bit manipulation instructions. Under bit manipulation instruction, in the previous lecture, we saw the logical instructions. Now, I will move to second type of bit manipulation instruction, which is shift instructions. So, first one, SAR. So, it indicates that shift operating bits right and your new MSB is equal to old MSB. The syntax for SAR instruction is SAR destination comma count. So, this count decides how many bit positions can be shifted. So, the content of destination is going to shift count times. So, this is the flow. Content of MSB will be shifted to right, next right, right position. So, at the end, the LSB will be copied to CF and new MSB is nothing but old MSB. So, let us see the example for SAR. SAR DI comma 1. So, it shift world in DI one bit position right. And new MSB is equal to old MSB. Next, second type. SHR shift operating bits right and put zero in MSB. The syntax for this SHR is SHR destination comma count. So, content of destination will be shifted right position. So, all bits will be shifted right. LSB content will be copied to carry flag and this new MSB is equal to zero. So, example for this SHR BP comma 1. It will shift world in BP one bit position right and MSB is updated as zero. Next, SAL or SHL. It will shift operating bits left putting zero in LSB. Syntax is SAL slash or SHL destination comma count. So, content of LSB will be shifted left. Next position, it will keep on move the bits left one position. MSB content will be copied to C and zero is updated in LSB. So, example for this SAL BX comma 1. It will shift world in BX one bit position left and LSB will be updated as zero. Next, rotate type of instruction. First one, ROL. It rotate all bits of operating left and MSB to LSB. Syntax for ROL is ROL destination comma count. So, it will keep on rotate the bits LSB to next position next next next. MSB content will be copied to LSB and same content will be copied to carry flag. Example for ROL. ROL X comma 1. So, the world in AX one bit position left and MSB to LSB and CF. So, next type of rotate, ROR. It rotate all bits of operating right. LSB content copied to MSB. Syntax for ROR instruction. It is ROR destination comma count. So, it will keep on rotate the bits MSB to next position next bit next bit. And finally the LSB is moved to MSB and carry flag. This is how rotate is going to work. Example ROR BL comma 1. It will rotate all bits in BL right one bit position. LSB to MSB and to carry flag. So, think and write the answer for this question. The question is differentiate SAR and SAL instructions. Pause the video and write down the answer. I hope you have written. Let us see the answer. So, SAR how SAR works. It will shift the content of MSB to its next position next bit next bit next bit. And the LSB is moved to CF. And the new MSB is equal to old MSB. This is how SAR works. But what about SHR? So, it will shift the content of MSB to its right position next bit to right right. And finally the LSB is going to copy into CF. Here the MSB is updated as 0. But in SAR new MSB is equal to old MSB. Here MSB is updated as 0. This is what exactly the difference between SAR and SHR. So, next type of rotate instruction. RCL rotate operand around to the left through carry flag. The syntax is RCL destination comma count. So, the content of LSB is moved to right position left position next left left left. And MSB content will be copied to CF. CF is going to copy into LSB. This is how the rotate RCL is working. Example for this type of RCL instruction is RCL dx comma 1. The word in dx one bit left MSB to CF and CF to LSB. Moving to next type of rotate instruction. RCL rotate operand around to the right through carry flag. RCL destination comma count. So, CF content is copied to MSB MSB to next position next bit to next next next. And LSB is going to copy into carry flag. Example for RCR is RCR BX comma 1. The word in BX write one bit position to carry flag to MSB and LSB to carry flag. This is about the rotate type of instructions. Moving to next type of instruction which is program execution transfer instruction. So, we will see the different type of program execution transfer instruction. Under this the first one is unconditional transfer instruction. Example call, call a procedure. The call instruction is used to transfer the execution to a sub program or procedure. So, there are two types of call. Near call and for call. In both the it is going to transfer the execution to sub program or any procedure which is written in call instruction. So, near call what exactly? The near call is a call to a procedure which is in the same code segment as the call instruction. But the far call in which the far call is a call to a procedure which is a different code segment from the one that the call instruction contains. So, this is the major difference between near and far. Example for call instruction, call BX. So, interact with a segment near or intra segment call. So, BX contains the offset of the first instruction of the procedure and replaces the content of IP with content of register BX. Next type return RET. So, it returns the execution from procedure to calling program. The return instruction will return execution from a procedure to the next instruction after the call instruction which was used to call the procedure. Next jump. This instruction will always cause the 86 to fetch its next instruction from the location specified in the instruction. Example jump word pointer to bracket BX. So, it replace IP with word from memory location pointed to by BX in DS. These are the references. Thank you.