Bit Manipulation Instructions

 NOT Src:

  •  It complements each bit of Src to produce 1’s complement of the specified operand.
  •  The operand can be a register or memory location.



 AND Des, Src:

  • It performs AND operation of Des and Src.
  • Src can be immediate number, register or memory location.
  • Des can be register or memory location.
  • Both operands cannot be memory locations at the same time.
  • CF and OF become zero after the operation.
  • PF, SF and ZF are updated.



 OR Des, Src:


  • It performs OR operation of Des and Src.
  • Src can be immediate number, register or memory location.
  • Des can be register or memory location.
  • Both operands cannot be memory locations at the same time.
  • CF and OF become zero after the operation.
  • PF, SF and ZF are updated.



 XOR Des, Src:


  • It performs XOR operation of Des and Src.
  • Src can be immediate number, register or memory location.
  • Des can be register or memory location.
  • Both operands cannot be memory locations at the same time.
  • CF and OF become zero after the operation.
  • PF, SF and ZF are updated.



 SHL Des, Count:


  • It shift bits of byte or word left, by count.
  • It puts zero(s) in LSBs.
  • MSB is shifted into carry flag.
  • If the number of bits desired to be shifted is 1, then the immediate number 1 can be written in Count.
  • However, if the number of bits to be shifted is more than 1, then the count is put in CL register.



 SHR Des, Count:


  • It shift bits of byte or word right, by count.
  • It puts zero(s) in MSBs.
  • LSB is shifted into carry flag.
  • If the number of bits desired to be shifted is 1, then the immediate number 1 can be written in Count.
  • However, if the number of bits to be shifted is more than 1, then the count is put in CL register.



 ROL Des, Count:


  • It rotates bits of byte or word left, by count.
  • MSB is transferred to LSB and also to CF.
  • If the number of bits desired to be shifted is 1, then the immediate number 1 can be written in Count.
  • However, if the number of bits to be shifted is more than 1, then the count is put in CL register.



 ROR Des, Count:


  • It rotates bits of byte or word right, by count.
  • LSB is transferred to MSB and also to CF.
  • If the number of bits desired to be shifted is 1, then the immediate number 1 can be written in Count.
  • However, if the number of bits to be shifted is more than 1, then the count is put in CL register.