Logical instructions in 8086 microprocessor

MicroprocessorMicrocontroller8086

These instructions are used to perform operations where data bits are involved, i.e. operations like logical, shift, etc. We can say that these instructions are logical instructions. In 8086, the destination register may or may not the Accumulator.

Let us see the logical instructions of 8086 microprocessor. Here the D, S and C are destination and source and count respectively. D, S and C can be either register, data or memory address.

Opcode
Operand
Description
AND
D,S
Used for adding each bit in a byte/word with the corresponding bit in another byte/word.
OR
D,S
Used to multiply each bit in a byte/word with the corresponding bit in another byte/word.
NOT
D
Used to invert each bit of a byte or word.
XOR
D,S
Used to perform Exclusive-OR operation over each bit in a byte/word with the corresponding bit in another byte/word.
TEST
D,S
Used to add operands to update flags, without affecting operands.
SHR
D,C
Used to shift bits of a byte/word towards the right and put zero(S) in MSBs.
SHL/SAL
D,C
Used to shift bits of a byte/word towards left and put zero(S) in LSBs.
ROR
D,C
Used to rotate bits of byte/word towards the right, i.e. LSB to MSB and to Carry Flag [CF].
ROL
D,C
Used to rotate bits of byte/word towards the left, i.e. MSB to LSB and to Carry Flag [CF].
RCR
D,C
Used to rotate bits of byte/word towards the right, i.e. LSB to CF and CF to MSB.
RCL
D,C
Used to rotate bits of byte/word towards the left, i.e. MSB to CF and CF to LSB.

 

 

raja
Published on 11-Mar-2019 15:52:27
Advertisements