Duplicate Question
The question on this page has been marked as a duplicate question.
Original Question
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...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
            
            
        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!
                                            
                Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.