Related Articles

Related Articles

Logical instructions in 8086 microprocessor
  • Last Updated : 22 May, 2018

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.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :