Program to find out the number of even and odd numbers from a given series of 16 bit hexadecimal numbers.
The simplest logic to decide whether a binary number is even or odd is to check the least significant bit of the number. If the bit is zero, the number is even, else its odd. Check the LSB by rotating the number through carry flag and increment even or odd number counter.
ASSUME CS:CODE, DS:DATA
LIST DW 2357H,0a579H,0c2322H,0c91eH,0c0000H,0957H
COUNT EQU 006h
START: XOR BX,BX
MOV SI, OFFSET LIST
AGAIN: MOV AX,[SI]
ODD: INC DX
NEXT: ADD SI,02
You might be also interested in:
:: Data transfer instructions of 8086 microprocessor
:: 8085 Microprocessor simulator for linux
::Interfacing pic microcontroller with LCD
:: Serial Port interfacing with atmega