首页 > 代码库 > 【汇编指令】数据处理指令之逻辑指令

【汇编指令】数据处理指令之逻辑指令

逻辑指令集有:AND/ORR/EOR/BIC

1)与逻辑指令一般用于置零某位: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 flags are updated. C flag may be updated by calculation of Op2.
Example 
       AND  R9,R2,#0xFF00     // Load R9 with R2 and value in 0xFF00
<script src="https://code.csdn.net/snippets/547236.js" type="text/javascript"></script>



2)逻辑或指令:ORR(或逻辑一般用于某位的置 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 flags are updated. C flag may be updated by calculation of Op2.
Example 
      ORR     R2, R0, R5    // Rd = R0 or R5

<script src="https://code.csdn.net/snippets/547258.js" type="text/javascript"></script>



3)比较指令:CMP  /    CMN    /TST   /   TEQ


<script src="https://code.csdn.net/snippets/547284.js" type="text/javascript"></script>


【汇编指令】数据处理指令之逻辑指令