日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當(dāng)前位置:首頁 > 單片機 > 單片機
[導(dǎo)讀] 編譯u-boot時,在Makefile 的ALL變量最后加上$(obj)u-boot.dis,會編譯出u-boot.dis,u-boot.dis是通過arm-linux-objdum –d 生成u-boot的每一條指令的反匯編。33d80080: e59f13f4 ldr r1, [pc, #1012]

編譯u-boot時,在Makefile 的ALL變量最后加上$(obj)u-boot.dis,會編譯出u-boot.dis,u-boot.dis是通過arm-linux-objdum –d 生成u-boot的每一條指令的反匯編。

33d80080: e59f13f4 ldr r1, [pc, #1012]
33d80084: e59f03f4 ldr r0, [pc, #1012]
33d80088: e5801000 str r1, [r0]
33d8008c: eb000015 bl 33d800e8

………

33d800e8 :
33d800e8: e3a00000 mov r0, #0 ; 0x0

上面的bl指令,從表面上看 bl 33d800e8,好像是跳到了絕對地址0x33d800e8處,此時是運行在絕對0x0地址處,然后用bl一下子跳到了內(nèi)存地址0x33d800e8處,可是此時內(nèi)存都還沒有初始化就運行,這怎么可能?

這好像是很矛盾,但仔細分析一下,原來是這樣的:

將 eb000015 轉(zhuǎn)為二進制:

1110 1011 0000 0000 0000 0000 0001 0101

看一下它的具體含義,下面是b/bl 指令的格式-- 出自《ARM Instruction Set》

31-28 –> cond

27-25 –> 101

24 --> L

23-0 –> offset

"Branch instructions contain a signed 2's complement 24 bit offset. This is shifted left two bits, sign extended to 32 bits, and added to the PC. The instruction can therefore specify a branch of +/- 32Mbytes. The branch offset must take account of the prefetch operation, which causes the PC to be 2 words (8 bytes) ahead of the current instruction. Branches beyond +/- 32Mbytes must use an offset or absolute destination which has been previously loaded into a register. In this case the PC should be manually saved in R14 if a Branch with Link type operation is required.“ 出自《ARM Instruction Set》


1110 –> cond –> always 無條件跳轉(zhuǎn)

27-25 –> 說明是B 跳轉(zhuǎn)指令

24 –> L位 Branch with Link, 跳轉(zhuǎn)時將下一條指令的地址拷貝到R14(lr)中

23-0 –> offset=0x15

執(zhí)行bl后:pc = 當(dāng)前pc + ( offset<<2 + 8 ) = 0x8c+(0x15<<2+8)= 0xE8

跳到偏移地址為0xE8的地方,也就是 cpu_init_crit函數(shù)中。


本站聲明: 本文章由作者或相關(guān)機構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點,本站亦不保證或承諾內(nèi)容真實性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關(guān)閉