ARM 汇编中的语法
我做了更多阅读,发现了这个链接< /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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
%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, the2
you have in code would be referred to as%f2
on the first three lines, and%b2
on the last two.我不熟悉那里使用的汇编语法,但如果我不得不猜测,我会说
%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.