Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Jawad Ali Jamshaid

INFT211102061

Computer Organization and Architecture


Assignment no 03
Cyber Security 5A
Mr. Matiullah
Question no 01: Write the Shift operators with
examples
➢ Shift Left
➢ Shift Right
➢ Shift Arithmetic left
➢ Shift Arithmetic Right

➢ Shift Left: A shift left logical of one position moves


each bit to the left by one. The low-order bit (the right-
most bit) is replaced by a zero bit and the high-order
bit (the left-most bit) is discarded
➢ Shift Right: The Shift Right instruction performs a
right shift on the destinations operand, filling the
lowest bit with 0. The lowest bit is moved into the
Carry Flag. SAL (Shift Arithmetic Left) is identical to
the SHL instruction. SAR (Shift Arithmetic Right)
performs a right arithmetic shift on its operand
➢ Shift Arithmetic right: SAR (Shift Arithmetic
Right) performs a right arithmetic shift on its
operand. The ROL instruction shifts each bit to
the left, with the highest bit copied in the Carry
flag and into the lowest bit
➢ Shift Arithmetic Left: Each bit in the register is shifted
to the left one by one in this shift micro-operation. The
most significant bit (MSB) is moved outside the
register, and the place of the least significant bit (LSB)
is filled with 0
…….END…….

You might also like