17 lines
372 B
ArmAsm
17 lines
372 B
ArmAsm
|
.data
|
||
|
N: .word 96
|
||
|
A: .double 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
|
||
|
S: .double 0
|
||
|
|
||
|
.text
|
||
|
main:
|
||
|
dadd r1,r0,r0 ; r1=i=0
|
||
|
lw r2, N(r0) ; r2=N
|
||
|
l.d f1, S(r0) ; f1=S
|
||
|
loop:
|
||
|
l.d f2, A(r1) ; f2=A[i]
|
||
|
add.d f1, f1, f2 ; f1=f1+A[i]
|
||
|
addi r1, r1, 8 ; i++
|
||
|
bne r1, r2, loop
|
||
|
s.d f1, S(r0) ; S=somme(A)
|
||
|
halt
|