在两者之间的指令的PC值(程序计数器) [英] PC value in between two instructions (program counter)

查看:295
本文介绍了在两者之间的指令的PC值(程序计数器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图了解看门狗的原因。汇编程序的片段如下:

Trying to understand the cause of the watchdog. The snippet of assembly routine is as follows:

fe813cf0:       2820            cmp     r0, #32
fe813cf2:       dbf0            blt.n   fe813cd6 <XYZ+0x10>
fe813cf4:       f04f 30ff       mov.w   r0, #4294967295 ; 0xffffffff
fe813cf8:       bd10            pop     {r4, pc}

从转储我的PC值是fe813cf3。这是什么意思?我应该际preT怎么了?
请让我知道,如果需要更多的信息。

My PC value from dump is fe813cf3. What does this mean? How should I interpret it? Please let me know if more info is required.

推荐答案

如果这是一个看门狗触发,这似乎表明该处理器已挂起。您采集的状态可能已损坏,在最坏的情况下。不知道你是如何获得倾销,所以很难说。

If it's a watchdog that triggers, that seems to indicate that the processor has hung. The state you're capturing might be corrupt, in the worst case. Not sure how you get the "dump", so it's hard to tell.

在一般的ARM,一个奇怪的地址,表示要切换到拇指的指令集。

In general on ARM, an odd address indicates a jump that wanted to switch to the Thumb instruction set.

例如见本文档

See for instance this documentation of the BX (branch exchange) instruction:

BX指令分支到包含在指定寄存器的地址。跳转地址位0的值确定是否继续在ARM状态或Thumb状态。

The BX instruction branches to the address contained in a specified register. The value of bit 0 of the branch address determines whether execution continues in ARM state or Thumb state.

的地址的位0可以以这种方式被使用,原因是:

Bit 0 of an address can be used in this way because:


      
  • 所有的ARM指令都是字对齐。这意味着,位0和任何ARM指令的地址1被忽略,因为这些位指地址的半字和字节部分

  • All ARM instructions are word-aligned. This means that bits 0 and 1 of the address of any ARM instruction are ignored because these bits refer to the halfword and byte part of the address.

所有的Thumb指令都是半字对齐。这意味着,因为它是指地址字节一部分的任何Thumb指令的地址位0被忽略。

All Thumb instructions are halfword-aligned. This means that bit 0 of the address of any Thumb instruction is ignored because it refers to the byte part of the address.

不过,我pretty确认以上意味着PC从未真正的设置的奇地址,位0被分支指令清除。

However, I'm pretty sure the above implies that the PC is never actually set to an odd address, bit 0 is cleared by the branch instruction.

这篇关于在两者之间的指令的PC值(程序计数器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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