ARM 汇编和 x86 汇编之间的差异 [英] Differences Between ARM Assembly and x86 Assembly

查看:87
本文介绍了ARM 汇编和 x86 汇编之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在要学习 ARM Assembly,为我的 Windows Mobile 5 iPAQ 进行开发,但我有一些问题:

I'm now going to learn ARM Assembly, to develop for my Windows Mobile 5 iPAQ, but I have some questions:

  • ARM 汇编和 x86 汇编之间的主要区别是什么?
    • 中断(新类型)有什么不同吗?
      • 它们是什么以及它们的含义是什么?

      推荐答案

      主要区别:

      • ARM 是一种 RISC 风格的架构 - 指令具有常规大小(标准 ARM 为 32 位,Thumb 模式为 16 位,尽管 Thumb 有一些指令会占用 2 个指令插槽")

      • ARM is a RISC style architecture - instructions have a regular size (32-bit for standard ARM and 16-bits for Thumb mode, though Thumb has some instructions that chew up 2 instruction 'slots')

      至少通过 ARM v5 架构(我不确定 v6 是做什么的),ARM 上的中断模型与 Intel 上的有很大不同 - ARM 不是将寄存器压入堆栈,而是交换到不同的影子"正常集的寄存器集.处理器的模式决定了哪个寄存器文件是可见的(并不是所有的寄存器都必须被遮蔽).这是一个相当复杂的安排.较新的 ARM 架构(无论如何都是 v7)有一个中断模型,它更接近于 Intel 的中断模型,当中断发生时寄存器被推入堆栈.

      up through at least ARM v5 architecture (I'm not sure what v6 does), the interrupt model on ARM is vastly different than on Intel - instead of pushing registers onto the stack, the ARM swaps to a different set of registers which 'shadow' the normal set. The mode of the processor determines which register file is visible (and not all registers are necessarily shadowed). it's a pretty complex arrangement. Newer ARM Architectures (v7 anyway) have an interrupt model that's closer to Intel's where registers are pushed on to the stack when an interrupt occurs.

      Arm 指令有一些英特尔没有的有趣功能:

      Arm instruction have some interesting features that aren't in Intel's:

      • 指令具有内置的条件标志 - 因此,如果指定的条件标志与当前状态寄存器标志状态不匹配,则每条指令都可以作为 NOP 执行(这可以用来避免所有这些围绕一两条指令的跳转经常在英特尔组装中看到).
      • ARM 具有可作为指令一部分嵌入的移位逻辑.因此,当使用寄存器作为源操作数时,您可以将其作为指令的固有部分进行移位.这有助于索引数组,有时还有助于算术.

      另一方面,除了加载和存储到内存之外,ARM 不能直接对内存做太多事情.Intel 程序集可以直接在内存上执行更多操作.

      On the other side, the ARM can't do much with memory directly except load from and store to it. Intel assembly can perform more operations directly on memory.

      请注意,ARM 架构版本并不直接对应于实际的 ARM 处理器版本 - 例如,如果我没记错的话,ARM7 是架构 v5 处理器.就我个人而言,我觉得这比应该的更令人困惑.

      Note that the ARM architecture version doesn't correspond directly to the actual ARM processor versions - for example, if I remember right the ARM7 is a architecture v5 processor. Personally, I find this far more confusing than it should be.

      ARM 架构参考可从 http://www.arm.com 免费下载.我还建议获取 Hitex 的各种 ARM 微控制器指南的副本 一个好的起点.

      The ARM Architecture references are freely downloadable from http://www.arm.com. I also suggest getting copies of Hitex's guides to various ARM microcontrollers for a good starting point.

      有几个关于 ARM 入门指南的 Stackoverflow 问题.回顾它们会给你很多好的开始:

      There have been several Stackoverflow questions regarding pointers to getting started with ARM. Reviewing them will give you a lot of good places to start:

      这篇关于ARM 汇编和 x86 汇编之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆