Consider the following array with the contents given:

5 5 5 5 5 5 5 5 5 5

Do the the following:
a) Write an assembly code using index addressing to add all the elements in the array and store the result in a memory location 'RESULT'. consider each of the element is of WORD size

Here is an assembly code using index addressing to add all the elements in the array and store the result in a memory location 'RESULT':

```assembly
section .data
array DW 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
RESULT DW 0

section .text
global _start

_start:
mov ecx, 10 ; Initialize loop counter to 10
mov esi, 0 ; Initialize array index
mov ax, [array + esi * 2] ; Load first element of the array into ax register

loop_start:
add ax, [array + esi * 2] ; Add the current element of the array to ax
add esi, 1 ; Increment array index by 1
loop loop_start ; Repeat until loop counter becomes zero

mov [RESULT], ax ; Store the result in memory location RESULT

exit:
mov eax, 1 ; Exit system call
xor ebx, ebx ; Exit status 0
int 0x80 ; Perform the system call
```

In this code, the `array` is stored in the `.data` section with the given elements. The `RESULT` is also declared in the `.data` section to store the final result.

In the `_start` section, the loop counter `ecx` is initialized to 10 (as there are 10 elements in the array). The array index `esi` is set to 0 initially. The first element of the array is loaded into the `ax` register using index addressing (`[array + esi * 2]`) as each element is of WORD size (2 bytes).

Then, a loop (`loop_start`) is started. Inside the loop, the current element of the array is added to the `ax` register using index addressing. The `esi` is then incremented by 1 to move to the next element. The loop continues until the loop counter `ecx` becomes zero.

After the loop, the final result in the `ax` register is stored in the memory location `RESULT` using the `mov` instruction.

Finally, the code exits using a system call, ensuring the `RESULT` is stored in the memory location specified.

Sure! Here's an example of an ARM assembly code using index addressing to add all the elements in the array and store the result in a memory location 'RESULT':

```
.data
array dw 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
result dw 0 ; Memory location to store the result

.text
.global _start
_start:
ldr r1, =array ; Load the address of the array into r1
ldr r3, =result ; Load the address of the result into r3

mov r0, #0 ; Initialize r0 to 0 (accumulator)
mov r2, #0 ; Initialize r2 to 0 (array index)

loop:
ldr r4, [r1, r2] ; Load the value at address (r1 + r2) into r4
add r0, r0, r4 ; Add the value in r4 to the accumulator (r0)

add r2, r2, #2 ; Increment the array index by 2 (since each element is WORD size)
cmp r2, #20 ; Compare the array index with the total number of elements (10 elements * 2 bytes)
bne loop ; Branch back to loop if the branch condition is not equal (not all elements processed)

str r0, [r3] ; Store the final result (accumulated value) at the address in r3

mov r7, #1 ; System call for exit
mov r0, #0 ; Exit status 0
svc 0 ; Execute the system call
```

Note that this code assumes an ARM architecture and uses the GNU Assembler (GAS) syntax. The array is defined in the `.data` section, and the result is defined as a separate memory location.

The code starts by loading the address of the array into register r1 and the address of the result into register r3. Registers r0 and r2 are used as accumulators and for indexing, respectively.

In the `loop`, the value at the current index (address `(r1 + r2)`) is loaded into register r4 and added to the accumulator (register r0). The array index is incremented by 2 since each element is of size WORD (2 bytes).

The loop continues until all elements in the array have been processed. Once the loop is complete, the final result (accumulated value) is stored at the address in register r3 using the `str` instruction.

Finally, the program exits using a system call with an exit status of 0.

Please note that this code is an example and may need to be modified or adapted based on your specific requirements or assembly language syntax.