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.

Code:
ARRAY DW 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
RESULT DW, ?

ORG 400H

MOV AX, 0
MOV BX, 0

L1:
ADD AX, [ARRAY+BX]
ADD BX, 2
CMP BX, 20
JL L1

MOV RESULT, AX

Nasm assembler says:
lab7.asm:2: error: expression syntax error

The error message suggests that there is a syntax error on line 2 of the code. Looking at the code, it seems that the error may be caused by the comma after "DW" in the line "RESULT DW, ?". The correct syntax for declaring a memory location with an uninitialized value in NASM assembly is "RESULT DW ?" without the comma.

Here is the corrected code:

```assembly
ARRAY DW 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
RESULT DW ?

ORG 400H

MOV AX, 0
MOV BX, 0

L1:
ADD AX, [ARRAY+BX]
ADD BX, 2
CMP BX, 20
JL L1

MOV [RESULT], AX
```

Note that the last line "MOV [RESULT], AX" is also corrected to store the value of AX in the memory location RESULT.

It seems that there is a syntax error in line 2 of your assembly code. The error is likely caused by the missing size specifier for the 'RESULT' variable in the declaration. To fix this error, you need to specify the size of 'RESULT' as a WORD by adding 'WORD' after 'DW'. Here's the corrected code:

```
ARRAY DW 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
RESULT DW ?

ORG 400H

MOV AX, 0
MOV BX, 0

L1:
ADD AX, [ARRAY+BX]
ADD BX, 2
CMP BX, 20
JL L1

MOV [RESULT], AX
```

With this correction, the assembly code should now work as intended to add all the elements in the array and store the result in the 'RESULT' memory location.