1. 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's an example of 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
mov esi, array ; point to the start of the array

xor eax, eax ; clear accumulator
add_loop:
add ax, [esi] ; add current element to accumulator
add esi, 2 ; move to next element (WORD = 2 bytes)
loop add_loop ; repeat until loop counter becomes zero

mov [result], ax ; store the result in 'RESULT'

; your program continues here
```

In this code, we define an array called 'array' with the given elements and initialize a variable 'result' to store the sum.

The assembly code starts at the _start label. We load the loop counter with the number of elements in the array (10 in this case) and use the mov instruction to point the esi register to the start of the array.

Next, we initialize the eax register to zero using the xor instruction as an accumulator for the sum. Inside the add_loop label, the value at the memory location pointed by esi is added to the accumulator using the add instruction. Then, the esi register is incremented by 2 to move to the next element in the array.

The loop instruction is used to repeat the add_loop block until the loop counter becomes zero. As the add_loop block will be repeated 10 times (number of elements in the array), each element will be added to the accumulator.

Finally, after the loop completes, we store the final result in the 'RESULT' memory location using the mov instruction.

Please note that this code assumes that the array is located in the writable data section (.data) and the 'RESULT' memory location is also in the data section. Also, the code snippet provided is for x86 assembly using NASM syntax, so it may need to be adjusted for different architectures or assembler syntaxes.

To write an assembly code using index addressing to add all the elements in the array, you can follow these steps:

1. Load the base address of the array into a register, let's say R1.
2. Initialize a register, let's say R2, with zero to store the sum.
3. Use a loop to iterate through each element in the array:
a) Load the value at the current index into a register, let's say R0.
b) Add the value in R0 to the sum stored in R2.
c) Increment the index register, let's say R3, by 2 (since each element in the array is of WORD size).
d) Check if R3 exceeds the length of the array (in bytes). If it does, exit the loop.
e) Jump back to the beginning of the loop.

Here's the assembly code:

```assembly
; Assuming the base address of the array is stored in R1

MOV R2, #0 ; Initialize the sum to zero
MOV R3, #0 ; Initialize the index to zero

Loop:
LDR R0, [R1, R3] ; Load the value at the current index
ADD R2, R2, R0 ; Add the value to the sum
ADD R3, R3, #2 ; Increment the index by 2 (WORD size)
CMP R3, #20 ; Compare the index with the length of the array (10 WORDs = 20 bytes)
BCC Loop ; Jump back to the beginning of the loop if index < length

STR R2, RESULT ; Store the result in the memory location 'RESULT'

END:
```

Note: The length of the array (20 bytes) and the memory location 'RESULT' are not specified in the question, so you may need to adjust these instructions according to your requirements.