ARM 汇编中的语法

发布于 2024-10-26 21:39:47 字数 640 浏览 1 评论 0原文

我做了更多阅读,发现了这个链接< /a>.在这里,实现互斥体的大多数步骤都非常直接且易于理解...但是有一些我不明白的事情在这个代码片段中:

    BEQ     %b1           ; Failed - retry from 1  
    ; Lock acquired  
    DMB                   ; Required before accessing protected resource  
    BX      lr  2         ; Take appropriate action while waiting for mutex to become unlocked  
    WAIT_FOR_UPDATE  
    B       %b1           ; Retry from 1  

存在于 lock_mutex 过程中。 %b1%f2 是什么?它们有什么关系?

谢谢, 维杰

I have been doing some more reading and came upon this link. Over here most of the steps to implement a Mutex are quite direct and understandable... but a few things that I don't understand are in this snippet :

    BEQ     %b1           ; Failed - retry from 1  
    ; Lock acquired  
    DMB                   ; Required before accessing protected resource  
    BX      lr  2         ; Take appropriate action while waiting for mutex to become unlocked  
    WAIT_FOR_UPDATE  
    B       %b1           ; Retry from 1  

present within the lock_mutex procedure. What is %b1 and %f2 ?? What do they relate to ?

Thanks,
Vijay

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

高跟鞋的旋律 2024-11-02 21:39:47

%b/f 用于引用指令周围的临时标签。 %b 表示“后退”,%f 表示“前进”。该数字是要使用的标签。例如,代码中的 2 在前三行中将被称为 %f2,在后两行中将被称为 %b2

%b/f are used to refer to temporary labels around the instruction. %b indicates "back" and %f indicates "forward". The number is the label to use. For example, the 2 you have in code would be referred to as %f2 on the first three lines, and %b2 on the last two.

醉梦枕江山 2024-11-02 21:39:47

我不熟悉那里使用的汇编语法,但如果我不得不猜测,我会说 %b1 指的是向后跳转到标签 1,并且%f2向前跳转到标签 2。

I'm not familiar with the assembler syntax used there, but if I had to guess, I'd say that %b1 refers to a backward jump to label 1, and %f2 refers to a forward jump to label 2.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文