.text
.globl _start
_start:
/*1~100的累加*/
MOV R0, #0
MOV R1, #0
MOV R2, #0
MOV R3, #1
@循环1
bl ONE
/*5的阶乘*/
@循环2
bl TOW
stop:
b stop
@1~100
ONE:
ADD R0, R0, #1
ADD R1, R1, R0
CMP R0,#100
BCC ONE
mov pc, lr
@5的阶乘
TOW:
ADD R2, R2, #1
@MUL RnRd不能相同
/*
MUL R3, R2, R3
BCC TOW
mov pc, lr
*/
MUL R4, R3, R2
MOV R3, R4
CMP R2,#5
BCC TOW
mov pc, lr
.end