第四讲 ARM指令系统和编程(2013).ppt

  1. 1、本文档共87页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
* * * Mention A bus and B bus on 7TDMI core. Give examples: ADD r0, r1, r2 ADD r0, r1, r2, LSL#7 ADD r0, r1, r2, LSL r3 ADD r0, r1, #0x4E * * Could have used 12 bits directly for immediate value - this would allow 0-4095. But this does not allow any large numbers, which are useful for: base address of memory devices in target system large, but simple hex constants (0x10000) Research has shown there is a need for a large range of small numbers (frequently needed) but also some large numbers. 50% of all constants lie between the range -15 and +15 and 90% lie in the range -511 and +511. Will vary depending on the application. ROR #n is confusing… but can be considered as ROL #32-n Opcode 0xe3a004ff = MOV r0, #0xff, 8 Core rotates 0xff right by 4 pairs of bits = MOV r0, #0xff000000 * Point out that it is 8-bit value shifted to anywhere within the 32-bit word (but must be an even number of bits). Other bits are zeros. Mention that ROR#2,4,6 (not shown) will split the 8-bit immediate with some bits at bottom of word and some at top. mov r0, #256 ; mov r0, #0x100 mov r1, #0x40, 30 ; mov r1, #0x100 etc. This method of generating constants allows 3073 distinct values, about 25% fewer than if 12-bits were used without modification. They are, however, a much more useful set of values. * Rotate left can be implemented as rotate right (32-number), e.g. rotate left of 10 is performed using rotate right of 22. RRX shifts by 1 bit position, of a 33 bit amount (includes carry flag). Very specialized application (e.g. encryption algorithms). Cannot be generated by C compiler. We have used it for 64/64 bit divide. RRX allows you to shift multiprecision values right by one efficiently. Also used in ARM’s MPEG code in a very tricky piece of code. ANSI C does not have a rotate operation (it only has ““ and “” which are the equivalent of LSL, LSR and ASR). However the ARM compiler recognizes rotate type expresssions and optimizes these to use ROR, e.g. int f(unsigne

文档评论(0)

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

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

1亿VIP精品文档

相关文档