ARM LDRLE 指令有什么作用? [英] What does the ARM LDRLE instruction do?

查看:38
本文介绍了ARM LDRLE 指令有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 LDRE 指令检查一些反汇编.例如:

I am inspecting some dissassembly with an LDRE instruction. e.g:

LDRLE R3, #0x1234

我在指令列表中找不到这个.所以我的问题是,LDRLE 指令有什么作用?

I can't find this in the instruction list. So my question is, what does the LDRLE instruction do?

我的猜测,如果指令由 c 代码表示:

My guess, if the instruction were represented by c code:

// LDRLE R3, #0x1234
R3 = R3 <= 0x1234 ? R3 : 0x1234

推荐答案

LDRLE 指令实际上是 LDR(从内存加载寄存器)指令,带有条件执行限定符LE"(小于或等于).

The LDRLE instruction is really the LDR (load register from memory) instruction, with the conditional execution qualifer "LE" (less than or equal to).

当N标志和V标志不同时,条件LE"为真",当Z位被置位时也是如此(Z、N和V是PSR中4个标志位中的3个).您可以在处理器的 PSR 布局上找到来自 ARM 的信息.

The condition "LE" is "true" when the N flag and the V flag are different, and it's also true when the Z bit is set (Z, N and V are 3 of the 4 flag bits in the PSR). You can find information from ARM on your processor's PSR layout.

所以换句话说,这个 LDR 指令仅在LE"条件为真时根据 PSR 中的当前标志执行.这些标志可能会受到在 LDRLE 指令之前执行的指令的影响.换句话说,LE 条件的评估基于上一条指令的效果,而不是当前指令的操作数的值(在这种情况下,LDRLE 指令).

So in other words, this LDR instruction is only executed when the "LE" condition is true per the current flags in the PSR. These flags can be affected by instructions that execute prior to your LDRLE instruction. In other words, the LE condition is evaluated based on the effects of previous instructions, not the values of the operands of the current instruction (in this case, the LDRLE instruction).

最后,如果执行该指令会做什么(条件 LE 根据当前 PSR 标志为真)?它将(立即数)值 0x1234 加载到寄存器 R3 中.

Finally, what does the instruction do if it is executed (condition LE is true per current PSR flags)? It loads the (immediate) value 0x1234 into register R3.

这篇关于ARM LDRLE 指令有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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