ARM汇编指令

ARM汇编指令

1. 汇编语法
1.1 mov
movw	r0, #63500	; 0xf80c

将63500放到r0寄存器的低八位中

movt	r0, #25667	; 0x6443f80c

将25667放到r0寄存器的高八位中

1.2 lsl 左移
stmdb	sp!, {r4, r5, r6, r7, sl, lr}
ldrb.w	r6, [sp, #44]	; 0x2c              
movs	r0, #16
lsl.w	r1, r0, r6
1.3 bx lr 返回值
bx	lr

返回值放在r0寄存器中

1.4 数组加载:注意数组在地址上的偏移需要 -* 4,而Index是正常的 * 1
28003a6e:	f641 7152 	movw	r1, #8018	; 0x1f52
28003a72:	f6c2 017f 	movt	r1, #10367	; 0x287f		
28003a76:	7808      	ldrb	r0, [r1, #0]				
28003a78:	f855 1020 	ldr.w	r1, [r5, r0, lsl #2]		
1.5 bne 判断不相等:判断r1寄存器是否等于0
2. 文件修改
1. 头文件和变量整理到模板中
2. 变量的赋值

​ 1. 删掉extern

  1. 在full.log中查找变量

    5dd87	. DW_TAG_variable
    	  DW_AT_name("xxx")
    	  DW_AT_decl_line(32)
    	  DW_AT_decl_column(23)
    	  DW_AT_decl_file(1)
    	  DW_AT_type(0x5c36a)
    	  DW_AT_external(true)
    	  DW_AT_declaration(false)
    	  DW_AT_location: addr(0x287f1f70)
    
  2. 继续查找DW_AT_type(0x5c36a)

    5c36a	. TAG_array_type
    	  DW_AT_ordering(ORD_row_major)
    	  DW_AT_byte_size(20)
    	  DW_AT_type(0x5c365)
    
    5c371	. . TAG_subrange_type
    	    DW_AT_type(0x5bfdf)
    	    DW_AT_byte_size(4)
    	    DW_AT_lower_bound(0)
    	    DW_AT_upper_bound(4)
    

    数组变量5个,继续向下查找

    1. 变量为指针变量
    5c365	. TAG_pointer_type
      DW_AT_type(0x5dc45)
    
    1. 找到最终的变量类型-结构体变量
    5dc45	. TAG_typedef
      DW_AT_name("xxx")
      DW_AT_decl_line(290)
      DW_AT_decl_column(3)
      DW_AT_decl_file(39)
      DW_AT_type(0x5dc2a)
    
    5dc2a	. TAG_structure_type
      DW_AT_decl_line(288)
      DW_AT_decl_column(1)
      DW_AT_decl_file(39)
      DW_AT_byte_size(65536)
      DW_AT_accessibility(DW_ACCESS_public)
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

艾格北峰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值