arm 汇编

来源:互联网 发布:ie优化公司 编辑:程序博客网 时间:2024/05/16 17:52

1:全局变量

.globl _reset_reset:.word __reset.globl _bss_start_bss_start:.word __bss_start__reset:mov r1, 0xFF


.globl 

_reset 保存__reset 的地址

_bss_start 保存 __bss_start 地址


2:lds 文件

BSS (NOLOAD):
{
         . = ALIGN(4);
         __bss_start = .;   /*__bss_start 变量的地址为当前地址 */
         *(.bss)
        _end = .;


3: LDR  ADR

LDR r1, =0xfff ;loads 0xfff into r1
LDR r2, =place ;loads the address of place into r2
LDR r2, place  ;loads value pointed by place
start:
MOV r0, #10
ADR r4, start   ; => SUB r4, pc, 0xc




原创粉丝点击