Manipulating Bits:

The ability to manipulate individual bits in a byte is one of the advantages of assembly language.

Bits can manipulated in two ways:

  • Using shift instructions to move bits left or right.
  • Used Logical isntructions NOT, AND, OR and XOR with appropriate masks.

Logical Shift Left:

A logical shift left causes the most signifiicant bit to be shifted itno the carry bit, and a zero moves in to occupy the vacated space in the lowest significant bit.

Uses of a lofical shift:

  • A logical right shift can be used to examine the least significant bit of a number.
  • After the operation, the carry…


No comments have yet been made