BIC

From ARMwiki
(Difference between revisions)
Jump to: navigation, search
(Created.)
 
(Added more descriptive title.)
 
Line 8: Line 8:
 
}}
 
}}
  
==BIC[S]==
+
==BIC[S] : Bit Clear==
 
BIC will perform a bitwise AND of one register with the complement of a second. This sounds complicated, so think of it as a simple way to ''clear'' selected bits in a register - BIC with '''1''' clears that bit, and with '''0''' leaves it unchanged.
 
BIC will perform a bitwise AND of one register with the complement of a second. This sounds complicated, so think of it as a simple way to ''clear'' selected bits in a register - BIC with '''1''' clears that bit, and with '''0''' leaves it unchanged.
  

Latest revision as of 08:00, 22 December 2011

BIC
Instruction BIC[S]
Function Bit Clear
Category Data processing
ARM family All
Notes -

Contents

[edit] BIC[S] : Bit Clear

BIC will perform a bitwise AND of one register with the complement of a second. This sounds complicated, so think of it as a simple way to clear selected bits in a register - BIC with 1 clears that bit, and with 0 leaves it unchanged.

Operand 1 is a register, operand 2 can be a register, shifted register, or an immediate value (which may be shifted).

If the S bit is set (BICS), the N and Z flags are set according to the result, the C flag is updated according to the shifter, while the V flag is not altered.

BIC is useful for clearing selected bits in a register.

[edit] Syntax

  BIC<suffix>  <dest>, <op 1>, <op 2>

[edit] Function

  dest = op_1 AND (NOT op_2)

[edit] Example

  BIC  R0, R0, #3  ; clear bits zero and one of R0

[edit] Technical

The instruction bit pattern is as follows:

31 - 28 27 26 25 24 - 21 20 19 - 16 15 - 12 11 - 0
condition 0 0 I 1 1 1 0 S op_1 dest op_2/shift
Personal tools
Namespaces

Variants
Actions
Navigation
Contents
Toolbox