Question

[In x86 Assembly Language] Declare a double word array of size 10 and initialize it with...

[In x86 Assembly Language]

Declare a double word array of size 10 and initialize it with some numbers. Find the number of even numbers and the number of odd numbers in this array and save them in locations called oddCount and evenCount.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
DATA SEGMENT
A DW 1,2,3,4,5,6,7,8,9,10
oddCount DW ?
evenCount DW ?
DATA ENDS
CODE SEGMENT
        ASSUME DS:DATA,CS:CODE
START:
      MOV AX,DATA
      MOV DS,AX
      LEA SI,A
      MOV DX,0000
      MOV BL,02
      MOV CL,10
   L1:MOV AX,WORD PTR[SI]
      DIV BL
      CMP AH,00
      JNZ L2
      INC evenCount
      JMP L3
   L2:INC oddCount
   L3:
      ADD SI,2
      DEC CL
      CMP CL,00
      JNZ L1
      MOV AH,4CH
      INT 21H
CODE ENDS
END START
Add a comment
Know the answer?
Add Answer to:
[In x86 Assembly Language] Declare a double word array of size 10 and initialize it with...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT