The logical instruction set is: And/orr/eor/bic
1) With logic commands are generally used to place 0 bits: and
and
Logical and operation.
Syntax |
|
And{cond}{s} Rd, Rn, OP2 |
Description |
|
Load Rd with logical AND of Rn with OP2. Rd: = Rn and OP2 |
Condition Flags |
|
If S is specified, N, Z the flags are updated. C flag May is updated by calculation of OP2. |
Example |
|
and R9,R2, #0xFF00 //Load R9 with R2 and value in 0XFF00 |
2) logic or instruction: ORR (or logic generally used for a bit of 1)
ORR
Logical OR operation.
Syntax |
|
Orr{cond}{s} Rd, Rn, OP2 |
Description |
|
OR operations on the values in Rn and OP2. |
Condition Flags |
|
If S is specified, N, Z the flags are updated. C flag May is updated by calculation of OP2. |
Example |
|
ORR R2, R0, R5 //Rd = R0 or R5 |
3) comparison instruction: Cmp/cmn/tst/teq
Logic instruction of the "assembly instruction" Data processing instruction