首页 > 其他 > 详细

【汇编指令】数据处理指令之算术指令集

时间:2014-12-09 21:35:50      阅读:237      评论:0      收藏:0      [点我收藏+]

ARM指令集:

其中包括数据处理指令集

1)算术指令(ADD,ADC,SUB,SBC , RSB, RSC )

①加法指令:ADD,ADDS

其中带S的表示可以更新标志位

ADD/ADDS

Add values and store result to register.

Syntax   ADD{cond}{S}  Rd, Rn, Op2
Description   Add Rn and Op2 and store result to Rd.
Condition Flags   If S is specified update flags: N, Z, C, V.
Example  
       ADDS  R0,R2,R4          //Add R2 and R4 and store result to R0, update flags
       ADD   R4,R4,#0xFF00     //Add value in 0xFF00 and R4 and store result in R4

bubuko.com,布布扣

②带进位的加法指令:ADC/ADDS

ADC

Add with Carry.

Syntax   ADC{cond}{S}  Rd, Rn, Op2
Description   Add Rn and Op2 and Carry flag and store result to Rd. ADC is typical used for multi-word arithmetic.
Condition Flags   If S is specified update flags: N, Z, C, V.
Example  
ADDS  R0,R2,R4       // add R2 + R4, store result to R0, set flags
ADC   R1,R3,R5       // add R3 + R5 with carry from previous ADDS, store result to R1

bubuko.com,布布扣

③反向减法指令;RSB/RSC

     rsb r0, r0, #100                ;r0 = 100 - r0 ;表示把100减去R0的值存入r0中





【汇编指令】数据处理指令之算术指令集

原文:http://blog.csdn.net/cj_kano/article/details/41827671

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!