GNU汇编 函数调用的例子

.text

.global  _start

_start:

          mov r1,#2

          cmp  r1,#1

          bl func1    @bl能保存下一条指令的位置到lr寄存器里面,b不能

          mov  r1, #2

          cmp r1, #3

          func1:

          mov r1,#2

          mov r2,#3

          mov pc,lr     @PC指针的变化在函数调用返回时很重要

 

posted @ 2018-12-25 17:37  小飞Python  阅读(275)  评论(0编辑  收藏  举报