COUNTING NUMBER OF EVEN AND ODD NUMBERS FROM A GIVEN SERIES To write an assembly language program to count the number of even and odd numbers from a given series. - Code

Latest

programs

Thursday, October 13, 2011

COUNTING NUMBER OF EVEN AND ODD NUMBERS FROM A GIVEN SERIES To write an assembly language program to count the number of even and odd numbers from a given series.


COUNTING NUMBER OF EVEN AND ODD NUMBERS FROM A GIVEN SERIES

Aim: -   To write an assembly language program to count the number of even and odd numbers from a given series.

            MOV CL, 05
                      XOR BL, BL
                      XOR DL, DL
                      LEA SI, SERIES
NEXT2:        MOV AL, [SI]
                     SHR AL, O1
                      JNC NEXT1
                     

                       INC BL
                      JMP NEXT3
NEXT1:        INC DL
NEXT3:        INC SI
                      DEC CL
                      JNZ NEXT2
                      MOV EVEN, DL
                      MOV ODD, BL
                     END

Result: The numbers of even and odd numbers are counted from the given series.

No comments:

Post a Comment