Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

Program to find the total no. of even and odd nos. from an array

Posted By: Viheke Fischer     Category: Assembly Language     Views: 13148

Write a program to find the total no. of even and odd nos. from an array.

Code for Program to find the total no. of even and odd nos. from an array in Assembly Language

DATA SEGMENT
A DW 1,2,3,4,5,6,7,8,9,10
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 DH
      JMP L3
   L2:INC DL
   L3:
      ADD SI,2
      DEC CL
      CMP CL,00
      JNZ L1
      MOV AH,4CH
      INT 21H
CODE ENDS
END START


;OUTPUT:->
;-G CS: 0029
;
;AX=0005  BX=0002  CX=0000  DX=0505  SP=0000  BP=0000  SI=0014  DI=0000
;DS=0BF4  ES=0BE4  SS=0BF4  CS=0BF6  IP=0029   NV UP EI PL ZR NA PE NC
;0BF6:0029 B44C          MOV     AH,4C
  
Share: 



Viheke Fischer
Viheke Fischer author of Program to find the total no. of even and odd nos. from an array is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
Prem Panicker from India Comment on: Sep 24
wright a pgm find average of n even numbers in an array of 16 numbers
in assembly language/9HGku

Siby Xavier from India Comment on: Apr 11
please check this link for sample programs
itsourtech.blogs...ot.in/.../...ith-8086_8654.html

View All Comments