Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly X-Loader start.s中的GNU汇编程序指令_Assembly_Gnu_Directive_U Boot_Omap - Fatal编程技术网

Assembly X-Loader start.s中的GNU汇编程序指令

Assembly X-Loader start.s中的GNU汇编程序指令,assembly,gnu,directive,u-boot,omap,Assembly,Gnu,Directive,U Boot,Omap,我正在分析TI X-Loader代码,以便更深入地了解omap cortex引导序列 我从/cpu/omap3文件夹中的start.S文件开始。第一行如下: #include <config.h> #include <asm/arch/cpu.h> .globl _start _start: b reset ldr pc, _hang ldr pc, _hang ldr pc, _hang ldr pc, _hang

我正在分析TI X-Loader代码,以便更深入地了解omap cortex引导序列

我从/cpu/omap3文件夹中的start.S文件开始。第一行如下:

#include <config.h>
#include <asm/arch/cpu.h>

.globl _start
_start: 
    b   reset
    ldr pc, _hang
    ldr pc, _hang
    ldr pc, _hang
    ldr pc, _hang
    ldr pc, _hang
    ldr pc, _hang
    ldr pc, _hang

_hang:
    .word do_hang

    .word 0x12345678
    .word 0x12345678
    .word 0x12345678
    .word 0x12345678
    .word 0x12345678
    .word 0x12345678
    .word 0x12345678 /* now 16*4=64 */l

.global _end_vect
_end_vect:
#包括
#包括
.globl_启动
_开始:
b重置
ldr个人电脑
ldr个人电脑
ldr个人电脑
ldr个人电脑
ldr个人电脑
ldr个人电脑
ldr个人电脑
_挂起:
.多行字
.word 0x12345678
.word 0x12345678
.word 0x12345678
.word 0x12345678
.word 0x12345678
.word 0x12345678
.word 0x12345678/*现在为16*4=64*/l
.global\u end\u vect
_结束向量:
异常向量(重置向量除外)将跳转到地址“\u hang”。 但是那里没有操作代码,只有标签do_hang的地址(在代码后面找到,这是一个死循环函数)。 我对.word的理解是,它将值(在我们的例子中是do_hang的地址)复制到二进制文件中的特定位置,在我们的例子中是地址“_hang”。 当电脑加载了_-hang时,程序执行跳转到地址_-hang,在那里它找不到操作码,而是一个地址值(do-hang)

我的问题是:

  • 难道不应该有命令“b do_________________________________
  • 当程序计数器指向不包含操作码但包含地址的位置时,这不应该导致系统崩溃吗
  • 不应该.word指令只在.data部分有意义吗
提前感谢你的帮助

马丁

好的!我知道了

命令是LDR PC_hang! 它不会跳转到_-hang,但会将_-hang中的值加载到PC中。 _hang中的值是死循环函数do_hang的地址

还有一个问题: 为什么不在每个向量中简单地“b do_hang”? 我想我们永远也不会知道

问候

马丁