		; loop initiation code

		MOV R0, #0 ; use r0 for i, set to 0

		ADR R2,N ; get address for N

		LDR R1,[r2] ; get value of N for loop termination test

		MOV R2,#0 ; use R2 for f, set to 0

		ADR R3,c ; load R3 with address of base of c array

		ADR R5,x ; load R5 with address of base of x array

		; loop test

loop		CMP R0,R1

		BGE loopend ; if i >= N, exit loop

		; loop body

		LDR R4,[R3,R0] ; get value of c[i]

		LDR R6,[R5,R0] ; get value of x[i]

		MUL R4,R4,R6 ; compute c[i]*x[i]

		ADD R2,R2,R4 ; add into running sum f

		; update loop counter

		ADD R0,R0,#1 ; add 1 to i

		B loop ; unconditional branch to top of loop

