Professional Documents
Culture Documents
The TEST instruction performs a bit by bit logical AND operation on the two operands. The
result of this ANDing operation is not available for further use, but flags are affected.
SAL / SHL destination, count.
SAL and SHL are two mnemonics for the same instruction. This instruction shifts each bit in the
specified destination to the left and 0 is stored at LSB position. The MSB is shifted into the carry
flag. The destination can be a byte or a word. It can be in a register or in a memory location. The
number of shifts is indicated by count.
SHR: SHR destination, count
This instruction shifts each bit in the specified destination to the right and 0 is stored at MSB
position. The LSB is shifted into the carry flag. The destination can be a byte or a word. It can be
a register or in a memory location. The number of shifts is indicated by count.
SAR: SAR destination, count
This instruction shifts each bit in the specified destination some number of bit positions to the
right. As a bit is shifted out of the MSB position, a copy of the old MSB is put in the MSB
position. The LSB will be shifted into CF.
Eg. SAR BL, 1
OUTPUT
OR
INSTRUCTION
CODE
org 100h
ret
OUTPUT
NOT INSTRUCTION
CODE
org 100h
OUTPUT
XOR INSTRUCTION
CODE
org 100h
; add your code here
MOV AX,0018H
MOV CX,0016H
XOR AX,CX
ret
OUTPUT
TASK#2
Multiply decimal 14 with decimal 14 using AND and shift operators
CODE
OUTPUT
CONCLUSION
In this lab we learn about logical operations and shift operators and perform the given tasks on
software.