关于arm汇编语句

来源:百度知道 编辑:UC知道 时间:2024/06/24 11:41:23
我看arm 2440语句在很多地方都有一句 b . 很不明白这到底是什么意思,有的注释为到达编译器地址。这里有一段最后一句就是 b .
ENTER_SLEEP
;NOTE.
;1) rGSTATUS3 should have the return address after wake-up from SLEEP mode.

ldr r0,=REFRESH
ldr r1,[r0] ;r1=rREFRESH
orr r1, r1, #BIT_SELFREFRESH
str r1, [r0] ;Enable SDRAM self-refresh
;//Enable SDRAM self-refresh

mov r1,#16 ;Wait until self-refresh is issued,which may not be needed.
0 subs r1,r1,#1
bne %B0
;//Wait until self-refresh is issued,which may not be needed

ldr r1,=MISCCR ;IO register
ldr r0,[r1]
orr r0,r0,#(7<<17) ;Set SCLK0=1, SCLK1=1, SCKE=1.
str r0,[r1]

ldr r0,=CLKCON ; Enter sleep mode
str r2,[r0]

b . ;CPU will die here.
我说的是 b . 大家注意这里还有一个点,单纯b的意思我当然知道 大家有没有知道的

b .是死循环的意思.
相对于其他汇编编译器可能是 b $
也就是跳回到当前PC地址..b {PC}

b即branch,无条件转移,相当于其他cpu的jp、jmp、jump等指令,你没注意上面会有一句bne?这是条件转移,具体你看看手册吧。