如何编写ARM汇编至少两个`area`s? [英] How to write at least two `area`s in ARM assembly?

查看:279
本文介绍了如何编写ARM汇编至少两个`area`s?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图写它定义上的RAM我的数据的区域,为我的code区。我想这样做,但我就是不能使它工作。我使用出口也试过导入,但在使用他们,我不可能解决各种错误。

I'm trying to write an area which defines my data on the RAM, and an area for my code. I tried to do that, but I just can't make it work. I also tried using EXPORT and IMPORT but I couldn't solve various errors while using them.

    AREA HEAP, READWRITE, ALIGN=3
MYSTR   DCB "JaVid",0

    AREA RESET, CODE, READONLY
        ;IMPORT MYSTR

        ENTRY
        ADR R0, MYSTR   ;STRING POINTER

NEXT    LDRB R1, [R0]   ;CHARACTER HOLDER
        CMP R1, #'a'
        BLT OK
        CMP R1, #'z'
        BGT OK

        ;WE NEED TO SWITCH
        SUB R1, #'a'-'A'

OK      STRB R1, [R0], #1
        B NEXT

    END

请你给我它是如何做的例子吗?

Would you please give me an example of how it's done?

推荐答案

我怀疑你可能有问题,因为你不能使用 ADR 来指向另一个符号 AREA 。请参见精细手工本节

I suspect you may be having problems because you cannot use ADR to refer to a symbol in another AREA. See this section of the fine manual

您可能需要使用 LDR R0,= myStr的代替。

此外,你的循环似乎并没有终止。

Also, your loop does not seem to terminate.

[注:这将是有益的它,你表现出你所得到的确切的错误信息和您正在使用与上面的code中的命令行]

[Note: It would be helpful it you showed the exact error message you are getting and the command lines you are using with the code above.]

这篇关于如何编写ARM汇编至少两个`area`s?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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