Asked by Anonymous

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

Answers

There are no human answers yet.
There are no AI answers yet. The ability to request AI answers is coming soon!

Related Questions