Logical instructions in 8086 microprocessor

Logical instructions are the instructions which perform basic logical operations such as AND, OR, etc. In 8086 microprocessor, the destination operand need not be the accumulator.

Following is the table showing the list of logical instructions:

OPCODE OPERAND DESTINATION EXAMPLE
AND D, S D = D AND S AND AX, 0010
OR D, S D = D OR S OR AX, BX
NOT D D = NOT of D NOT AL
XOR D, S D = D XOR S XOR AL, BL
TEST D, S performs bit-wise AND operation and affects the flag registor TEST [0250], 06
SHR D, C shifts each bit in D to the right C times and 0 is stored at MSB position SHR AL, 04
SHL D, C shifts each bit in D to the left C times and 0 is stored at LSB position SHL AX, BL
ROR D, C rotates all bits in D to the right C times ROR BL, CL
ROL R, C rotates all bits in D to the left C times ROL BX, 06
RCR D, C rotates all bits in D to the right along with carry flag C times RCR BL, CL
RCL R, C rotates all bits in D to the left along with carry flag C times RCL BX, 06

Here D stands for destination, S stands for source and C stands for count.
They can either be register, data or memory address.



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.