在ARM汇编双条件 [英] Double Conditions in ARM assembly

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

问题描述

我很新的ARM和做一类的分配。
我感到困惑的是双条件一样,如果(X> 0安培;&安培; X< 100)。做点什么

I am very new to ARM and doing an assignment for a class. What I am confused about is a double condition like, if (x > 0 && x < 100) do something.

我想获得做的是检查在地址内存,如果,如​​果信息是一个大写或小写字符。

What I am trying to get done is check to see if in an address memory, if the information is a upper or lower case character.

我发现这里的链接,但它不是ARM似乎并没有像它可以帮助我。

I found a link on here but it is not for ARM and doesn't seem like it can help me.

我想是这样的:

BGT R2,#0x60的

BLT R2,#0x7B

但乱扔期待一个地址前pression所以我假设你不能值挺直比较int类型的错误。

But is throwing errors about expecting an address expression so I am assuming you can not compare a value stright to an int.

编辑,固定我的病情,打字速度过快,把错误的GT LT箭头

Edited, fixed my condition, was typing too fast and put wrong GT LT arrows

推荐答案

您不能在那样一个指令做比较分支在一起。你需要使用独立的比较和分支指令。 (ARM确实有一个零比较和分支,但在这里并不适用。)

You can't do the comparison and branch together in one instruction like that. You need to use separate compare and branch instructions. (ARM does have a "compare and branch on zero," but that does not apply here.)

您想要的东西更像是:

    CMP r2, #100
    BGT label_out
    CMP r2, #0
    BLT label_out  

... do stuff

label_out:  ; the branches come here if R2 < 0 || R2 > 100

这篇关于在ARM汇编双条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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