1 Answers
Code 01:
AREA POS_SUM, CODE
ENTRY
LDR R0,= 0X40000000
MOV R5, #05
MOV R6, #00
POS LDR R2, [R0], #4
MOV R3, R2
MOVS R2, R2, LSL #1
ADDCC R6, R6, R3
SUBS R5, R5, #1
BNE POS
STOP B STOP
END
Code 02:
AREA POS_SUM, CODE
ENTRY
LDR R0,=0X40000000
MOV R5, #5
MOV R3, #00
MOV R6, #0Xffffffff
POS LDR R7, [R0], #4
MOV R8, R7
AND R11, R6, R7
MOVS R11, R11, LSL#1
ADDCC R9, R9, R8
SUBS R5, R5, #1
BNE POS
STOP B STOP
END