- 汇编实现1-100累加,结果保存到R0
.text @声明下面内容都属于文本段内容
.global _start @声明_start是一个全局启用的标签
_start: @封装_start标签,汇编的标签和c中函数类似
mov r1,#1
b loop
loop:
add r0,r0,r1
add r1,r1,#1
cmp r1,#100
ble loop
.end @声明当前文本段结束
.text @声明下面内容都属于文本段内容
.global _start @声明_start是一个全局启用的标签
_start: @封装_start标签,汇编的标签和c中函数类似
mov r1,#1
b loop
loop:
add r0,r0,r1
add r1,r1,#1
cmp r1,#100
ble loop
.end @声明当前文本段结束