ARM_Assembly_language_programming汇.ppt

  1. 1、本文档共41页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
ARM_Assembly_language_programming汇

* * ARM Assembly language programming Agenda ARM Data processing instructions ARM Data transfer instructions Arm Control flow instructions Features of Thumb state ARM uses three types of instructions Data processing instructions (arithmetic operations, logical operations, register moves , comparisons, shift operations). Data transfer (register load/store instructions). Control flow instructions (branch instructions). Data processing instructions Rules apply to ARM data processing instructions : - All operands are 32 bit s , come either from registers or aas specified as constants in the instruction itself - The result is also 32 bits and is placed in a register. - 3 operands are used : 2 for inputs and 1 for result. Ex. : ADD r0,r1,r2 ; r0 = r1 + r2 Works for both unsigned and 2’s complement signed numbers. This may produce carry out signal and overflow bits , but ignored by default Result register can be same as an input operand register. Data processing instructions (cont’d) ARM’s basic arithmetic operations : ADD r0,r1,r2 ; r0 = r1 + r2 ADC r0,r1,r2 ; r0 = r1 + r2 +C SUB r0,r1,r2 ; r0 = r1 – r2 SBC r0,r1,r2 ; r0 = r1 – r2 + c + 1 RSB r0,r1,r2 ; r0 = r2 – r2 RSC r0,r1,r2 ; r0 = r2 – r1 + c - 1 RSB stands for reverse subtraction. Operands may be unsigned or 2’s complement integers. ‘C’ is the carry bit in the CPSR Data processing instructions (cont’d) ARM’s bit-wise logical operations : AND r0,r1,r2 ; r0 = r1 and r2 ( bit-by-bit for 32 bits) ORR r0,r1,r2 ; r0 = r1 or r2 EOR r0,r1,r2 ; r0 r1 xor r2 BIC r0,r1,r2 ; r0 = r1 and not r2 BIC stands for ‘bit clear’, where every ‘1’ in the second operand clears the corresponding bit in the first : r1 : 0101 0011 1010 1111 1101 1010 0110 1011 r2 : 1111 1111 1111 1111 0000 0000 0000 0000 r0 : 0000 0000 0000 0000 1101 1010 0110 1011 Data processing instructions (cont’d) ARM’s register move operations : MOV r0,r2 ; r0 = r2 MVN r0,r2 ; r0 = not r2 MV

文档评论(0)

liwenhua11 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档