1.练习一
 

 
.text @文本段
.global _start @ 声明一个_start函数入口
_start:  @ _start标签,相当于C语言中函数mov r0,#0x2mov r1,#0x3cmp r0,r1beq stopsubhi r0,r0,r1subcc r1,r1,r0stop:   @ stop标签,相当于C语言中函数b stop  @ 跳转到stop标签下的第一条指令执行,相当于C语言中while(1).end @结束标志
 

 
 
 
2.练习二 用for循环实现1~100之间和5050
 
.text @文本段
.global _start @ 声明一个_start函数入口
_start:  @ _start标签,相当于C语言中函数mov r0,#1  @ 一条汇编指令mov r1,#0bl loop_sumloop_sum:cmp r0,#100bhi stopadd r1,r1,r0add r0,r0,#1bl loop_summov pc,lrstop:  @ stop标签,相当于C语言中函数b stop @ 跳转到stop标签下的第一条指令执行,相当于C语言中while(1)   
.end @结束标志
 

 
 思维导图
 
