开发者

Syntax in ARM assembly

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  

p开发者_运维知识库resent within the lock_mutex procedure. What is %b1 and %f2 ?? What do they relate to ?

Thanks, Vijay


%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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜